Back to Netdata

List rooms via Netdata Cloud

docs/netdata-ai/skills/query-netdata-cloud/query-rooms.md

2.11.02.7 KB
Original Source

List rooms via Netdata Cloud

This guide is part of the query-netdata-cloud skill. Read the SKILL.md prerequisites first.

Rooms are Cloud-only organizational units. There is no agent-side equivalent.


Endpoint

GET /api/v2/spaces/{spaceID}/rooms -- list all rooms the user can see in a space.

Use the wrapper

bash
source "$(git rev-parse --show-toplevel)/.agents/skills/query-netdata-agents/scripts/_lib.sh"
agents_load_env

# All rooms in a space.
agents_query_cloud GET "/api/v2/spaces/$SPACE/rooms"

Per-room response fields

Verified live -- response is a JSON array, each entry:

FieldDescription
idRoom UUID. Use this anywhere the API expects a room id.
slugURL-safe identifier (e.g. agent-events-r0gtre6)
nameHuman-readable name (e.g. agent-events)
descriptionFree-form description (may be null)
privatetrue if invitation-only
untouchabletrue for the auto-managed "All nodes" room (cannot be deleted)
node_countNumber of nodes assigned to this room
member_countNumber of users in this room
isMemberWhether the calling user is a member
silencing_stateNotification silencing state for the calling user
permissionsArray of permission strings the caller has on the room
createdAtRFC3339 timestamp

Common patterns

bash
# Find the room id by name.
agents_query_cloud GET "/api/v2/spaces/$SPACE/rooms" \
  | jq -r --arg NAME "agent-events" '.[] | select(.name==$NAME) | .id'

# Rooms with at least one reachable node, sorted by node count.
agents_query_cloud GET "/api/v2/spaces/$SPACE/rooms" \
  | jq -r 'sort_by(-.node_count) | .[] | select(.node_count > 0) | "\(.name)\t\(.node_count)"'

# Rooms the caller can administer.
agents_query_cloud GET "/api/v2/spaces/$SPACE/rooms" \
  | jq -r '.[] | select(.permissions | index("room:Delete")) | .name'

Limits and gotchas

  • The "All nodes" room is special. It auto-includes every node in the space and cannot be deleted. Filter on untouchable=true if you need it specifically.
  • node_count and member_count are server-side counts -- no need to fetch nodes/members just to get the totals.
  • Permissions vary per user. The same room returns different permissions[] arrays depending on the caller's role; another user may see fewer permissions.

See also