List all stream routes in a service on a gateway group
GET /apisix/admin/stream_routes
GET /apisix/admin/stream_routesInteractive request editor loads with JavaScript.
In: header
Query Parameters
The unique identifier of the service.
^[a-zA-Z0-9-_.]+$1 <= length <= 256Page number of the listed resources. Used together with page_size. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.
int321 <= valueNumber of resources listed per page. Used together with page. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.
int321 <= valueOrder to list the resources by. The sorting index follows the configuration of order_by.
"desc"Value in
- "asc"
- "desc"
Index to order resources by.
"updated_at"Value in
- "created_at"
- "updated_at"
Condition to search resources by.
Gateway group ID. Optional when using the gateway group admin key to authenticate.
1 <= lengthIf true, include publish information in the response, such as apisix_route_id, route_version_id, and service_version_id. The additional information is only useful for the Dashboard and not for API users.
falseResponse Body
application/json
application/json
curl -X GET "$API_BASE_URL/apisix/admin/stream_routes?service_id=bd58fce2-b6cc-4d2d-a53c-6ce11b19c101&search=version%253Dv2&gateway_group_id=86fb9981-d9d2-4555-9df8-91ae92129335"Successfully retrieved the paginated list of stream routes.
{
"total": 1,
"list": [
{
"name": "us-west-rsc",
"labels": {
"version": "v2",
"env": "prod"
},
"desc": "Object description.",
"remote_addr": "127.0.0.1",
"server_addr": "mysql",
"server_port": 3306,
"plugins": {
"ip-restriction": {
"whitelist": [
"192.168.0.1/24"
],
"message": "Access denied"
}
},
"id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
"service_id": "b32e678e-7f6b-4a50-b113-550621ed4c01",
"gateway_group_id": "bc1b95c9-b348-4832-acc3-e257d2342df1",
"gateway_group_name": "us-west-rsc",
"created_at": 1742288232,
"updated_at": 1742288235
}
]
}Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.
{
"value": {},
"error_msg": "error message"
}Complete operation details and schema variants
GET /apisix/admin/stream_routes
List all stream routes in a service on a gateway group
List stream routes in a service through an APISIX Admin API compatible endpoint under /apisix/admin/. Use this for visibility into current L4 routing rules.
Required IAM Permission: Action gateway:GetPublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s
Parameters
service_id(query, string, required): The unique identifier of the service.page(query, integer, optional): Page number of the listed resources. Used together withpage_size. For example, when there are 13 resources in total, if the query parameters arepage=1&page_size=10, the GET response will show the routetotalas13and display 10 resources in the first page. If the query parameters arepage=2&page_size=10, the GET response will show the routetotalas13and display 3 resources in the second page.page_size(query, integer, optional): Number of resources listed per page. Used together withpage. For example, when there are 13 resources in total, if the query parameters arepage=1&page_size=10, the GET response will show the routetotalas13and display 10 resources in the first page. If the query parameters arepage=2&page_size=10, the GET response will show the routetotalas13and display 3 resources in the second page.direction(query, string, optional): Order to list the resources by. The sorting index follows the configuration oforder_by.order_by(query, string, optional): Index to order resources by.search(query, string, optional): Condition to search resources by.gateway_group_id(query, string, required): Gateway group ID. Optional when using the gateway group admin key to authenticate.with_publish_info(query, boolean, optional): If true, include publish information in the response, such asapisix_route_id,route_version_id, andservice_version_id. The additional information is only useful for the Dashboard and not for API users.
Responses
200: Successfully retrieved the paginated list of stream routes.- allOf variant 1
list(array, optional): An array of resources.total(integer, optional): Total number of objects.- allOf variant 2
list(array, optional): The array of routes.- allOf variant 1
- allOf variant 1
list[].name(string, optional): The object name.list[].labels(object, optional): Key-value pairs of labels.list[].desc(string, optional): The object description.list[].remote_addr(string, optional): Client address filter. If the client request does not originate fromremote_addr, the request will not be forwarded to the stream server.- anyOf variant 1: IPv4
- anyOf variant 2: IPv4/CIDR
- anyOf variant 3: IPv6
- anyOf variant 4: IPv6/CIDR
list[].server_addr(string, optional): Stream server address.- anyOf variant 1: IPAddress
- anyOf variant 1: IPv4
- anyOf variant 2: IPv4/CIDR
- anyOf variant 3: IPv6
- anyOf variant 4: IPv6/CIDR
- anyOf variant 2: Domain
list[].server_port(integer, optional): Stream server port.- allOf variant 2
list[].plugins(object, optional): Key-value pairs of plugins and their configurations on the object.- allOf variant 2
list[].id(string, optional): The object ID.list[].service_id(string, optional): The service ID.list[].gateway_group_id(string, optional): The gateway group ID.list[].gateway_group_name(string, optional): The object name.list[].created_at(integer, optional): The object created timestamp.list[].updated_at(integer, optional): The object updated timestamp.400: Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.value(object, optional): The specific resource.error_msg(string, optional): The error message.
cURL
curl -X GET '$API_BASE_URL/apisix/admin/stream_routes'