Creates a savings plan. After you call this operation, a savings plan is purchased and paid for.
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 |
---|---|---|---|---|
bssapi:CreateSavingsPlansInstance | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
SpecType | string | No | The specification type. This parameter is used together with the Specification parameter. You must specify this parameter if the Type parameter is not set to universal. Valid values:
| family |
PayMode | string | Yes | The payment mode. Valid values:
| total |
Specification | string | No | The specifications of the savings plan. This parameter is used together with the SpecType parameter. | ecs.g6 |
Type | string | Yes | The type of the savings plan. Valid values:
| universal |
PoolValue | string | Yes | The contracted amount. unit: CNY | 0.1 |
Duration | string | Yes | The service duration. This parameter is used together with the PricingCycle parameter. | 1 |
CommodityCode | string | Yes | The code of the service. | savingplan_common_public_cn |
PricingCycle | string | Yes | The unit of the subscription duration. This parameter is used together with Duration. Valid values:
| Year |
Region | string | No | The ID of the region in which you create the savings plan. You must specify this parameter if the Type parameter is not set to universal. | cn-hangzhou |
EffectiveDate | string | No | The time when the savings plan takes effect. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. | 2021-12-31T00:00:00Z |
ExtendMap | object | No | The extended parameters. | |
string | No | The extended parameter whose value consists of key-value pairs. | TEST:123 |
Response parameters
Examples
Sample success responses
JSON
format
{
"Message": "The parameter must be specified.\n",
"RequestId": "26dabb0c-8ca0-4aa0-8143-30499f3fe304",
"Data": {
"OrderId": 202110260001
},
"Code": "PARAM_ERROR",
"Success": true
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | IdempotentParameterMismatch | The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-03-27 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-03-22 | The Error code has changed | View Change Details |