Adding an identity

You can add a new identity.

Method and URI

To add an identity, use a POST method with a URI:

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

Parameters

None.

Data

Data 1: name

The name of the identity.

  • Example value: AD-sarah.wiseman

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

Data 2: username

The username of the identity.

  • Example value: sarah.wiseman@bluemachines.com.invalid

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

Data 3: password

The password of the identity.

  • Example value: @sw!9*Q7C.V<y-h"

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

Data 4: ostype

The operating system of the services in which the identity is used.

  • Value Use LINUX for a credential to log in to a Linux system, or use null otherwise. For example, assume that you register an Oracle Database that is running on a Linux application server with IBM Spectrum Protect Plus. In this case, use LINUX for the application server, and use null for the Oracle Database.

  • Type: System string or null. Required. Available in the web user interface.

Data 5: comment

An optional comment on the identity.

  • Example value: Sarah’s Active Directory credential.

  • Type: String.

Example: Add an identity defined by Microsoft Active Directory

Assume that you want to register the following credential, which was created on Microsoft Active Directory:

  • Name: AD-sarah.wiseman

  • Username: sarah.wiseman@bluemachines.com.invalid

  • Password: @sw!9*Q7C.V<y-h"

  • Comment: Sarah’s Active Directory credential

A Python snippet that is similar to the following example can be used to register the credential:

_data = f'''{{
    "name":     "AD-sarah.wiseman",
    "username": "sarah.wiseman@beluemachines.com.invalid",
    "password": "@sw!9*Q7C.V<y-h\\"",
    "ostype":   null,
    "comment":  "Sarah's Active Directory credential"
}}'''

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

Tip

To send a double quotation mark in the password value, type two backslashes in the Python f-string and the REST API receives a single backslash followed by the double quotation mark (\\”).

_images/reference_identity_create02.png

Figure 89 The same action can be taken in the IBM Spectrum Protect Plus web user interface: In the Identity pane, click Add Identity. Enter required values in the fields.

The request prompts a response that is structured as shown, with the HTTP status of 201 (Created). Review the response to ensure that the new identity, AD-sarah.wiseman, was created. The password value is represented by null.

{
    "links": {...},
    "resourceType": "user",
    "id": "2101",
    "name": "AD-sarah.wiseman",
    "username": "sarah.wiseman@beluemachines.com.invalid",
    "type": "system",
    "ostype": null,
    "comment": "Sarah's Active Directory credential",
    "keyid": null,
    "realm": "@BELUEMACHINES.COM.INVALID",
    "rbacPath": "root:0/identity:0/identitytype:credential/identitycredential:21
↪33",
    "password": null
}