[{"label":"Latest (v37.0)","version":"latest"},{"version":"v36.3"},{"version":"v36.2"},{"version":"v36.1"},{"version":"v36.0"},{"link":"https://developer.vmware.com/apis/1046/vmware-cloud-director","version":"v35.0"}]
vmware-cloud-director

Create VDC Compute Policy

Description

Creates a new VDC compute policy. if PolicyType is VdcKubernetesPolicy, then the response is a 202 with task URL in location header. For VdcVmPolicy type, the response is 201 with created policy in response body.

Request

Request

URL

URL


post
https://{api_host}/cloudapi/2.0.0/vdcComputePolicies
Copy

Request Body

Request Body

VdcComputePolicy2 of type(s) application/json Required
{
	"name": "string",
	"policyType": "string"
}
string
policyType Required

The discriminator type is used to differentiate among various sub policy types.


string
name Required

Display name.


string
description Optional

string
id Optional

UUID for vDC compute policy. This is immutable.


boolean
isAutoGenerated Optional

It is a read-only field. It indicates whether the policy is auto-generated.


boolean
isSizingOnly Optional

This field cannot be updated and is a read-only field in the client after creation. It defines whether the policy is SIZING_ONLY or if it also contains affinity information.


array of string
compatibleVdcTypes Optional

A list of read-only compatible vDC types for this policy.


pvdcComputePolicy Optional

This field cannot be updated and is a read-only field in the client after creation.


string
pvdcId Optional

URN for Provider vDC.

Authentication

Authentication

This operation uses the following authentication methods.

Response

Response

Response Body

Response Body

202 Accepted returns VdcComputePolicy2 of type(s) application/json;version=37.0
{
	"compatibleVdcTypes": [
		"string"
	],
	"description": "string",
	"id": "string",
	"isAutoGenerated": false,
	"isSizingOnly": false,
	"name": "string",
	"policyType": "string",
	"pvdcComputePolicy": {
		"id": "string",
		"name": "string"
	},
	"pvdcId": "string"
}
string
policyType Required

The discriminator type is used to differentiate among various sub policy types.


string
name Required

Display name.


string
description Optional

string
id Optional

UUID for vDC compute policy. This is immutable.


boolean
isAutoGenerated Optional

It is a read-only field. It indicates whether the policy is auto-generated.


boolean
isSizingOnly Optional

This field cannot be updated and is a read-only field in the client after creation. It defines whether the policy is SIZING_ONLY or if it also contains affinity information.


array of string
compatibleVdcTypes Optional

A list of read-only compatible vDC types for this policy.


pvdcComputePolicy Optional

This field cannot be updated and is a read-only field in the client after creation.


string
pvdcId Optional

URN for Provider vDC.

Errors

Errors

400

Invalid configuration.

Code Samples

Code Samples

cURL Command

curl -X POST -H "Content-Type: application/json" -d '{"compatibleVdcTypes":["string"],"description":"string","id":"string","isAutoGenerated":false,"isSizingOnly":false,"name":"string","policyType":"string","pvdcComputePolicy":{"id":"string","name":"string"},"pvdcId":"string"}' https://{api_host}/cloudapi/2.0.0/vdcComputePolicies


[{"label":"Latest (v37.0)","version":"latest"},{"version":"v36.3"},{"version":"v36.2"},{"version":"v36.1"},{"version":"v36.0"},{"link":"https://developer.vmware.com/apis/1046/vmware-cloud-director","version":"v35.0"}]
vmware-cloud-director
Feedback

Was this page helpful?