To update your vCenter virtual server credentials, use the following request:
POST /virtual_machines/:virtual_machine_id/service_credentials.xml
POST /virtual_machines/:virtual_machine_id/service_credentials.json
XML Request Example
curl -i -X POST -u user_email:api_key --url http://onapp.test/virtual_machines/44/service_credentials.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<vcenter_service_credentials><username>username</username><password>password</password></vcenter_service_credentials>'
CODE
JSON Request Example
curl -i -X POST -u user_email:api_key --url http://onapp.test/virtual_machines/44/service_credentials.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"vcenter_service_credentials": {"username": "username", "password": "password"}}'
CODE
XML Output Example
<vcenter_service_credentials>
<username>username</username>
<password>password</password>
<virtual_machine_id>44</virtual_machine_id>
<id>14</id>
</vcenter_service_credentials>
CODE
Where:
username - the username used by the user when accessing the system
password - the password used by the user when accessing the system
virtual_machine_id - the ID of the virtual server
id - the ID of the user