Networked Media Open Specifications

Behaviour

←APIs - Client Side Implementation · Index↑ · Interoperability - IS-04→

The Annotation API provides access to the annotation properties associated with a particular resource, uniquely identified by its ID.

Setting Values

The API allows clients to independently set values for label, description and individually named tags.

The following PATCH request to the /node/self endpoint asks to update the label and description but make no change to the tags associated with the Node resource.

{
    "label": "fave node",
    "description": "my favourite node"
}

The following PATCH request to the /node/devices/21a28338-fb2e-4df5-9b55-d58e6124bc9f endpoint asks to add, or replace the values for, the “studio” tag but make no change to other tags, the label or description.

{
    "tags": {
        "studio": ["HQ2"]
    }
}

Resetting Values

The API allows clients to reset values for label, description and individually named tags, using null.

The following PATCH request asks to reset the label and “location” tag, at the same time as adding, or replacing the values for, the “studio” tag.

{
    "label": null,
    "tags": {
      "location": null,
      "studio": ["HQ2"]
    }
}

The reset behaviour depends on the API implementation. The new values MUST be valid per the schema.

A PATCH request with tags set to null asks to reset all tags.

The following PATCH request asks to reset all the annotation properties for a resource.

{
    "label": null,
    "description": null,
    "tags": null
}

Read-Write Tags

The namespace urn:x-nmos:tag:user: is defined and included in the Tags register of the NMOS Parameter Registers.

API implementations MUST support read-write for tags in this namespace, subject to any internal limitations.

Tags in other namespaces can be read-write or read-only.

Read-Only Tags

Some named tags, such as those defined by BCP-002-01 and BCP-002-02, or by a particular manufacturer, are intended to have read-only values assigned to the resources by the manufacturer.

An API implementation MAY therefore reject requests to update specific named tags, with a 500 (Internal Server Error) response.

A PATCH request with tags set to null does not update read-only tags.

Additional Limitations

Some named tags have additional limitations, such as needing precisely one element in the array of values. An API implementation SHOULD reject requests which do not meet the additional limitations specified for such tags, with a 500 (Internal Server Error) response.

Minimum requirements on supported annotations are specified in terms of size in Bytes when encoded in UTF-8.

Notes:

The API implementation MUST reject requests which it cannot process, with a 500 (Internal Server Error) response.

Successful Response

When a successful PATCH request is made, the response MUST be the updated resource with the new values for all properties.

The version attribute is incremented in the response to the PATCH request and subsequent GET requests. See the related Interoperability: IS-04 section of the specification.

Error Response

Unsuccessful requests MUST produce the error response per the APIs specification. The API is strongly RECOMMENDED to include an informative error response body with 500 (Internal Server Error) responses mentioned above, to indicate why the request is rejected.

Persistence of Updates

The API implementation MUST persist updates to the annotation properties for the lifetime of a resource uniquely identified by its ID, including consistency over reboots, power cycles, and software upgrades.

The lifetime of a resource ends when the API implementation intends not to use its ID again. If the implementation removes the resource from the API, for example when switching away from its current operating profile, but can reinstate the resource with the same ID later, for example as a result of switching back to that operating profile, the lifetime of the resource has not ended and the annotation properties MUST be persisted.

←APIs - Client Side Implementation · Index↑ · Interoperability - IS-04→