All Products
Search
Document Center

AnalyticDB:CreateDBInstancePlan

Last Updated:Aug 28, 2026

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.

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

gpdb:CreateDBInstancePlan

get

*DBInstance

acs:gpdb:*:{#accountId}:dbinstance/{#dbinstanceId}

None 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:

  • 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 ModifySpec only for instances in elastic storage mode.

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

PauseResume

PlanScheduleType

string

Yes

The execution mode of the plan. Valid values:

  • Postpone: The plan is executed later.

  • Regular: The plan is executed periodically.

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
  • This parameter must be specified only when PlanScheduleType is set to Regular.

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

2022-04-17T23:00: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
  • This parameter must be specified only when PlanScheduleType is set to Regular.

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

2023-04-17T23:00: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"}}

  • 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 elements

Element

Type

Description

Example

object

DBInstanceId

string

The instance ID.

gp-bp12ga6v69h86****

ErrorMessage

string

The error message.

This parameter is returned only if the request fails.

****

PlanId

string

The plan ID.

1234

RequestId

string

The request ID.

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

Status

string

Indicates whether the request was successful.

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

success

Examples

Success response

JSON format

{
  "DBInstanceId": "gp-bp12ga6v69h86****",
  "ErrorMessage": "****",
  "PlanId": "1234",
  "RequestId": "34b32a0a-08ef-4a87-b6be-cdd9f56fc3ad",
  "Status": "success"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.