Ana içeriğe geç

Get Worker Route Health

Endpoint

GET /apiops/projects/{projectName}/apiProxies/{apiProxyName}/environments/{environmentName}/route-health/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyNamestringYesAPI Proxy name (must exist)
environmentNamestringYesEnvironment name (must exist)

Query Parameters

None.

Request Body

This endpoint does not require a request body.

Response

Success Response (200 OK)

{
"status": "SUCCESS",
"resultList": [
{
"routeActive": true,
"servedPath": "/api/v1/pets",
"methods": ["GET", "POST"],
"apinizerRootContext": "/apigateway",
"podsResponded": 2,
"podsActive": 2,
"deployedInManager": true,
"inconsistent": false,
"pods": [
{
"routeActive": true,
"servedPath": "/api/v1/pets",
"methods": ["GET", "POST"],
"workerPodIp": "http://10.0.1.11:8091",
"apinizerRootContext": "/apigateway"
},
{
"routeActive": true,
"servedPath": "/api/v1/pets",
"methods": ["GET", "POST"],
"workerPodIp": "http://10.0.1.12:8091",
"apinizerRootContext": "/apigateway"
}
]
}
],
"resultCount": 1
}

Response Fields

FieldTypeDescription
statusstringRequest status (SUCCESS or FAILURE)
resultListarraySingle-element array with the aggregated route health result
resultList[].routeActivebooleantrue only when every worker pod that answered reports the route as active. A partial deploy (some pods stale) surfaces as false even though some pods are healthy — inspect pods for the breakdown
resultList[].servedPathstringInvoke path the (first) active worker pod is serving; null if no pod reports the route as active
resultList[].methodsarray[string]HTTP methods accepted by the route on the first active pod
resultList[].apinizerRootContextstringGateway root context prefix, read from GeneralSettings on the manager (not from the pods)
resultList[].podsRespondedintegerNumber of worker pods that answered the probe (successfully or with an error)
resultList[].podsActiveintegerNumber of worker pods that reported the route as active
resultList[].deployedInManagerbooleanWhat the manager's own deployment record says for this environment — the same flag the management screen renders as deployed/undeployed
resultList[].inconsistentbooleantrue when the manager record and the workers disagree (see below). Always false when no pod answered, because the worker state is then simply unknown
resultList[].podsarrayRaw per-pod probe results, including pods that errored
resultList[].pods[].routeActivebooleanWhether this specific pod has the proxy loaded and marshalled into its routing table
resultList[].pods[].servedPathstringInvoke path this pod is serving
resultList[].pods[].methodsarray[string]HTTP methods this pod's route accepts
resultList[].pods[].workerPodIpstringWorker pod hostname/IP (or management API URL) that produced this answer
resultList[].pods[].apinizerRootContextstringRoot context this specific worker pod is running with
resultList[].pods[].errorstringPresent only if this pod could not be probed (e.g. proxy not loaded, network failure)
resultCountintegerAlways 1

Consistency Between the Manager and the Workers

deployedInManager and routeActive describe two different sources of truth, and they can drift apart. inconsistent tells you when they disagree:

deployedInManagerrouteActiveMeaning
truetrueHealthy — the API Proxy is deployed and every reachable worker pod serves it
falsetrueOrphan deployment — the management screen shows the environment as undeployed, but the gateway keeps answering with the configuration snapshot it received at deployment time. Later changes made in the manager never reach it and no "redeploy required" warning appears. Redeploy to refresh it, or undeploy explicitly to remove the route
truefalseThe deployment did not reach the worker pods (or not all of them — check podsActive against podsResponded). A redeploy is needed
falsefalseHealthy — the API Proxy is undeployed and no worker serves it

Use this endpoint to scan for orphan deployments: probe the environments an API Proxy is not deployed to and treat every inconsistent: true answer as a route that must be cleaned up.

Error Response (400 Bad Request)

{
"status": "FAILURE",
"resultMessage": "ApiProxy with name (petstore-api) is not found!"
}

Common Causes

  • apiProxyName is empty
  • environmentName is empty
  • API Proxy name does not exist in the project
  • Environment name does not exist, or the user does not have access to it

Error Response (401 Unauthorized)

{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}

cURL Example

curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/petstore-api/environments/production/route-health/" \
-H "Authorization: Bearer YOUR_TOKEN"

Notes and Warnings

  • No backend call: This endpoint never calls the real backend. Each worker pod is probed against its own in-memory routing configuration only.
  • Deploy SUCCESS is not the same as route active: A successful Deploy API Proxy response does not guarantee the route has been pushed to and loaded by every worker pod yet. Use this endpoint right after deploying to confirm the route is actually serve-able before running a real invocation.
  • Partial deploy detection: If some pods have loaded the route and others have not, routeActive is false for the aggregate even though podsActive is greater than zero — check the per-pod pods list to identify which pods are stale.
  • Zero pods responded: If the environment has no reachable worker pods (or no management API settings configured), podsResponded and podsActive are both 0 and routeActive is false.
  • One hop for the invoke URL: apinizerRootContext is included so a CI/CD caller can build the full invoke URL (gateway base URL + apinizerRootContext + servedPath) without a second lookup. For a per-environment gateway base URL and full path list across all environments, see Get API Proxy Invoke Info.

Permissions

User must have API_MANAGEMENT + VIEW permission in the project.