/auth/v1/roles: GET

Gets the details of user roles.

The following table shows which roles can access this REST API endpoint:
Table 1. Access by role
Data admin Data user Collection Admin Admin Service user
1 1 1 1
1The specified role must be one that is assigned to the requesting user ID. Otherwise the command fails with error 403, "Not authorized".

Synopsis of the request URL

curl -k  -H ‘Authorization: Bearer <token>’ https://<spectrum_discover_host>/auth/v1/roles

Supported request types and response formats

Supported request types:
  • GET
Supported response formats:
  • JSON

Examples

The following example shows how to get the details of user roles.

Request:
curl -k  -H ‘Authorization: Bearer <token>’ https://<spectrum_discover_host>/auth/v1/roles

Response:

{
  "roles": [
    {
      "domain_id": null,
      "id": "0ce17850c81a4e5da06ecd93f8ea0393",
      "name": "admin"
    },
    {
      "domain_id": null,
      "id": "383d4b371f244a2a8529a35b665b5c01",
      "name": "datauser"
    },
    {
      "domain_id": null,
      "id": "7d9f6d213b6d4317a395bbf248fdd9b6",
      "name": "collectionadmin"
    },
    {
      "domain_id": null,
      "id": "103bc9b8f1864c19af5663ec357f8d51",
      "name": "dataadmin"
    },
    {
      "domain_id": null,
      "id": "8388af928ce546bea7a0cd804a427b7c",
      "name": "serviceuser"
    }
  ]
}