All Products
Search
Document Center

AnalyticDB:UpdateDBInstancePlan

Last Updated:Oct 09, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
gpdb:UpdateDBInstancePlanget
  • DBInstance
    acs:gpdb:*:{#accountId}:dbinstance/{#dbinstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

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****
PlanNamestringNo

The name of the plan.

test-plan
PlanDescstringNo

The description of the plan.

this is a test plan
PlanStartDatestringNo

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
  • This parameter must be specified only for periodically executed plans.

  • If you do not specify this parameter, the current time is used.

2022-04-17T23:00Z
PlanEndDatestringNo

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
  • This parameter must be specified only for periodically executed plans.

  • If you do not specify this parameter, the plan stops until the plan is deleted.

2023-04-17T23:00Z
PlanConfigstringNo

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"}}
PlanIdstringYes

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"}}
  • 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}}
  • 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 * ? "}}.

Note For more information about cron expressions, see Cron expression.

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

34b32a0a-08ef-4a87-b6be-cdd9f56fc3ad
Statusstring

The state of the operation.

If the operation is successful, success is returned. If the operation fails, this parameter is not returned.

success
ErrorMessagestring

The error message returned.

This parameter is returned only when the operation fails.

****
DBInstanceIdstring

The ID of the instance.

gp-bp12ga6v69h86****
PlanIdstring

The ID of the plan.

1234

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
2022-08-25Add OperationView Change Details