Bastionhost does not provide an API operation to enable auto-renewal for a bastion host. However, you can call the SetRenewal operation supported by the transactions and bills management API to enable auto-renewal for a bastion host. This API is also called BSS API for short.

Background information

The BSS API is a set of common operations used to manage Alibaba Cloud resources. For example, you can call the operations to query service prices, manage instances, or obtain bills. For more information about the operations of the BSS API, see API Overview.

You can call the SetRenewal operation to enable auto-renewal for a bastion host. For more information about how to call the operation, see Request Structure.

This topic describes how to call the SetRenewal operation to enable auto-renewal for a bastion host and provides examples.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes SetRenewal The operation that you want to perform. Set the value to SetRenewal.
InstanceIDs String Yes bastionhost-cn-**** The ID of the bastion host. If you enter multiple IDs, separate them with commas (,). You can enable auto-renewal only for subscription bastion hosts. You can enter a maximum of 100 IDs.
RenewalStatus String Yes AutoRenewal

The method that is used to renew the bastion host. Valid values:

  • AutoRenewal
  • ManualRenewal
  • NotRenewal
RenewalPeriod Integer No 1

The auto-renewal period. Valid values:

  • 1
  • 2
  • 3
  • 6
    Note You can specify this parameter only when you set RenewalPeriodUnit to M.
Note If you set RenewalStatus to AutoRenewal, this parameter is required.
RenewalPeriodUnit String No M

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

  • M: months
  • Y: years
Note If you set RenewalStatus to AutoRenewal, this parameter is required.
ProductCode String No bastionhost The service code of the bastion host.

Set the value to bastionhost, which indicates Bastionhost.

ProductType String No bastionhost The service type of the bastion host.

Set the value to bastionhost, which indicates Bastionhost.

SubscriptionType String No Subscription The billing method of the bastion host.

Set the value to Subscription.

Response parameters

Parameter Type Example Description
Code String Success The status code.
Message String Successful! The message returned for Code.
RequestId String 6000EE23-274B-4E07-A697-FF2E999520A4 The ID of the request.
Success Boolean true Indicates whether the request is successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=SetRenewal
&InstanceIDs=bastionhost-cn-****
&RenewalStatus=AutoRenewal
&RenewalPeriod=1
&RenewalPeriodUnit=M
&<Common request parameters>

Sample success responses

XML format

<SetRenewalResponse>
      <Message>Successful!</Message>
      <RequestId>6000EE23-274B-4E07-A697-FF2E999520A4</RequestId>
      <Success>true</Success>
      <Code>Success</Code>
</SetRenewalResponse>

JSON format

{
    "Message": "Successful!",
    "RequestId": "6000EE23-274B-4E07-A697-FF2E999520A4",
    "Success": true,
    "Code": "Success"
}

Error codes

For a list of error codes, visit the API Error Center.