API7 Docs

Count the number of gateway instances by status in a gateway group

GET /api/instances/count/{field}

GET /api/instances/count/{field}

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Path Parameters

field*"status"

Field to count by.

Value in

  • "status"

Query Parameters

gateway_group_id*string

Gateway group ID. Optional when using the gateway group admin key to authenticate.

Length1 <= length
search?string

Condition to search resources by.

Response Body

application/json

application/json

curl -X GET "$API_BASE_URL/api/instances/count/status?gateway_group_id=86fb9981-d9d2-4555-9df8-91ae92129335&search=version%253Dv2"

Successfully retrieved the gateway instance count grouped by health status.

{
  "value": [
    {
      "key": "Healthy",
      "count": 1
    }
  ]
}
Complete operation details and schema variants

GET /api/instances/count/{field}

Count the number of gateway instances by status in a gateway group

IAM Action: gateway:GetGatewayInstance, Resource: arn:api7:gateway:gatewaygroup/%s

Parameters

  • gateway_group_id (query, string, required): Gateway group ID. Optional when using the gateway group admin key to authenticate.
  • search (query, string, optional): Condition to search resources by.
  • field (path, string, required): Field to count by.

Responses

  • 200: Successfully retrieved the gateway instance count grouped by health status.
  • allOf variant 1
  • value (object, optional): The specific resource.
  • allOf variant 2
  • value (array, optional): An array of gateway instance count status.
  • value[].key (string, optional): Gateway status.
  • value[].count (integer, optional): The number of instances.
  • 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/api/instances/count/{field}'