/bucket: GET

Retrieves information on all buckets that are stored with AFM.

Availability

Available on all IBM Storage Scale editions.

Description

The GET /bucket request retrieves details on AFM buckets. The information displayed includes the stored credentials that were set for buckets and the relevant server combination. You can view information for a specific bucket or all buckets. For more information about the fields in the data structures that are returned, see mmafmcoskeys command.

Request URL

https://<IP address or host name of API server>:<port>/scalemgmt/v2/bucket
where
bucket
Specifies bucket as the resource. Required.

Request headers

Accept: application/json

Parameters

The following parameters can be used in the request URL to customize the request:
Table 1. List of parameters
Parameter name Description and applicable keywords Required/optional
bucketname The name of the bucket for which you want to view the definition. You can define "all" to view definition of all buckets. Optional.

Request data

No request data.

Response data

The following list of attributes is available in the response data:

{      
"status":
   {
      "code": ReturnCode
      "message": "ReturnMessage",   
   }
"paging": 
  {
    "next": "URL"
  },
   " [
      {
         "accessKey": "String",
         "bucket": "String",
         "endpoint": URL,
         "secretKey": "String"
   }
   ],
}

The details of the parameters are provided in the following list:

"status":
Return status.
"code": ReturnCode,
The HTTP status code that was returned by the request.
"message": "ReturnMessage"
The return message.
"paging"
The URL to retrieve the next page. Paging is enabled when more than 1000 objects are returned by the query.
"accessKey": "Access key"
The access key of the bucket.
"secretKey": "Secret key"
The secret key of the specified bucket.
"bucket": "Bucket name"
Name of the bucket.
"endpoint": "URL"
The server name and the region where the bucket is located.

Examples

The following example gets information about all buckets:

Request data:
curl -k -u admin:admin001 -X GET --header 'accept:application/json' 
'https://198.51.100.1:443/scalemgmt/v2/bucket?bucketName=all'
The request URL with no field or filter parameter returns only the details that uniquely identify the object.

Response data:

Note: In the JSON data that is returned, the return code indicates whether the command is successful. The response code 200 indicates that the command successfully retrieved the information. Error code 400 represents an invalid request and 500 represents internal server error.
[
  {
    "accessKey": "admin123",
    "bucket": "iw1",
    "endpoint": "ap-northeast-1@192.168.80.112",
    "secretKey": "admin123"
  },
  {
    "accessKey": "admin123",
    "bucket": "iw2",
    "endpoint": "ap-northeast-1@192.168.80.112",
    "secretKey": "admin123"
  }
  ],
  "status" : {
    "code" : 200,
    "message" : "The request finished successfully"
  }
}