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

Update VDC Max Compute Policy

Description

Updates Max Compute Policy of the vDC. Returns 400 if policy type is not VdcVmPolicy.

Request

Request

URL

URL


put
https://{api_host}/cloudapi/2.0.0/vdcs/{orgVdcId}/maxComputePolicy
Copy

Path Parameters

Path Parameters

string
orgVdcId Required

Request Body

Request Body

VdcComputePolicy2 of type(s) application/json Required
{
    "name": "myPolicy",
    "policyType": "VdcKubernetesPolicy"
}
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

200 OK

Returns VdcComputePolicy2 of type(s) application/json;version=36.3
{
    "description": "This is an example payload to create a policy of type VdcKubernetesPolicy.\nFollow /1.0.0/vdcComputePolicies example to know payload to create a VdcVmPolicy type\nof compute policy. Note that policyType field will have to be added to the payload taken\nfrom /1.0.0/vdcComputePolicies example, if you are using /2.0.0/vdcComputePolicies.\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": "VdcKubernetesPolicy",
    "pvdcComputePolicy": {
        "id": "urn:vcloud:pvdcComputePolicy:494f4a50-09ce-4ba7-913b-3fde593bc7ef",
        "name": "nameOfPvdcPolicy"
    },
    "vdc": {
        "id": "urn:vcloud:vdc:f8dfe02d-47e5-4e3c-ba71-f0d67810d0ef",
        "name": "vdc1"
    }
}
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 PUT -H "Content-Type: application/json" -d '{"description":"This is an example payload to create a policy of type VdcKubernetesPolicy.\nFollow /1.0.0/vdcComputePolicies example to know payload to create a VdcVmPolicy type\nof compute policy. Note that policyType field will have to be added to the payload taken\nfrom /1.0.0/vdcComputePolicies example, if you are using /2.0.0/vdcComputePolicies.\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":"VdcKubernetesPolicy","pvdcComputePolicy":{"id":"urn:vcloud:pvdcComputePolicy:494f4a50-09ce-4ba7-913b-3fde593bc7ef","name":"nameOfPvdcPolicy"},"vdc":{"id":"urn:vcloud:vdc:f8dfe02d-47e5-4e3c-ba71-f0d67810d0ef","name":"vdc1"}}' https://{api_host}/cloudapi/2.0.0/vdcs/{orgVdcId}/maxComputePolicy


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