.. include:: ../../../router.1.0/srcDoc/vars.rst .. _section-record_administration: Remote Administration ===================== A control client (such as *RTI Admin Console*) can use this interface to remotely control *Recording Service*. .. Note:: *Recording Service* remote administration is based on the |RAP| described in :numref:`section-Rap`. Please refer to that manual for a detailed discussion on the workings of remote administration in *Recording Service*. Below you will find an API reference for all the supported operations. .. _section-record_remote_admin_enable: Enabling Remote Administration ------------------------------ By default, remote administration is disabled in *Recording Service*. To enable remote administration you can use the ```` XML tag (see :numref:`section-config-administration-tag`) or the ``-remoteAdministrationDomainId`` command-line parameter (see :numref:`section-recording-service-command-line-parameters`). Both of these methods enable remote administration and set the domain ID for remote communication. Available Service Resources --------------------------- :numref:`TableRecorderResources` lists the public resources specific to *Recording Service*. Each resource identifier is expressed as a hierarchical sequence of identifiers, including parent and target resources. (See :numref:`section-Arm-ResourceId` for details.) In the table below, the elements ``(rs)``, and ``(st)`` refer to the name of an entity of the corresponding class as specified in the configuration in the ``name`` attribute. For example, in the following configuration: .. code-block:: xml ... The resource identifier is: .. code-block:: html /recording_services/MyRecorder In the table below, the resource identifier is written as /recording_services/(rs), where (rs) is the service name. (st) is the storage name, and so on. This nomenclature is used in the table to give you an idea of the structure of the resource identifiers. For actual (example) resource identifier names, see the example section that follows. .. list-table:: Resources and Their Identifiers in *Recording Service* :name: TableRecorderResources :widths: 20 80 :header-rows: 1 * - Resource - Resource Identifier * - *Recording Service* - /recording_services/(rs) * - *Storage* - /recording_services/(rs)/storage/(st) Example ^^^^^^^ This example shows you how to address a resource of each possible resource class in *Recording Service*. .. rubric:: *Recording Service* Entity with name "MyRecorder": .. code-block:: xml ... Resource identifier: .. code-block:: html /recording_services/MyRecorder .. rubric:: *Storage* Entity with name "sqlite" (implicit name of the builtin storage): .. code-block:: xml ... Resource identifier: .. code-block:: html /recording_services/MyRecorder/storage/sqlite .. _section-record_remote_commands: Remote API Overview ------------------- .. list-table:: Remote Interface Overview :name: RecorderTableRemoteAdminAPI :widths: 10 50 30 :header-rows: 1 * - Resource - Operation - Description * - :litrep:`RecordingService` - :ref:`DELETE /recording_services/(rs) ` - Shuts down a running *Recording Service* instance. * - :litrep:`RecordingService` - :ref:`UPDATE /recording_services/(rs):flush ` - Flushes all buffered data in memory into disk. * - - :ref:`UPDATE /recording_services/(rs)/state ` - Sets a *Recording Service* state. * - builtin SQLite *Storage* - :ref:`UPDATE /recording_services/(rs)/storage/sqlite:rollover ` - Continues the current recording in a new file (also known as a "shard" or file segment). Note: Only valid for builtin SQLite plugin. * - - :ref:`UPDATE /recording_services/(rs)/storage/sqlite:tag_timestamp ` - Associates a symbolic name with the current time (with an optional offset) in the recording. Note: Only valid for builtin SQLite plugin. Recording Service ----------------- .. _record_service_self_delete: .. function:: DELETE /recording_services/(rs) **Operation** ``shutdown`` This operation will cause *Recording Service* to shutdown. .. _record_storage_self_flush: .. function:: UPDATE /recording_services/(rs):flush **Operation** ``flush`` This operation will cause Recording Service to flush contents of all topics and topic groups into permanent storage. This operation can be used with any of Recording Service's modes of operation, but is crucial when running in buffering mode, because it's the only way to flush buffered samples into permanent storage. This operation will store a total of N samples into storage, N being the depth of the History QoS policy. If there are fewer samples in the buffer, this operation will store all of them. This operation will affect the whole service, meaning that all Topics and Topic Groups will be affected by it. .. list-table:: :widths: 30 70 :header-rows: 1 * - Request Field - Value * - ``action`` - UPDATE * - ``resource_identifier`` - /recording_services/MyRecorder:flush **Request body** - Empty. .. _record_service_self_state: .. function:: UPDATE /recording_services/(rs)/state **Operation** ``set_state`` Sets the state of a *Recording Service* object. The action is parametrized on octet_body, which could have the following values: See :ref:`section-Rap-CommonOps-SetState` (:numref:`section-Rap-CommonOps-SetState`). Valid requested states: * ``STARTED`` * ``STOPPED`` * ``PAUSED`` * ``RUNNING`` - Example To pause an instance of *Recording Service* with the name "MyRecorder": .. list-table:: :widths: 30 70 :header-rows: 1 * - Request Field - Value * - ``action`` - UPDATE * - ``resource_identifier`` - /recording_services/MyRecorder/state * - ``octet_body`` - .. code-block:: C to_cdr_buffer(RTI::Service::EntityStateKind::PAUSED) .. _section_record_remote_storage: Storage ------- .. _record_storage_rollover: .. function:: UPDATE /recording_services/(rs)/storage/sqlite:rollover **Operation** ``rollover`` If the storage plugin being used is the builtin SQLite plugin, this operation will cause the recording to switch to a new file segment (also known as a "shard") in the fileset. .. list-table:: :widths: 30 70 :header-rows: 1 * - Request Field - Value * - ``action`` - UPDATE * - ``resource_identifier`` - /recording_services/MyRecorder/storage/sqlite:rollover **Request body** - Empty. .. _record_storage_tag_timestamp: .. function:: UPDATE /recording_services/(rs)/storage/sqlite:tag_timestamp **Operation** ``tag_timestamp`` If the storage plugin being used is the builtin SQLite plugin, this operation will introduce a new entry in the symbolic timestamps table, using the tag name, textual description, and offset time specified in the arguments to the operation (CDR-serialized in the octet-body with the RTI::RecordingService::DataTagParams data type). - Example To tag a moment with the name "/example/test1/tag1", representing a moment that is 123 milliseconds in the past: .. list-table:: :widths: 30 70 :header-rows: 1 * - Request Field - Value * - ``action`` - UPDATE * - ``resource_identifier`` - /recording_services/MyRecorder/storage/sqlite:tag_timestamp * - ``octet_body`` - .. code-block:: C++ std::string tag_name_1("/example/test1/tag1"); std::string tag_description_1("start of test"); RTI::RecordingService::DataTagParams data_tag_arguments; data_tag_arguments.tag_name(tag_name_1); data_tag_arguments.tag_description(tag_description_1); data_tag_arguments.timestamp_offset(-123); std::vector data_tag_arguments_buffer; dds::topic::topic_type_support ::to_cdr_buffer( data_tag_arguments_buffer, data_tag_arguments);