[{"label":"Latest (v1.0)","version":"latest"}]
nsx-vmc-policy

Apply Tags To Enforcement Point VM

Description

Allows an admin to apply multiple tags to a virtual machine. This operation does not store the intent on the policy side. It applies the tag directly on the specified enforcement point. This operation will replace the existing tags on the virtual machine with the ones that have been passed. If the application of tag fails on the enforcement point, then an error is reported. The admin will have to retry the operation again. Policy framework does not perform a retry. Failure could occur due to multiple reasons. For e.g enforcement point is down, Enforcement point could not apply the tag due to constraints like max tags limit exceeded, etc.

Request

Request

URL

URL


post
https://nsxmanager.your.domain/policy/api/v1/infra/realized-state/enforcement-points/{enforcement-point-name}/virtual-machines?action=update_tags
Copy

Path Parameters

Path Parameters

string
enforcement-point-name Required

Request Body

Request Body

VirtualMachineTagsUpdate of type(s) application/json Required
{
	"tags": [
		{}
	],
	"virtual_machine_id": "string"
}
array of Tag
tags Required

List of tags to be applied on the virtual machine


string
virtual_machine_id Required

The identifier that is used in the enforcement point that uniquely identifies the virtual machine. In case of NSXT it would be the value of the external_id of the virtual machine.

Authentication

Authentication

This operation uses the following authentication methods.

Response

Response

204 No Content

No Content

Errors

Errors

400

Bad Request


ApiError
403

Forbidden


ApiError
404

Not Found


ApiError
412

Precondition Failed


ApiError
500

Internal Server Error


ApiError
503

Service Unavailable

Code Samples

Code Samples

cURL Command

curl -X POST -H "Content-Type: application/json" -d '{"tags":[{"scope":"string","tag":"string"}],"virtual_machine_id":"string"}' https://nsxmanager.your.domain/policy/api/v1/infra/realized-state/enforcement-points/{enforcement-point-name}/virtual-machines?action=update_tags
Vendor Extensions

Vendor Extensions

This operation contains the following vendor extensions defined in the spec:
x-vmw-doc-operation: apply-tags-to-enforcement-point-vm
x-vmw-nsx-module: PolicyRealizedState


Feedback

Was this page helpful?