Guest File Manager Initiate File Transfer To Guest

Guest File Manager Initiate File Transfer To Guest

Initiates an operation to transfer a file to the guest.

Obtains a URL to the file inside the guest to be transferred from the client. The user should send a HTTP PUT request specifying the file content in the body of the request. Multiple PUT request cannot be sent to the URL simultaneously. URL will be invalidated after a successful PUT request is sent. If the power state of the Virtual Machine is changed when the file transfer is in progress, or the Virtual Machine is migrated, then the transfer operation is aborted.

In order to ensure a secure connection to the host when transferring a file using HTTPS, the X.509 certificate for the host must be used to authenticate the remote end of the connection. The certificate of the host that the virtual machine is running on can be retrieved using the following fields: vm (VirtualMachine) -> runtime (VirtualMachineRuntimeInfo) -> host (HostSystem) -> config (HostConfigInfo) -> certificate.

Request
URI
POST
https://{vcenter-host}/sdk/vim25/{release}/GuestFileManager/{moId}/InitiateFileTransferToGuest
COPY
Path Parameters
string
moId
Required

The unique identifier for the managed object to which the method attaches; the serialized managed object reference for a request has the form moType/moId, in this case GuestFileManager/{moId}.

string
release
Required

The vSphere release schema. The current specification covers vSphere 8.0.3.0 APIs.


Request Body
InitiateFileTransferToGuestRequestType of type(s) application/json
Required

Show optional properties

{
    "vm": {},
    "auth": {
        "interactiveSession": false
    },
    "guestFilePath": "string",
    "fileAttributes": {},
    "fileSize": 0,
    "overwrite": false
}
{
    "vm": {
        "_typeName": "string",
        "type": "string",
        "value": "string"
    },
    "auth": {
        "_typeName": "string",
        "interactiveSession": false
    },
    "guestFilePath": "string",
    "fileAttributes": {
        "_typeName": "string",
        "modificationTime": "string",
        "accessTime": "string",
        "symlinkTarget": "string"
    },
    "fileSize": 0,
    "overwrite": false
}
vm
Required

Reference to an instance of the VirtualMachine managed object.

auth
Required

GuestAuthentication is an abstract base class for authentication in the guest.

string
guestFilePath
Required

The complete destination path in the guest to transfer the file from the client. It cannot be a path to a directory or a symbolic link.

fileAttributes
Required

Different attributes for a guest file.

integer As int64 As int64
fileSize
Required

Size of the file to transfer to the guest in bytes.

boolean
overwrite
Required

If set, the destination file is clobbered.

Authentication
This operation uses the following authentication methods.
Responses
200

A URL to which the user has to send a PUT request. The host part of the URL is returned as '*' if the hostname to be used is the name of the server to which the call was made. For example, if the call is made to esx-svr-1.domain1.com, and the file can be uploaded to https://esx-svr-1.domain1.com/guestFile?id=1&token=1234, the URL returned may be https://*/guestFile?id=1&token=1234. The client replaces the asterisk with the server name on which it invoked the call.

The URL is valid only for 10 minutes from the time it is generated. Also, the URL becomes invalid whenever the virtual machine is powered off, suspended or unregistered.

Returns string of type(s) application/json
Operation doesn't return any data structure

500

GuestOperationsFault: if there is an error processing a guest operation.

GuestOperationsUnavailable: if the VM agent for guest operations is not running.

InvalidPowerState: if the VM is not powered on.

InvalidState: if the operation cannot be performed because of the virtual machine's current state.

TaskInProgress: if the virtual machine is busy.

GuestPermissionDenied: if the operation fails because the guest authentication will not allow the operation.

InvalidGuestLogin: if the the guest authentication information was not accepted.

FileFault: if there is a file error in the guest operating system.

GuestComponentsOutOfDate: If the guest agent is too old to support the operation.

OperationNotSupportedByGuest: If the operation is not supported by the guest OS.

OperationDisabledByGuest: If the operation is not enabled due to guest agent configuration.

Returns VimFault of type(s) application/json
This response body class contains all of the following: MethodFault
{
    "_typeName": "string",
    "faultCause": "MethodFault Object",
    "faultMessage": [
        {
            "_typeName": "string",
            "key": "string",
            "arg": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": {
                        "_typeName": "string"
                    }
                }
            ],
            "message": "string"
        }
    ]
}