Skip to content

OcAgentsApi

FarbodZamani edited this page Mar 25, 2022 · 1 revision

This class contains all REST API calls to the /api/agents endpoint.

Namespace

It is accessible under OpencastApi\Rest namespace.

Version

This endpoint is available for API Version 1.1.0 or greater, therefore, it throws an Exception upon direct class instantiation, or it won't be defined as property in OpencastApi\OpenCast class when api version is incompatible!

How to use

  1. In OpencastApi\OpenCast as its property with OpenCast properties naming convention:
use OpencastApi\OpenCast;
$opencastApi = new OpenCast($config);
$ocAgentsApi = $opencastApi->agentsApi;
...
  1. Direct instantiation:
use OpencastApi\Rest\OcRestClient;
use OpencastApi\Rest\OcAgentsApi;
$ocRestClient = new OcRestClient($config);
$ocAgentsApi = new OcAgentsApi($ocRestClient);
...

Functions

Consumable functions are listed below:

getAll($limit = 0, $offset = 0)

Returns a list of capture agents. More Detail

  • $limit (int) (optional) The maximum number of results to return for a single request (Default value=0)

  • $offset (int) (optional) The index of the first result to return (Default value=0)

  • Returns an array: ['code' => 200, 'body' => '{A (potentially empty) list of agents is returned}']

get($agentId)

Returns a single capture agent. More Detail

  • $agentId (string) The agent id

  • Returns an array: ['code' => 200, 'body' => '{The agent is returned}']

Clone this wiki locally