Opencast

AssetManager REST Documentation

/assets
This service indexes and queries available (distributed) episodes.

General Notes

Table of Contents

Read methods

Method / Path: GET /assets/{mediaPackageID}/{mediaPackageElementID}/{version}/{filename}
Description: Get an asset
Path params: mediaPackageID: the media package identifier
mediaPackageElementID: the media package element identifier
version: the media package version
filename: a descriptive filename used as the download filename
Optional (query) params: NONE
Status codes: 200: OK, File returned
404: Not Found, Not found
304: Not Modified, If file not modified
403: Forbidden, Not allowed to read assets of this snapshot.
500: Internal Server Error, There has been an internal error.
Notes:
  • Return value description: The file
Testing:
Sample: /assets/{mediaPackageID}/{mediaPackageElementID}/{version}/{filename}
Testing form (click to reveal)
Method / Path: GET /episode/{mediaPackageID}
Description: Get the media package from the last snapshot of an episode.
Path params: mediaPackageID: the media package ID
Optional (query) params: NONE
Response formats: text/xml
Status codes: 200: OK, Media package returned
404: Not Found, Not found
403: Forbidden, Not allowed to read media package.
500: Internal Server Error, There has been an internal error.
Notes:
  • Return value description: The media package
Testing:
Sample: /episode/{mediaPackageID}
Testing form (click to reveal)
Method / Path: GET /{mediaPackageID}/properties.json
Description: Get stored properties for an episode.
Path params: mediaPackageID: the media package ID
Optional (query) params: namespace: property namespace
Response formats: application/json
Status codes: 200: OK, Media package returned
404: Not Found, Not found
403: Forbidden, Not allowed to read media package.
500: Internal Server Error, There has been an internal error.
Notes:
  • Return value description: Properties as JSON
Testing:
Sample: /{mediaPackageID}/properties.json?namespace={namespace}
Testing form (click to reveal)
Method / Path: GET /{mediaPackageID}/workflowProperties.json
Description: Get stored workflow properties for an episode.
Path params: mediaPackageID: the media package ID
Optional (query) params: NONE
Response formats: application/json
Status codes: 200: OK, Media package returned
200: OK, Invalid parameters
404: Not Found, Not found
403: Forbidden, Not allowed to read media package.
500: Internal Server Error, There has been an internal error.
Notes:
  • Return value description: Properties as JSON
Testing:
Sample: /{mediaPackageID}/workflowProperties.json
Testing form (click to reveal)

Write methods

Method / Path: POST /add
Description: Adds a media package to the asset manager. This method is deprecated in favor of method POST 'snapshot'.
Path params: NONE
Required (form) params: mediapackage: The media package to add to the search index.
Optional (form) params: NONE
Status codes: 204: No Content, The media package was added, no content to return.
403: Forbidden, Not allowed to add a media package.
500: Internal Server Error, There has been an internal error and the media package could not be added
Notes:
  • Return value description: No content is returned.
Testing:
Sample: /add
Testing form (click to reveal)
Method / Path: DELETE /delete/{id}
Description: Removes snapshots of an episode, owned by the default owner from the asset manager.
Path params: id: The media package ID of the episode whose snapshots shall be removed from the asset manager.
Optional (query) params: NONE
Status codes: 204: No Content, Snapshots have been removed, no content to return.
404: Not Found, The episode does either not exist or no snapshots are owned by the default owner.
403: Forbidden, Not allowed to delete this episode.
500: Internal Server Error, There has been an internal error and the episode could not be deleted.
Notes:
  • Return value description: No content is returned.
Testing:
Sample: /delete/{id}
Testing form (click to reveal)
Method / Path: POST /moveByDate
Description: Move all snapshots between two dates.
Path params: NONE
Required (form) params: start: The start date, in the format yyyy-MM-dd'T'HH:mm:ss'Z'.
end: The end date, in the format yyyy-MM-dd'T'HH:mm:ss'Z'.
target: The target storage to move the mediapackage to.
Optional (form) params: NONE
Response formats: text/xml
Status codes: 200: OK, The job created to move the snapshots.
400: Bad Request, Invalid parameters, and the job was not created
500: Internal Server Error, There has been an internal error, and the job was not created
Notes:
  • Return value description: The Job created
Testing:
Sample: /moveByDate
Testing form (click to reveal)
Method / Path: POST /moveById
Description: Move a mediapackage based on its ID.
Path params: NONE
Required (form) params: id: The mediapackage ID to move.
target: The target storage to move the mediapackage to.
Optional (form) params: NONE
Response formats: text/xml
Status codes: 200: OK, The job created to move the snapshot.
400: Bad Request, Invalid parameters, and the job was not created
500: Internal Server Error, There has been an internal error, and the job was not created
Notes:
  • Return value description: The Job created
Testing:
Sample: /moveById
Testing form (click to reveal)
Method / Path: POST /moveByIdAndDate
Description: Move all snapshots for a given mediapackage taken between two dates.
Path params: NONE
Required (form) params: id: The mediapackage ID to move.
start: The start date, in the format yyyy-MM-dd'T'HH:mm:ss'Z'.
end: The end date, in the format yyyy-MM-dd'T'HH:mm:ss'Z'.
target: The target storage to move the mediapackage to.
Optional (form) params: NONE
Response formats: text/xml
Status codes: 200: OK, The job created to move the snapshots.
400: Bad Request, Invalid parameters, and the job was not created
500: Internal Server Error, There has been an internal error, and the job was not created
Notes:
  • Return value description: The Job created
Testing:
Sample: /moveByIdAndDate
Testing form (click to reveal)
Method / Path: POST /moveByIdAndVersion
Description: Move a mediapackage based on its ID and version.
Path params: NONE
Required (form) params: id: The mediapackage ID to move.
version: The version to move.
target: The target storage to move the mediapackage to.
Optional (form) params: NONE
Response formats: text/xml
Status codes: 200: OK, The job created to move the snapshot.
400: Bad Request, Invalid parameters, and the job was not created
500: Internal Server Error, There has been an internal error, and the job was not created
Notes:
  • Return value description: The Job created
Testing:
Sample: /moveByIdAndVersion
Testing form (click to reveal)
Method / Path: POST /{mediaPackageID}/workflowProperties
Description: Set additional workflow properties
Path params: mediaPackageID: the media package ID
Required (form) params: properties: JSON object containing new properties
Optional (form) params: NONE
Status codes: 201: Created, Properties successfully set
400: Bad Request, Invalid data
500: Internal Server Error, Internal error
Notes:
  • Return value description: Returned status code indicates success
Testing:
Sample: /{mediaPackageID}/workflowProperties
Testing form (click to reveal)
Method / Path: POST /snapshot
Description: Take a versioned snapshot of a media package.
Path params: NONE
Required (form) params: mediapackage: The media package to take a snapshot from.
Optional (form) params: NONE
Status codes: 204: No Content, A snapshot of the media package has been taken, no content to return.
403: Forbidden, Not allowed to take a snapshot.
500: Internal Server Error, There has been an internal error and no snapshot could be taken.
Notes:
  • Return value description: No content is returned.
Testing:
Sample: /snapshot
Testing form (click to reveal)
Method / Path: POST /updateIndex
Description: Trigger search index update for event. The usage of this is limited to global administrators.
Path params: NONE
Required (form) params: id: The event ID to trigger an index update for.
Optional (form) params: NONE
Status codes: 204: No Content, Update successfully triggered.
403: Forbidden, Not allowed to trigger update.
404: Not Found, No such event found.
Notes:
  • Return value description: No content is returned.
Testing:
Sample: /updateIndex
Testing form (click to reveal)