Account modification

The account modification interface has been created in order to modify the metadata or the operational behavior of a storage account.

This includes adding user metadata, system metadata, quota allocation, maximum containers for the account or changing the operational state.

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 :

POST <accesser>:8338/accounts/{account.id}
Table 1. Request Parameter
Request Parameter Style Type Description
Common request headers      
X-Account-Meta-name (Optional) header String

The account user metadata. The {name} is the name of metadata item that you want to add, update, or delete. To delete this item, send an empty value in this header or use X-Remove-Account-Meta-{name}. You must specify an x-account-meta-{name} header for each metadata item (for each{name}) that you want to add, update, or delete.

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.
X-Account-Meta-Quota-Bytes (Optional)[Future] header Integer The number of bytes allocated for this storage account
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.

If the maximum container count was set prior to the current invocation, then the value overwrites the previous value.

If the value is less than the total number of containers already created for the storage account, then container creation is effectively "disabled" until the number of containers falls below the value. In such a scenario, S3 PUT Bucket returns HTTP response code 507.

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 the full Ceph test suite depends on the version of the suite).

If this parameter is not set using the Service API, then the system-wide maximum container limit per storage account applies. Contact Customer Support personnel to determine this value.

X-Account-Status (Optional) header String This value can be set to enabled
ibm-account-id (Optional) header String Optional. Your Bluemix ID, which the system stores. This request header is only available for IAM-authenticated requests.
Table 2. Response Parameter
Response Parameter Style Type Description
Common response headers      
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-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 this parameter is not set using the Service API, then the parameter is not returned in the response and the system-wide maximum container limit per storage account applies. Contact Customer Support personnel to determine this value.

X-Timestamp Integer header 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.

ibm-account-id (Optional) header String Optional. Your Bluemix ID stored by the system. This request header is only available for IAM-authenticated requests.
Table 3. HTTP Response Code
HTTP Response Code Description
202 Accepted The account already exists. Note that any user metadata will be updated during this process but the stored account creation time would not be updated.
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.
404 Not Found The account does not exist in Swift.
409 Conflict The account was not modified due to an internal conflict (e.g. invalid quota specified)
410 Gone The account has been recently deleted and its data is gone

Operational Note:

Once disabled, any normal requests that Swift receives against the account, its containers, or objects, will receive a 401 Unauthorized response. This happens even if a user provides a valid Keystone token that would otherwise have access to the account.

Table 4. Role Guidance
Role Guidance Description
Service User A user configured at the Manager with a Service User Role

Example Output

Request
POST <accesser>:8338/accounts/731fc6f265cd486d900f16e84c5cb594
x-account-meta-name: "Company Account"  
X-Account-Max-Container-Count: 10000
 
Response
HTTP/1.1 202 Accepted
Content-Length: 202
X-Timestamp: 1458262564.22774
Content-Type: application/json; charset=utf-8
X-Trans-Id: tx9809aded32734d38a61e5-0056ebe748
X-Account-Max-Container-Count: 10000
Date: Fri, 18 Mar 2016 11:32:24 GMT
{    
    "account": {
        "id": "731fc6f265cd486d900f16e84c5cb594",
        "metadata": {
            "name": "Company Account"
            "location": "Chicago"
        },
        "system_metadata": {
            "tagid": "82443531-09ed-4184-b790-3607543ae79f"
        }
    }
}