Package org.opennms.smoketest.utils
Class RestClient
- java.lang.Object
-
- org.opennms.smoketest.utils.RestClient
-
public class RestClient extends Object
-
-
Constructor Summary
Constructors Constructor Description RestClient(InetSocketAddress addr)
RestClient(InetSocketAddress addr, String username, String password)
RestClient(URL url)
RestClient(URL url, String username, String password)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCategory(String categoryName)
void
addCategoryToNode(String nodeCriteria, String categoryName)
javax.ws.rs.core.Response
addInterface(String nodeCriteria, OnmsIpInterface ipInterface)
javax.ws.rs.core.Response
addMinion(OnmsMinion minion)
javax.ws.rs.core.Response
addNode(OnmsNode onmsNode)
void
addOrReplaceRequisition(Requisition requisition)
javax.ws.rs.core.Response
addService(String nodeCriteria, String ipAddress, OnmsMonitoredService service)
void
deleteGraphML(String graphName)
javax.ws.rs.core.Response
deleteInterface(String nodeCriteria, String ipAddress)
javax.ws.rs.core.Response
deleteMinion(String id)
javax.ws.rs.core.Response
deleteNode(String nodeCriteria)
javax.ws.rs.core.Response
deleteService(String nodeCriteria, String ipAddress, String service)
static RestClient
forLocalhost()
Create a REST client that connects to http://localhost:8980/ with the default credentials.OnmsAlarmCollection
getAlarmsByEventUei(String eventUei)
OnmsAlarmCollection
getAlarmsForNode(int nodeId)
List<OnmsEvent>
getAllEvents()
List<OnmsMinion>
getAllMinions()
List<OnmsApplication>
getApplications()
String
getDisplayVersion()
List<OnmsEvent>
getEvents()
OnmsEventCollection
getEventsForNode(int nodeId)
OnmsEventCollection
getEventsForNodeByEventUei(int nodeId, String eventUei)
Long
getFlowCount(long start, long end)
javax.ws.rs.core.Response
getGraphML(String graphName)
OnmsIpInterface
getInterface(String nodeCriteria, String ipAddress)
QueryResponse
getMeasurements(QueryRequest request)
OnmsMinion
getMinion(String id)
OnmsNode
getNode(String nodeCriteria)
List<OnmsNode>
getNodes()
ResourceDTO
getResourcesForNode(String nodeCriteria)
javax.ws.rs.core.Response
getResponseForInterface(String nodeCriteria, String ipAddress)
javax.ws.rs.core.Response
getResponseForNode(String nodeCriteria)
javax.ws.rs.core.Response
getResponseForService(String nodeCriteria, String ipAddress, String service)
OnmsMonitoredService
getService(String nodeCriteria, String ipAddress, String service)
List<OnmsMonitoredService>
getServicesForANode(String nodeCriteria, String ipAddress)
void
importRequisition(String foreignSource)
void
resetGeocoderConfiguration()
void
sendEvent(Event event)
void
sendEvent(Event event, boolean clearDates)
void
sendGraphML(String graphName, InputStream graphMLStream)
-
-
-
Constructor Detail
-
RestClient
public RestClient(InetSocketAddress addr)
-
RestClient
public RestClient(URL url)
-
RestClient
public RestClient(InetSocketAddress addr, String username, String password)
-
-
Method Detail
-
forLocalhost
public static RestClient forLocalhost()
Create a REST client that connects to http://localhost:8980/ with the default credentials. Used for testing.- Returns:
- a new REST client for OpenNMS on the localhost
-
getDisplayVersion
public String getDisplayVersion()
-
addOrReplaceRequisition
public void addOrReplaceRequisition(Requisition requisition)
-
importRequisition
public void importRequisition(String foreignSource)
-
getServicesForANode
public List<OnmsMonitoredService> getServicesForANode(String nodeCriteria, String ipAddress)
-
getMeasurements
public QueryResponse getMeasurements(QueryRequest request)
-
getResponseForNode
public javax.ws.rs.core.Response getResponseForNode(String nodeCriteria)
-
addNode
public javax.ws.rs.core.Response addNode(OnmsNode onmsNode)
-
addInterface
public javax.ws.rs.core.Response addInterface(String nodeCriteria, OnmsIpInterface ipInterface)
-
deleteInterface
public javax.ws.rs.core.Response deleteInterface(String nodeCriteria, String ipAddress)
-
addService
public javax.ws.rs.core.Response addService(String nodeCriteria, String ipAddress, OnmsMonitoredService service)
-
getService
public OnmsMonitoredService getService(String nodeCriteria, String ipAddress, String service)
-
getResponseForService
public javax.ws.rs.core.Response getResponseForService(String nodeCriteria, String ipAddress, String service)
-
deleteNode
public javax.ws.rs.core.Response deleteNode(String nodeCriteria)
-
deleteService
public javax.ws.rs.core.Response deleteService(String nodeCriteria, String ipAddress, String service)
-
getInterface
public OnmsIpInterface getInterface(String nodeCriteria, String ipAddress)
-
getResponseForInterface
public javax.ws.rs.core.Response getResponseForInterface(String nodeCriteria, String ipAddress)
-
getEventsForNode
public OnmsEventCollection getEventsForNode(int nodeId)
-
getEventsForNodeByEventUei
public OnmsEventCollection getEventsForNodeByEventUei(int nodeId, String eventUei)
-
getAlarmsByEventUei
public OnmsAlarmCollection getAlarmsByEventUei(String eventUei)
-
getAlarmsForNode
public OnmsAlarmCollection getAlarmsForNode(int nodeId)
-
getMinion
public OnmsMinion getMinion(String id)
-
getAllMinions
public List<OnmsMinion> getAllMinions()
-
addMinion
public javax.ws.rs.core.Response addMinion(OnmsMinion minion)
-
deleteMinion
public javax.ws.rs.core.Response deleteMinion(String id)
-
sendEvent
public void sendEvent(Event event)
-
sendEvent
public void sendEvent(Event event, boolean clearDates)
-
getFlowCount
public Long getFlowCount(long start, long end)
-
getResourcesForNode
public ResourceDTO getResourcesForNode(String nodeCriteria)
-
resetGeocoderConfiguration
public void resetGeocoderConfiguration()
-
addCategory
public void addCategory(String categoryName)
-
sendGraphML
public void sendGraphML(String graphName, InputStream graphMLStream)
-
getGraphML
public javax.ws.rs.core.Response getGraphML(String graphName)
-
deleteGraphML
public void deleteGraphML(String graphName)
-
getApplications
public List<OnmsApplication> getApplications()
-
-