File Manager Make Directory

File Manager Make Directory

Create a folder using the specified name.

If the parent or intermediate level folders do not exist, and the parameter createParentDirectories is false, a FileNotFound fault is thrown. If the intermediate level folders do not exist, and the parameter createParentDirectories is true, all the non-existent folders are created.

Requires Datastore.FileManagement privilege on the datastore.

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

string
release
Required

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


Request Body
MakeDirectoryRequestType of type(s) application/json
Required
{
    "name": "string",
    "datacenter": {
        "_typeName": "string",
        "type": "string",
        "value": "string"
    },
    "createParentDirectories": false
}
string
name
Required

The name of the folder, either a URL or a datastore path referring to the folder to be created.

datacenter
Optional

Reference to an instance of the Datacenter managed object.

boolean
createParentDirectories
Optional

If true, any non-existent intermediate level folders will be created. If not specified, it is assumed to be false.

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 datastore. Typically, a specific subclass of this exception is thrown.

CannotCreateFile: if the create operation on the folder fails.

FileAlreadyExists: if a file or folder with the given name already exists at the destination.

FileNotFound: if the createParentDirectories is false and a intermediate level folder specified by name is not found.

FileFault: if there is a generic file error

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