Notifications¶
Most URLs that acts as resources in the RESTful API are used as resources in the notification framework as well.
In the following reference, {notification-entity}
is one of the following:
/item
/collection
/job
/storage
/storage/file
/quota
/group
/document
Changed in version 4.8: The /document notification resource was added.
Applying notifications to entire resources¶
Notifications can be applied to entire resources. For example if used on the item resource, then events that occur to any item will potentially trigger the event.
Retrieve all notifications that exists within an entire resource¶
-
GET
{notification-entity}/notification/
¶ Lists URIs to all notifications that exists within the given resource.
Produces: - application/xml, application/json – A URIListDocument containing URIs to all available notifications.
- text/plain – A CRLF-delimited list of URIs.
Role: _{notification-entity}_notification_read
Example¶
GET /item/job/notification
Accept: application/xml
<URIListDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<uri>VX-573</uri>
</URIListDocument>
Create a new notification that is applied to the entire resource¶
-
POST
{notification-entity}/notification/
¶ Adds a notification that is applied to an entire resource
Accepts: - application/xml, application/json – NotificationDocument
Produces: - application/xml, application/json – URIListDocument
- text/plain – The id of the notification.
Role: _{notification-entity}_notification_write
Example¶
Create a notification that triggers when PLACEHOLDER_IMPORT job finish.
POST /item/job/notification
Content-Type: application/xml
<NotificationDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<action>
<http>
<url>http://10.10.0.3/notify-job</url>
<timeout>5</timeout>
<retry>3</retry>
<method>POST</method>
<contentType>application/xml</contentType>
</http>
</action>
<trigger>
<job>
<finished/>
<filter>
<type>PLACEHOLDER_IMPORT</type>
</filter>
</job>
</trigger>
</NotificationDocument>
<URIListDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<uri>VX-573</uri>
</URIListDocument>
Deletes all notifications that exists within an entire resource¶
-
DELETE
{notification-entity}/notification/
¶ Removes all notifications that exists within the specified resource.
Status Codes: - 200 OK – Everything went well.
Role: _{notification-entity}_notification_write
Retrieve a particular notification¶
-
GET
{notification-entity}/notification/
(notification-id)¶ Retrieves a particular notification with the given id.
Status Codes: - 404 Not found – No notification with that id exists in that resource.
Produces: - application/xml, application/json – NotificationDocument
Role: _{notification-entity}_notification_read
Example¶
Retrieve job notification VX-573.
GET /job/notification/VX-573
Accept: application/xml
<NotificationDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<action>
<http>
<url>http://10.10.0.3/notify-job</url>
<timeout>5</timeout>
<retry>3</retry>
<method>POST</method>
<contentType>application/xml</contentType>
</http>
</action>
<trigger>
<job>
<finished/>
<filter>
<type>PLACEHOLDER_IMPORT</type>
</filter>
</job>
</trigger>
</NotificationDocument>
Remove a particular notification¶
-
DELETE
{notification-entity}/notification/
(notification-id)¶ Removes a particular notification with the given id.
Status Codes: - 200 OK – The notification was successfully removed.
- 404 Not found – No notification with that id exists in that resource.
Role: _{notification-entity}_notification_write
Applying notifications to specific entities¶
Notifications can also be applied on specific entities, for example a single job.
Note
These resources do not apply for the /storage/file
endpoint.
Retrieve all notifications that exists for a particular entity¶
-
GET
{notification-entity}/
(entity-id)/notification/
¶ Lists URIs to all notifications that exists for a given entity.
Produces: - application/xml, application/json – A URIListDocument containing URIs to all available notifications.
- text/plain – A CRLF-delimited list of URIs.
Role: _{notification-entity}_notification_read
Create a new notification that is applied to a particular entity¶
-
POST
{notification-entity}/
(entity-id)/notification/
¶ Adds a notification to the given entity.
Accepts: - application/xml, application/json – NotificationDocument
Produces: - application/xml, application/json – URIListDocument
- text/plain – The id of the notification.
Role: _{notification-entity}_notification_write
Deletes all notifications that exists within an entire resource¶
-
DELETE
{notification-entity}/
(entity-id)/notification/
¶ Removes all notifications that exists within the specified resource.
Status Codes: - 200 OK – Everything went well.
Role: _{notification-entity}_notification_write
Retrieve a particular notification¶
-
GET
{notification-entity}/
(entity-id)/notification/
(notification-id)¶ Retrieves a particular notification with the given id.
Status Codes: - 404 Not found – No notification with that id exists in that resource.
Produces: - application/xml, application/json – NotificationDocument
Role: _{notification-entity}_notification_read
Remove a particular notification¶
-
DELETE
{notification-entity}/
(entity-id)/notification/
(notification-id)¶ Removes a particular notification with the given id.
Status Codes: - 200 OK – The notification was successfully removed.
- 404 Not found – No notification with that id exists in that resource.
Role: _{notification-entity}_notification_write