Create Policies
Creates a new compute policy. if you do not have all of the privileges described as follows: - Operation execution requires ComputePolicy.Manage.
Request
URLURL
Header Parameters
Header Parameters
Required session ID, acquired from Create Session API under CIS product
vmware-api-session-id example
"b00db39f948d13ea1e59b4d6fce56389"
Request Body
Specification for the new policy to be created. The new policy will be an instance of the capability that has the creation type (see Capabilities.Info.create-spec-type) equal to the type of the specified value (see spec). The parameter must contain all the attributes defined in CreateSpec.
Authentication
Response
Response BodyResponse Body
The identifier of the newly created policy. Use this identifier to get or destroy the policy. The result will be an identifier for the resource type: com.vmware.vcenter.compute.Policy.
Errors
com.vmware.vapi.std.errors.already_exists : if a policy with the same name is already present on this vCenter server. | com.vmware.vapi.std.errors.invalid_argument : if a parameter passed in the spec is invalid.
com.vmware.vapi.std.errors.unauthorized : if the user doesn’t have the required privileges.
com.vmware.vapi.std.errors.unable_to_allocate_resource : if more than 100 policies are created.
‘Default’ means this response is used for all HTTP codes that are not covered individually for this operation.
Code Samples
cURL Command
Vendor Extensions
x-vmw-doc-operation: create