SetRenewal
Key Management Service (KMS) does not provide an operation for configuring auto-renewal for instances. Call the SetRenewal operation provided by the Alibaba Cloud Billing Management API (BSS API) to set the renewal status of a KMS instance.
SetRenewal is provided by the BSS API, not by KMS. Call it as a BSS API operation.
Background information
The BSS API provides general-purpose operations for managing Alibaba Cloud resources, including querying service prices, managing instances, and retrieving billing information. SetRenewal is one of these operations, so the request syntax and the signature method of the BSS API apply.
For the request syntax and the signature method, see Request syntax and signature method. For all operations supported by the BSS API, see List of operations by function.
Limits
The following limits apply when you call SetRenewal to set the renewal status of KMS instances:
Billing method — Only subscription instances are supported.
Batch size — You can specify up to 100 instance IDs in a single call.
Service code and service type — The service code of Key Management Service is
kms. The service type differs between the China site and the International site.
Debugging
Call SetRenewal in OpenAPI Explorer without calculating signatures. After a successful call, OpenAPI Explorer automatically generates SDK code samples.
Request parameters
The value of RenewalStatus determines whether the renewal duration parameters apply:
AutoRenewal —
RenewalPeriodandRenewalPeriodUnitare required.RenewalPeriodspecifies the auto-renewal duration, andRenewalPeriodUnitspecifies the unit of that duration.ManualRenewal or NotRenewal —
To change the renewal status of an instance, callRenewalPeriodandRenewalPeriodUnitare not required.SetRenewalagain with a differentRenewalStatusvalue.
The following table describes the request parameters of the SetRenewal operation.
| Name | Type | Required | Description | Example |
| InstanceIDs | String | Yes | The IDs of the instances for which you want to set the renewal status. Separate multiple instance IDs with commas (,). | kst-hzz65f176a0ogplgq**** |
| RenewalStatus | String | Yes | The renewal status. Valid values:
| AutoRenewal |
| ProductCode | String | Yes | The service code. | kms |
| RenewalPeriod | Integer | No (conditionally required) | The auto-renewal duration of the instance. Unit: months. Valid values:
| 1 |
| RenewalPeriodUnit | String | No (conditionally required) | The unit of the auto-renewal duration. Valid values:
| M |
| ProductType | String | No | The service type. Valid values:
| kms_ddi_public_cn |
| SubscriptionType | String | No | The billing method. Set the value to Subscription. | Subscription |
Response parameters
The following table describes the response parameters of the SetRenewal operation.
| Name | Type | Example | Description |
| Code | String | Success | The status code of this request. |
| Message | String | Successful! | The status code message that corresponds to Code. |
| RequestId | String | 6000EE23-274B-4E07-A697-FF2E999520A4 | The request ID. |
| Success | Boolean | true | Indicates whether this request was successful. |
Examples
Sample success response
The following sample shows a successful response in XML format:
<SetRenewalResponse>
<Message>Successful!</Message>
<RequestId>6000EE23-274B-4E07-A697-FF2E999520A4</RequestId>
<Success>true</Success>
<Code>Success</Code>
</SetRenewalResponse>The following sample shows the same response in JSON format:
{
"Message": "Successful!",
"RequestId": "6000EE23-274B-4E07-A697-FF2E999520A4",
"Success": true,
"Code": "Success"
}