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
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:
|
RenewalPeriod | Integer | No | 1 | The auto-renewal period. Valid values:
Note If you set RenewalStatus to AutoRenewal, this parameter is required. |
RenewalPeriodUnit | String | No | M | The unit of the auto-renewal period. Valid values:
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_std_public_intl | 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"
}