Creates a routing rule.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sae:CreateIngress |
create |
*All Resource
|
None | None |
Request syntax
POST /pop/v1/sam/ingress/Ingress HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| NamespaceId |
string |
Yes |
The ID of the namespace where the application resides. Currently, cross-namespace applications are not supported. |
cn-beijing:sae-test |
| Description |
string |
No |
The name of the routing rule. |
ingress-for-sae-test |
| SlbId |
string |
No |
The Server Load Balancer (SLB) instance that is used by the routing rule. Note
SLB SLB instances include CLB instances and ALB instances. |
lb-uf6hucc7inlqrtcq5**** |
| ListenerPort |
integer |
Yes |
The SLB listening port. This port cannot be occupied. |
80 |
| CertId |
string |
No |
The ID of the CLB certificate. Valid values:
For more information about how to use SSL certificate IDs for CLB, see Manage certificates (CLB). |
188077086902****_176993d****_181437****_108724**** |
| CertIds |
string |
No |
The ID of the multi-certificate ALB. Valid values:
|
87***35-cn-hangzhou,812***3-cn-hangzhou |
| DefaultRule |
string |
Yes |
The default forwarding rule. Forwards traffic to a specified application through a specified port based on the IP address. The following table describes the parameters.
Note
All requests that do not match or satisfy Rules forwarding rules are forwarded to the specified application. |
{"appId":"395b60e4-0550-458d-9c54-a265d036****","containerPort":8080} |
| Rules |
string |
Yes |
The forwarding rule. Forwards traffic to a specified application through a specified port based on the domain name and request path. The following table describes the parameters.
Note
Only ALB allows you to set the RewritePath feature. CLB does not support this feature. |
[{"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":"/sys/(.*)/(.*)/aaa","backendProtocol":"http"}] |
| LoadBalanceType |
string |
No |
SLB the type of the SLB instance. It depends on the type that you entered when you created the routing rule and cannot be changed when you update it. Valid values:
|
clb |
| ListenerProtocol |
string |
No |
The request forwarding protocol. Valid values:
|
HTTP |
| SecurityPolicyId |
string |
No |
The ID of the security policy instance. |
sp-bp1bpn0kn9**** |
| RequestTimeout |
integer |
No |
Specifies the request timeout period. Unit: seconds. Valid values: 1 to 180. If the backend server does not respond within the timeout period, the SLB abandons the wait and returns an HTTP 504 error code to the client. |
3 |
| IdleTimeout |
integer |
No |
Specifies the connection idle timeout period. Unit: seconds. Valid values: 1 to 60. If there is no access request within the timeout period, the SLB will temporarily interrupt the current connection until the next request comes to re-establish a new connection. |
15 |
| EnableXForwardedFor |
boolean |
No |
|
- |
| EnableXForwardedForClientSrcPort |
boolean |
No |
|
- |
| EnableXForwardedForProto |
boolean |
No |
|
- |
| EnableXForwardedForSlbId |
boolean |
No |
|
- |
| EnableXForwardedForSlbPort |
boolean |
No |
|
- |
| AddressType |
string |
No |
|
- |
| LoadBalancerEdition |
string |
No |
|
- |
| ZoneMappings |
string |
No |
|
- |
| CorsConfig |
string |
No |
|
- |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned data. |
||
| RequestId |
string |
The ID of the request. |
91F93257-7A4A-4BD3-9A7E-2F6EAE6D**** |
| Message |
string |
Additional information. Valid values:
|
success |
| TraceId |
string |
The ID of the trace. This parameter is used to query the exact call information. |
0a98a02315955564772843261e**** |
| Data |
object |
Responses. |
|
| IngressId |
integer |
The ID of the routing rule. |
87 |
| ErrorCode |
string |
Error code. Valid values:
|
空 |
| Code |
string |
The HTTP status code or the error code. Valid values:
|
200 |
| Success |
boolean |
Indicates whether the routing rule was created. Valid values:
|
true |
Examples
Success response
JSON format
{
"RequestId": "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
"Message": "success",
"TraceId": "0a98a02315955564772843261e****",
"Data": {
"IngressId": 87
},
"ErrorCode": "空",
"Code": "200",
"Success": true
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter.NotEmpty | You must specify the parameter %s. | |
| 400 | InvalidParameter.Obviously | The specified parameter is invalid {%s}. | |
| 400 | InvalidParameter.WithMessage | The parameter is invalid {%s}: %s | |
| 400 | Slb.NotFound | The SLB instance does not exist: slbId [%s] | |
| 400 | Exceed.IngressRule | The number of Ingress related rules must be less than or equal to 40. | |
| 400 | SlbListenerPort.NotAvailable | The SLB listening port is unavailable: slbId [%s], port [%s] | |
| 400 | SSLCert.NotFound | The specified SSL certificate cannot be found. | |
| 404 | InvalidResponse.Api | The response of API %s is empty. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.