Policy > Infra > Labels

Create or replace label

Create label if not exists, otherwise replaces the existing label.
If label already exists then type attribute cannot be changed.
This API is available when using VMware Cloud on AWS or VMware NSX-T.

Request:

Method:
PUT
URI Path(s):
/policy/api/v1/infra/labels/<label-id>
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
PolicyLabel+

Example Request:

PUT https://<policy-mgr>/policy/api/v1/infra/labels/my-domains-label { "type" : "Domain", "refs" : ["/infra/domains/mydomain1", "/infra/domains/mydomain2", "/infra/domains/mydomain3"] }

Successful Response:

Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
PolicyLabel+

Example Response:

{ "type": "Domain", "refs": [ "/infra/domains/mydomain3", "/infra/domains/mydomain2", "/infra/domains/mydomain1" ], "resource_type": "PolicyLabel", "id": "my-domains-label", "display_name": "my-domains-label", "path": "/infra/labels/my-domains-label", "relative_path": "my-domains-label", "parent_path": "/infra/labels/my-domains-label", "marked_for_delete": false, "_create_user": "admin", "_create_time": 1544641564432, "_last_modified_user": "admin", "_last_modified_time": 1544641564432, "_system_owned": false, "_protection": "NOT_PROTECTED", "_revision": 0 }

Required Permissions:

crud

Feature:

policy_label

Additional Errors: