Fetch a List of Namespaces
Provides a list of Namespaces present in your account.
Input ParametersInput Parameters
|
Parameter |
Mandatory/Optional |
Data Type |
Description |
|---|---|---|---|
| query | Optional | string/integer/boolean | Filter the namespace list by providing a query using Qualys syntax. |
| pageNumber | Mandatory | integer | Specify the number of pages to be displayed. Valid values: 1, or 2, or 3, or...n Default value: 1 |
| pageSize | Mandatory | integer | Specify the number of entries to be displayed on a page. Default value: 50 |
| sort | Optional | string/integer | Specify the Qualys token value to sort the response. Valid value: created:desc |
Sample: Fetch a List of Namespaces in your accountSample: Fetch a List of Namespaces in your account
API request
curl -X GET
"<qualys_base_url>/csapi/v1.3/k8sResource/namespace?query=name%3A%20%22test%22&pageNumber=1&pageSize=50&sort=updatedAt%3Adesc"
"Authorization: Bearer <token>"
Response JSON
{
"data": [
{
"uuid": "6020b72f-4682-43fa-a803-3b1cd9197531",
"clusterUid": "0db3cf6d-4318-4c32-9d71-b6cbe8954055",
"sensorUuid": "b3ba7b8c-2eac-2c50-1ca5-533471e78e75",
"name": "test",
"labels": [
"kubernetes.io/metadata.name:test"
],
"annotations": null,
"updatedAt": "1748500804671",
"deletedAt": null,
"resourceVersion": 2422633,
"createdAt": "1745909358000",
"status": "ACTIVE"
},
{
"uuid": "9e0dd692-a7f1-44d0-b7f9-417b2162000f",
"clusterUid": "0db3cf6d-4318-4c32-9d71-b6cbe8954055",
"sensorUuid": "b3ba7b8c-2eac-2c50-1ca5-533471e78e75",
"name": "test-ksp",
"labels": [
"pod-security.kubernetes.io/audit:restricted",
"kubernetes.io/metadata.name:test-ksp",
"pod-security.kubernetes.io/enforce:restricted",
"pod-security.kubernetes.io/warn:restricted"
],
"annotations": null,
"updatedAt": "1748500804719",
"deletedAt": null,
"resourceVersion": 2925515,
"createdAt": "1747041578000",
"status": "ACTIVE"
},
{
"uuid": "3246750d-3783-446e-96fa-8e29f80c4eba",
"clusterUid": "0db3cf6d-4318-4c32-9d71-b6cbe8954055",
"sensorUuid": "b3ba7b8c-2eac-2c50-1ca5-533471e78e75",
"name": "testing-tom-nginx",
"labels": [
"kubernetes.io/metadata.name:testing-tom-nginx"
],
"annotations": null,
"updatedAt": "1748500804748",
"deletedAt": null,
"resourceVersion": 2183154,
"createdAt": "1745491782000",
"status": "ACTIVE"
}
],
"count": 3,
"groups": {},
"aggs": null
}