Returns a list of all datonis_roles belonging to an account as per the specified criteria. This API is paginated and returns 20 datonis_roles by default. A datonis_role is uniquely identified by a 'datonis_role_key'. This key should be used in all the other API referencing a particular datonis_role.

Params

Param name Description
page
optional

Page number of results to be fetched, Default 1


Value: Must be Integer.
per
optional

Number of things records to be returned in one page, Default 20


Value: Must be Integer.
order_by
optional

Field on which resultant datonis_roles should be sorted


Value: Must be a String
order
optional

Order, asc or desc, in which results should be sorted


Value: Must be a String
timestamp_format
optional

Format, “str” or “int”, in which timestamps should be returned, Default “int”


Value: Must be a String
search
optional

Keywords based on which things should be searched. Currently you can search datonis_roles on - datonis_role_key, name


Value: Must be a String
scope
optional

Matching condition if multiple keywords are specified for search. Valid values are “all” or “any”. Default is “all”


Value: Must be a String
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean
field_list
optional

List of fields required in the result.


Value: Must be an array of any type
fields
optional

[Deprecated]Comma separated list of fields required in the result.


Value: Must be a String

Examples

Request - listing all datonis_roles without any criteria
  curl -X GET  -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" https://api.datonis.io/api/v3/datonis_roles

Response (returns first 20 records)
{
  "total_count": 5,
  "page": 1,
  "datonis_roles": [
    {
      "abilities": [
        0
      ],
      "account_admin": true,
      "datonis_role_key": "2e46ec4f56",
      "name": "Account Admin",
      "permissions": [
        {
          "class": "all",
          "operation": null,
          "seqno": 0
        }
      ],
      "created_at": 1448282945,
      "updated_at": 1448282945
    },
    {
      "abilities": [
        1,
        11,
        17,
        6
      ],
      "account_admin": false,
      "datonis_role_key": "9c6dcctaec",
      "name": "Read Only",
      "permissions": [
        {
          "class": "thing",
          "operation": "read",
          "seqno": 1
        },
        {
          "class": "sensor",
          "operation": "read",
          "seqno": 1
        },
        {
          "class": "rule",
          "operation": "read",
          "seqno": 6
        },
        {
          "class": "instruction",
          "operation": "read",
          "seqno": 11
        },
        {
          "class": "group",
          "operation": "read",
          "seqno": 17
        }
      ],
      "created_at": 1448282945,
      "updated_at": 1448282945
    },
    {
      "abilities": [
        3
      ],
      "account_admin": false,
      "datonis_role_key": "d5552947a8",
      "name": "Agent",
      "permissions": [
        {
          "class": "thing",
          "operation": "read",
          "seqno": 1
        },
        {
          "class": "thing",
          "operation": "update",
          "seqno": 3
        },
        {
          "class": "sensor",
...
Request - listing datonis_roles by specifying number of datonis_roles to be returned at a time (page size) and specific set to be returned (page)
  curl -X GET  -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"per":"2", "page":"2"}' https://api.datonis.io/api/v3/datonis_roles

Response (returns page 2 with 2 datonis_roles per page)
{
  "total_count": 5,
  "page": "2",
  "datonis_roles": [
    {
      "abilities": [
        3
      ],
      "account_admin": false,
      "datonis_role_key": "d5552947a8",
      "name": "Agent",
      "permissions": [
        {
          "class": "thing",
          "operation": "read",
          "seqno": 1
        },
        {
          "class": "thing",
          "operation": "update",
          "seqno": 3
        },
        {
          "class": "sensor",
          "operation": "read",
          "seqno": 1
        },
        {
          "class": "sensor",
          "operation": "update",
          "seqno": 3
        }
      ],
      "created_at": 1448282945,
      "updated_at": 1448282945
    },
    {
      "abilities": [
        5
      ],
      "account_admin": false,
      "datonis_role_key": "6t9f5bed7f",
      "name": "Thing_only",
      "permissions": [
        {
          "class": "thing",
          "operation": "read",
          "seqno": 1
        },
        {
          "class": "thing",
          "operation": "create",
          "seqno": 2
        },
        {
          "class": "thing",
          "operation": "update",
          "seqno": 3
        },
        {
          "class": "thing",
          "operation": "delete",
          "seqno": 4
        },
        {
          "class": "thing",
          "operation": "all",
          "seqno": 5
        },
        {
          "class": "sensor",
          "operation": "read",
          "seqno": 1
        },
        {
          "class": "sensor",
          "operation": "create",
          "seqno": 2
        },
      ...