Adding an access key

Add an access key.

Method and URI

To add an access key, use a POST method with a URI:

POST    https://{hostname|IPv4}/api/identity/key

Parameters

None.

Data

Data 1: name

The name of the access key.

  • Example value: BlueMachines Amazon S3 California Key

  • Type: String. Required. Available in the web user interface.

Data 2: access

An access key string.

  • Example value: G9493LAPUDNDPL9J38SW

  • Type: String. Available in the web user interface.

Data 3: secret

A secret key of the access key.

  • Example value: rNzSHk2gBfjf9cECGp+cjrhEdhsZmxwHnRckk8BP

  • Type: String. Available in the web user interface.

Example: Add an access key

Assume that you want to add an access key with the following properties:

  • Name: BlueMachines S3 Compatible Object Storage Key

  • Access key: PJNG6J5FHENHWZ66K77X

  • Secret key: CFBF8QcKtMSMYTE++mX3pUWSwmchNBgg5afbnw5T

A Python snippet that is similar to the following example can be used to send a request to IBM Spectrum Protect Plus to add the access key:

_data = f'''{{
    "name":   "BlueMachines S3 Compatible Object Storage Key,
    "access": "PJNG6J5FHENHWZ66K77X"
    "secret": "CFBF8QcKtMSMYTE++mX3pUWSwmchNBgg5afbnw5T"
}}'''

requests.post('https://' + spp_ipv4 + '/api/identity/key',
    headers={...}, data=_data, verify=...)
_images/reference_accesskey_create02.png

Figure 61 The same action can be taken in the IBM Spectrum Protect Plus web user interface: In the VMware pane, ensure that the Access Keys tab is displayed. Click Add Access Key. In the Add New Access Key section, enter the name, access key, secret key, and click Save.

After you run the Python snippet, ensure that you get a response with the HTTP status of 201 (Created) and the access key was created. The response body is similar to the JSON object for one of the access keys, as shown in Getting information about access keys and SSH keys.