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 voidaddCategory(String categoryName)voidaddCategoryToNode(String nodeCriteria, String categoryName)javax.ws.rs.core.ResponseaddInterface(String nodeCriteria, OnmsIpInterface ipInterface)javax.ws.rs.core.ResponseaddMinion(OnmsMinion minion)javax.ws.rs.core.ResponseaddNode(OnmsNode onmsNode)voidaddOrReplaceRequisition(Requisition requisition)javax.ws.rs.core.ResponseaddService(String nodeCriteria, String ipAddress, OnmsMonitoredService service)voiddeleteGraphML(String graphName)javax.ws.rs.core.ResponsedeleteInterface(String nodeCriteria, String ipAddress)javax.ws.rs.core.ResponsedeleteMinion(String id)javax.ws.rs.core.ResponsedeleteNode(String nodeCriteria)javax.ws.rs.core.ResponsedeleteService(String nodeCriteria, String ipAddress, String service)static RestClientforLocalhost()Create a REST client that connects to http://localhost:8980/ with the default credentials.OnmsAlarmCollectiongetAlarmsByEventUei(String eventUei)OnmsAlarmCollectiongetAlarmsForNode(int nodeId)List<OnmsEvent>getAllEvents()List<OnmsMinion>getAllMinions()List<OnmsApplication>getApplications()StringgetDisplayVersion()List<OnmsEvent>getEvents()OnmsEventCollectiongetEventsForNode(int nodeId)OnmsEventCollectiongetEventsForNodeByEventUei(int nodeId, String eventUei)LonggetFlowCount(long start, long end)javax.ws.rs.core.ResponsegetGraphML(String graphName)OnmsIpInterfacegetInterface(String nodeCriteria, String ipAddress)QueryResponsegetMeasurements(QueryRequest request)OnmsMiniongetMinion(String id)OnmsNodegetNode(String nodeCriteria)List<OnmsNode>getNodes()ResourceDTOgetResourcesForNode(String nodeCriteria)javax.ws.rs.core.ResponsegetResponseForInterface(String nodeCriteria, String ipAddress)javax.ws.rs.core.ResponsegetResponseForNode(String nodeCriteria)javax.ws.rs.core.ResponsegetResponseForService(String nodeCriteria, String ipAddress, String service)OnmsMonitoredServicegetService(String nodeCriteria, String ipAddress, String service)List<OnmsMonitoredService>getServicesForANode(String nodeCriteria, String ipAddress)voidimportRequisition(String foreignSource)voidresetGeocoderConfiguration()voidsendEvent(Event event)voidsendEvent(Event event, boolean clearDates)voidsendGraphML(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()
-
-