Account creation
This API covers the manual creation of a storage account via the Service API.
The storage account name must be from 1-256 characters long and must be alphanumeric or "-" characters only. The name also cannot contain a slash (/) character as this delimits the account and container name.
The keys for request parameters must be treated as case-insensitive at all times. These keys can contain ASCII 7-bit characters that are not control (0-31) characters, DEL, or a separator character, according to HTTP/1.1. Also, Object Storage does not support the underscore character, which it silently converts to a hyphen.
The user and system metadata values in do not follow HTTP/1.1 rules for character encodings. The caller must use a UTF-8 encoding to get a byte array for any string that contains characters that are not in the 7-bit ASCII 0-127 range.
Base Command :
PUT <accesser>:8338/accounts/{account.id}| Request Parameter | Style | Type | Description |
|---|---|---|---|
| X-Account-Meta-name (Optional) | header | String | The account user metadata. The {name} is the name of metadata item that you want to add. You must specify an x-account-meta-{name} header for each metadata item (for each{name}) that you want to add |
| X-Account-Sysmeta-name (Optional) | header | String | The account system metadata. This requires a special permission to be configured for the role for which the authenticated user has been assigned |
| ibm-account-id (Optional) | header | String | Optional. Your IBM Cloud Platform ID, which the system stores. This request header is only available for IAM-authenticated requests. |
| X-Account-Max-Container-Count (Optional) | header | String | The maximum number of containers for this storage account. The range is 0 to a system-wide
upper limit of maximum containers per storage account. Contact Customer Support personnel to
determine or change the value of the upper limit of the maximum containers per storage account. If the value is set to 0, then the storage account cannot create containers but with appropriate permissions (container ACL or IAM) can access other containers. Creation of numerous containers simultaneously or in rapid succession for a storage account can result in container creation failing for the account with the response code HTTP 500 during the period of contention. A smaller value can result in Ceph tests failing for this storage account (The number of buckets required for full Ceph test suite depends on the version of the suite). If the parameter is not set, then the system-wide maximum container limit per storage account applies. Contact Customer Support personnel to determine this value. |
| Response Parameter | Style | Type | Description |
|---|---|---|---|
| id | Body | String | The id of the storage account |
| All User Metadata (optional) | Body | String | The current key value pair for each user metadata item (only if the output format is JSON or XML) |
| All System Metadata (optional) | Body | String | The current key value pair for each system metadata item (only if the output format is JSON or XML) |
| X-Timestamp | header | Integer | The date and time in UNIX Epoch time stamp format when the account, container, or object was
initially created as a current version. For example, 1440619048 is equivalent to Mon, Wed, 26 Aug 2015 19:57:28 GMT. |
| X-Account-Max-Container-Count (Optional) | header | String | The maximum number of containers for this storage account. If the value is not set in the request, then this parameter is not present |
| ibm-account-id (Optional) | header | String | Optional. Your IBM Cloud Platform ID stored by the system. This request header is only available for IAM-authenticated requests. |
| HTTP Response Code | Description |
|---|---|
| 201 Created | The storage account was properly created |
| 400 Bad Request | The storage account name exceeds 256 characters or has invalid characters |
| 401 Unauthorized | The provided token is invalid or could not be verified with Keystone. |
| 403 Forbidden | The provided token may be valid, but Keystone has reported to Swift that the user lacks the appropriate permission. |
| 409 Conflict | The account was not created due to an an account already existing or during an internal conflict |
| Role Guidance | Description |
|---|---|
| Service User | A user configured at the Manager with a Service User Role |
Example Output
Request
PUT <accesser>:8338/accounts/731fc6f265cd486d900f16e84c5cb594
x-account-sysmeta-tagid: "82443531-09ed-4184-b790-3607543ae79f",
x-account-meta-name: "Company Account"
x-account-max-container-count: "1000"
Response
HTTP/1.1 201 CREATED
Content-Length: 63
Content-Type: application/json; charset=utf-8
X-Trans-Id: tx8ea13a3a835544d8bebf1-0056eb522a
X-Account-Max-Container-Count: 1000
Date: Fri, 18 Mar 2016 00:56:10 GMT
X-Timestamp: 1458262564.22774
{
"account": {
"id": "731fc6f265cd486d900f16e84c5cb594",
"metadata": {
"name": "Company Account"
"location": "Chicago"
},
"system_metadata": {
"tagid": "82443531-09ed-4184-b790-3607543ae79f"
}
}
}