SetRenewal

Updated at:

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.

Important

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:

  • AutoRenewalRenewalPeriod and RenewalPeriodUnit are required. RenewalPeriod specifies the auto-renewal duration, and RenewalPeriodUnit specifies the unit of that duration.

  • ManualRenewal or NotRenewalRenewalPeriod and RenewalPeriodUnit are not required.

    To change the renewal status of an instance, call SetRenewal again with a different RenewalStatus value.

The following table describes the request parameters of the SetRenewal operation.

NameTypeRequiredDescriptionExample
InstanceIDsStringYesThe IDs of the instances for which you want to set the renewal status. Separate multiple instance IDs with commas (,).kst-hzz65f176a0ogplgq****
RenewalStatusStringYes

The renewal status. Valid values:

  • AutoRenewal

  • ManualRenewal

  • NotRenewal

AutoRenewal
ProductCodeStringYesThe service code.kms
RenewalPeriodIntegerNo (conditionally required)

The auto-renewal duration of the instance. Unit: months. Valid values:

  • 1

  • 2

  • 3

  • 6

  • 12

1
RenewalPeriodUnitStringNo (conditionally required)

The unit of the auto-renewal duration. Valid values:

  • M: months.

  • Y: years.

M
ProductTypeStringNo

The service type. Valid values:

  • kms_ddi_public_cn: China site.

  • kms_ddi_public_intl: International site.

kms_ddi_public_cn
SubscriptionTypeStringNoThe billing method. Set the value to Subscription.Subscription

Response parameters

The following table describes the response parameters of the SetRenewal operation.

NameTypeExampleDescription
CodeStringSuccessThe status code of this request.
MessageStringSuccessful!The status code message that corresponds to Code.
RequestIdString6000EE23-274B-4E07-A697-FF2E999520A4The request ID.
SuccessBooleantrueIndicates 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"
}