Activate a Single Agent

[POST] /qps/rest/2.0/activate/am/asset/<id>?module=<value1>,<value2>

Activate a single cloud agent for one or more modules (i.e. VM, PC, FIM, EDR, SCA, CAPS, SwCA).

Where “id” (Required) is the asset ID of the agent you want to activate. This is the agent ID where the agent is installed. We have added support for new Qualys application — Mitigation. 

“module” (Required) is the module to be activated for the agent: AGENT_VM (for VM module), AGENT_PC (for PC module), AGENT_FIM (for FIM module), AGENT_EDR (for EDR module), AGENT_SCA (for SCA module), AGENT_CAPS (for Cloud Agent as Passive Sensor module), AGENT_SwCA (for Software Composition Analysis module), AGENT_MTG (for Mitigation module). Specified module must be enabled in the user’s subscription. You can specify more than one module separated by a comma. For example, module = AGENT_VM, AGENT_PC, AGENT_FIM, AGENT_EDR, AGENT_SCA, AGENT_CAPS, AGENT_SwCA, AGENT_MTG.

Permissions required - Managers with full scope. Other users must have these permissions: Access Permission “API Access” and CA Agent Permission “Activate Agent".

Input ParametersInput Parameters

There are no input parameters.

Sample - Activate single agent for VM and MTG moduleSample - Activate single agent for VM and MTG module

API request

curl -u fo_username:password -X POST -H "Content-Type: text/xml" -H "X-Requested-With: curl" --data-binary @single_activation.xml "<qualys_base_url>/qps/rest/2.0/activate/am/asset/5808297?module=AGENT_VM, AGENT_MTG"
Note: “file.xml” contains the request POST data.
    

Contents of single_activation.xml

<?xml version="1.0" encoding="UTF-8" ?>
<ServiceRequest></ServiceRequest>      
    

Response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/2.0/am/asset.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <Asset>
            <id>5808297</id>
            <name>qubu1404spp4</name>
            <created>2024-09-22T11:45:38Z</created>
            <modified>2024-10-21T21:14:26Z</modified>
            <type>HOST</type>
            <tags>
                <list>
                    <TagSimple>
                        <id>1835835</id>
                        <name>Tag name 1</name>
                    </TagSimple>
                    <TagSimple>
                        <id>2327817</id>
                        <name>Tag name 2</name>
                    </TagSimple>
                    <TagSimple>
                        <id>1828415</id>
                        <name>Cloud Agent</name>
                    </TagSimple>
                    <TagSimple>
                        <id>2079439</id>
                        <name>Tag name 3</name>
                    </TagSimple>
                    <TagSimple>
                        <id>1855817</id>
                        <name>Tag name 4</name>
                    </TagSimple>
                </list>
            </tags>
            <sourceInfo>
                <list>
                    <AssetSource/>
                </list>
            </sourceInfo>
        </Asset>
    </data>
</ServiceResponse>      
    

Sample - Error while activating SCA for a Cloud Agent where PC is ActivatedSample - Error while activating SCA for a Cloud Agent where PC is Activated

API request

curl -u fo_username:password -X POST -H "Content-Type: text/xml" -H 
"X-Requested-With: curl" --data-binary @single_activation.xml 
"<qualys_base_url>/qps/rest/2.0/activate/am/asset/23058587?module=AGENT_SCA"       
    

Contents of single_activation.xml

<?xml version="1.0" encoding="UTF-8" ?> <ServiceRequest> 
</ServiceRequest>        
    

 Response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/2.0/am/asset.xsd">
		<responseCode>OTHER_ERROR</responseCode>
		<responseErrorDetails>
			<errorMessage>Error activating agent(s)</errorMessage>
			<errorResolution>There was an error activating 
agent(s). Error: PC is already activated on selected agent.</errorResolution>
		</responseErrorDetails>
	</ServiceResponse>        
    

XSD

<platform API server>/qps/xsd/2.0/am/asset.xsd