NSX-T Data Center REST API

Create or update vm tag attachment

Create or update vm tag attachment

Request:

Method:
PATCH
URI Path(s):
/policy/api/v1/infra/categories/{category-id}/tags/{tag-id}/attachments
/policy/api/v1/orgs/{org-id}/projects/{project-id}/infra/categories/{category-id}/tags/{tag-id}/attachments
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
TagAttachment+

Example Request:

PATCH https://<policy-mgr>/policy/api/v1/infra/tag/tag1/attachments { "remove_from": [ {"resource_type" : "VIRTUAL_MACHINE", "resource_ids": ["vm0"] }, { "resource_type" : "VIRTUAL_MACHINE", "resource_ids": ["vm4"] }, { "resource_type" : "SEGMENT", "resource_ids": ["seg"] } ], "apply_to": [ { "resource_type" : "VIRTUAL_MACHINE", "resource_ids": ["vm1", "vm3"] }, { "resource_type" : "SEGMENT", "resource_ids": ["seg3","seg1"] } ] }

Successful Response:

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

Example Response:

{ "attached_to": [ { "resource_type": "VIRTUAL_MACHINE", "resource_ids": [ "vm1", "vm3" ] }, { "resource_type": "SEGMENT", "resource_ids": [ "seg1", "seg3" ] } ], "tag_path": "/infra/tag/tag1", "marked_for_delete": false, "overridden": false, "_protection": "NOT_PROTECTED" }

Required Permissions:

crud

Feature:

policy_vm_vm_tags

Additional Errors: