Add a serving name to a virtual server
Adds a CIFS/SMB serving name to a virtual server, and sets the domain association, if none is already set.
The active directory user that is used to connect to the domain controller (dcUsername), must have appropriate permissions to add new computer accounts to the specific active directory domain.
Active directory mode should be used in almost all cases, but to allow a virtual server to join an NT4 domain, the maximum supported SMB version needs to be set to 1 via the CLI.
HTTP request syntax (URI)
POST <base_URI>/v8/storage/virtual-servers/{virtualServerId}/serving-names
Parameters
Name | Type | Required | Values | Description |
virtualServerId | URI_PARAM | Y | string/number | Specifies either the virtual server object ID or the HNAS storage virtual server ID. |
allowMove | BODY | N | boolean | If the name already exists within the active directory, allow it to be moved. Default value is False. |
domain | BODY | N | string | Domain to join – must be supplied, if no name already set for the current context. |
dnsSuffix | BODY | N | string | Primary DNS suffix of new serving name, if it is different to the DNS name of the domain. |
dcIpAddress | BODY | N | IP Address | IP address of a domain controller that serves the active directory domain. |
dcUsername | BODY | N | string | Active directory domain controller username, which needs to have permission to add computer accounts to the domain. |
dcPassword | BODY | N | string | Active directory domain controller password. |
dcFolder | BODY | N | string | Active directory folder to place the machine account in. The default is “cn=Computers”. |
mode | BODY | Y | string |
Mode of operation, either active directory or legacy NT domain mode: Possible values are:
|
servingName | BODY | Y | string | New serving name. |
Return codes
Code | Data | Description |
201 | servingName | Serving name successfully added. |
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: Add a new active directory name, when there is already an existing name present
curl -vk -H "X-Api-Key: zrxvSDAv9x.RIP4gkmKarG3beF.or.4Tc2im7oeqYN88C9XPGHxbXC" https://172.17.11.11:8444/v8/storage/virtual-servers/1/serving-names -X POST -d '{"servingName":"newSmbName", "mode":"ADS", "dcUsername":"Administrator", "dcPassword":"password123"}'
Response example
HTTP/1.1 201 Created { "servingName": { "dnsSuffix": "protocols.example.com", "domain": "PROTOCOLS", "isDisjoint": false, "isOnline": true, "mode": "ADS", "objectId": "313a3a3a6e6577536d624e616d653a3a3a303a3a3a4f49445f24232140255f56", "servingName": "newSmbName", "virtualServerId": 1 }, "uri": "https://172.27.5.11:8444/v8/storage/serving-names/313a3a3a6e6577536d624e616d653a3a3a303a3a3a4f49445f24232140255f56" }