REST API - get

content library item updatesession file: get

Retrieves information about a specific file in the snapshot of the library item at the time when the update session was created.

Request:

HTTP request

POST https://{server}/rest/com/vmware/content/library/item/updatesession/file/id:{update_session_id}?~action=get

Path Parameters

Name Type Description
Required
update_session_id string Identifier of the update session.

Request Body Structure:

{
    "file_name""string"
}

Request Body Parameters:

Name Type Description
bold = required
file_name string Name of the file.

Response:

HTTP Status Code: 200

Representation:

{
    "value"{
        "bytes_transferred"1,
        "error_message"{
            "args"[
                "string",
                "string"
            ],
            "default_message""string",
            "localized""string",
            "id""string",
            "params"[
                {
                    "value"{
                        "dt""2015-01-01T22:13:05.651Z",
                        "s""string",
                        "d"1.5,
                        "precision"1,
                        "format""SHORT_DATE",
                        "i"1,
                        "l"{
                            "id""string",
                            "params"[
                                {
                                    "value"{
                                        "dt""2015-01-01T22:13:05.651Z",
                                        "s""string",
                                        "d"1.5,
                                        "precision"1,
                                        "format""SHORT_DATE",
                                        "i"1,
                                        "l"{
                                            "id""string",
                                            "params"[
                                                {
                                                    "key""string"
                                                }
                                            ]
                                        }
                                    },
                                    "key""string"
                                }
                            ]
                        }
                    },
                    "key""string"
                }
            ]
        },
        "upload_endpoint"{
            "ssl_certificate_thumbprint""string",
            "uri""http://myurl.com"
        },
        "size"1,
        "checksum_info"{
            "checksum""string",
            "algorithm""SHA1"
        },
        "source_endpoint"{
            "ssl_certificate_thumbprint""string",
            "uri""http://myurl.com"
        },
        "name""string",
        "source_type""NONE",
        "keep_in_storage"true,
        "status""WAITING_FOR_TRANSFER"
    }
}

Response Type:

Name Type Description
bold = required
value info Information about the file.
value.name string The name of the file.

value.source_type string The source type (NONE, PUSH, PULL) from which the file is being retrieved. This may be NONE if the file is not being changed.

Defines how the file content is retrieved. Value is one of:
NONE: No source type has been requested.
PUSH: The client is uploading content using HTTP(S) PUT requests.
PULL: The server is pulling content from a URL. The URL scheme can be http, https, file, or ds.

value.size long The file size, in bytes as received by the server. This field is guaranteed to be set when the server has completely received the file.

Optional. This field won't be set until the file status is READY.

value.checksum_info checksum_info The checksum information of the file received by the server.

Optional. If unset, the server does not verify the checksum.

value.checksum_info.algorithm string The checksum algorithm (SHA1, MD5, SHA256, SHA512) used to calculate the checksum.

Optional. If not specified the default checksum algorithm is SH_a1.

value.checksum_info.checksum string The checksum value calculated with content.library.item.file.checksum_info.algorithm.

value.source_endpoint transfer_endpoint A source endpoint from which to retrieve the file.

Optional. It is only relevant when source_type has value PULL. This field is optional and it is only relevant when the value of source_type is PULL.

value.source_endpoint.uri URI Transfer endpoint URI. The supported URI schemes are: http, https, and ds.

An endpoint URI with the ds scheme specifies the location of the file on the datastore. The format of the datastore URI is:

  • ds:///vmfs/volumes/uuid/path

When the transfer endpoint is a datastore location, the server can import the file directly from the storage backing without the overhead of streaming over HTTP.

value.source_endpoint.ssl_certificate_thumbprint string Thumbprint of the expected SSL certificate for this endpoint. Only used for HTTPS connections. The thumbprint is the SHA-1 hash of the DER encoding of the remote endpoint's SSL certificate. If set, the remote endpoint's SSL certificate is only accepted if it matches this thumbprint, and no other certificate validation is performed.

Optional. If not specified, standard certificate validation is performed.

value.upload_endpoint transfer_endpoint An upload endpoint to which the client can push the content.

Optional. It is only relevant when source_type has value PUSH. This field is optional and it is only relevant when the value of source_type is PUSH.

value.upload_endpoint.uri URI Transfer endpoint URI. The supported URI schemes are: http, https, and ds.

An endpoint URI with the ds scheme specifies the location of the file on the datastore. The format of the datastore URI is:

  • ds:///vmfs/volumes/uuid/path

When the transfer endpoint is a datastore location, the server can import the file directly from the storage backing without the overhead of streaming over HTTP.

value.upload_endpoint.ssl_certificate_thumbprint string Thumbprint of the expected SSL certificate for this endpoint. Only used for HTTPS connections. The thumbprint is the SHA-1 hash of the DER encoding of the remote endpoint's SSL certificate. If set, the remote endpoint's SSL certificate is only accepted if it matches this thumbprint, and no other certificate validation is performed.

Optional. If not specified, standard certificate validation is performed.

value.bytes_transferred long The number of bytes of this file that have been received by the server.

value.status string The transfer status (WAITING_FOR_TRANSFER, TRANSFERRING, READY, VALIDATING, ERROR) of this file.

Defines the transfer state of a file. Value is one of:
WAITING_FOR_TRANSFER: Indicates that a file has been defined for a library item and its content needs to be uploaded.
TRANSFERRING: Indicates that data is being transferred to the file.
READY: Indicates that the file has been fully transferred and is ready to be used.
VALIDATING: Indicates that the file is being validated (checksum, type adapters).
ERROR: Indicates that there was an error transferring or validating the file.

value.error_message localizable_message Details about the transfer error.

Optional. An error message is set if the status is ERROR.

value.error_message.id string Unique identifier of the localizable string or message template.

This identifier is typically used to retrieve a locale-specific string or message template from a message catalog.

value.error_message.default_message string The value of this localizable string or message template in the en_US (English) locale. If vapi.std.localizable_message.id refers to a message template, the default message will contain the substituted arguments. This value can be used by clients that do not need to display strings and messages in the native language of the user. It could also be used as a fallback if a client is unable to access the appropriate message catalog.

value.error_message.args string[] Positional arguments to be substituted into the message template. This list will be empty if the message uses named arguments or has no arguments.

value.error_message.params list Named arguments to be substituted into the message template. This attribute was added in vSphere API 7.0.0.0.

Optional. Unset means that the message template requires no arguments or positional arguments are used.

value.error_message.localized string Localized string value as per request requirements. This attribute was added in vSphere API 7.0.0.0.

Optional. when the client has not requested specific locale the implementation may not populate this field to conserve resources.

value.keep_in_storage boolean 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 list upon update session completion. This attribute was added in vSphere API 6.8.

Optional. If unset, the file will be kept in storage upon update session completion.

Errors:

HTTP Status Code Type Description
404 not_found if the update session doesn't exist.
400 invalid_argument if the file doesn't exist in the library item associated with the update session.