Call the UpdateLogstashChargeType to convert a pay-as-you-go Alibaba Cloud Logstash instance to a subscription instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. You can use OpenAPI Explorer to search for API operations, call API operations, and dynamically generate SDK sample code.

Request header

This operation uses only common request headers. For more information, see Common parameters.

Request syntax

POST /openapi/logstashes/[InstanceId]/actions/convert-pay-type HTTPS|HTTP  

Request parameters

Parameter Type Required Example Description
InstanceId String Yes ls-cn-n6w1o5jq****

The ID of the instance.

clientToken String No 5A2CFF0E-5718-45B5-9D4D-70B3FF****

A unique token generated by the client to guarantee the idempotency of the request. The value of this parameter is generated by the client and is unique among different requests. The maximum length is 64 ASCII characters.

RequestBody

Enter the following parameters in RequestBody.

Parameter

Type

Required

Example

Description

paymentInfo

Array

Yes

The billing information of the instance after conversion.

└duration

Integer

Yes

1

The subscription period of the image. If pricingCycle is set to Year, valid values are 1 to 3. If pricingCycle is set to Month, valid values are 1 to 9.

└pricingCycle

String

Yes

Year

The billing cycle of the instance. Valid values: Year and Month.

paymentType

String

Yes

prepaid

The current Payment type of the instance. Currently, you can only convert pay-as-you-go instances to subscription instances. Therefore, the value of this parameter is fixed to prepaid.

Note └ indicates a child parameter.

Sample code:

{
  "paymentInfo":{ 
       "duration":1,
       "pricingCycle":"Month"
    },
  "paymentType":"prepaid"
}

Response parameters

Parameter Type Example Description
RequestId String F99407AB-2FA9-489E-A259-40CF6DCC****

The ID of the request.

Result Boolean true

Returned results:

  • true: conversion successful
  • false: conversion failed

Examples

Sample requests

POST /openapi/logstashes/ls-cn-n6w1o5jq****/actions/convert-pay-type HTTP/1.1
common request headers
{
  "paymentInfo":{ 
       "duration":1,
       "pricingCycle":"Month"
    },
  "paymentType":"prepaid"
}

Sample success responses

JSON Syntax

{
    "Result":true,
    "RequestId":"3760F67B-691D-4663-B4E5-6783554F****"
}

Error codes

HttpCode Error code Error message Description
400 InstanceNotFound The instanceId provided does not exist. The error message returned because the instance cannot be found. Check the status of the instance.

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