Bind the usage plan to the service environment

Last updated: 2020-06-09 15:08:32

    Note:

    This is a legacy API which has been hidden and will no longer be updated. We recommend using the new API Gateway API 3.0 which is standardized and faster.

    Interface description

    This API (BindEnvironment) is used to bind a usage plan to the service environment.
    After the publish service is implemented in a certain environment, the API needs authentication and a usage plan needs to be bound before it can be called. This API binds the usage plan to a specific environment.
    Currently, binding a usage plan to API, is supported, but there cannot be both a usage plan bound to the service and a usage plan bound to the API for the same service. Therefore, for an environment that has already bound a service level usage plan, please use the service level use plan demotion API to perform the degradation operation first.

    Input Parameter

    The following request parameter list only lists the API request parameters. For other parameters, please see Common Request Parameters .

    Parameter name Required Type Description
    UsagePlanIds.n Yes List Of String Unique ID list of usage plans to be bound.
    ServiceId Yes String The service to be bound is a unique ID.
    Environment Yes String The environment to be bound.
    BindType No String Binding type, the value is API, and the default value of SERVICE, is SERVICE.
    ApiIds.n No List of String API unique ID array, which is required when bindType=API.

    Output Parameter

    Parameter name Type Description
    Code Int Common error code, 0 indicates success, other values indicate failure. For more information, please see the error code page Common error code .
    CodeDesc String Error code on the business side. If a Success, error is returned on success, the cause of the business error is returned.
    Message String Module error message description, related to the interface.

    Example

    https://apigateway.api.qcloud.com/v2/index.php?
    &<Common request parameters>
    &Action=BindEnvironment
    &usagePlanId.0=usagePlan-XX
    &usagePlanId.1=usagePlan-XXX
    &serviceId=sevice-XX
    &bindEnvironment=test

    The returned results are as below:

    {
        "code":"0",
        "message":"",
        "codeDesc":"Success"     
    }
    https://apigateway.api.qcloud.com/v2/index.php?
    &<Common request parameters>
    &Action=BindEnvironment
    &usagePlanId.0=usagePlan-XX
    &usagePlanId.1=usagePlan-XXX
    &serviceId=sevice-XX
    &bindType=API
    &apiIds.0=api-2yuua008
    &bindEnvironment=test

    The returned results are as below:

    {
        "code":"0",
        "message":"",
        "codeDesc":"Success"     
    }

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help