[{"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 Pvdc Compute Policy

Description

Creates a new pVDC compute policy

Request

Request

URL

URL


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

Request Body

Request Body

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

Display name.


string
policyType Required

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


string
description Optional

string
id Optional

UUID for pVDC compute policy. This is immutable.


string
pvdcId Optional

URN for Provider vDC. If not provided, then this policy is considered Global.

Authentication

Authentication

This operation uses the following authentication methods.

Response

Response

Response Body

Response Body

201 Created

Returns PvdcComputePolicy2 of type(s) application/json;version=36.3
{
    "description": "This is an example payload to create a policy of type PvdcKubernetesPolicy.\nFollow /1.0.0/pvdcComputePolicies example to know payload to create a PvdcVmPolicy type\nof compute policy. Note that policyType field will have to be added to the payload taken\nfrom /1.0.0/pvdcComputePolicies example, if you are using /2.0.0/pvdcComputePolicies.\n",
    "kubernetesConfig": {
        "namespaceResourceSpec": {
            "cpuLimit": 1000,
            "cpuReservationGuarantee": 1,
            "memoryLimit": 1024,
            "memoryReservationGuarantee": 1
        },
        "storageClasses": [
            {
                "limit": 20480,
                "storageClass": "gold"
            },
            {
                "limit": 10240,
                "storageClass": "silver"
            }
        ],
        "virtualMachineClasses": [
            "best-effort-xsmall",
            "best-effort-small"
        ]
    },
    "name": "myPolicy",
    "policyType": "PvdcKubernetesPolicy",
    "pvdcId": "urn:vcloud:providervdc:d1c4cc73-f111-4bc2-a361-e91839c061c9",
    "supervisorCluster": {
        "moref": "domain-c8",
        "name": "test-cluster"
    }
}
string
name Required

Display name.


string
policyType Required

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


string
description Optional

string
id Optional

UUID for pVDC compute policy. This is immutable.


string
pvdcId Optional

URN for Provider vDC. If not provided, then this policy is considered Global.


202 Accepted

The request have been accepted and the task to monitor the request is in the Location header.

Errors

Errors

400

Invalid configuration.

Code Samples

Code Samples

cURL Command

curl -X POST -H "Content-Type: application/json" -d '{"description":"This is an example payload to create a policy of type PvdcKubernetesPolicy.\nFollow /1.0.0/pvdcComputePolicies example to know payload to create a PvdcVmPolicy type\nof compute policy. Note that policyType field will have to be added to the payload taken\nfrom /1.0.0/pvdcComputePolicies example, if you are using /2.0.0/pvdcComputePolicies.\n","kubernetesConfig":{"namespaceResourceSpec":{"cpuLimit":1000,"cpuReservationGuarantee":1,"memoryLimit":1024,"memoryReservationGuarantee":1},"storageClasses":[{"limit":20480,"storageClass":"gold"},{"limit":10240,"storageClass":"silver"}],"virtualMachineClasses":["best-effort-xsmall","best-effort-small"]},"name":"myPolicy","policyType":"PvdcKubernetesPolicy","pvdcId":"urn:vcloud:providervdc:d1c4cc73-f111-4bc2-a361-e91839c061c9","supervisorCluster":{"moref":"domain-c8","name":"test-cluster"}}' https://{api_host}/cloudapi/2.0.0/pvdcComputePolicies


[{"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?