Update Guest Filesystem Files
Changes the file attributes of a specified file or directory inside the guest.
if you do not have all of the privileges described as follows: - The resource VirtualMachine referenced by the parameter vm requires VirtualMachine.GuestOperations.Modify.
Request
URLURL
https://{api_host}/api/vcenter/vm/{vm}/guest/filesystem/files?action=update
Path Parameters
Path Parameters
string
vm
Required
Virtual Machine to perform the operation on.
The parameter must be an identifier for the resource type: VirtualMachine.
Header Parameters
Header Parameters
string
vmware-api-session-id
Required
Required session ID, obtained by first calling Create Session API
Request Body
Request Body
VmGuestFilesystemFilesUpdateRequestBody of mimetype application/json
Optional
This is a request body class for an operation.
(The request body parameter is missing description)
{
"credentials": {
"interactive_session": false,
"type": "enum"
},
"file_attributes": {},
"path": "string"
}
file_attributes
Required
Specifies the different file attributes of the guest file to be changed. See Files.FileAttributesUpdateSpec.
string
path
Required
The complete path to the file or directory to be changed in the guest. If the file points to an symbolic link, then the attributes of the target file are changed.
cURL Command
curl -X POST -H "vmware-api-session-id: b00db39f948d13ea1e59b4d6fce56389" -H "Content-Type: application/json" -d '{"credentials":{"interactive_session":false,"password":"string","saml_token":"string","type":"enum","user_name":"string"},"file_attributes":{"last_accessed":"string","last_modified":"string","posix":{"group_id":0,"owner_id":0,"permissions":"string"},"windows":{"hidden":false,"read_only":false}},"path":"string"}' https://{api_host}/api/vcenter/vm/{vm}/guest/filesystem/files?action=update
Errors
400
com.vmware.vapi.std.errors.invalid_argument : if fileAttributes does not apply to the guest operating system.
if path is not a file. The value of com.vmware.vapi.std.errors.Error#data will contain all the fields defined in the FileErrorDetails providing additional information about the failure.
if path is too long. The value of com.vmware.vapi.std.errors.Error#data will contain all the fields defined in the FileErrorDetails providing additional information about the failure. | com.vmware.vapi.std.errors.not_allowed_in_current_state : if the virtual machine is not running. | com.vmware.vapi.std.errors.unsupported : if the operation is not supported by the VMware Tools in the guest operating system.
if the operation is disabled by the VMware Tools in the guest operating system.
403
com.vmware.vapi.std.errors.unauthorized : if path cannot be accessed.
if path cannot be updated because the guest authentication will not allow the operation.
404
com.vmware.vapi.std.errors.not_found : if the virtual machine is not found.
if path is not found. The value of com.vmware.vapi.std.errors.Error#data will contain all the fields defined in the FileErrorDetails providing additional information about the failure.
Availability
Added in 7.0.2.0