Creates a plan for an AnalyticDB for PostgreSQL instance.
Operation description
- The plan management feature is supported only for pay-as-you-go instances.
- When you change the compute node specifications or change the number of compute nodes, transient connections may occur. We recommend that you perform these operations during off-peak hours.
Before you call this operation, make sure that you are familiar with the billing of AnalyticDB for PostgreSQL. For more information, see Billing methods and AnalyticDB for PostgreSQL pricing.
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:CreateDBInstancePlan | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DBInstanceId | string | Yes | The instance ID. Note
You can call the DescribeDBInstances operation to query the IDs of all AnalyticDB for PostgreSQL instances within a region.
| gp-bp12ga6v69h86**** |
PlanName | string | Yes | The name of the plan. | test-plan |
PlanDesc | string | No | The description of the plan. | this is a test plan |
PlanType | string | Yes | The type of the plan. Valid values:
Note
| PauseResume |
PlanScheduleType | string | Yes | The execution mode of the plan. Valid values:
| Regular |
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 | Yes | 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":{"planCronTime":"0 0 12 1/1 * ? "},"resume":{"planCronTime":"0 0 0 1/1 * ? "}} |
Description of the PlanConfig parameter
When PlanType is set to PauseResume:
-
If PlanScheduleType is set to Postpone, 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 PlanScheduleType is set to Regular, 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 PlanType is set to Resize:
-
If PlanScheduleType is set to Postpone, you must specify the point in time to add or remove compute nodes and the number of desired compute nodes. scaleOut: adds compute nodes. scaleIn: removes compute nodes. executeTime: the point in time to add or remove compute nodes. The time must be in UTC. segmentNodeNum: the number of desired compute nodes. Examples:
- Add compute nodes:
{"scaleOut":{"executeTime":"2022-08-30T16:00:00Z","segmentNodeNum":4}}
- Remove compute nodes:
{"scaleIn":{"executeTime":"2022-08-30T16:00:00Z","segmentNodeNum":2}}
- Add compute nodes:
-
If PlanScheduleType is set to Regular, you must specify the point in time to periodically add and remove compute nodes and the number of desired compute nodes. scaleOut: adds compute nodes. scaleIn: removes compute nodes. planCronTime: the point in time to periodically add and remove compute nodes. The time must be in the cron expression format in UTC. segmentNodeNum: the number of desired compute nodes. Example:
{"scaleIn":{"segmentNodeNum":2,"planCronTime":"0 0 12 1/1 * ? "},"scaleOut":{"segmentNodeNum":4,"planCronTime":"0 0 0 1/1 * ? "}}
.
When PlanType is set to ModifySpec:
-
If PlanScheduleType is set to Postpone, you must specify the point in time to upgrade or downgrade compute node specifications and the desired specifications. scaleUp: upgrades compute node specifications. scaleDown: downgrades compute node specifications. executeTime: the point in time to upgrade or downgrade compute node specifications. The time must be in UTC. instanceSpec: the desired specifications. Examples:
- Upgrade compute node specifications:
{"scaleUp":{"executeTime":"2022-08-30T16:00:00Z","instanceSpec":"4C32G"}}
- Downgrade compute node specifications:
{"scaleDown":{"executeTime":"2022-08-30T16:00:00Z","instanceSpec":"2C16G"}}
- Upgrade compute node specifications:
-
If PlanScheduleType is set to Regular, you must specify the point in time to periodically upgrade and downgrade compute node specifications and the desired specifications. scaleUp: upgrades compute node specifications. scaleDown: downgrades compute node specifications. planCronTime: the point in time to periodically upgrade and downgrade compute node specifications. The time must be in the cron expression format in UTC. instanceSpec: the desired specifications. Example:
{"scaleUp":{"instanceSpec":"4C32G","planCronTime":"0 0 12 1/1 * ? "},"scaleDown":{"instanceSpec":"2C16G","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 |