vcenter folder: list

Returns information about at most 1000 visible (subject to permission checks) folders in vCenter matching the vcenter.folder.filter_spec.

Request:

HTTP request

GET https://{server}/rest/vcenter/folder

?filter.datacenters.1=obj-103
&filter.datacenters.2=obj-103
&filter.names.1=string
&filter.names.2=string
&filter.folders.1=obj-103
&filter.folders.2=obj-103
&filter.parent_folders.1=obj-103
&filter.parent_folders.2=obj-103
&filter.type=DATACENTER

Request Query Parameters:

Name Type Description
bold = required
filter filter_spec Optional. Specification of matching folders for which information should be returned.
filter.folders string[] Identifiers of folders that can match the filter.

Optional. If unset or empty, folders with any identifier match the filter.When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: Folder. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: Folder.

filter.names string[] Names that folders must have to match the filter (see vcenter.folder.summary.name).

Optional. If unset or empty, folders with any name match the filter.

filter.type string Type that folders must have to match the filter (see vcenter.folder.summary.type).

Optional. If unset, folders with any type match the filter.

filter.parent_folders string[] Folders that must contain the folder for the folder to match the filter.

Optional. If unset or empty, folder in any folder match the filter.When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: Folder. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: Folder.

filter.datacenters string[] Datacenters that must contain the folder for the folder to match the filter.

Optional. If unset or empty, folder in any datacenter match the filter.When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: Datacenter. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: Datacenter.

Response:

HTTP Status Code: 200

Representations:

{
    "value"[
        {
            "folder""obj-103",
            "name""string",
            "type""DATACENTER"
        },
        {
            "folder""obj-103",
            "name""string",
            "type""DATACENTER"
        }
    ]
}
<?xml version="1.0" ?>
<ns0:List-Result xmlns:ns0="http://vmware.com/vcenter/folder" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <value-array>
    <array-item>
      <folder>obj-103</folder>
      <name>string</name>
      <type>DATACENTER</type>
    </array-item>
    <array-item>
      <folder>obj-103</folder>
      <name>string</name>
      <type>DATACENTER</type>
    </array-item>
  </value-array>
</ns0:List-Result>

Response Type:

Name Type Description
bold = required
value summary[] Commonly used information about the folders matching the vcenter.folder.filter_spec.
value[].folder string Identifier of the folder.

When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: Folder. When operations return a value of this structure as a result, the field will be an identifier for the resource type: Folder.

value[].name string Name of the vCenter Server folder.

value[].type string Type (DATACENTER, DATASTORE, HOST, NETWORK, VIRTUAL_MACHINE) of the vCenter Server folder.

Defines the type of a vCenter Server folder. The type of a folder determines what what kinds of children can be contained in the folder. Value is one of:
DATACENTER: A folder that can contain datacenters.
DATASTORE: A folder that can contain datastores.
HOST: A folder that can contain compute resources (hosts and clusters).
NETWORK: A folder that can contain networkds.
VIRTUAL_MACHINE: A folder that can contain virtual machines.

Errors:

HTTP Status Code Type Description
400 invalid_argument if the vcenter.folder.filter_spec.type field contains a value that is not supported by the server.
400 unable_to_allocate_resource if more than 1000 folders match the vcenter.folder.filter_spec.
503 service_unavailable if the system is unable to communicate with a service to complete the request.
401 unauthenticated if the user can not be authenticated.
403 unauthorized if the user doesn't have the required privileges.