Queries the routes of an HTTP API.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| apig:ListHttpApiRoutes | list | *HttpApi acs:apig:{#regionId}:{#accountId}:httpapi/{#HttpApiId} |
| none |
Request syntax
GET /v1/http-apis/{httpApiId}/routes HTTP/1.1
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| httpApiId | string | No | The HTTP API ID. | api-cr68g1dlhtgm31f*** |
| pageNumber | integer | No | The page number of the page to return. Pages start from page 1. Default value: 1. | 1 |
| pageSize | integer | No | The number of entries per page. Valid values: 1 to 100. Default value: 10. | 10 |
| environmentId | string | No | The environment ID. | env-cpqnr6tlhtgubc*** |
| deployStatuses | string | No | The deployment state of the route. Enumerated values:
| NotDeployed |
| name | string | No | The route name. | itemcenter-gateway |
| nameLike | string | No | The route name keyword for a fuzzy search. | item |
| pathLike | string | No | The route path keyword for a fuzzy search. | /v1 |
| gatewayId | string | No | The ID of the Cloud-native API Gateway instance. | gw-cpv4sqdl**** |
| withConsumerInfoById | string | No | The authentication rules of the specified consumer in each route returned. | cs-xxx |
| consumerAuthorizationRuleId | string | No | The string that is used to filter routes based on consumer authentication rules. Only authorized APIs are returned. | cas-xxx |
| withAuthPolicyInfo | boolean | No | The consumer authorization information in the response. | true |
| withPluginAttachmentByPluginId | string | No | The mounting information of the specified plug-in in each route returned. | pl-xxx |
| domainId | string | No | Specifies to filter routes by domain ID. | d-xxx |
Response parameters
Examples
Sample success responses
JSONformat
{
"requestId": "CBEEB8C1-108E-50F0-9BEA-DED79553C309",
"code": "Ok",
"message": "success",
"data": {
"pageNumber": 1,
"pageSize": 20,
"totalSize": 9,
"items": [
{
"routeId": "",
"name": "",
"deployStatus": "",
"description": "",
"match": {
"ignoreUriCase": true,
"path": {
"type": "Prefix",
"value": "/user"
},
"headers": [
{
"type": "Exact",
"name": "dev",
"value": true
}
],
"methods": [
"GET"
],
"queryParams": [
{
"type": "Exact",
"name": "age",
"value": 17
}
]
},
"backend": {
"scene": "Single",
"services": [
{
"serviceId": "service-cq2bmmdlhtgj***",
"name": "item-service",
"protocol": "HTTP",
"port": 0,
"weight": 49,
"version": "v1"
}
]
},
"domainInfos": [
{
"domainId": "",
"name": "",
"protocol": ""
}
],
"environmentInfo": {
"environmentId": "",
"name": "",
"alias": "",
"gatewayInfo": {
"gatewayId": "",
"name": ""
},
"subDomains": [
{
"domainId": "",
"name": "",
"protocol": "",
"networkType": "Internet"
}
]
},
"createTimestamp": 0,
"updateTimestamp": 0
}
]
}
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|
