Updated on 2024-04-30 GMT+08:00

Querying the Permission Policy List

Function

This API is used to query the permission policy list.

URI

GET /v1/permissions/rules

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

The number of records allowed on each page when the list is queried by page. The default value is -1.

offset

No

Integer

Start offset when the list is queried by page. The default value is 0.

order_by

No

String

Sorting parameter when the list is queried by page. The value can be create_at or update_at.

order

No

String

Sorting order when the list is queried by page. The value can be desc or asc.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Identity authentication information

Minimum: 1

Maximum: 16384

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

items

Array of Rule objects

Permission policy list

total

Integer

Total number of records on all pages

Table 4 Rule

Parameter

Type

Description

kind

String

API type.

apiVersion

String

API version. The value is fixed at v1 and cannot be changed.

metadata

ObjectMeta object

Basic information

spec

RuleSpec object

Detailed description of an object. UCS creates or updates objects by defining or updating spec.

Table 5 ObjectMeta

Parameter

Type

Description

uid

String

Cluster ID

name

String

Cluster name

labels

Map<String,String>

Label

creationTimestamp

String

Creation time. It is a UTC time in the RFC 3339 format.

updateTimestamp

String

Update timestamp

Table 6 RuleSpec

Parameter

Type

Description

iamuserids

Array of strings

IAM user information associated with a permission policy

type

String

Permission policy type. The value can be readonly, develop, admin, or custom.

contents

Array of Content objects

Permission policy content

description

String

Permission policy description

Minimum: 0

Maximum: 255

Table 7 Content

Parameter

Type

Description

verbs

Array of strings

Action list

resources

Array of strings

Resource list

Example Requests

None

Example Responses

Status code: 200

Permission policy list

{
  "items" : [ {
    "metadata" : {
      "name" : "admin",
      "uid" : "3dcdef78-65bb-11ee-bdf2-0255ac100033",
      "creationTimestamp" : "2023-10-08 09:15:36.526016 +0000 UTC",
      "updateTimestamp" : "2023-10-08 09:15:36.526016 +0000 UTC"
    },
    "spec" : {
      "iamUserIDs" : [ "873395a21c8d4d8ba9e37d6d32debc41" ],
      "type" : "admin",
      "contents" : [ {
        "verbs" : [ "*" ],
        "resources" : [ "*" ]
      } ]
    }
  } ],
  "total" : 1
}

Status Codes

Status Code

Description

200

Permission policy list

400

Client request error. The server could not execute the request.

500

Internal server error.

Error Codes

See Error Codes.