List Namespaces
Retrieve a list of Kubernetes namespaces within a specified time range.
Last updated
curl 'https://api.groundcover.com/api/k8s/v2/namespaces/list' \
-H 'accept: application/json' \
-H 'authorization: Bearer <YOUR_API_KEY>' \
-H 'content-type: application/json' \
-H 'X-Backend-Id: <YOUR_BACKEND_ID>' \
--data-raw '{"sources":[],"start":"2025-01-24T06:00:00.000Z","end":"2025-01-24T08:00:00.000Z"}'{
"namespaces": [
"groundcover",
"monitoring",
"kube-system",
"default"
]
}# Get current time and subtract 24 hours for start time
start_time=$(date -u -v-24H '+%Y-%m-%dT%H:%M:%S.000Z')
end_time=$(date -u '+%Y-%m-%dT%H:%M:%S.000Z')
curl 'https://api.groundcover.com/api/k8s/v2/namespaces/list' \
-H 'accept: application/json' \
-H 'authorization: Bearer <YOUR_API_KEY>' \
-H 'content-type: application/json' \
-H 'X-Backend-Id: <YOUR_BACKEND_ID>' \
--data-raw "{\"sources\":[],\"start\":\"$start_time\",\"end\":\"$end_time\"}"