Modifies a plan for an AnalyticDB for PostgreSQL instance.
Operation description
You can call this operation to modify a plan for an AnalyticDB for PostgreSQL instance in Serverless mode. For example, you can modify a plan for periodically pausing and resuming an instance or scaling an instance.
Limits
You can call this operation up to 1,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
gpdb:UpdateDBInstancePlan | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DBInstanceId | string | Yes | The ID of the instance. Note
You can call the DescribeDBInstances operation to query the details of all AnalyticDB for PostgreSQL instances in a specific region, including instance IDs.
| gp-bp12ga6v69h86**** |
PlanName | string | No | The name of the plan. | test-plan |
PlanDesc | string | No | The description of the plan. | this is a test plan |
PlanStartDate | string | No | The start time of the plan. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Note
| 2022-04-17T23:00Z |
PlanEndDate | string | No | The end time of the plan. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. The end time must be later than the start time. Note
| 2023-04-17T23:00Z |
PlanConfig | string | No | The execution information of the plan. Specify the parameter in the JSON format. The parameter value varies based on the values of PlanType and PlanScheduleType. The following section describes the PlanConfig parameter. | {"pause":{"executeTime":"2022-08-30T16:00:00Z"}} |
PlanId | string | Yes | The ID of the plan. Note
You can call the DescribeDBInstancePlans operation to query the details of plans, including plan IDs.
| 1234 |
Description of the PlanConfig parameter
When the plan task is to pause or resume the instance:
-
If the plan is executed later, you must specify the point in time to pause or resume the instance. pause: pauses the instance. resume: resumes the instance. executeTime: the point in time to pause or resume the instance. The time must be in UTC. Examples:
- Pause the instance:
{"pause":{"executeTime":"2022-08-30T16:00:00Z"}}
- Resume the instance:
{"resume":{"executeTime":"2022-08-30T16:00:00Z"}}
- Pause the instance:
-
If the plan is executed periodically, you must specify the point in time to periodically pause and resume the instance. pause: pauses the instance. resume: resumes the instance. planCronTime: the point in time to periodically pause and resume the instance. The time must be in the cron expression format in UTC. Example:
{"pause":{"planCronTime":"0 0 12 1/1 * ? "},"resume":{"planCronTime":"0 0 0 1/1 * ? "}}
.
When the plan task is to scale out or scale in the instance:
-
If the plan is executed later, you must specify the point in time to scale out or scale in the instance and the number of desired nodes. scaleOut: scales out the instance. scaleIn: scales in the instance. executeTime: the point in time to scale out or scale in the instance. The time must be in UTC. segmentNodeNum: the number of desired nodes. Examples:
- Scale out the instance:
{"scaleOut":{"executeTime":"2022-08-30T16:00:00Z","segmentNodeNum":4}}
- Scale in the instance:
{"scaleIn":{"executeTime":"2022-08-30T16:00:00Z","segmentNodeNum":2}}
- Scale out the instance:
-
If the plan is executed periodically, you must specify the point in time to periodically scale out and scale in the instance and the number of desired nodes. scaleOut: scales out the instance. scaleIn: scales in the instance. planCronTime: the point in time to periodically scale out and scale in the instance. The time must be in the cron expression format in UTC. segmentNodeNum: the number of desired nodes. Example:
{"scaleIn":{"segmentNodeNum":2,"planCronTime":"0 0 12 1/1 * ? "},"scaleOut":{"segmentNodeNum":4,"planCronTime":"0 0 0 1/1 * ? "}}
.
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "34b32a0a-08ef-4a87-b6be-cdd9f56fc3ad",
"Status": "success",
"ErrorMessage": "****",
"DBInstanceId": "gp-bp12ga6v69h86****",
"PlanId": "1234"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2022-08-25 | Add Operation | View Change Details |