All Products
Search
Document Center

AnalyticDB for PostgreSQL:CreateDBInstancePlan

Last Updated:Mar 03, 2024

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

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:CreateDBInstancePlanRead
  • DBInstance
    acs:gpdb:*:{#accountId}:dbinstance/{#dbinstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

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

The name of the plan.

test-plan
PlanDescstringNo

The description of the plan.

this is a test plan
PlanTypestringYes

The type of the plan. Valid values:

  • PauseResume: pauses and resumes an instance.
  • Resize: changes the number of compute nodes.
  • ModifySpec: changes compute node specifications.
Note
  • You can specify the value to Resize only for instances in Serverless mode.

  • You can specify the value to ModifySpec only for instances in elastic storage mode.

PauseResume
PlanScheduleTypestringYes

The execution mode of the plan. Valid values:

  • Postpone: The plan is executed later.
  • Regular: The plan is executed periodically.
Regular
PlanStartDatestringNo

The start time of the plan. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

Note
  • This parameter must be specified only when PlanScheduleType is set to Regular.

  • If you do not specify this parameter, the plan is executed immediately.

2022-04-17T23:00Z
PlanEndDatestringNo

The end time of the plan. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC. The end time must be later than the start time.

Note
  • This parameter must be specified only when PlanScheduleType is set to Regular.

  • If you do not specify this parameter, the plan does not end.

2023-04-17T23:00Z
PlanConfigstringYes

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

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

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

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

Indicates whether the request was successful.

If the request was successful, success is returned. If the request failed, this parameter is not returned.

success
ErrorMessagestring

The error message.

This parameter is returned only if the request fails.

****
DBInstanceIdstring

The instance ID.

gp-bp12ga6v69h86****
PlanIdstring

The plan ID.

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 Operationsee changesets