After deploying a machine, you can use the IaaS APIs to update the machine with custom properties. Custom properties provide you with the flexibility to add any information about the machine that you want.
Prerequisites
- Verify that all general prerequisites and prerequisites for the Automation Assembler Infrastructure as a Service (IaaS) service have been satisfied. See Prerequisites for API Use Case Examples.
- Verify that you have the ID of the virtual machine in your deployment. See Get Deployment Resource IDs.
Procedure
Example: Add a Custom Properties to Your Virtual Machine
Update the virtual machine with resource ID 42f49781-1490-4a08-ae21-8baf383a72ac by adding custom properties.
Assign variables.
$ url='https://appliance.domain.com'
$ api_version='2021-07-15'
Assign the virtual machine ID.
$ virtual_machine_id='42f49781-1490-4a08-ae21-8baf383a72ac'
Update the machine with custom properties.
$ curl -X PATCH \ $url/iaas/api/machines/$virtual_machine_id?apiVersion=$api_version \ -H "Authorization: Bearer $access_token" \ -H 'Content-Type: application/json' \ -d '{ "customProperties": { "ownerName": "VMuser_Example", "ownerEmail": "[email protected]", "ownerCell": "123.456.7890" }, "description": "string", "tags": "[ { \"key\" : \"my.enumeration.type\", \"value\": \"ec2_instance\" } ]" }' | jq "."
A snippet of the response shows that the request was successful.
... "customProperties": { "ownerName": "VMuser_Example", "ownerEmail": "[email protected]", "ownerCell": "123.456.7890" "image": "ubuntu", "OStype": "LINUX", "imageId": "ami-b1234cc5", ... }, ...