Updated on 2024-05-27 GMT+08:00

Querying the Permissions of an Agency

Function

This API is used to obtain the permissions required by the agency based on the source database type, destination database type, and whether the database is self-managed.

URI

GET /v5/{project_id}/agency/permissions

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

For details, see Obtaining a Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

source_type

No

String

Source database type.

  • mysql: MySQL
  • sqlserver: Microsoft SQL Server
  • postgresql: PostgreSQL
  • mongodb: MongoDB and DDS
  • dws: GaussDB(DWS)
  • oracle: Oracle
  • taurus: GaussDB(for MySQL)
  • ddm: DDM
  • kafka: Kafka
  • gaussdbv5: GaussDB Distributed
  • gaussdbv5ha: GaussDB Primary/Standby
  • gaussmongodb: GeminiDB Mongo
  • elasticsearch: CSS/ES
  • db2: Db2
  • tidb: TiDB
  • redis: Redis
  • rediscluster: Cluster Redis
  • gaussredis: GeminiDB Redis
  • mariadb: MariaDB
  • informix: Informix
  • dynamo: Dynamo

target_type

No

String

Destination database type.

  • mysql: MySQL
  • sqlserver: Microsoft SQL Server
  • postgresql: PostgreSQL
  • mongodb: MongoDB and DDS
  • dws: GaussDB(DWS)
  • oracle: Oracle
  • taurus: GaussDB(for MySQL)
  • ddm: DDM
  • kafka: Kafka
  • gaussdbv5: GaussDB Distributed
  • gaussdbv5ha: GaussDB Primary/Standby
  • gaussmongodb: GeminiDB Mongo
  • elasticsearch: CSS/ES
  • db2: Db2
  • tidb: TiDB
  • redis: Redis
  • rediscluster: Cluster Redis
  • gaussredis: GeminiDB Redis
  • mariadb: MariaDB
  • informix: Informix
  • dynamo: Dynamo

is_non_dbs

Yes

Boolean

Indicates whether the database is self-managed.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

MIME type of the request body. Use the default value application/json. For APIs used to upload objects or images, the value varies depending on the flow type.

The default value is application/json.

X-Auth-Token

Yes

String

User token obtained from IAM.

It is a response to the API for obtaining a user token. This API is the only one that does not require authentication.

After a request is processed, the value of X-Subject-Token in the header is the token value.

X-Language

No

String

Request language type.

Default value: en-us

Enumerated values:

  • en-us
  • zh-cn

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

common_permissions

Array of strings

  • DRS FullAccess: All permissions for DRS.

engine_permissions

Array of strings

  • GaussDB ReadOnlyAccess: Read-only permissions for GaussDB.
  • GeminiDB ReadOnlyAccess: Read-only permissions for GeminiDB.
  • GaussDBforMSQLReadOnlyAccess: Read-only permissions for GaussDB(for MySQL).
  • DWS ReadOnlyAccess: Read-only permissions for GaussDB(DWS).
  • DDM ReadOnlyAccess: Read-only permissions for Distributed Database Middleware (DDM).
  • DDS ReadOnlyPolicy: Read-only permissions for Document Database Service (DDS).
  • RDS ReadOnlyAccess: Read-only permissions for Relational Database Service (RDS).
  • MRS ReadOnlyAccess: Read-only permissions for MapReduce Service (MRS), including permissions for querying clusters and read-only permissions for ECS, BMS, EVS, and VPC.

Example Request

Obtaining the permissions required by the agency based on the source database type, destination database type, and whether the database is self-managed

https://{endpoint}/v5/054ba152d480d55b2f5dc0069e7ddef0/agency/permissions?source_type=mysql&target_type=taurus&non_dbs=false

Example Response

Status code: 200

{
"common_permissions": [
    "DRS FullAccess",
  ],
  "engine_permissions": [
    "RDS ReadOnlyAccess",
    "GaussDBforMSQLReadOnlyAccess"
  ]
}

Status Code

Status Code

Description

200

OK

Error Code

For details, see Error Code.