Fetch Associations for an Image

Shows associations of an image.

GET/v1.3/images/{imageSha}/association

Input ParametersInput Parameters

Parameter

Mandatory/Optional

Data Type

Description

imageSha

Mandatory

string

Specify the SHA value of a specific image in the user’s scope.

filter

Optional

string

Filter the images 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.

type

Optional

string

Specify the type of information to be fetched: Container, Host, Drift, All.

SampleSample

API request

    curl -X GET 
"<qualys_base_url>/csapi/v1.3/images/{imageId}/association?imageId=5d556c82899c&type=ALL" 
--header "Authorization: Bearer <token>"

Response

    {
    "containers": [],
    "driftContainers": [],
    "hosts": [
        {
            "sensorUuid": "2a9726f2-69d1-4255-b6ba-2f4d0c7bb596",
            "hostname": "qualys-virtual-machine",
            "ipAddress": "11.111.11.11",
            "uuid": null,
            "runningContainerCount": null,
            "stoppedContainerCount": null,
            "createdContainerCount": null,
            "pausedContainerCount": null,
            "runningContainerCountForAssociatedImage": null,
            "stoppedContainerCountForAssociatedImage": null,
            "createdContainerCountForAssociatedImage": null,
            "pausedContainerCountForAssociatedImage": null
        }
    ]
}
    

Error Response

The following error response is seen when the sub-users don't have permission to the specified image.

    {  
    "errorCode": "403 FORBIDDEN",  
    "message": "Request Forbidden",  
    "timestamp": 1700721586546
    }