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.
Permissions
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
Resource URL
https://hostname:port/api/sam/vmmanagers
Resource information
Operation details | Description |
---|---|
Purpose | Adds a new VM manager or changes an existing one. |
HTTP method | PUT |
Resource URI | https://hostname:port/api/sam/vmmanagers |
Request Content-Type |
application/json |
Request headers |
|
Response Content-Type |
application/json |
Response headers |
|
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
and Azure Stack HCI.
|
sharecredentials |
Indicates whether the VM manager shares credentials with other hosts in the same cluster. The
attribute is applicable only for Hyper-V and Azure Stack HCI.
|
type |
Type of the VM manager.
|
url |
Web address of the VM manager. To add a VM manager, specify its full URL. 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. |
vmmanagertooltype |
VM Manager Tool deployment type.
|
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 https://hostname:port/api/sam/vmmanagers
- Request header
-
Accept: application/json Accept-Language: en-US Token: <token>
- Request body
-
[{ "login":"user1", "password":"<password>", "url":"<URL>", "type":2 }]
- Response
-
200 OK
Example HTTP conversation - changing a VM manager
To change an existing VM manager, provide the following attributes:
vmmanagerid
login
password
url
type
Important: All attributes must be provided in the request regardless of how many of
the attributes you want to change.
- Request
-
PUT https://hostname:port/api/sam/vmmanagers
- Request header
-
Accept: application/json Accept-Language: en-US Token: <token>
- Request body
-
[{ "vmmanagerid":1, "login":"user1", "password":"<password>", "url":"<URL>", "type":3 }]
- Response
-
200 OK