Skip to content

OcCaptureAdmin

FarbodZamani edited this page Mar 28, 2022 · 3 revisions

This class contains a REST API call to the /capture-admin 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);
$ocCaptureAdmin = $opencastApi->captureAdmin;
...
  1. Direct instantiation:
use OpencastApi\Rest\OcRestClient;
use OpencastApi\Rest\OcCaptureAdmin;
$ocRestClient = new OcRestClient($config);
$ocCaptureAdmin = new OcCaptureAdmin($ocRestClient);
...

Functions

Consumable functions are listed below:

getAgentState($name, $format = '')

Returns the state of a given capture agent. (JSON by default | XML on demand) More Detail

  • $name (string) Name of the capture agent

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

  • Returns an array: ['code' => 200, 'body' => ' {agentState}]

getAgentCapabilities($name, $format = '')

Returns the capabilities of a given capture agent. (JSON by default | XML on demand) More Detail

  • $name (string) Name of the capture agent

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

  • Returns an array: ['code' => 200, 'body' => ' {An XML (text) or JSON (Object) representation of the agent capabilities }]

getAgentConfiguration($name, $format = '')

Returns the capabilities of a given capture agent. (JSON by default | XML on demand) More Detail

  • $name (string) Name of the capture agent

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

  • Returns an array: ['code' => 200, 'body' => ' {An XML (text) or JSON (Object) representation of the agent configuration}]

recordings()

Return all registered recordings and their state. (JSON by default | XML on demand) More Detail

  • Returns an array: ['code' => 200, 'body' => '{an array of all known recordings}']

getAgents($format = '')

Return all of the known capture agents on the system. (JSON by default | XML on demand) More Detail

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

  • Returns an array: ['code' => 200, 'body' => ' {An XML (text) or JSON (Object) representation of all of the known capture agents}]

getRecording($recordingId, $format = '')

Return the state of a given recording. (JSON by default | XML on demand) More Detail

  • $recordingId (string) The ID of a given recording

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

  • Returns an array: ['code' => 200, 'body' => ' {An XML (text) or JSON (Object) representation of the state of the recording with the correct id}]

deleteAgent($name)

Remove record of a given capture agent More Detail

  • $name (string) Name of the capture agent

  • Returns an array: ['code' => 200, 'reason' => 'OK'] ({agentName} removed)

deleteRecording($recordingId)

Remove record of a given recording More Detail

  • $recordingId (string) The ID of a given recording

  • Returns an array: ['code' => 200, 'reason' => 'OK'] ( {recordingId} removed )

setAgentState($agentName, $state, $address = '')

Set the status of a given capture agent More Detail

  • $agentName (string) Name of the capture agent

  • $state (string) The state of the capture agent. Known states are: idle, shutting_down, capturing, uploading, unknown, offline, error

  • $address (string) (optional) Address of the agent

  • Returns an array: ['code' => 200, 'reason' => 'OK'] ({agentName} set to {state})

setAgentStateConfiguration($agentName, $configuration)

Set the configuration of a given capture agent, registering it if it does not exist More Detail

  • $agentName (string) Name of the capture agent

  • $configuration (string) An XML or JSON representation of the capabilities. XML as specified in http://java.sun.com/dtd/properties.dtd (friendly names as keys, device locations as corresponding values)

  • Returns an array: ['code' => 200, 'body' => '{ An XML or JSON representation of the agent configuration }']

setRecordingStatus($recordingId, $state)

Set the status of a given recording, registering it if it is new More Detail

  • $recordingId (string) The ID of a given recording

  • $state (string) The state of the recording. Known states: unknown, capturing, capture_finished, capture_error, manifest, manifest_error, manifest_finished, compressing, compressing_error, uploading, upload_finished, upload_error.

  • Returns an array: ['code' => 200, 'reason' => 'OK'] ({recordingId} set to {state})