Guest File Manager Initiate File Transfer From Guest

Guest File Manager Initiate File Transfer From Guest

Initiates an operation to transfer a file from the guest.

Obtains a reference to FileTransferInformation object for the file transfer operation. The information object contains a URL to the file inside the guest to be transferred to the client.

See FileTransferInformation for information on how to use the information object. 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}/InitiateFileTransferFromGuest
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.2.0 APIs.


Request Body
InitiateFileTransferFromGuestRequestType of type(s) application/json
Required
{
    "vm": {
        "_typeName": "string",
        "type": "string",
        "value": "string"
    },
    "auth": {
        "_typeName": "string",
        "interactiveSession": false
    },
    "guestFilePath": "string"
}
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 path to the file inside the guest that has to be transferred to the client. It cannot be a path to a directory or a symbolic link.

Authentication
This operation uses the following authentication methods.
Responses
200

A reference to FileTransferInformation.

Returns FileTransferInformation of type(s) application/json
This response body class contains all of the following: DataObject
{
    "_typeName": "string",
    "attributes": {
        "_typeName": "string",
        "modificationTime": "string",
        "accessTime": "string",
        "symlinkTarget": "string"
    },
    "size": 0,
    "url": "string"
}
attributes
Required

Different attributes for a guest file.

integer As int64 As int64
size
Required

Total size of the file in bytes.

string
url
Required

Specifies the URL to which the user has to send HTTP GET request.

Multiple GET requests cannot be sent to the URL simultaneously. URL will become invalid once a successful GET request is sent.

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 is available for download from 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.


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"
        }
    ]
}