Updated on 2024-09-26 GMT+08:00

Renewing Subscription to Yearly/Monthly Resources (Old)

Function

When subscription to yearly/monthly resources of a customer is about to expire, the customer can renew the subscription to the resources.

This API will be brought offline. For details about the new API for renewing subscription to yearly/monthly resources, see Renewing Subscription to Yearly/Monthly Resources.

Web UI

Customers can manually renew subscription to yearly/monthly resources when the subscription is about to expire in the Billing Center.

  1. Go to the Renewals page.
  2. Set the search criteria.

    • Customers who have enabled enterprise project management can set the search criteria to filter an enterprise project and query its resources that are to be renewed.
    • You can click Set Renewal Date to set the expiration date of resources. For details, see Setting a Renewal Date.
    • Under the Manual Renewals, Auto Renewals, Pay-per-Use After Expiration, and Renewals Canceled tabs, you can query all resources to be renewed.
    • You can manually renew resources under the Manual Renewals, Auto Renewals, Pay-per-Use After Expiration, and Renewals Canceled tabs.

  3. All resources that need to be manually renewed can be moved to the Manual Renewals tab. For details, see Restoring to Manual Renewal.
  4. Renew resources separately or in batches.

    • Separate renewal: Click Renew in the Operation column for the desired resource.

    • Batch renewal: Select the check boxes for the desired resources, and click Renew in the upper left corner.

    • On the Renewals page, resources that have orders pending payment are hidden by default. You can unselect Do not show resources that have orders pending payment to show them.
    • When you renew a resource that has an order pending payment, the following message will be displayed: "The resource has an order pending payment. You can renew it only after you pay or cancel the order." You can click the order number in the dialog box to go to the order details page. After you pay or cancel the order, the resource becomes renewable.

  5. Select a renewal duration and click Pay.

  6. Select discounts and a payment option, and click Pay.

REST API

A customer can renew subscription to yearly/monthly resources on the partner sales platform.

  • This API can be invoked only by the customer AK/SK or token. This is because that partners cannot by products by themselves.
  • After you invoke this API, if a primary resource ID has an attached resource ID, the system will renew the subscription to both the primary resource and attached resource.
    • For example, ECS is the primary resource, and EVS is the attached resource.
    • If the shared bandwidth is used, the bandwidth is the primary resource, and EIPs are the attached resource.
    • If the exclusive bandwidth is used, EIPs are the primary resources, and the bandwidth is the attached resource.
  • This API supports automatic payment. Discounts and coupons can be used for automatic payment. For details about how to use discounts or coupons during payment, see Support for Discounts or Coupons.

  1. URI

    POST /v1.0/{domain_id}/common/order-mgr/resources/renew

    The following table describes the parameters.

    Table 1 URI parameter description

    Parameter

    Mandatory

    Value Range

    Description

    domain_id

    Yes

    A maximum of 64 characters

    Customer account ID. For details, see How Do I Obtain Customer's customer_id and domain_id Values?

  2. Request

    Request Parameters

    Parameter

    Mandatory

    Type

    Value Range

    Description

    resource_ids

    Yes

    List<String>

    [1-10]

    Resource IDs.

    Only the primary resource ID is supported. A maximum of 10 resource IDs can be configured.

    To determine the primary resources, query is_main_resource in the response of the API described in Querying Customer's Yearly/Monthly Resources (Old).

    period_type

    Yes

    Integer

    [2|3]

    Period type. The value can be:

    • 2: Month
    • 3: Year

    period_num

    Yes

    Integer

    [1-11]

    Number of periods.

    • Month: 1 to 11
    • Year: 1 to 3

    expire_mode

    No

    Integer

    [0-3]

    Expiration policy (This field has been discarded. Do not use it.)

    • 0: Enter the grace period.
    • 1: Change billing mode to pay-per-use.
    • 2: Automatic unsubscription
    • 3: Automatic renewal

    isAutoPay

    No

    Integer

    [0-1]

    Whether enable automatic payment.

    • 0: No
    • 1: Yes

    If this parameter is left empty, default value 0 is used (automatic payment disabled).

    If this parameter is not included in the request parameters, is set to "", or is set to null, the value 0 is used. This parameter cannot be left empty.

    Example Request
    POST https://bss-intl.myhuaweicloud.com/v1.0/{domain_id}/common/order-mgr/resources/renew HTTP/1.1
    Content-Type: application/json
    X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ
    
    {
      "resource_ids": ["53fe*****068b"],
      "period_type":2,
      "period_num":2,
      "expire_mode":0
    }

  1. Response

    Response Parameters

    Parameter

    Type

    Description

    error_code

    String

    Status code.

    For details, see 4.

    error_msg

    String

    Error description.

    order_ids

    List<String>

    List of order IDs generated when resource subscription is renewed.

    expiredResourceIds

    List<string>

    List of resources that cannot be renewed due to expiration.

    This parameter has a value only when the error code is 3016.

    Example Response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: length
    Date: response time  
    
    {
        "error_code": "CBC.0000",
        "error_msg": "success",
        "order_ids": ["xxxxxxxxxx"],
        "expiredResouceIds":[]
    }

  1. Returned Values
    • 4xx: This class of HTTP status code is intended for situations in which the error seems to have been caused by the client, for example, the request contains bad syntax or incorrect parameters. You must ensure the request is correct.
    • 5xx: This class of HTTP status code is intended for cases in which the Huawei Cloud server is aware that it has encountered an error or is otherwise incapable of performing the request. In this case, contact Huawei Cloud customer service.

    HTTP Status Code

    Error Code

    Description

    200

    CBC.0000

    Success.

    200/400

    CBC.0100

    Invalid input parameter.

    500

    CBC.0999

    Other errors.

    403

    CBC.0151

    Access denied.

    200

    CBC.7281

    You cannot renew or cancel subscription because your account has been frozen.

    200

    CBC.3016

    Expired resources exist.

    200

    CBC.99003144

    You have orders in progress and cannot perform the current operation.

    400

    CBC.99003154

    Subscription plus renewal too long. Select shorter renewal.

    200

    CBC.3144

    You have orders in progress and cannot perform the current operation.

    200

    CBC.99003631

    Resources that are being unsubscribed, deleted, or released cannot be renewed.

    200

    CBC.30010036

    Renewal is only supported for primary resources.

    200

    CBC.30010069

    The renewal period does not exist.

    200

    CBC.30050006

    Automatic order payment failed.