Package org.opennms.web.rest.v1
Class SnmpConfigRestService
- java.lang.Object
-
- org.opennms.web.rest.v1.OnmsRestService
-
- org.opennms.web.rest.v1.SnmpConfigRestService
-
@Component("snmpConfigRestService") @Transactional public class SnmpConfigRestService extends OnmsRestServiceREST service to the OpenNMS SNMP configuration
snmp-config.xmlThis current implementation setting and getting all parameters which are in snmp-config.xml
Be aware that setting the SNMP configuration for a rage of IPs is currently not supported by this REST service!The implementation only supports a PUT request because it is an implied "Update" of the configuration since it requires an IP address and all IPs have a default configuration. This request is is passed to the factory for optimization of the configuration store:
snmp-config.xml.Example 1: Change SNMP configuration.
curl -v -X PUT -H "Content-Type: application/xml" \ -H "Accept: application/xml" \ -d "<snmp-info> <community>yRuSonoZ</community> <port>161</port> <retries>1</retries> <timeout>2000</timeout> <version>v2c</version> </snmp-info>" \ -u admin:admin http://localhost:8980/opennms/rest/snmpConfig/10.1.1.1Example 2: Query SNMP community string.
curl -v -X GET -u admin:admin http://localhost:8980/opennms/rest/snmpConfig/10.1.1.1
- Since:
- 1.8.1
- Version:
- $Id: $
- Author:
- Mathew Brozowski
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opennms.web.rest.v1.OnmsRestService
OnmsRestService.ComparisonOperation
-
-
Field Summary
-
Fields inherited from class org.opennms.web.rest.v1.OnmsRestService
DEFAULT_LIMIT
-
-
Constructor Summary
Constructors Constructor Description SnmpConfigRestService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static String[]getAddresses(String input)SnmpInfogetSnmpInfo(String ipAddr, String location)getSnmpInfojavax.ws.rs.core.ResponsesetSnmpInfo(String ipAddress, SnmpInfo snmpInfo)setSnmpInfoprotected voidtearDown()javax.ws.rs.core.ResponseupdateInterface(String ipAddress, MultivaluedMapImpl params)Updates a specific interface-
Methods inherited from class org.opennms.web.rest.v1.OnmsRestService
applyQueryFilters, applyQueryFilters, getBadRequestResponse, getBeanWrapperForClass, getException, getException, getNumericValue, getRedirectUri, readLock, readUnlock, removeParameter, removeParameter, setProperties, writeLock, writeUnlock
-
-
-
-
Method Detail
-
tearDown
@PreDestroy protected void tearDown()
-
getSnmpInfo
public SnmpInfo getSnmpInfo(String ipAddr, String location)
getSnmpInfo
- Parameters:
ipAddr- aStringobject.- Returns:
- a
org.opennms.web.snmpinfo.SnmpInfoobject.
-
setSnmpInfo
public javax.ws.rs.core.Response setSnmpInfo(String ipAddress, SnmpInfo snmpInfo)
setSnmpInfo
- Parameters:
ipAddress- aStringobject.snmpInfo- aorg.opennms.web.snmpinfo.SnmpInfoobject.- Returns:
- a
Responseobject.
-
updateInterface
@Transactional public javax.ws.rs.core.Response updateInterface(String ipAddress, MultivaluedMapImpl params)
Updates a specific interface- Parameters:
ipAddress- aStringobject.params- aMultivaluedMapImplobject.- Returns:
- a
Responseobject.
-
-