API7 Docs

Count resources by type in each gateway group

GET /api/gateway_groups/count/{resource_type}

GET /api/gateway_groups/count/{resource_type}

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Path Parameters

resource_type*string

Resource type.

Value in

  • "ssl"
  • "consumer"
  • "gateway_instance"

Response Body

application/json

curl -X GET "$API_BASE_URL/api/gateway_groups/count/ssl"

Successfully retrieved the resource count per gateway group.

{
  "total": 1,
  "list": [
    {
      "id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
      "type": "api7_gateway",
      "environment": "production",
      "name": "us-west-rsc",
      "description": "Gateway group description.",
      "labels": {
        "version": "v2",
        "env": "prod"
      },
      "created_at": 1742288232,
      "updated_at": 1742288235,
      "config": {
        "control_plane_key_prefix": "/gateway_groups/us-west-1",
        "control_plane_user": "etcd_user",
        "control_plane_password": "safe_password",
        "image_tag": "latest"
      },
      "count": 0
    }
  ]
}
Complete operation details and schema variants

GET /api/gateway_groups/count/{resource_type}

Count resources by type in each gateway group

Parameters

  • resource_type (path, string, required): Resource type.

Responses

  • 200: Successfully retrieved the resource count per gateway group.
  • allOf variant 1
  • list (array, optional): An array of resources.
  • total (integer, optional): Total number of objects.
  • allOf variant 2
  • list (array, optional):
  • allOf variant 1
  • list[].id (string, optional): The object ID.
  • list[].type (string, optional):
  • list[].environment (string, optional): Which license DP core allowance the gateway group's data plane instances draw from:
  • production: counted against max_dp_cores.
  • non_production: counted against max_non_production_dp_cores.

The two allowances are metered and restricted independently, so a gateway group used for staging or testing does not consume production cores. Creating a gateway group without this field puts it on the production allowance; updating one without it leaves the allowance unchanged.

  • list[].name (string, optional): The object name.
  • list[].description (string, optional): Gateway group description.
  • list[].labels (object, optional): Key-value pairs of labels.
  • list[].created_at (integer, optional): The object created timestamp.
  • list[].updated_at (integer, optional): The object updated timestamp.
  • list[].config (object, optional): Control plane details.
  • list[].config.control_plane_key_prefix (string, optional): The prefix of the key in the control plane (etcd). The pattern is /gateway_groups/{gateway_group_id}.
  • list[].config.control_plane_user (string, optional): The etcd user.
  • list[].config.control_plane_password (string, optional): The etcd password.
  • list[].config.image_tag (string, optional): The API7 gateway version.
  • allOf variant 2
  • list[].count (integer, optional): The number of resources.

cURL

curl -X GET '$API_BASE_URL/api/gateway_groups/count/{resource_type}'