Content Library Item Updatesession File add
Requests file content to be changed (either created, or updated).
Depending on the source type of the file, this operation will either return an upload endpoint where the client can push the content, or the server will pull from the provided source endpoint. If a file with the same name already exists in this session, this operation will be used to update the content of the existing file.
When importing a file directly from storage, where the source endpoint is a file or datastore URI, you will need to have the ContentLibrary.ReadStorage privilege on the library item. If the file is located in the same directory as the library storage backing folder, the server will move the file instead of copying it, thereby allowing instantaneous import of files for efficient backup and restore scenarios. In all other cases, a copy is performed rather than a move.
Returns an authorization error if you do not have all of the privileges described as follows:
- Operation execution requires
System.Anonymous
.
Identifier of the update session to be modified.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.
Specification for the file that needs to be added or updated. This includes whether the client wants to push the content or have the server pull it.
Show optional properties
{
"name": "string",
"source_type": "string"
}
{
"name": "string",
"source_type": "string",
"source_endpoint": {
"uri": "string",
"ssl_certificate_thumbprint": "string",
"ssl_certificate": "string"
},
"size": 0,
"checksum_info": {
"algorithm": "string",
"checksum": "string"
}
}
The name of the file being uploaded.
The source type (SourceType) from which the file content will be retrieved.
For more information see: Content Library Item Updatesession File SourceType.
Location from which the Content Library Service will fetch the file, rather than requiring a client to upload the file.
This property is optional and it is only relevant when the value of source_type is Content Library Item Updatesession File SourceType.PULL.
The file size, in bytes.
If missing or null
, the server will not verify it received the correct size.
The checksum of the file. If specified, the server will verify the checksum once the file is received. If there is a mismatch, the upload will fail. For ova files, this value should not be set.
If missing or null
, the server will not verify the checksum.
An Content Library Item Updatesession File Info schema containing upload links as well as server side state tracking the transfer of the file.
"Content Library Item Updatesession File Info Object"
The name of the file.
The source type (SourceType) from which the file is being retrieved. This may be Content Library Item Updatesession File SourceType.NONE if the file is not being changed.
For more information see: Content Library Item Updatesession File SourceType.
The file size, in bytes as received by the server. This property is guaranteed to be set when the server has completely received the file.
This property won't be set until the file status is Content Library Item TransferStatus.READY.
The checksum information of the file received by the server.
If missing or null
, the server does not verify the checksum.
A source endpoint from which to retrieve the file.
This property is optional and it is only relevant when the value of source_type is Content Library Item Updatesession File SourceType.PULL.
An upload endpoint to which the client can push the content.
This property is optional and it is only relevant when the value of source_type is Content Library Item Updatesession File SourceType.PUSH.
The number of bytes of this file that have been received by the server.
The transfer status (TransferStatus) of this file.
For more information see: Content Library Item TransferStatus.
Details about the transfer error.
An error message is set if the status is Content Library Item TransferStatus.ERROR.
Whether or not the file will be kept in storage upon update session completion. The flag is true for most files, and false for metadata files such as manifest and certificate file of update session with library item type OVF. Any file with Content Library Item Updatesession File Info.keep_in_storage set to false will not show up in the list of files returned from GET /content/library/item/{libraryItemId}/file upon update session completion.
This property was added in vSphere API 6.8.
If missing or null
, the file will be kept in storage upon update session completion.
Vapi Std Errors InvalidArgument if the fileSpec is invalid.
Vapi Std Errors NotAllowedInCurrentState:
- if the content of the library item associated with the update session has been deleted from the storage backings (see LibraryModel#storageBackings) associated with it.
- if metadata files such as manifest and certificate file are added after the OVF descriptor file. This is applicable to update sessions with library item type OVF only. This error was added in vSphere 6.8.0.
"Vapi Std Errors Error Object"
Stack of one or more localizable messages for human error consumers.
The message at the top of the stack (first in the list) describes the error from the perspective of the operation the client invoked.
Each subsequent message in the stack describes the "cause" of the prior message.
Data to facilitate clients responding to the operation reporting a standard error to indicating that it was unable to complete successfully.
Operations may provide data that clients can use when responding to errors. Since the data that clients need may be specific to the context of the operation reporting the error, different operations that report the same error may provide different data in the error. The documentation for each each operation will describe what, if any, data it provides for each error it reports.
The Vapi Std Errors ArgumentLocations, Vapi Std Errors FileLocations, and Vapi Std Errors TransientIndication schemas are intended as possible values for this property. Vapi Std DynamicID may also be useful as a value for this property (although that is not its primary purpose). Some resources may provide their own specific schemas for use as the value of this property when reporting errors from their operations.
Some operations will not set this property when reporting errors.
Discriminator field to help API consumers identify the structure type.
For more information see: Vapi Std Errors Error Type.
This property was added in vSphere API 6.7.2.
Can be missing or null
for compatibility with preceding implementations.
if the caller doesn't have ContentLibrary.ReadStorage privilege on the library item of the update session and source type Content Library Item Updatesession File SourceType.PULL is requested for a file or datastore source endpoint (that is, not HTTP or HTTPs based endpoint).
"Vapi Std Errors Unauthorized Object"
if the update session doesn't exist.
"Vapi Std Errors NotFound Object"
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"name:"string","source_type:"string"}' https://{api_host}/api/content/library/item/update-session/{updateSessionId}/file