Host Datastore Browser Delete File

Host Datastore Browser Delete File
Deletes the specified files from the datastore.

Deprecated as of VI API 2.5, use DeleteDatastoreFile_Task.

Deletes the specified files from the datastore.

If a valid virtual disk file is specified, then all the components of the virtual disk are deleted.

Required privileges: Datastore.DeleteFile

Request
URI
POST
https://{vcenter-host}/sdk/vim25/{release}/HostDatastoreBrowser/{moId}/DeleteFile
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 HostDatastoreBrowser/{moId}.

string
release
Required

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


Request Body
DeleteFileRequestType of type(s) application/json
Required
{
    "datastorePath": "string"
}
string
datastorePath
Required

datastorePath

Authentication
This operation uses the following authentication methods.
Responses
204

No Content

Operation doesn't return any data structure

500

InvalidDatastore: if the operation cannot be performed on the target datastores. Typically, a specific subclass of this exception is thrown.

FileNotFound: if the file or folder specified by datastorePath is not found.

CannotDeleteFile: if the delete operation on the file fails.

InvalidArgument: if fileInfo is not a valid FileInfo type.

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

Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"datastorePath":"string"}' https://{api_host}/sdk/vim25/{release}/HostDatastoreBrowser/{moId}/DeleteFile