Create a virtual server
Creates a virtual server on the storage system. The virtual server is assigned the specified IP address when created, and that is assigned to a specific network port or VLAN.
This API call has changed in version 8.
HTTP request syntax (URI)
POST <base_URI>/v8/storage/virtual-servers
Parameters
Name | Type | Required | Values | Description |
name | BODY | Y | string | Name (only alphanumeric and "-") for the virtual server to be created. |
nodeId | BODY | N | number | Specifies either a node object ID or an HNAS storage cluster node ID of the cluster node on which to create the virtual server. |
ipAddress | BODY | Y | string | Either IPv4 or IPv6 address of the virtual server. |
netmask | BODY | Y | string | Netmask must be of the form x.x.x.x for an IPv4 address or specify a prefix length which would be valid for both IPv4 or IPv6 addresses.. |
port | BODY | Y | string | Name or object ID of the Ethernet link aggregation, or VLAN object ID for the virtual server. |
Return codes
Code | Data | Description |
201 | virtualServer | Virtual server object successfully created. |
400 | Error Message | Missing or invalid request contents. |
403 | Error Message | Operation forbidden by access level. |
404 | Error Message | Requested resource not found. |
500 | Error message | Error associated with the storage system. |
Any HTTP status code other than 201 indicates that the API did not complete successfully.
Request example
curl -vk -H "X-Api-Key: zrxvSDAv9x.RIP4gkmKarG3beF.or.4Tc2im7oeqYN88C9XPGHxbXC" https://172.17.11.11:8444/v8/storage/virtual-servers –d '{"name":"TestEVS", "ipAddress":"172.17.37.63", "port":"ag1", "netmask": "255.255.255.0"}' -X POST
Response example
HTTP/1.1 201 Created { "virtualServer": { "UUID": "b912ecdc-77df-11d0-958c-49e1bb864b23", "virtualServerId": 7, "ipAddresses": [ "172.17.37.63" ], "isEnabled": true, "name": "TestEVS", "objectId": "373a3a3a4f49445f24232140255f56", "status": "ONLINE", "type": "File services", }, "uri" : "https://172.17.11.11:8444/v8/storage/virtual-servers/373a3a3a4f49445f24232140255f56" }