Enabling or disabling Agents with a REST API


Use this endpoint to enable or disable Agents. Agents can be of two types – Collection Stations and Collection Agents. For more information, see Agent-types.

Notes

  • Before running this endpoint, you need to generate an authorization token by running the login endpoint. This token is used to authenticate a user into the product. You need to pass this token in the header each time you want to run the endpoint.
  • To log out from a given session, you need to run the logout endpoint.

For more information, see Developing.

This topic contains the following information:

Endpoint overview

Use the PUT method to enable or disable one or more Agents. By enabling an Agent, you enable the Agent to collect data. Conversely, by disabling an Agent, you stop the Agent from collecting data.

Note

When you disable an Agent that is associated with multiple hosts, data collection from all those hosts is automatically stopped.

Request URL

PUT <protocol>://<host>:<port>/olaengine/itdaws/hostservices/agents/<action>?agent=<agentNames>&version=<apiVersion>

Parameter definitions

The following parameters can be used in the request URL.

Examples

The following examples illustrate the inputs for enabling or disabling Agents by using the PUT method.

Example 1: Enable a single Agent

The following example illustrates the input and response for enabling an Agent by specifying the Agent name, "Agent1.bmc.com".

Request URL

PUT http://localhost:9797/olaengine/itdaws/hostservices/agents/enable?agent=Agent1.bmc.com

Response
{
   "statusCode": "200",
   "statusMessage": "OK",
   "agents": [{
       "agent": {
           "agentName": "Agent1.bmc.com"
        }
    }]
}

Example 2: Enable multiple Agents

The following example illustrates the input and response for enabling multiple Agents by specifying the following Agent names:

  • Collection-station_hou1
  • Collection-agent_hou2

Request URL

PUT http://localhost:9797/olaengine/itdaws/hostservices/agents/enable?agent=Collection-station_hou1,Collection-agent_hou2

Response
{
   "statusCode": "200",
   "statusMessage": "OK",
   "agents": [{
       "agent": {
           "agentName": "Collection-station_hou1"
           "agentName": "Collection-agent_hou2"
        }
    }]
}

Example 3: Disable a single Agent

The following example illustrates the input and response for disabling an Agent by specifying the Agent name, "collection-station_hou.bmc.com".

Request URL

PUT http://localhost:9797/olaengine/itdaws/hostservices/agents/disable?agent=collection-station_hou.bmc.com

Response
{
   "statusCode": "200",
   "statusMessage": "OK",
   "agents": [{
       "agent": {
           "agentId": "collection-station_hou.bmc.com"
        }
    }]
}

Response elements

The following sections help you understand the response elements:

Element definitions

Successful response sample

See examples.

Unsuccessful response sample

{
   "statusCode": "400",
   "statusMessage": "Bad Request",
   "agents": [{
       "messages": [{
           "severity": "Error",
           "code": "update.agent.invalid.id",
           "text": "Agent with id provided=clm-hou-agent, doesnt exist."
        }]
    }]
}

HTTP status codes

The following table describes the status codes that are likely to appear while working with this endpoint.


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*