All Products
Search
Document Center

PolarDB:BindResourceControl

Last Updated:Dec 04, 2026

Binds a specified resource control rule to a user, database, query, or connection in a PolarDB for MySQL cluster. After the binding is successful, the target object is subject to the CPU quota limits of the resource control rule.

Operation description

Resource Control is used to limit the CPU resources that can be used by specified users, databases, queries, or connections in a PolarDB for MySQL cluster. The current release supports creating, modifying, deleting, binding, and unbinding resource control rules, but does not support querying Resource Control CPU utilization.

Limits

  • This feature applies only to PolarDB for MySQL Cluster Edition clusters that support Resource Control. PolarDB for MySQL Standard Edition is not supported.

  • The cluster kernel parameter loose_enable_resource_control must be set to ON.

Important This is the notice content.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

polardb:BindResourceControl

create

*DBCluster

acs:polardb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}

None None

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The ID of the region where the PolarDB cluster is deployed.

Note

You can call the DescribeRegions operation to query available regions.

cn-beijing

DBClusterId

string

Yes

The ID of the PolarDB cluster.

pc-**************

ResourceControlName

string

Yes

The name of the resource control rule. The name must be 1 to 63 ASCII characters in length, start with a letter, and contain only letters, digits, and underscores.

test_rc

TargetType

string

Yes

The type of the binding target. Valid values: USER, DATABASE, QUERY, and CONNECTION. The values are case-insensitive.

USER

TargetValue

string

Yes

The value of the binding target. The specific format is determined by TargetType. For more information, see the following table.

app_user

Rules for TargetValue:

TargetTypeTargetValue descriptionExample value
USERThe database username. The name must be 1 to 63 ASCII characters in length, start with a letter, and contain only letters, digits, and underscores. Accounts that contain a host, wildcards, or reference symbols are not supported.app_user
DATABASEThe database name. The name must be 1 to 63 ASCII characters in length, start with a letter, and contain only letters, digits, and underscores.order_db
QUERYThe query ID. The value must be a positive decimal integer without symbols, spaces, or leading zeros. Valid values: 1 to Long.MAX_VALUE.12345
CONNECTIONThe connection ID. The value must be a positive decimal integer without symbols, spaces, or leading zeros. Valid values: 1 to Long.MAX_VALUE.67890

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

6BD9CDE4-5E7B-4BF3-9BB8-83C73E******

Examples

Success response

JSON format

{
  "RequestId": "6BD9CDE4-5E7B-4BF3-9BB8-83C73E******"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameters.Malformed The specified Resource Control parameter is not valid. This generic code is retained for other unspecified scenarios to maintain compatibility with existing callers that match the old code string.
400 Database.ConnectError Unable to connect to the database instance.
400 Database.ExecError The Resource Control operation could not be executed on the database instance.
403 IncorrectDBInstanceType Resource Control is not supported for the current DB cluster edition or kernel configuration.
403 AuthorizationFailure The request is not authorized to operate Resource Control. Authorization failed because RAM permissions are insufficient or the feature is not enabled.
404 InvalidDBClusterId.NotFound The DBClusterId provided does not exist in our records. The specified DBClusterId parameter does not exist in the current record.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.