Host Datastore Browser Delete File

Host Datastore Browser Delete File

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://{api_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 8.0.2.0 APIs.


Request Body
DeleteFileRequestType of type(s) application/json
Required
"DeleteFileRequestType Object"
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: InlineVimFault0
"VimFault Object"

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