Adding and updating VM managers
You use the PUT
operation on the api/sam/vmmanagers
element to add or update VM managers. You can perform these actions only for VM managers that are
managed in central mode.
To add or update VM managers, the following requirements must be met:
- You must have the Manage VM Managers and Servers permission
- The computer group to which you are assigned must contain the computer on which the central VM Manager Tool is installed
Operation details | Description |
---|---|
Operation | PUT api/sam/vmmanagers |
Purpose | Adds a new VM manager or changes an existing one. |
HTTP method | PUT |
Resource URI | https://server_host_name:port_number/api/sam/vmmanagers?token=token |
Request Content-Type |
application/json |
Response Content-Type |
application/json |
Normal HTTP response codes |
|
Error HTTP response codes |
|
Request attributes
Attribute | Description |
---|---|
login |
User name that is used to access the VM manager. |
password |
Password that is used to access the VM manager. The password is encrypted after it is sent. |
protocol |
Communication protocol used by the VM manager. The attribute is applicable only for Hyper-V.
|
sharecredentials |
Indicates whether the VM manager shares credentials with other hosts in the same cluster. The
attribute is applicable only for Hyper-V.
|
type |
Type of the VM manager.
|
url |
Web address of the VM manager. You can specify a full URL, a host name, or an IP address. The
default URL differs depending on the virtualization type.
|
vmmanagerid |
ID of the VM manager that you want to change. To obtain the ID, use REST API for the retrieval of VM managers. |
vmmanagertoolid |
ID of the VM Manager Tool that collects data from the VM manager that you want to change. To obtain the ID, use REST API for the retrieval of VM managers. |
Example HTTP conversation - adding a VM manager
To add a new VM manager, provide the following attributes:
login
password
url
type
- Request
-
PUT http://localhost:9081/api/sam/vmmanagers ?token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623 [{ "login":"user1", "password":"vZaW1Ve6", "url":"192.0.2.24", "type":2 }]
- Response
-
200 OK
Example HTTP conversation - changing a VM manager
To change an existing VM manager, provide the following attributes:
login
password
url
type
vmmanagerid
vmmanagertoolid
Important: All attributes must be provided in the request regardless of how many of
the attributes you want to change.
- Request
-
PUT http://localhost:9081/api/sam/vmmanagers ?token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623 [{ "vmmanagerid":1, "vmmanagertoolid":1, "login":"user1", "password":"vZaW1Ve6", "url":"192.0.2.24", "type":3 }]
- Response
-
200 OK