I am trying to update Tags on a machine that is part of a deployment using the following API call:
/deployment/api/deployments/{depId}/resources/{resourceId}/requests
With the following body:
{
"actionId": "Cloud.vSphere.Machine.Update.Tags",
"inputs": {
"key":"testkey"
"value":"testvalue"
},
"reason": "testing"
}
When I run this the response shows the task is not completed and pending, when looking at the GUI it completes without updating the tags.
I expect the issue is with the inputs being provided, I have tried different variations most of them that result in an error. If I place a tag on the machine prior to running this API call, the tag gets removed (assume I have to read them in and pass them back with the update call).
If anyone has this functional, please provide the correct syntax.
Your input needs to be an array of tags including the existing tags you want to keep.
"inputs": {
"tags": [
{ "key":"myTag", "value": "myValue" },
{ "key":"anotherTag", "value":"anotherValue" }
]
}
Your input needs to be an array of tags including the existing tags you want to keep.
"inputs": {
"tags": [
{ "key":"myTag", "value": "myValue" },
{ "key":"anotherTag", "value":"anotherValue" }
]
}
Steve,
That did it, thank you very much.
where to update the code, is it in cloud template, need more details
This is an API call from Postman etc. to the vRA API. It's executed against a machine in a deployment. Consider it as a Day 2 operation on the machine.
The Cloud Template contains the constraint tags read at request phase, in this scenario they are not updated.
Regards,
Greg, VMware
Hi Steve,
I have similar task to do, but in this case API call is triggering day2 with actionID but in my case I don't have "Update Tags" day2 resource action. I need actual workflow code to update tags. could you please help me with that?.
Many Thanks in Advance