Fetch a Detailed Containers List

Returns a response with a given number of container records according to the filter.

GET/v1.3/containers/list

When you make your API request, you’ll use the “limit” input parameter to specify the number of records to return. For example, you can choose to return details for 10 containers at a time by specifying limit=10. The Response Header will include a unique link that you can specify in the next API request to get the next set of results. i.e. the next 10 containers. Take the link as is for the new request; no additional parameters are needed. When there are no more records to return, the Response Header will show a value of “null” for the link.

The details shown for each container in the list response will be the same as if you were fetching a single container, except that the “vulnerabilities” section of the response will only show qid, result, and software.

Input ParametersInput Parameters

Parameter

Mandatory/Optional

Data Type

Description

limit

Optional

integer

Specify the number of records to include in the response.

Enter a value from 1 to 250.

filter

Optional

string

Filter the containers list by providing a query using Qualys syntax.

Refer to the “How to Search” topic in the online help for assistance with creating your query.

Sample 1: List containers with a limit of 2 recordsSample 1: List containers with a limit of 2 records

API request

    curl -X GET 
"<qualys_base_url>/csapi/v1.3/containers/list?limit=2" 
--header "Authorization: Bearer <token>"
    

Response Headers

    {
    "content-type": "application/json;charset=UTF-8",
    "date": "Wed, 26 Aug 2020 07:56:59 GMT",
    "link": "<http://qualysapi.qualys.com/csapi/v1.3/containers/list?limit=2&paginationQuery=updated%3E%3D1594876830694+AND+not+uuid%3A+%5B65eff01b-7775-3a0a-bd68-e6da1e7a39f5%5D>;rel=next",
    "referrer-policy": "same-origin",
    "server": "Qualys",
    "transfer-encoding": "chunked",
    "x-content-type-options": "nosniff",
    "x-frame-options": "sameorigin",
    "x-permitted-cross-domain-policies": "none",
    "x-powered-by": "Qualys",
    "x-xss-protection": "1; mode=block"
}
    

Response JSON

    {
    "data": [
        {
            "portMapping": null,
            "imageId": "3aabd9e6d667",
            "created": "1593759719000",
            "updated": "1594876830316",
            "label": null,
            "uuid": "cdb22685-9fbb-3971-90aa-706086a64079",
            "sha": "a249ee950e639492563f2dd7caa231adc5fc3fe5714f1d82a23cc2f8bbcda22f",
            "privileged": false,
            "path": "/bin/sh",
            "imageSha": "3abcd9e6d6670283b5e2df06bb77354b379b17ac7b940e8ea9edb202d423af13",
            "macAddress": "",
            "customerUuid": "a1d17d52-03fb-c803-83a6-1048acccaca9",
            "ipv4": null,
            "ipv6": null,
            "name": "container-1",
            "host": {
                "sensorUuid": "213d6f22-f8cc-42ad-814a-49b4b5c38d64",
                "hostname": "cloudagent",
                "ipAddress": "10.11.12.13",
                "uuid": "52d08bfe-2799-4f5c-81fb-8c0950d80f5e",
                "lastUpdated": null
            },
            "state": "DELETED",
            "imageUuid": "e2c22565-d1d9-3f9c-ac83-ad9b09f110ef",
            "containerId": "a978ee930e63",
            "stateChanged": "1593759720784",
            "services": null,
            "users": null,
            "operatingSystem": null,
            "lastVmScanDate": "1593759720784",
            "source": "GENERAL",
            "isInstrumented": null,
            "exceptions": null,
            "environment": [
                "VAULT_VERSION=0.9.3",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "arguments": [
                "-c",
                "sed -i 's/\\r//g' /usr/local/bin/init.sh"
            ],
            "command": "/bin/sh -c sed -i 's/\\r//g' /usr/local/bin/init.sh",
            "drift": null,
            "vulnerabilities": null,
            "softwares": null,
            "isDrift": null,
            "isRoot": true
        },
        {
            "portMapping": null,
            "imageId": "dd2f1712bc5a",
            "created": "1593759720000",
            "updated": "1594876830694",
            "label": null,
            "uuid": "62eff01b-7775-4a0a-bd68-e6db1e7a39f5",
            "sha": "c0db6c214c3ec6cd6620ad07e4e06da540c50c3c0c1372f84116dbe8aa03dd8d",
            "privileged": false,
            "path": "/bin/sh",
            "imageSha": "dd6d1713ac6a55dffe5faff50e7408f51f8f11081f7c4c43e8e84697becfa38b",
            "macAddress": "",
            "customerUuid": "a1d17f51-05fb-c803-84a6-1048acccaca9",
            "ipv4": null,
            "ipv6": null,
            "name": "container-2",
            "host": {
                "sensorUuid": "213d6f22-f8cc-43bd-814a-49b4d5c38e64",
                "hostname": "cloudagent",
                "ipAddress": "10.11.12.13",
                "uuid": "53d08bfe-2899-4f5c-81fa-8c0950d80f5e",
                "lastUpdated": null
            },
            "state": "DELETED",
            "imageUuid": "ca5f92da-7785-344b-8681-8c64f30a043b",
            "containerId": "c0da6c314c2e",
            "stateChanged": "1593759721924",
            "services": null,
            "users": null,
            "operatingSystem": null,
            "lastVmScanDate": "1593759721924",
            "source": "GENERAL",
            "isInstrumented": null,
            "exceptions": null,
            "environment": [
                "VAULT_VERSION=0.9.3",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "arguments": [
                "-c",
                "sed -i 's/\\r//g' /usr/local/bin/docker-entrypoint.sh"
            ],
            "command": "/bin/sh -c sed -i 's/\\r//g' /usr/local/bin/docker-entrypoint.sh",
            "drift": null,
            "vulnerabilities": null,
            "softwares": null,
            "isDrift": null,
            "isRoot": true,
            "cluster": {
                "type": "kubernetes",
                "version": "v1.1.1",
                "project": "k8s-project",
                "node": {
                    "name": "k8s-node",
                    "isMaster": true
                },
                "pod": {
                    "name": "pod-name",
                    "uuid": "6325d4f-bf0c-3488-8144-89c7d03dfacf",
                    "namespace": "cs",
                    "label": [
                        {
                            "key": "com.docker.compose.container-number",
                            "value": "1"
                        },
                        {
                            "key": "com.docker.compose.service",
                            "value": "lb"
                        }
                    ]
   
                      "controllers": [
                        {
                            "uuid": "a3145d4f-bf0c-3488-8144-89c7d03dfacf",
                            "name": "deployment-name",
                            "type": "DEPLOYMENT"
                        },
                        {
                            "uuid": "b3145d4f-bf0c-3488-8144-89c7d03dfacf",
                            "name": "replicaset-name",
                            "type": "REPLICASET"
                        }
                    ]
                }
            }
        }
    ],
    "limit": 2
}
    

Sample 2: Get the next set of results for containers listSample 2: Get the next set of results for containers list

In this example, the link from the Response Header from the previous API request is specified as part of the new request in order to get the next set of results. The response will be similar to the previous example.

API request

    curl -X GET 
"<qualys_base_url>/csapi/v1.3/containers/list?limit=2&paginationQuery=updated%3E%3D1594876830694+AND+not+uuid%3A+%5B65eff01b-7775-3a0a-bd68-e6da1e7a39f5%5D" --header "Authorization: Bearer <token>"
    

Sample 3: Response with no linkSample 3: Response with no link

Here’s a sample response where there are no more records to return after this, so there is no link provided in the Response Header section. You’ll see a value of “null” for the link.

Response Headers

    {
    "content-type": "application/json;charset=UTF-8",
    "date": "Wed, 26 Aug 2020 07:56:59 GMT",
    "link": "null",
    "referrer-policy": "same-origin",
    "server": "Qualys",
    "transfer-encoding": "chunked",
    "x-content-type-options": "nosniff",
    "x-frame-options": "sameorigin",
    "x-permitted-cross-domain-policies": "none",
    "x-powered-by": "Qualys",
    "x-xss-protection": "1; mode=block"
}