/search/agents [GET / POST]

Search for available agents.

URL Parameters


Name Optional Valid values
start Yes Integer (search agents from a start position where last created agent is 0, the default)
limit Yes Integer (max agents to fetch in each call, default is 100)


Body Parameters


Name Optional Valid values
start No Integer (search agents from a start position where last created agent is 0, the default)
limit No Integer (max agents to fetch in each call, default is 100)
service_id Yes If service identifies is provided, the search returns all valid agents based on the service mapping.
agents Yes This key may include a json presentation of agent mapping. The search returns all valid agents based on this mapping. For example: 
 
## returns agent names like agent1, agent34 etc.
{
    "name" : "agent\d+*"
} 
 


Request Examples      

## using GET method

curl -k -u admin:admin https://OPERETOHOST/search/agents?start=0\&limit=3

    

## using POST method, useful in case of complex filters, for example:
## get all agents with property name or value "webserver"

curl -k -u admin:admin -X POST -H "Content-Type: application/json" -d '{
"start" : 0,
"limit" : 100,
"filter": {
   "generic" : "webserver"
  }
}' https://OPERETOHOST/search/agents 

  

## search by agents mapping

curl -k -u admin:admin -X POST -H "Content-Type: application/json" -d '{
"start" : 0,
"limit" : 100,
"agents": {"name":"web\\d+*"}
}' https://OPERETOHOST/search/agents

        

Response Example     

{
  "status": "success",
  "data": [
    {
      "active": true,
      "modified_date": "2015-10-31T19:04:58.208366",
      "id": "john-laptop",
      "online": true
    },
    {
      "active": true,
      "modified_date": "2015-10-31T19:04:58.208366",
      "id": "test-client-1",
      "online": true
    }
  ]
}