Skip to main content Skip to content

Resources

Cloud infrastructure components discovered across connected cloud accounts. Statuses, Kubernetes workload discovery, list and refresh APIs, filters, and the resource object schema.

8 min read Last updated: 

Resources are cloud infrastructure components (VMs, databases, clusters, etc.) discovered across your connected cloud accounts.

Overview

When you connect a cloud account, ZopNight’s discoverer service scans for resources across all enabled regions. Each resource is classified by type, tagged as schedulable or inventory-only, and stored with its cloud metadata.

Resource Statuses

StatusDescription
runningResource is active and running
stoppedResource has been stopped
startingResource is transitioning to running state
stoppingResource is transitioning to stopped state
pendingResource state is being determined

Kubernetes workload discovery

ZopNight discovers what runs inside your clusters, not just the cluster nodes. EKS, GKE, and AKS expose a uniform set of workload children, listed alongside compute and network resources for inventory. Workloads are not scheduled one by one: Kubernetes start/stop is done per namespace (eks-namespace, gke-namespace, aks-namespace).

CategoryResource types
Workloadsdeployment, statefulset, daemonset, job, cronjob, replicaset
Services & networkingservice, ingress, networkpolicy
Configurationconfigmap, secret, serviceaccount
Storagepersistentvolume, persistentvolumeclaim, storageclass
Autoscalinghorizontalpodautoscaler, verticalpodautoscaler
Clusternamespace, node, pod, role, rolebinding, clusterrole, clusterrolebinding

Cluster types (eks-cluster, gke-cluster, aks-cluster) gain a detail page that lists workloads, breaks down nodes, filters by namespace, and renders pod- and workload-level CPU/memory metrics from the cluster’s metrics backend.

List Resources

GET /resources

List all discovered resources with filtering and pagination.

Query Parameters

ParameterTypeDescription
searchstringSearch by resource name or UID
typestringFilter by resource type (e.g., ec2 with provider=aws, compute with provider=gcp)
providerstringFilter by cloud provider (aws, gcp, azure)
statusstringFilter by status (running, stopped, etc.)
regionstringFilter by cloud region
schedulablebooleanFilter by schedulable capability
pageintegerPage number (default: 1)
limitintegerItems per page (default: 20)
sort_bystringSort field (name, type, status, provider)
sort_orderstringasc or desc
Example
curl "https://api.zop.dev/resources?provider=aws&type=ec2&status=running&limit=10" \
-H "Authorization: Bearer <token>"
Response
{
"data": {
"items": [
{
"id": "0b7d5c3e-2f1a-4e9b-8c6d-5a4b3c2d1e0f",
"orgId": "3f6c2a9e-8b1d-4c7e-9f2a-1d5e6b7c8a90",
"name": "web-server-prod",
"uid": "i-0abc123def456",
"type": "ec2",
"instanceType": "t3.medium",
"region": "us-east-1",
"status": "running",
"cloudAccountId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"provider": "aws",
"childCount": 0,
"schedulable": true,
"scalable": false,
"tags": {
"Environment": "production",
"Team": "platform"
},
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-20T08:00:00Z"
}
],
"total": 1,
"hasMore": false,
"page": 1,
"limit": 10
}
}

The list is paginated. Keep requesting the next page until hasMore is false; limit is capped at 1000.

Get Resource

GET /resources/{resourceID}

Get detailed information about a specific resource.

Get Resources by IDs

GET /resources/by-ids

Fetch multiple resources by their IDs in a single request.

Example
curl "https://api.zop.dev/resources/by-ids?ids=0b7d5c3e-2f1a-4e9b-8c6d-5a4b3c2d1e0f,6a5b4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d" \
-H "Authorization: Bearer <token>"

Get Resources by UIDs

Look up resources by their cloud-native UIDs (e.g., AWS instance IDs, GCP self-link paths, Azure resource IDs). Useful when you have UIDs from cost data, recommendations, or topology and need the corresponding ZopNight resource records.

GET /resources/by-uids

Fetch resources by cloud UIDs (query string).

Example
curl "https://api.zop.dev/resources/by-uids?uids=i-0abc,i-0def" \
-H "Authorization: Bearer <token>"
POST /resources/by-uids

Fetch resources by cloud UIDs (large lists in JSON body).

Request
curl -X POST https://api.zop.dev/resources/by-uids \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{ "uids": ["i-0abc", "i-0def", "vm-prod-1"] }'

Count Resources

GET /resources/count

Total resource count for the org. Accepts the same filters as the list endpoint.

Discovery Summary

GET /resources/discovery-summary

Discovery rollup: refresh status, resource count, discovered types and regions. Used during onboarding.

Response
{
"data": {
"status": "completed",
"count": 1284,
"types": ["ec2", "rds", "eks-cluster"],
"regions": ["us-east-1", "us-west-2"],
"hasCompletedFullScan": true,
"startedAt": "2026-04-29T05:00:00Z",
"completedAt": "2026-04-29T05:02:10Z"
}
}

Access Check

GET /resources/{id}/access

Check whether the stored cloud credentials can access a managed Kubernetes cluster. Returns the IAM access verdict and, for EKS, the network-reachability verdict (so a private or IP-restricted control plane surfaces the IPs to allowlist).

Response
{
"data": {
"accessible": true,
"principal": "arn:aws:iam::123456789012:role/zopnight-cluster-reader",
"network": {
"reachable": false,
"reason": "ip_not_allowlisted",
"publicAccess": true,
"ourIps": [
"34.29.167.157/32",
"203.0.113.9/32"
]
}
}
}

network.reason is one of private (public access is disabled), ip_not_allowlisted (the endpoint’s allowlist is missing one of our IPs), or egress_config_error (our own egress configuration is incomplete, so we could not evaluate reachability; nothing for you to fix). It is absent when reachable.

The response also carries a deprecated ourIp string holding the first entry of ourIps. Do not rely on it; read ourIps.

Last Synced At

GET /resources/last-synced

Returns the most recent successful discovery timestamp for the org. Used by the sync status banner.

Response
{
"data": {
"lastSyncedAt": "2026-04-29T05:00:00Z"
}
}

Get Filter Fields

GET /resources/filter-fields

Get available filter options (distinct providers, cloud accounts, types, regions, statuses) for building filter UIs.

Response
{
"data": {
"providers": ["aws", "gcp", "azure"],
"cloudAccounts": [ ... ],
"types": [
"ec2", "rds", "eks-cluster", "eks-nodegroup",
"eks-deployment", "eks-statefulset", "eks-cronjob",
"compute", "cloudsql", "gke-cluster", "gke-nodepool",
"vm", "aks-cluster", "aks-agentpool",
"databricks", "databricks-cluster",
"databricks-pool", "databricks-sqlwarehouse"
],
"regions": ["us-east-1", "us-west-2", "europe-west1"],
"statuses": ["running", "stopped"]
}
}

Refresh Discovery

Trigger an on-demand resource discovery scan for a specific cloud account. Discovery runs across all enabled regions and updates the resource inventory.

POST /resources/refresh

Trigger a resource discovery refresh.

Request
curl -X POST https://api.zop.dev/resources/refresh \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"cloudAccountId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"provider": "aws"
}'
Response
{
"data": {
"refreshId": "c3d2e1f0-9a8b-4c7d-8e6f-5a4b3c2d1e0f",
"status": "queued"
}
}

Refresh Status

GET /resources/refresh/status

Check the status of a discovery refresh. Pass the refreshId returned by the refresh call.

Request
curl "https://api.zop.dev/resources/refresh/status?refreshId=c3d2e1f0-9a8b-4c7d-8e6f-5a4b3c2d1e0f" \
-H "Authorization: Bearer <token>"
Response
{
"data": {
"id": "c3d2e1f0-9a8b-4c7d-8e6f-5a4b3c2d1e0f",
"status": "completed",
"discovered": 47,
"startedAt": "2025-01-20T08:00:00Z",
"completedAt": "2025-01-20T08:02:15Z"
}
}

In progress: running, or canceling (a stop has been requested and the scan finishes its current provider first). Keep polling through both.

Finished: completed, partial (some accounts failed), failed, cancelled, skipped (every account was already being discovered), or idle: no refresh has run for this organisation, or its status has expired, since entries are kept for one hour.

Resource Object

FieldTypeDescription
idstringUnique resource ID
orgIdstringOrganization ID
namestringResource display name
uidstringCloud provider native resource identifier
typestringResource type, without a provider prefix (e.g., ec2, compute, vm)
instanceTypestringInstance size/type (e.g., t3.medium)
sizeGbnumber?Storage size in GB (storage resources)
unitCountinteger?Container/unit count (containerized resources)
regionstringCloud region
statusstringCurrent status (running, stopped, etc.)
cloudAccountIdstringConnected cloud account ID
providerstringCloud provider (aws, gcp, azure)
parentUidstringParent resource UID (e.g., cluster for a node)
childCountintegerNumber of child resources
schedulablebooleanWhether the resource supports start/stop scheduling
scalablebooleanWhether the resource can be scaled
metadataobjectProvider-specific details
tagsobjectCloud provider tags as key-value pairs
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last update timestamp

See Cloud Support Matrix for the full list of supported resource types per cloud provider.

Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console· Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console·