API7 Docs

Get healthcheck status for the upstream of a service on a gateway group, if upstream_id is not provided, get healthcheck status for default upstream of this service

GET /api/gateway_groups/{gateway_group_id}/services/{apisix_service_id}/healthcheck

GET /api/gateway_groups/{gateway_group_id}/services/{apisix_service_id}/healthcheck

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Path Parameters

gateway_group_id*string

Gateway group ID.

Length1 <= length
apisix_service_id*string

The unique identifier of the APISIX service.

Match^[a-zA-Z0-9-_.]+$
Length1 <= length <= 256

Query Parameters

upstream_id?string

The unique identifier of the upstream.

Match^[a-zA-Z0-9-_.]+$
Length1 <= length <= 256

Response Body

application/json

curl -X GET "$API_BASE_URL/api/gateway_groups/86fb9981-d9d2-4555-9df8-91ae92129335/services/bd58fce2-b6cc-4d2d-a53c-6ce11b19c101/healthcheck"

The response for retrieving some source's healthcheck status.

{
  "value": {
    "httpbin.com:80": {
      "host": "httpbin.com",
      "port": 80,
      "total": 1,
      "healthy": 1,
      "unhealthy": 0,
      "unknown": 0,
      "updated_at": 1750150319,
      "gateway_instances": [
        {
          "id": "xxx-yyy-zzz",
          "hostname": "api7ee3-apisix-699b68db7f-cxgcw",
          "status": "healthy",
          "created_at": 1750150300,
          "updated_at": 1750150335
        }
      ]
    }
  }
}
Complete operation details and schema variants

GET /api/gateway_groups/{gateway_group_id}/services/{apisix_service_id}/healthcheck

Get healthcheck status for the upstream of a service on a gateway group, if upstream_id is not provided, get healthcheck status for default upstream of this service

Retrieve upstream node health check results for a service in a gateway group. If no upstream ID is provided, the status of the service's default upstream is returned.

Required IAM Permission: Action gateway:GetPublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s

Parameters

  • gateway_group_id (path, string, required): Gateway group ID.
  • apisix_service_id (path, string, required): The unique identifier of the APISIX service.
  • upstream_id (query, string, optional): The unique identifier of the upstream.

Responses

  • 200: The response for retrieving some source's healthcheck status.
  • value (object, optional): Healthcheck status data for every node.
  • value.*.host (string, optional): Upstream host.
  • value.*.port (integer, optional): Upstream port.
  • value.*.total (integer, optional): Total number of gateway instances.
  • value.*.healthy (integer, optional): Number of gateway instances that determine the node is healthy.
  • value.*.unhealthy (integer, optional): Number of gateway instances that determine the node is unhealthy.
  • value.*.unknown (integer, optional): Number of gateway instances that did not report the check results for this node.
  • value.*.updated_at (integer, optional): The time of the node status updated at.
  • value.*.gateway_instances (array, optional): An array of gateway instance's health check count details of the node.
  • value.*.gateway_instances[].id (string, optional): Gateway instance ID.
  • value.*.gateway_instances[].hostname (string, optional): Instance hostname.
  • value.*.gateway_instances[].status (string, optional): Health status of the node.
  • value.*.gateway_instances[].created_at (integer, optional): The timestamp of the data plane’s first report of the gateway instance’s probe result regarding the node’s health status.
  • value.*.gateway_instances[].updated_at (integer, optional): The timestamp of the most recent report from the data plane on the gateway instance’s probe result for the node’s health status.
  • 400: Invalid arguments. Error details will be provided in the response.

cURL

curl -X GET '$API_BASE_URL/api/gateway_groups/{gateway_group_id}/services/{apisix_service_id}/healthcheck'