Skip to content

OcServices

FarbodZamani edited this page Jun 22, 2022 · 5 revisions

This class contains services.{json|xml} REST API call to the /services endpoint.

Namespace

It is accessible under OpencastApi\Rest namespace.

How to use

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

Functions

Consumable functions are liested below:

getServiceJSON($serviceType = '', $host = '', $format = '')

Returns a service registraton or list of available service registrations as object (JSON) by default or XML (text) on demand. More Detail

  • $serviceType (string) (optional) The service type identifier. (from 1.1.1, this parameter became optional)

  • $host (string) (optional) The host, including the http(s) protocol.

  • $format (string) (optional) The output format (json or xml) of the response body. (Default value = 'json')

  • Returns an array: ['code' => 200, 'body' => '{the available service, formatted as xml or json}']

Clone this wiki locally