-->

Softlayer REST API for tagging machines

2019-09-16 07:00发布

问题:

Can someone please give me a Softlayer REST API for tagging machines that are already provisioned. I need to both for virtual machines and bare metal machines.

Thanks, Kishore

回答1:

Virtual Machine

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Tag/setTags
Method: Post

{  
   "parameters":[  
      "tag1,tag2",
      "GUEST",
      29756959
   ]
}

replace 29756959 with the ID of your virtual machine

Bare metal

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Tag/setTags

Method: Post

{  
   "parameters":[  
      "tag1,tag2",
      "HARDWARE",
      29756959
   ]
}

replace 29756959 with the ID of your bare metal