Get Item File
If vSphere APIs begin with /rest (vs /api), any maps are consumed/returned instead as arrays of objects, each containing a key and a value property field.
Retrieves the information for a single file in a library item by its name. if you do not have all of the privileges described as follows: - The resource com.vmware.content.library.Item referenced by the parameter libraryItemId requires System.Read.
Request
URLURL
https://{api_host}/rest/com/vmware/content/library/item/file/id:{library_item_id}?~action=get
Parameters
Parameters
string
library_item_id
Required
Identifier of the library item whose file information should be returned.
The parameter must be an identifier for the resource type: com.vmware.content.library.Item.
Query Parameters
Query Parameters
string
name
Required
Name of the file in the library item whose information should be returned.
Header Parameters
Header Parameters
string
vmware-api-session-id
Required
Required session ID, obtained by first calling Create Session API
Example: b00db39f948d13ea1e59b4d6fce56389
Response
Response
Response BodyResponse Body
200 OK returns
LibraryItemFileGetResponseBody
of type application/json
The File.Info object with information on the specified file.
{
"value": {
"cached": false,
"checksum_info": {
"algorithm": "enum",
"checksum": "string"
},
"name": "string",
"size": 0,
"version": "string"
}
}
cURL Command
curl -X POST -H "vmware-api-session-id: b00db39f948d13ea1e59b4d6fce56389" https://{api_host}/rest/com/vmware/content/library/item/file/id:{library_item_id}?~action=get?name=string
Errors
404
com.vmware.vapi.std.errors.not_found : if libraryItemId refers to a library item that does not exist.
if name refers to a file that does not exist in the library item.
On This Page
Item File Operations
get
post