Obtaining the Gateway Route List
Function
This API is used to obtain the gateway route list.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
URI
POST /v3/meshes/{mesh_id}/gateways/{gateway}/routes
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| mesh_id | Yes | String | Mesh ID |
| gateway | Yes | String | Service name |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Message body type (format) Range: |
| X-Auth-Token | Yes | String | API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Namespace | Yes | Map<String,String> | Namespace of the gateway whose route list is to be obtained. The key is namespace, and the value is the namespace name. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| gatewayNamespace | String | Namespace that the gateway belongs to |
| routes | GatewayVirtualRoute object | Route list |
| Parameter | Type | Description |
|---|---|---|
| namespace | String | Namespace of a backend Service |
| matchRule | String | Matching rule. The value can be prefix (prefix matching) or exact (exact matching). |
| path | String | Matching path |
| serviceName | String | Backend Service name |
| servicePort | Integer | Backend Service port |
| rewrite | HTTPRewrite object | Rewriting rule |
| Parameter | Type | Description |
|---|---|---|
| uri | String | Used to rewrite the URI path or prefix. If the original path is matched by prefix, the value provided in this field replaces the corresponding matched prefix. |
| authority | String | Used to rewrite the HTTP Host/Authority header |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| errorCode | String | Error code |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| errorCode | String | Error code |
Example Requests
{
"Namespace" : [ null ]
} Example Responses
None
Status Codes
| Status Code | Description |
|---|---|
| 200 | The gateway route list is obtained. |
| 400 | Failed to obtain the route list due to incorrect parameters. |
| 500 | Internal error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot