All Products
Search
Document Center

BSS OpenAPI:CreateSavingsPlansInstance

Last Updated:Aug 14, 2024

Creates a savings plan. After you call this operation, a savings plan is purchased and paid for.

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
bssapi:CreateSavingsPlansInstancecreate
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
SpecTypestringNo

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:

  • group: specification group
  • family: specification family
family
PayModestringYes

The payment mode. Valid values:

  • total: all upfront
  • half: partial upfront
  • zero: no upfront
total
SpecificationstringNo

The specifications of the savings plan. This parameter is used together with the SpecType parameter.

ecs.g6
TypestringYes

The type of the savings plan. Valid values:

  • universal: general-purpose type
  • ecs: Elastic Compute Service (ECS) compute type
  • elasticy: elastic type
universal
PoolValuestringYes

The contracted amount. unit: CNY

0.1
DurationstringYes

The service duration. This parameter is used together with the PricingCycle parameter.

1
CommodityCodestringYes

The code of the service.

savingplan_common_public_cn
PricingCyclestringYes

The unit of the subscription duration. This parameter is used together with Duration. Valid values:

  • Year
  • Month
Year
RegionstringNo

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
EffectiveDatestringNo

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
ExtendMapobjectNo

The extended parameters.

stringNo

The extended parameter whose value consists of key-value pairs.

TEST:123

Response parameters

ParameterTypeDescriptionExample
object

The details of the savings plan.

Messagestring

The error message returned.

The parameter must be specified.
RequestIdstring

The ID of the request.

26dabb0c-8ca0-4aa0-8143-30499f3fe304
Dataobject

The data returned.

OrderIdlong

The ID of the order.

202110260001
Codestring

The status code.

PARAM_ERROR
Successboolean

Indicates whether the request was successful.

true

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError message
400IdempotentParameterMismatchThe 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 timeSummary of changesOperation
2023-03-27The Error code has changed. The request parameters of the API has changedView Change Details
2023-03-22The Error code has changedView Change Details