tencent cloud

Feedback

CreateUpstream

Last updated: 2024-10-10 21:40:56

    1. API Description

    Domain name for API request: apigateway.tencentcloudapi.com.

    This API is used to create an upstream.

    A maximum of 20 requests can be initiated per second for this API.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common Params. The value used for this API: CreateUpstream.
    Version Yes String Common Params. The value used for this API: 2018-08-08.
    Region Yes String Common Params. For more information, please see the list of regions supported by the product.
    Scheme Yes String Backend protocol. Valid values: HTTP, HTTPS
    Algorithm Yes String Load balancing algorithm. Valid value: ROUND-ROBIN
    UniqVpcId Yes String Unique VPC ID
    UpstreamName No String Upstream name
    UpstreamDescription No String Upstream description
    UpstreamType No String Upstream access type. Valid values: IP_PORT, K8S
    Retries No Integer Retry attempts. It defaults to 3.
    UpstreamHost No String The Host request header that forwarded from the gateway to backend
    Nodes.N No Array of UpstreamNode Backend nodes
    Tags.N No Array of Tag Label
    HealthChecker No UpstreamHealthChecker Health check configuration
    K8sService.N No Array of K8sService Configuration of TKE service

    3. Output Parameters

    Parameter Name Type Description
    UpstreamId String The unique upstream ID returned
    Note: This field may return NULL, indicating that no valid value was found.
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Creating an upstream

    This example shows you how to create an upstream.

    Input Example

    https://apigateway.tencentcloudapi.com/?Action=CreateUpstream
    &Retries=1
    &UpstreamName=test
    &Algorithm=ROUND_ROBIN
    &UniqVpcId=vpc-sadada
    &UpstreamType=IP_PORT
    &UpstreamHost=www.a.com
    &UpstreamDescription=test
    &Scheme=instance-HTTP
    &Nodes.0.VmInstanceId=ins-saadas
    &Nodes.0.Host=127.0.0.1
    &Nodes.0.Port=80
    &Nodes.0.Weight=100
    &<Common Request Parameters>
    

    Output Example

    {
        "Response": {
            "UpstreamId": "upstream-0c96l2bo",
            "RequestId": "b3197c48-53fb-46df-b721-df4424cf8be9"
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    AuthFailure Error with CAM signature/authentication.
    DryRunOperation DryRun Operation. It means that the request would have succeeded, but the DryRun parameter was used.
    FailedOperation Operation failed.
    FailedOperation.OperateUpstream Backend error
    FailedOperation.TagBindServiceError The tag was not bound to the specified service.
    InternalError Internal error.
    InvalidParameter Incorrect parameter.
    InvalidParameter.FormatError Incorrect parameter format.
    InvalidParameterValue.InvalidVpcConfig Invalid VPC information
    InvalidParameterValue.NotInOptions The parameter value is incorrect, as it is not an available option.
    InvalidParameterValue.RangeExceeded The parameter value is incorrect, as it is not within the valid value range.
    LimitExceeded The quota limit is exceeded.
    MissingParameter Missing parameter.
    OperationDenied Operation denied.
    RequestLimitExceeded The number of requests exceeds the frequency limit.
    ResourceInUse The resource is in use.
    ResourceInsufficient Insufficient resource.
    ResourceNotFound The resource does not exist.
    UnauthorizedOperation The operation is unauthorized.
    UnsupportedOperation Unsupported operation.