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 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
username The unique username for this account. (Must be 1 to 64 characters in length). string None Yes
initiatorSecret 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
targetSecret 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
attributes List of name-value pairs in JSON object format. JSON object None No

Return value

This method has the following return value:

Name Description Type
account An object containing information about the newly created account. account

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": []
    },
    "accountID": 90
  }
}