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

ParameterTypeRequiredExampleDescription
ActionStringYesSetRenewalThe operation that you want to perform. Set the value to SetRenewal.
InstanceIDsStringYesbastionhost-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.
RenewalStatusStringYesAutoRenewal

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

  • AutoRenewal
  • ManualRenewal
  • NotRenewal
RenewalPeriodIntegerNo1

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.
RenewalPeriodUnitStringNoM

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

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

Set the value to bastionhost, which indicates Bastionhost.

ProductTypeStringNobastionhost_std_public_intlThe service type of the bastion host.

Set the value to bastionhost, which indicates Bastionhost.

SubscriptionTypeStringNoSubscriptionThe billing method of the bastion host.

Set the value to Subscription.

Response parameters

ParameterTypeExampleDescription
CodeStringSuccessThe status code.
MessageStringSuccessful!The message returned for Code.
RequestIdString6000EE23-274B-4E07-A697-FF2E999520A4The ID of the request.
SuccessBooleantrueIndicates 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"
}