All Products
Search
Document Center

Data Management:GetAuthorityTemplate

Last Updated:Oct 21, 2024

Queries the information about a permission template.

Operation description

You must be a Data Management (DMS) administrator or a database administrator (DBA). For more information about how to view system roles, see View system roles.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
TemplateIdlongYes

The ID of the permission template.

1563
TidlongNo

The ID of the tenant. You can call the GetUserActiveTenant or ListUserTenants operation to query the tenant ID.

3***

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931
ErrorCodestring

The error code returned if the request failed.

UnknownError
ErrorMessagestring

The error message returned if the request failed.

UnknownError
AuthorityTemplateViewobject

The details of the permission template.

TemplateIdlong

The ID of the permission template.

1563
CreatorIdlong

The ID of the user who created the permission template.

12***
Namestring

The name of the permission template.

TestTemplate
Descriptionstring

The description of the permission template.

This template is used for business testing.
CreateTimestring

The time when the permission template was created. The time is in the yyyy-MM-DD HH:mm:ss format.

2023-01-01 00:00:00
AuthorityTemplateItemListarray<object>

The resource information in the permission template.

AuthorityTemplateItemobject
ItemIdlong

The ID of the resource.

12***
TemplateIdlong

The ID of the permission template.

1563
ModifierIdlong

The ID of the user who modified the resource.

51***
ResourceTypestring

The type of the resource. Valid values:

  • INSTANCE: instance
  • LOGIC_DB: logical database
  • META_DB: physical database
  • LOGIC_TABLE: logical table
  • SINGLE_TABLE: physical table
INSTANCE
InstanceIdlong

The ID of the instance.

188****
DbIdlong

The ID of the database.

43***
TableNamestring

The name of the table.

ExampleTable
Attributestring

Other information. For example, you can add the logon permission on an instance to the permission template.

"permissionTypes": [ "LOGIN" ]
Successboolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.
true
Tidlong

The ID of the tenant.

3***

Examples

Sample success responses

JSONformat

{
  "RequestId": "0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931",
  "ErrorCode": "UnknownError",
  "ErrorMessage": "UnknownError",
  "AuthorityTemplateView": {
    "TemplateId": 1563,
    "CreatorId": 0,
    "Name": "TestTemplate\n",
    "Description": "This template is used for business testing.\n",
    "CreateTime": "2023-01-01 00:00:00",
    "AuthorityTemplateItemList": {
      "AuthorityTemplateItem": [
        {
          "ItemId": 0,
          "TemplateId": 1563,
          "ModifierId": 0,
          "ResourceType": "INSTANCE",
          "InstanceId": 0,
          "DbId": 0,
          "TableName": "ExampleTable",
          "Attribute": "\"permissionTypes\": [\n            \"LOGIN\"\n          ]"
        }
      ]
    }
  },
  "Success": true,
  "Tid": 0
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-10-19The response structure of the API has changedView Change Details
2023-09-20The internal configuration of the API is changed, but the call is not affectedView Change Details