All Products
Search
Document Center

Serverless App Engine:UpdateIngress

Last Updated:Aug 11, 2023

Updates the configurations of a routing rule.

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 headers

This operation uses only common request headers and does not have operation-specific request headers. For more information, see Common request and response headers.

Request syntax

PUT /pop/v1/sam/ingress/Ingress HTTP/1.1

Request parameters

Parameter

Type

Position

Required

Example

Description

IngressId

Long

Query

Yes

87

The ID of the routing rule.

CertId

String

Query

No

188077086902****_176993d****_181437****_108724****

The ID of the certificate that is associated with the Classic Load Balancer (CLB) instance.

  • If LoadBalanceType is set to clb, specify this parameter to configure a certificate for the HTTP listener.

For information about how to manage the SSL certificate IDs that are used by CLB instances, see Manage certificates (CLB).

CertIds

String

Query

No

87***35-cn-hangzhou,812***3-cn-hangzhou

The IDs of the certificates that are associated with the Application Load Balancer (ALB) instance.

  • If LoadBalanceType is set to alb, specify this parameter to configure multiple certificates for the HTTPS listener. Separate multiple certificate IDs with commas (,).

  • The ID of the SSL certificate that is used by an ALB instance can be obtained from Certificate Management Service. In this example, this parameter is set to 756***-cn-hangzhou. 756*** indicates the certificate ID that is obtained from the service page. -cn-hangzhou indicates the fixed suffix. For more information, see Manage certificates (ALB).

Description

String

Query

No

ingress-sae-test

The name of the routing rule.

ListenerPort

String

Query

No

443

The listener port for the Server Load Balancer (SLB) instance. You must specify a vacant port.

DefaultRule

String

Query

No

{"appId":"395b60e4-0550-458d-9c54-a265d036****","containerPort":8080}

The default forwarding rule. You can specify a port and an application in the default forwarding rule to forward traffic based on the IP address of the application. The following parameters are involved:

  • appId: the application ID.

  • containerPort: the container port of the application.

Note

All requests that do not match the forwarding rules specified in the Rules parameter are forwarded over the port to the specified application.

Rules

String

FormData

No

[{"appId":"395b60e4-0550-458d-9c54-a265d036****","containerPort":8080,"domain":"www.sae.site","path":"/path1"},{"appId":"666403ce-d25b-47cf-87fe-497565d2****","containerPort":8080,"domain":"sae.site","path":"/path2"}]

The forwarding rules. You can specify a port and an application in a forwarding rule to forward traffic based on the specified domain name and request path. The following parameters are involved:

  • appId: the application ID.

  • containerPort: the container port of the application.

  • domain: the domain name.

  • path: the request path.

LoadBalanceType

String

Query

No

clb

This parameter is invalid.

ListenerProtocol

String

Query

No

HTTP

The protocol that is used to forward requests. Valid values:

  • HTTP: HTTP is suitable for applications that need to identify the transmitted data.

  • HTTPS: HTTPS is suitable for applications that require encrypted data transmission.

Response parameters

Parameter

Type

Example

Description

RequestId

String

91F93257-7A4A-4BD3-9A7E-2F6EAE6D****

The request ID.

Message

String

success

The returned message. Valid values:

  • success: If the call is successful, success is returned.

  • An error code: If the call fails, an error code is returned.

TraceId

String

0a98a02315955564772843261e****

The trace ID.

Data

Object

The returned result.

IngressId

Long

87

The ID of the routing rule.

ErrorCode

String

Null

The error code. Valid values:

  • If the call is successful, the ErrorCode parameter is not returned.

  • If the call fails, the ErrorCode parameter is returned. For more information, see the "Error codes" section in this topic.

Code

String

200

The HTTP status code. Valid values:

  • 2xx: The call was successful.

  • 3xx: The call was redirected.

  • 4xx: The call failed.

  • 5xx: A server error occurred.

Success

Boolean

true

Indicates whether the configurations of the routing rule were updated. Valid values:

  • true: The configurations were updated.

  • false: The configurations failed to be updated.

Examples

Sample requests

PUT /pop/v1/sam/ingress/Ingress?IngressId=87&CertId=188077086902****_176993d****_181437****_108724****&Description=ingress-sae-test&ListenerPort=443&DefaultRule={"appId":"395b60e4-0550-458d-9c54-a265d036****","containerPort":8080}&LoadBalanceType=clb&ListenerProtocol=HTTP HTTP/1.1
Host:sae.aliyuncs.com
Content-Type:application/json

Rules=[{"appId":"395b60e4-0550-458d-9c54-a265d036****","containerPort":8080,"domain":"www.sae.site","path":"/path1"},{"appId":"666403ce-d25b-47cf-87fe-497565d2****","containerPort":8080,"domain":"sae.site","path":"/path2"}]

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UpdateIngressResponse>
    <RequestId>91F93257-7A4A-4BD3-9A7E-2F6EAE6D****</RequestId>
    <Message>success</Message>
    <TraceId>0a98a02315955564772843261e****</TraceId>
    <Data>
        <IngressId>87</IngressId>
    </Data>
    <Code>200</Code>
    <Success>true</Success>
</UpdateIngressResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
  "Message" : "success",
  "TraceId" : "0a98a02315955564772843261e****",
  "Data" : {
    "IngressId" : 87
  },
  "Code" : "200",
  "Success" : true
}

Error codes

HttpCode

Error code

Error message

Description

400

InvalidParameter.NotEmpty

You must specify the parameter %s.

The value of the %s parameter is invalid. This parameter cannot be left empty.

400

InvalidParameter.Obviously

The specified parameter is invalid {%s}.

The value of the {%s} parameter is invalid.

400

InvalidParameter.WithMessage

The parameter is invalid {%s}: %s

The value %s of the {%s} parameter is invalid.

400

Exceed.IngressRule

The number of Ingress related rules must be less than or equal to 40.

The number of routing rules cannot exceed 40.

400

SlbListenerPort.NotAvailable

The SLB listening port is unavailable: slbId [%s], port [%s]

The listener port [%s] of the SLB instance whose ID is [%s] is occupied.

400

SSLCert.NotFound

The specified SSL certificate cannot be found.

The SSL certificate is not found.

For a list of error codes, see Service error codes.