Directly Assign the Configuration Profile to the Agents
You can use this API to assign configuration profiles to Cloud Agents by specifying their host assets in the API request. You add/remove a maximum of fifty thousand assets per request.
Input ParameterInput Parameter
Use the following input parameter to specify the host assets for the Configuration Profile.
Parameter | Optional/ Mandatory | Data Type | Description |
---|---|---|---|
agentsToBeAdded | No | String | Specify the asset host ID to assign the configuration profile to the associated agents. |
agentsToBeRemoved | No | String | Specify the asset host IDs to remove the configuration profile for associated agents. |
You can not leave both the agentsToBeAdded
and agentsToBeRemoved
parameters empty. You should at least provide the values for one of these parameters.
Sample: Assign the Configuration Profile using Valid Asset IDsSample: Assign the Configuration Profile using Valid Asset IDs
The following sample illustrates assigning a configuration profile to the Cloud Agents associated with the host assets.
API Request
curl --location --request
PUT '<qualys_base_url>/caui/v1/config-profiles/direct-assign/1234567'
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <JWT_TOKEN>' \
--data '
API Request Body
{
"agentsToBeAdded": [60112345,60212345, 60312345, 604212345, 60512345, 60612345],
"agentsToBeRemoved": [60712345]
}
API Response
{
"message": "Direct assignment request is accepted, It will be processed in sometime. For confirmation please check activity logs. Please take note of below list of invalid or skipped asset id (s).",
"invalidIdList": {}
}
Sample: Assign the Configuration Profile using Invalid Asset IDsSample: Assign the Configuration Profile using Invalid Asset IDs
The following sample illustrates the assignment of a configuration profile using invalid asset IDs.
API Request
curl --location --request
PUT '<qualys_base_url>/caui/v1/config-profiles/direct-assign/1234567'
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <JWT_TOKEN>' \
--data '
API Request Body
{
"agentsToBeAdded": [1234, 5678, 9876],
"agentsToBeRemoved": [5432]
}
API Response
{
"code": 400,
"message": "Invalid Input",
"content":{
"InvalidList": {
"agentsToBeAdded": [1234, 5678, 9876],
"agentsToBeRemoved": [5432]
}
},
"timestamp": 1733564649754
}
Sample: When same Asset IDs are used to add and remove the Configuration Profile Sample: When same Asset IDs are used to add and remove the Configuration Profile
The following sample illustartes using same asset IDs for adding and removing the configuration profile. Due to contadiction in the API request, API skips the comman asset IDs specified for the agentsToBeAdded and agentsToBeRemoved parameters.
API Request
curl --location --request
PUT '<qualys_base_url>/caui/v1/config-profiles/direct-assign/1234567'
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <JWT_TOKEN>'\
--data '
API Request Body
{
"agentsToBeAdded": [60112345,60212345, 60312345, 604212345, 60512345, 60612345],
"agentsToBeRemoved": [60112345,60212345, 60312345, 604212345, 60512345, 60612345]
}
API Response
{
"code":400,
"message":"Invalid Input",
"content":{
"invalidIdList":{},
"skippedIdList":[
60112345,
60212345,
60312345,
60412345,
60512345,
60612345
]
}
}
Sample: When both valid and invalid Asset IDs are usedSample: When both valid and invalid Asset IDs are used
This sample illustrates using both the valid and invalid Asset IDs in the input payload. When you provide both valid and invalid Asset IDs in the input payload, the configuration profile is applied to assets with valid IDs and assets with invalid asset IDs are skipped.
API Request
curl --location --request
PUT '<qualys_base_url>/caui/v1/config-profiles/direct-assign/1234567'
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <JWT_TOKEN>' \
--data '
API Request Body
{
"agentsToBeAdded": [60112345,60212345, 60312345, 604212345, 60512345, 60612345, 1234, 56789],
"agentsToBeRemoved": [123]
}
API Response
{
"message": "Direct assignment request is accepted, It will be processed in sometime. For confirmation please check activity logs. Please take note of below list of invalid or skipped asset id (s).",
"invalidIdList":
{
"agentsToBeAdded": [12345, 56789]
}
}