Bastionhost does not provide an API operation to renew a bastion host. However, you can call the RenewInstance operation supported by the transactions and bills management API to renew 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 RenewInstance operation to renew a bastion host. For more information about how to call the operation, see Request Structure.

This topic describes how to call the RenewInstance operation to renew 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 RenewInstance The operation that you want to perform. Set the value to RenewInstance.
InstanceId String Yes bastionhost-cn-**** The ID of the bastion host.
ProductCode String Yes bastionhost The service code of the bastion host. Set the value to bastionhost, which indicates Bastionhost.
RenewPeriod Integer Yes 6

The renewal period of the subscription bastion host. Unit: months. Valid values:

  • 1~9
  • 12
  • 24
  • 36
ProductType String No bastionhost The service type of the bastion host. Set the value to bastionhost, which indicates Bastionhost.
ClientToken String No JASIOFKVNVI**** The client token that is used to ensure the idempotence of the request. The server checks whether a request with the same client token has been received. If so, the server returns the query result of the last request.

Response parameters

Parameter Type Example Description
Code String Success The status code.
Data Struct The returned information.
└OrderId String 2026532523**** The ID of the order.
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=RenewInstance
&InstanceId=bastionhost-cn-****
&ProductCode=bastionhost
&RenewPeriod=6
&<Common request parameters>

Sample success responses

XML format

<RenewInstanceResponse>
      <Message>Successful!</Message>
      <RequestId>6000EE23-274B-4E07-A697-FF2E999520A4</RequestId>
      <Success>true</Success>
      <Code>Success</Code>
      <Data>
            <OrderId>2026532523****</OrderId>
      </Data>
</RenewInstanceResponse>

JSON format

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

Error codes

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