Common response parameters

Table 1. Common response parameters
Response Parameter Style Type Description
credential body Object

A credential object Required: Yes

blob body String The credential itself, as a serialized blob

"blob": {
 "access": "<access key>",
 "secret": "<secret key>",
 "status": "<Active/Inactive>"
}
Required: Yes (if the system generates, the status will be Active by default)
project_id body String The storage account ID.

Required: Yes

type body String Required: Yes (ec2)
subject_ibm_id body String Identity of the user/service within IAM.

Required: No. Only present if subject_ibm_id was included in the request.

id body String This will be the Access Key

Required: Yes

Table 2. HTTP response codes
HTTP Response Code Description
201 Created Request is successful
400 Bad Request Request does not comply with specification
401 Unauthorized The provided token is not valid or cannot be verified
403 Forbidden The provided token although valid, does not provide appropriate permissions to the user
404 Not Found No such user or storage account exists
405 Method Not Allowed Although the user may be valid, the user does not have privileges to access storage account
409 Conflict The user has reached maximum number of keys that can be generated for the user
503 Service Unavailable The credential API service is currently unavailable
Table 3. Role Guidance
Role Guidance Description
Key Management Admin Permission Generic permission to allow a admin to manage access keys
Key Management User Permission Generic permission to allow a user to manage access keys

Example Output

Request 
-------
POST <accesser>:8338/credentials/
{
    "credential": {
        "project_id": "731fc6f265cd486d900f16e84c5cb594",
        "type": "ec2",
        "subject_ibm_id": "IBMid-61KR43CAFF",
        "user_id": "bb5476fd12884539b41d5a88f838d773"
    }
}

Response
--------
HTTP/1.1 201 CREATED
Content-Length: 342
Content-Type: application/json; charset=utf-8
X-Trans-Id: tx8ea13a3a835544d8bebf1-0056eb522a
Date: Fri, 18 Mar 2016 00:56:10 GMT
X-Timestamp: 1458262564.22774
{
    "credential": {
        "user_id": "bb5476fd12884539b41d5a88f838d773",
        "blob": {"access": "7da79ff0aa364e1396f067e352b9b79a",
                 "secret": "secretKey",
                 "status": "Inactive"
        },
        "project_id": "731fc6f265cd486d900f16e84c5cb594",
        "type": "ec2",
        "subject_ibm_id": "IBMid-61KR43CAFF",
        "id": "7da79ff0aa364e1396f067e352b9b79a"
    }
}