vcenter compute policies: create
Creates a new compute policy in VMware Cloud on AWS. Usage beyond VMware Cloud on AWS is not supported. Warning: This operation is available as Technology Preview. These are early access APIs provided to test, automate and provide feedback on the feature. Since this can change based on feedback, VMware does not guarantee backwards compatibility and recommends against using them in production environments. Some Technology Preview APIs might only be applicable to specific environments.
Request:
HTTP request
POST https://{server}/api/vcenter/compute/policies
{
"capability" : "obj-103",
"name" : "string",
"description" : "string"
}
"capability" : "obj-103",
"name" : "string",
"description" : "string"
}
Body Parameters:
Name | Type | Description |
---|---|---|
bold = required | ||
- | object | Specification for the new policy to be created. The new policy will be an instance of the capability that has the creation type (see vcenter.compute.policies.capabilities.info.create_spec_type) equal to the type of the specified value (see spec ). |
-.capability | string | Identifier of the capability this policy is based on. Warning: This attribute is available as Technology Preview. These are early access APIs provided to test, automate and provide feedback on the feature. Since this can change based on feedback, VMware does not guarantee backwards compatibility and recommends against using them in production environments. Some Technology Preview APIs might only be applicable to specific environments. if unset, then the name of capability structure will be used to distinguish the policy type.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.vcenter.compute.policies.Capability . When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.vcenter.compute.policies.Capability . |
-.name | string | Name of the policy. The name needs to be unique within this vCenter server. Warning: This attribute is available as Technology Preview. These are early access APIs provided to test, automate and provide feedback on the feature. Since this can change based on feedback, VMware does not guarantee backwards compatibility and recommends against using them in production environments. Some Technology Preview APIs might only be applicable to specific environments. |
-.description | string | Description of the policy. Warning: This attribute is available as Technology Preview. These are early access APIs provided to test, automate and provide feedback on the feature. Since this can change based on feedback, VMware does not guarantee backwards compatibility and recommends against using them in production environments. Some Technology Preview APIs might only be applicable to specific environments. |
Response:
HTTP Status Code: 201
Response Body Structure:
"obj-103"
Headers:
NoneType:
Name | Type | Description |
---|---|---|
bold = required | ||
- | string | The identifier of the newly created policy. Use this identifier to get or destroy the policy. |
Errors:
HTTP Status Code | Type | Description |
---|---|---|
400 | already_exists | if a policy with the same name is already present on this vCenter server. |
400 | invalid_argument | if a parameter passed in the spec is invalid. |
500 | unable_to_allocate_resource | if more than 100 policies are created. |
403 | unauthorized | if the user doesn't have the required privileges, or when used beyond VMware Cloud on AWS. |