AddAccount
You can use AddAccount
to add a new account to the system. You can also use this method to create new volumes under the new account as the account is created. The Challenge-Handshake Authentication Protocol (CHAP) settings you specify for the account apply to all volumes owned by the account.
Parameters
This method has the following input parameters:
Name | Description | Type | Default value | Required |
---|---|---|---|---|
|
List of name-value pairs in JSON object format. |
JSON object |
None |
No |
|
Specifies whether CHAP account credentials can be used by an initiator to access volumes. |
boolean |
true |
No |
|
The CHAP secret to use for the initiator. This secret must be 12 to 16 characters in length and should be impenetrable. The initiator CHAP secret must be unique and cannot be the same as the target CHAP secret. If not specified, a random secret is created. |
string |
None |
No |
|
The CHAP secret to use for the target (mutual CHAP authentication). This secret must be 12 to 16 characters in length and should be impenetrable. The target CHAP secret must be unique and cannot be the same as the initiator CHAP secret. If not specified, a random secret is created. |
string |
None |
No |
|
The unique username for this account. (Must be 1 to 64 characters in length). |
string |
None |
Yes |
Return value
This method has the following return values:
Name |
Description |
Type |
account |
An object containing information about the newly created account. |
|
accountID |
The ID of the newly created account object. |
integer |
Request example
Requests for this method are similar to the following example:
{ "method": "AddAccount", "params": { "username" : "bobsmith", "initiatorSecret" : "168[#5A757ru268)", "targetSecret" : "tlt<,8TUYa7bC", "attributes" : { "billingcode" : 2345 } }, "id" : 1 }
Response example
This method returns a response similar to the following example:
{ "id": 1, "result": { "account": { "accountID": 90, "attributes": { "billingcode": 2345 }, "initiatorSecret": "168[#5A757ru268)", "status": "active", "storageContainerID": "00000000-0000-0000-0000-000000000000", "targetSecret": "tlt<,8TUYa7bC", "username": "bobsmith", "volumes": [], "enableChap": true }, "accountID": 90 } }
New since version
9.6