ocolin/tarana

Basic REST client for Tarana general API

Maintainers

Details

github.com/ocolin/Tarana

Source

Issues

Installs: 18

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/ocolin/tarana

2.2 2025-11-21 19:02 UTC

This package is auto-updated.

Last update: 2025-11-21 19:02:35 UTC


README

Description

This is a basic client for the Tarana API. It uses the EasySwagger library, but contains the Tarana swagger JSON file.

Usage

Environment variables

You can specify parameters in the constructor, but if any are left out, these environment variables will be used instead.

TARANA_API_TOKEN - Authentication token for API

TARANA_HOST - URL of server API

Instantiate

Create an instance of the Tarana object.

$tarana = new Ocolin\Tarana\Client();

Parameters

$url: Name of the Tarana host server. If null, will use .env field.

$api_key: Authentication token for server. If null, will use .env field.

$timeout: HTTP timeout. Defaults to 20 seconds.

$verify: Verify SSL credentials. Defaults to off.

Making a call

$output = $tarana->call( 
    path: '/v1/network/regions',
    query: [ 'count' => '10' ]
);

Parameters

$path: REQUIRED - End point API path, including named parameters names which will be replaced by variables. Copy/paste from the API docs.

$query: Array of parameters name/values to use for URI path or query URI.

$method: HTTP method. Defaults to GET.

$body: Object or array for POST/PUT/PATCH HTTP request bodies.