REST API - create

vcenter vm data sets: create

Creates a new data set. Warning: This operation is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Request:

HTTP request

POST https://{server}/api/vcenter/vm/{vm}/data-sets
{
    "disk_mode"true,
    "size"1,
    "name""string",
    "host""NONE",
    "description""string",
    "guest""NONE"
}

Path Parameters

Name Type Description
Required
vm string Identifier of the virtual machine.

Body Parameters:

Name Type Description
bold = required
- create_spec Specification of the data set to be created.
-.name string The name of the data set. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

-.description string A description of how the data set is used by its creator. This field can contain up to 1024 bytes. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

-.host string Host access control. XXX do we want this? Does anything but FULL make any sense? Or just make it symmetric in case? Any decision should only effect docs and impl, so we should be able to change it. Possible use-cases for non-FULL: - read-only for a built-in data set (eg guest status data) - if data set creation from the GOS is ever added, full access control may be useful. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Possible Entry access modes. Warning: This enumeration is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented. Value is one of:
NONE: No access is allowed, and the data set is not visible to a list operation. XXX does this matter? knowing a name isn't a security concern, and making Access only apply to Entries is clear and consistent. Warning: This constant is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.
READ_ONLY: Only read access is allowed for data set Entries. Warning: This constant is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.
READ_WRITE: Full read, write and delete access is allowed on data set Entries. Warning: This constant is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

-.guest string Guest access control. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Possible Entry access modes. Warning: This enumeration is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented. Value is one of:
NONE: No access is allowed, and the data set is not visible to a list operation. XXX does this matter? knowing a name isn't a security concern, and making Access only apply to Entries is clear and consistent. Warning: This constant is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.
READ_ONLY: Only read access is allowed for data set Entries. Warning: This constant is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.
READ_WRITE: Full read, write and delete access is allowed on data set Entries. Warning: This constant is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

-.size long The total size in bytes of the Entry data that can be used by this data set. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

-.disk_mode boolean If set, the data set treated like a disk on certain virtual machine operations. The data set is copied when the virtual machine is cloned or a snapshot is taken. Otherwise the data set is considered a property of the virtual machine, and is not included in a a snapshot operation or when the virtual machine is cloned. When a virtual machine is restored to a snapshot, any data set without {@name diskMode) will be destroyed. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Optional. If unset, the data set is copied when a virtual machine is cloned or a snapshot is taken.

Response:

HTTP Status Code: 201

Response Body Structure:

"obj-103"

Headers:

None

Type:

Name Type Description
bold = required
- string The identifier of the new data set.

Errors:

HTTP Status Code Type Description
400 invalid_argument if the specification is incorrect.
404 not_found if the virtual machine is not found.
400 already_exists if the data set with the same name already exists.
500 unable_to_allocate_resource if the new data set requires more resources than are available.
403 unauthorized if the user doesn't have the required privileges.