Files¶
The base path, referred to as {storage-resource}
below, is one of the
following depending on if a request should resolve all files or files on a
specific storage only.
/storage/{storage-id}
/storage
Operations on files, uses {file-resource}
can be one of:
{storage-resource}/file/{file-id}
{storage-resource}/file/path/{path}
{storage-resource}/file/uri/{uri}
Information about files in storage¶
List files in storage¶
New in version 4.1.2.
-
GET
{storage-resource}/file
¶ Retrieves the files for all or a specific storage.
There is a limit on how many files that can be returned for each call to this method. To get all files, iterate the calls.
Query Parameters: - id – Optional, if multiple
id
query parameters are specified only those files are returned. If no ids are specified, all files are returned. - path –
Optional string
- path - Return files under this sub-path to storage.
/
(default) - Return all files.
- prefix –
true
- Also include file prefixes that matches the criteriafalse
(default) - Do not include file prefixes
New in version 4.14.
- ignorecase –
true
- Search file path case insensitivelyfalse
- Search file path case sensitively
- recursive –
true
(default) - Return all files in tree.false
- Return only files directly under specified path.
- wildcard –
true
- Allow use of wildcards in path.false
(default) - No wildcard handling of path.
- hash – Optional list of hash values. Only return files with specific hash value.
- algorithm – Optional hash algorithm. Search for hash values used by specified algorithm
- count –
true
(default) - Return total number of hits in resultfalse
- Do not return total number of hits in result, in order to produce results faster
- state –
Optional string to filter results by file state. Can be used multiple times to select several states.
New in version 4.7.
- methodType – Return URIs from storage methods with a particular type.
By default, return URLs with empty
methodType
. - storageType – Only return URIs for files from storages of this type.
- methodMetadata – Optional metadata used with storage method.
- scheme – URI scheme to return.
Matrix Parameters: - first – Optional integer. From total list of files, start return list from specified number. Default is
0
. - cursor –
New in version 4.16.
*
- The initial cursor.string-from-search
- Cursor string returned from the search results.
If set, the cursorMark / search after features from Solr/Elasticsearch would be used to improve the deep paging performance during a search.
When
cursor
is used, The value offirst
will be ignored.Only metadata searches in the
generic
interval supportscursor
. - number – Optional integer. Return a maximum of specified number of files. Default is
10
. - prefixFirst –
Optional integer. From total list of prefixes, start return list from specified number. Default is
0
.Note: this parameter has no effect if Elasticsearch is the search backend.
New in version 4.14.
- prefixNumber –
Optional integer. Return a maximum of specified number of prefixes. Default is
10
.New in version 4.14.
- sort –
Optional comma-separated list.
fileId
[asc
(default) |desc
] (default) - Order results by file id.size
[asc
(default) |desc
] - Order results by file size (bytes).state
[asc
(default) |desc
] - Order results by file state.timestamp
[asc
(default) |desc
] - Order results by file timestamp.filename
[asc
(default) |desc
] - Order results by filename.extension
[asc
(default) |desc
] - Order results by file extension.New in version 4.2.1.
- storage – Optional list of storage ids. Return only files from specific storages.
Same as
storage-id
in URL, but can be specified multiple times - storageGroup –
Optional storage group id. Return only files from storages specified in the storage group
New in version 4.13.
- filter –
all
(default) - Return all filesitem
Only return files associated with an item.noitem
Only return files not associated with any item.
- excludeQueued –
true
(default if searching importable files) - Exclude the files that are queued for importfalse
(default if searching all files) - Do not exclude the files that are queued for import
- includeItem –
true
- Return associated items, shapes, and components.false
(default) - Do not return any information about associated items, shapes, and components.
Produces: - application/xml, application/json – FileListDocument
- text/plain – CRLF-delimited list of file ids
Role: _file_read
- id – Optional, if multiple
File search example¶
For examples on how recursive
and
wildcard
works together, see the following table:
Path | Recursive | Wildcard | File on storage | Note | |||
foo |
foo/bar |
foo/bar/baz |
foo/bar/?az |
||||
false |
- | Y | N | N | N | (1) | |
true |
- | Y | Y | Y | Y | ||
/ |
false |
- | Y | N | N | N | |
/ |
true |
- | Y | Y | Y | Y | |
/foo |
false |
- | Y | N | N | N | |
/foo |
true |
- | Y | Y | Y | Y | |
foo |
false |
- | Y | N | N | N | (2) |
foo |
true |
- | Y | Y | Y | Y | |
/foo/ |
false |
- | N | Y | N | N | |
/foo/ |
true |
- | N | Y | Y | Y | |
/foo/bar |
false |
- | N | Y | N | N | |
/foo/bar |
true |
- | N | Y | Y | Y | |
/foo/bar/ |
- | - | N | N | Y | Y | |
\foo\bar\ |
- | - | N | N | N | N | (3) |
/foo/bax///../bar/./ |
- | - | N | N | Y | Y | |
/foo/b?r |
false |
true |
N | Y | N | N | (4) |
/foo/b??r |
false |
true |
N | N | N | N | |
/foo/*r |
false |
true |
N | Y | N | N | (5) |
/foo/**r |
false |
true |
N | Y | N | N | |
/foo/bar/?az |
false |
false |
N | N | N | Y | (6) |
/foo/bar/?az |
false |
true |
N | N | Y | Y | |
/foo/bar/\?az |
false |
false |
N | N | N | N | (7) |
/foo/bar/\?az |
false |
true |
N | N | N | Y | (8) |
Notes:
- Empty string =
/
. - The initial
/
is implicit. /
is the path delimiter in Vidispine, also on Windows.?
= exactly one.*
= 0 or more?
is not officially supported, see URI’s, URL’s, and Special Characters.- With wildcard=false,
\
is literal. However,\
is not officially supported, see URI’s, URL’s, and Special Characters. - With wildcard=true, use
\
to quote (”\
” has to be quoted).
Legend:
- -
- Does not matter for this example
- Y
- is included in search result
- N
- is not include in search result
Prefix search example¶
Assuming there is a file app/Phone/Android/Oreo/GoolgePlay.txt
inside a storage, the result of some prefix search requests will be as follows:
GET /storage/{storage-id}/file?prefix=true
<FileDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<file>
...
</file>
<prefixes>
<prefix>apps/Phone/Android/Oreo/</prefix>
</prefixes>
</FileDocument>
GET /storage/{storage-id}/file?prefix=true&recursive=false
<FileDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<file>
...
</file>
<prefixes>
<prefix>apps/</prefix>
</prefixes>
</FileDocument>
GET /storage/{storage-id}/file?prefix=true&recursive=false&path=apps/
<FileDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<!-- The file list will be empty in this case -->
<prefixes>
<prefix>apps/Phone/</prefix>
</prefixes>
</FileDocument>
In the case of wildcard=true
and recursive=false
, only the levels before the first wildcard character will be returned.
So in the example below, apps/
will be returned, instead of apps/Phone/
or apps/Phone/Android/
GET /storage/{storage-id}/file?prefix=true&recursive=false&wildcard=true&path=app/*Oreo*
<FileDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<file>
...
</file>
<prefixes>
<prefix>apps/</prefix>
</prefixes>
</FileDocument>
Get status of file in storage¶
-
GET
{file-resource}
¶ Retrieves the information, such as file size, status and checksum, of a specific file.
Query Parameters: Matrix Parameters: - includeItem –
true
- Return associated items, shapes, and components.false
(default) - Do not return any information about associated items, shapes, and components.
Produces: - application/xml, application/json – FileDocument
- text/plain – Tabbed tuples of file id, file path, file size, file status, timestamp
Role: _file_read
- includeItem –
Upload file to storage¶
New in version 4.1.2.
-
POST
{storage-resource}/file/data
¶ Creates a new file on a specific storage, with the given file data.
Query Parameters: - transferId – An id to assign the transfer to be able to refer to it. Mandatory for chunked and passkey imports.
- transferPriority – An integer between 1 and 1000 that indicates what priority the transfer should be given in relation to other transfers (optional). A transfer with a high priority value is considered more important than a transfer with a low priority value.
- path –
The path of the file on the storage (optional).
New in version 4.7.
- uri –
The absolute file URI (optional and should be relative to the URI of a storage method).
New in version 4.7.
- state –
The state of the file (optional).
New in version 4.7.
Status Codes: - 400 –
If the amount of data received does not match the given Content-Length header.
New in version 4.2.3.
Accepts: - application/octet-stream – The raw essence data.
Produces: - application/xml, application/json –
New in version 4.7.
- text/plain – file id
Role: _file_write
File data¶
Get file data¶
-
GET
{file-resource}/data
¶ Retrieves the raw file data.
Produces: - application/octet-stream – The raw file data.
Role: _file_read
Upload file data¶
New in version 4.1.2.
-
POST
{file-resource}/data
¶ Uploads the file data for a specific file, overwriting any existing file data for the file.
Query Parameters: - transferId – An id to assign the transfer to be able to refer to it. Mandatory for chunked and passkey imports.
- transferPriority – An integer between 1 and 1000 that indicates what priority the transfer should be given in relation to other transfers (optional). A transfer with a high priority value is considered more important than a transfer with a low priority value.
Status Codes: - 400 –
If the amount of data received does not match the given Content-Length header.
New in version 4.2.3.
Accepts: - application/octet-stream – The raw file data.
Produces: - application/xml, application/json – FileDocument
Role: _file_write
Generate temporary credentials¶
New in version 4.15.
-
POST
{file-resource}/uri
¶ Generates temporary access credentials that give either READ or WRITE access directly to the file. By default, if the file is on S3 or Azure, this will try to create a read-only pre-signed URL for the file; if this fail or if the file is on another type of storage, it will try to create a proxy URL (with direct access to the file).
Note
Please note that these generated credentials will only allow access to the exact same key / filename, to use the examples below it would be image.jpg. You will not be able to read or write another key / filename using these credentials.
Amazon S3
When using the s3 scheme there are certain prerequisites that need to be met regarding policies and trust relationships with the account in use.
- If you specify which role to use by setting the
stsAssumeRole
property, you must make sure that this role have the permission policy to be able to assume the role (sts:AssumeRole) and that the policy allows to get the role (iam:GetRole). - If you want to rely on Vidispine to find a role attached to an EC2 instance profile (by leaving the
stsAssumeRole
property unset), you must make sure that the policy allows for getting the the EC2 instance profile (iam:GetInstanceProfile) and to get the attached role (iam:GetRole) and also the permission to assume this role (sts:AssumeRole).
The permission policy for the role will only require s3:GetObject and s3:PutObject permissions to use the basic features. If you intend to use this for multipart uploads you might also want to add the permissions for s3:ListMultipartUploadParts and s3:AbortMultipartUpload. Finally this role will also need a trust relationship with an account with access to the storage(s) as an intersection is made to decide permissions in the end.
Vidispine will then create a custom policy to limit the credentials to either GET or PUT as requested.
Query Parameters: - scheme –
Optional parameter to determine which type of URL / URI to be returned.
s3
Utilize AWS’s AssumeRole to generate a temporary URI giving access to only the specific file. Can be used either by setting thestsAssumeRole
property to specify which role to assume when generating the credentials OR by leaving this unset which will make Vidispine try to use a role from an EC2 instance profile. These will also look at the configuration property forstsRegion
and use that region when making the call to the STS API.https
(default) - Generates a temporary pre-signed HTTPS URL for either S3 or Azure, or a proxy URL (based on the configuration propertyapiNoauthUri
) if on another type of storage.http
- Same ashttps
but will also allow HTTP URL’s to be returned.
- write –
Optional, to set permission to either READ or WRITE.
true
- Will give credentials with access to write. This would also enable the optional permissions for s3:ListMultipartUploadParts and s3:AbortMultipartUpload if used together with thes3
scheme.false
- (Default) Will give credentials with access to read.
- duration – Optional, sets the duration of the temporary credentials in minutes. Default is set to the minimum (15) and the maximum is 720.
Produces: - application/xml, application/json – URIListDocument
Role: _file_write
- If you specify which role to use by setting the
Examples¶
To generate a writeable S3 URL with temporary credentials:
Note
The user id and secret key will be replaced with the generated temporary credentials in the returned URI.
POST /storage/file/VX-56/uri?scheme=s3&write=true
<URIListDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<uri>s3://ASIA....:...@example/image.jpg?sessionToken=...</uri>
</URIListDocument>
To generate a pre-signed HTTPS URL (or proxy URL depending on the type of storage):
POST /storage/file/VX-98/uri?scheme=https&write=true
<URIListDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<uri>https://example.blob.core.windows.net/image.jpg?sig=...</uri>
</URIListDocument>
Importable files¶
Get files that can be imported¶
-
GET
{storage-resource}/importable
¶ Retrieves a list of files, together with any found metadata, for files that do not belong to any component.
Same query and matrix parameters as for
GET {storage-resource}/file
.Query Parameters: - auto –
true
- Return files that will be automatically imported due to auto-import rules.false
(default) - Do not return files that will be automatically imported.
- id – Optional, if multiple
id
query parameters are specified only those files are returned. If no ids are specified, all files are returned. - path –
Optional string
- path - Return files under this sub-path to storage.
/
(default) - Return all files.
- prefix –
true
- Also include file prefixes that matches the criteriafalse
(default) - Do not include file prefixes
New in version 4.14.
- ignorecase –
true
- Search file path case insensitivelyfalse
- Search file path case sensitively
- recursive –
true
(default) - Return all files in tree.false
- Return only files directly under specified path.
- wildcard –
true
- Allow use of wildcards in path.false
(default) - No wildcard handling of path.
- hash – Optional list of hash values. Only return files with specific hash value.
- algorithm – Optional hash algorithm. Search for hash values used by specified algorithm
- count –
true
(default) - Return total number of hits in resultfalse
- Do not return total number of hits in result, in order to produce results faster
- state –
Optional string to filter results by file state. Can be used multiple times to select several states.
New in version 4.7.
- methodType – Return URIs from storage methods with a particular type.
By default, return URLs with empty
methodType
. - storageType – Only return URIs for files from storages of this type.
- methodMetadata – Optional metadata used with storage method.
- scheme – URI scheme to return.
Matrix Parameters: - first – Optional integer. From total list of files, start return list from specified number. Default is
0
. - cursor –
New in version 4.16.
*
- The initial cursor.string-from-search
- Cursor string returned from the search results.
If set, the cursorMark / search after features from Solr/Elasticsearch would be used to improve the deep paging performance during a search.
When
cursor
is used, The value offirst
will be ignored.Only metadata searches in the
generic
interval supportscursor
. - number – Optional integer. Return a maximum of specified number of files. Default is
10
. - prefixFirst –
Optional integer. From total list of prefixes, start return list from specified number. Default is
0
.Note: this parameter has no effect if Elasticsearch is the search backend.
New in version 4.14.
- prefixNumber –
Optional integer. Return a maximum of specified number of prefixes. Default is
10
.New in version 4.14.
- sort –
Optional comma-separated list.
fileId
[asc
(default) |desc
] (default) - Order results by file id.size
[asc
(default) |desc
] - Order results by file size (bytes).state
[asc
(default) |desc
] - Order results by file state.timestamp
[asc
(default) |desc
] - Order results by file timestamp.filename
[asc
(default) |desc
] - Order results by filename.extension
[asc
(default) |desc
] - Order results by file extension.New in version 4.2.1.
- storage – Optional list of storage ids. Return only files from specific storages.
Same as
storage-id
in URL, but can be specified multiple times - storageGroup –
Optional storage group id. Return only files from storages specified in the storage group
New in version 4.13.
- filter –
all
(default) - Return all filesitem
Only return files associated with an item.noitem
Only return files not associated with any item.
- excludeQueued –
true
(default if searching importable files) - Exclude the files that are queued for importfalse
(default if searching all files) - Do not exclude the files that are queued for import
Produces: - application/xml, application/json – An ImportableFileListDocument describing the job.
Role: _storage_read
- auto –
Importing a file from a storage¶
Start an import job¶
-
POST
{file-resource}/import
¶ Starts a an import job that will import the specified file. Only files that do not belong to any components can be imported.
Query Parameters: - filename – The original filename of the file.
- allowReimport –
true
- Import the file to this shape even if the file is already importing or is already part of another item.false
(default) Reject the request if the file with the given id has already been imported or is currently importing.
- id – A comma-delimited list of external ids to assign to the item.
- tag – An optional list of shape tags to use for transcoding.
- original – An optional tag, if specified it should be one of the tags specified in the tag parameter. Specifies that the original shape tag will be reset to the shape created to this tag.
- createThumbnails –
true
(default) - Generate thumbnails as per defined by shape tag.false
- Disable thumbnail generation.
- thumbnailService – An optional identifier to which thumbnail resource that should be used.
- createPosters – An optional list of time codes to use for creating posters.
- no-transcode –
true
- Will disable transcoding even if thetags
parameter is set. Rather, the specified tag will be used to determine cropping, scaling etc. of thumbnails.false
(default) - Normal transcode.
- resourceId –
The transcoder resource to use to execute the transcode.
New in version 4.12.
- overrideFastStart –
true
(default) - Use transcoder’s estimate of the duration for allocating header space in MOV files and similar files.false
- Do not use the transcoder’s estimate of the duration.
- requireFastStart –
true
(default) - Try to put the index tables (header) in front of the file.false
- Put header at end of file.
- fastStartLength – Optional estimated duration of the clip in seconds.
- notification – The placeholder job notification to use for this job. (Optional)
- notificationData – Any additional data to include for notifications on this job. (Optional)
- priority – The priority to assign to the job. Default is
MEDIUM
. - jobmetadata – Additional information for the job task.
- settings – Pre-configured import settings.
- importTag – An optional list of shape tags that the created shape will be associated with.
Default value is
original
. (New in 4.12.)
Accepts: - application/xml, application/json – MetadataDocument, initial metadata that is given to the imported item.
Produces: - application/xml, application/json – A JobDocument that describes the import job.
Role: _import
Start an import job of an IMF package¶
-
POST
{file-resource}/import/assetmap
¶ Starts a an import job that will import an
ASSETMAP
file (SMPTE ST 429-9). Files pointed to by the assetmap (DCP/InterOp or SMPTE) has to be stored in the same directory.Query Parameters: - allowReimport –
true
- Import the file to this shape even if the file is already importing or is already part of another item.false
(default) Reject the request if the file with the given id has already been imported or is currently importing.
- id – A comma-delimited list of external ids to assign to the item.
- tag – An optional list of shape tags to use for transcoding.
- original – An optional tag, if specified it should be one of the tags specified in the tag parameter. Specifies that the original shape tag will be reset to the shape created to this tag.
- createThumbnails –
true
(default) - Generate thumbnails as per defined by shape tag.false
- Disable thumbnail generation.
- thumbnailService – An optional identifier to which thumbnail resource that should be used.
- createPosters – An optional list of time codes to use for creating posters.
- no-transcode –
true
- Will disable transcoding even if thetags
parameter is set. Rather, the specified tag will be used to determine cropping, scaling etc. of thumbnails.false
(default) - Normal transcode.
- overrideFastStart –
true
(default) - Use transcoder’s estimate of the duration for allocating header space in MOV files and similar files.false
- Do not use the transcoder’s estimate of the duration.
- requireFastStart –
true
(default) - Try to put the index tables (header) in front of the file.false
- Put header at end of file.
- fastStartLength – Optional estimated duration of the clip in seconds.
- notification – The placeholder job notification to use for this job. (Optional)
- notificationData – Any additional data to include for notifications on this job. (Optional)
- priority – The priority to assign to the job. Default is
MEDIUM
. - jobmetadata – Additional information for the job task.
- settings – Pre-configured import settings.
- importTag – An optional list of shape tags that the created shape will be associated with.
Default value is
original
. (New in 4.12.)
Accepts: - application/xml, application/json – MetadataDocument, initial metadata that is given to the imported item.
Produces: - application/xml, application/json – A JobDocument that describes the import job.
Role: _import
- allowReimport –
Start an import job from path¶
New in version 4.10.
-
POST
{storage-resource}/file/import
¶ Starts a an import job that will import the specified file. Only files that do not belong to any components can be imported.
Query Parameters: - path – The path of the file on the storage. Mandatory.
- uri – The absolute file URI (should be relative to the URI of a storage method).
- state – The state of the file. Default is
CLOSED
. - createOnly –
true
- Fail if a file with that path already exists.false
(default) - Update the existing file if one exists, else create a new file entity.
- filename – The original filename of the file.
- allowReimport –
true
- Import the file to this shape even if the file is already importing or is already part of another item.false
(default) Reject the request if the file with the given id has already been imported or is currently importing.
- id – A comma-delimited list of external ids to assign to the item.
- tag – An optional list of shape tags to use for transcoding.
- original – An optional tag, if specified it should be one of the tags specified in the tag parameter. Specifies that the original shape tag will be reset to the shape created to this tag.
- createThumbnails –
true
(default) - Generate thumbnails as per defined by shape tag.false
- Disable thumbnail generation.
- thumbnailService – An optional identifier to which thumbnail resource that should be used.
- createPosters – An optional list of time codes to use for creating posters.
- no-transcode –
true
- Will disable transcoding even if thetags
parameter is set. Rather, the specified tag will be used to determine cropping, scaling etc. of thumbnails.false
(default) - Normal transcode.
- resourceId –
The transcoder resource to use to execute the transcode.
New in version 4.12.
- overrideFastStart –
true
(default) - Use transcoder’s estimate of the duration for allocating header space in MOV files and similar files.false
- Do not use the transcoder’s estimate of the duration.
- requireFastStart –
true
(default) - Try to put the index tables (header) in front of the file.false
- Put header at end of file.
- fastStartLength – Optional estimated duration of the clip in seconds.
- notification – The placeholder job notification to use for this job. (Optional)
- notificationData – Any additional data to include for notifications on this job. (Optional)
- priority – The priority to assign to the job. Default is
MEDIUM
. - jobmetadata – Additional information for the job task.
- settings – Pre-configured import settings.
- importTag – An optional list of shape tags that the created shape will be associated with.
Default value is
original
. (New in 4.12.)
Accepts: - application/xml, application/json – MetadataDocument, initial metadata that is given to the imported item.
Produces: - application/xml, application/json – A JobDocument that describes the import job.
Role: _import
Start an import job of an IMF package from path¶
New in version 4.10.
-
POST
{storage-resource}/file/import/assetmap
¶ Starts a an import job that will import an
ASSETMAP
file (SMPTE ST 429-9). Files pointed to by the assetmap (DCP/InterOp or SMPTE) has to be stored in the same directory.Query Parameters: - path – The path of the file on the storage. Mandatory.
- uri – The absolute file URI (should be relative to the URI of a storage method).
- state – The state of the file. Default is
CLOSED
. - createOnly –
true
- Fail if a file with that path already exists.false
(default) - Update the existing file if one exists, else create a new file entity.
- allowReimport –
true
- Import the file to this shape even if the file is already importing or is already part of another item.false
(default) Reject the request if the file with the given id has already been imported or is currently importing.
- id – A comma-delimited list of external ids to assign to the item.
- tag – An optional list of shape tags to use for transcoding.
- original – An optional tag, if specified it should be one of the tags specified in the tag parameter. Specifies that the original shape tag will be reset to the shape created to this tag.
- createThumbnails –
true
(default) - Generate thumbnails as per defined by shape tag.false
- Disable thumbnail generation.
- thumbnailService – An optional identifier to which thumbnail resource that should be used.
- createPosters – An optional list of time codes to use for creating posters.
- no-transcode –
true
- Will disable transcoding even if thetags
parameter is set. Rather, the specified tag will be used to determine cropping, scaling etc. of thumbnails.false
(default) - Normal transcode.
- overrideFastStart –
true
(default) - Use transcoder’s estimate of the duration for allocating header space in MOV files and similar files.false
- Do not use the transcoder’s estimate of the duration.
- requireFastStart –
true
(default) - Try to put the index tables (header) in front of the file.false
- Put header at end of file.
- fastStartLength – Optional estimated duration of the clip in seconds.
- notification – The placeholder job notification to use for this job. (Optional)
- notificationData – Any additional data to include for notifications on this job. (Optional)
- priority – The priority to assign to the job. Default is
MEDIUM
. - jobmetadata – Additional information for the job task.
- settings – Pre-configured import settings.
- importTag – An optional list of shape tags that the created shape will be associated with.
Default value is
original
. (New in 4.12.)
Accepts: - application/xml, application/json – MetadataDocument, initial metadata that is given to the imported item.
Produces: - application/xml, application/json – A JobDocument that describes the import job.
Role: _import
Move/copy/delete files from a storage¶
Create a file move/copy job¶
-
POST
{file-resource}/storage/
(target-storage-id)¶ Starts a move or copy job for the specified file.
Query Parameters: - move –
true
- Delete the original file when the copy has finished.false
- Just copy the file, and leave the original.
- filename – Optional filename, the desired target filename.
- useOriginalFilename – If set to true, the file will keep its original filename if available.
- timeRequirement – Optional number of seconds the target file is required to exist before being moved due to storage rules etc.
- limitRate – (New in 4.0.) Optional integer, throttle the rate at which the transfer takes place (bytes/second).
- notification – The placeholder job notification to use for this job. (Optional)
- notificationData – Any additional data to include for notifications on this job. (Optional)
- priority – The priority to assign to the job. Default is
MEDIUM
. - jobmetadata – Additional information for the job task.
Produces: - application/xml, application/json – JobDocument
Role: _file_write
- move –
Create a file delete job¶
-
DELETE
{file-resource}
¶ Starts a delete job for the specified file.
Query Parameters: - notification – The placeholder job notification to use for this job. (Optional)
- notificationData – Any additional data to include for notifications on this job. (Optional)
- priority – The priority to assign to the job. Default is
MEDIUM
. - jobmetadata – Additional information for the job task.
Produces: - application/xml, application/json – JobDocument
Role: _file_write
Managing files¶
Create a file entity in the database¶
-
POST
{storage-resource}/file
¶ Creates a file entity in the database. Does not create any physical files. Either a storage id and path or an absolute URI may be given.
Query Parameters: - path – The path of the file on the storage.
- uri – The absolute file URI (should be relative to the URI of a storage method).
- state – The state of the file. Default is
OPEN
. - createOnly –
true
(default) - Fail if a file with that path already exists.false
- Update the existing file if one exists, else create a new file entity.
Status Codes: - 409 Conflict – If
createOnly=true
and a file with that path already exists.
Produces: - application/xml, application/json – FileDocument
- text/plain – The id of the new or updated file.
-
POST
{storage-resource}/file
¶ Creates a file entity in the database. Does not create any physical files. Either a storage id and path or an absolute URI may be given.
Query Parameters: - createOnly –
true
(default) - Fail if a file with that path already exists.false
- Update the existing file if one exists, else create a new file entity.
Status Codes: - 409 Conflict – If
createOnly=true
and a file with that path already exists.
Accepts: - application/xml, application/json – FileDocument with the path or uri and file state.
Produces: - application/xml, application/json – FileDocument
- text/plain – The id of the new or updated file.
- createOnly –
Delete a file entity from the database¶
-
DELETE
{file-resource}/entity
¶ Deletes a file entity from the database. Does not touch the physical file.
Role: _file_write
Set new file path¶
-
POST
{file-resource}/path
¶ Registers a new file, with the new path, and change all relevant components to point to the new file instead. The old file is marked for deletion. Hence, caller should first do the physical move, then issue this command.
The path of file entities in Vidispine is immutable. This command is used when a file is moved manually (without Vidispine), and caller wants to register the new path.
Use the
duplicate
parameter to add another file as a duplicate. The file at the new location will be added to all components that the file is already a part of. No file entities will be removed.Query Parameters: - storage – Optional storage id. The new storage, if omitted, the same storage.
- path – The new path. Required.
- state – Optional new state of the file. (OPEN, CLOSED, etc).
- duplicate –
true
- The file at the target path is a duplicate of this file. The old file entity will NOT be removed.false
(default) - This target path is the new location. This old file entity will be removed.
New in version 4.2.12.
Produces: - application/xml, application/json – FileDocument
- text/plain – File id
Role: _file_write
Set file state¶
-
PUT
{file-resource}/state/
(state)¶ Changes the state of the specified file to the given state.
Can for example be used after writing a file to a storage, to immediately mark it as CLOSED and no longer growing.
Parameters: - state – The new state of the file.
Produces: - application/xml, application/json – The resulting FileDocument
- text/plain – The id of the file.
Example:
PUT /storage/file/VX-12/state/CLOSED
<FileDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<id>VX-432</id>
<path>sample.mov</path>
<uri>file:///srv/media1/sample.mov</uri>
<state>CLOSED</state>
<size>7889811</size>
<hash>5eb9646332c96c738b4cacf7bc110d4cd8523ed5</hash>
<timestamp>2016-03-24T17:02:53.796+01:00</timestamp>
<refreshFlag>1</refreshFlag>
<storage>VX-1</storage>
</FileDocument>
Unassociate a file with an item¶
-
PUT
{file-resource}/abandon
¶ Unassociates (disconnects) the physical file from the item. The shape which the file resided in will still exist, but there is no longer any connection between the file and the shape or item.
Query Parameters: - item – The item from which the file in unassociated
Role: _file_write
Re-index file¶
-
PUT
{file-resource}/re-index
¶ Queues a single file for re-index.
Produces: - text/plain –
See Re-indexing metadata if you wish to reindex all files in the system.