org.opennms.web.rest
Class SnmpConfigRestService

java.lang.Object
  extended by org.opennms.web.rest.OnmsRestService
      extended by org.opennms.web.rest.SnmpConfigRestService

@Component
@PerRequest
@Scope(value="prototype")
@Transactional
public class SnmpConfigRestService
extends OnmsRestService

REST service to the OpenNMS SNMP configuration snmp-config.xml

This current implementation only supports setting and getting of the configuration elements:

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 community string. Note: Community string is the only required element

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.1

Example 2: Query SNMP community string.

curl -v -X GET -u admin:admin http://localhost:8980/opennms/rest/snmpConfig/10.1.1.1

Author:
Mathew Brozowski

Nested Class Summary
 
Nested classes/interfaces inherited from class org.opennms.web.rest.OnmsRestService
OnmsRestService.ComparisonOperation
 
Constructor Summary
SnmpConfigRestService()
           
 
Method Summary
 SnmpInfo getSnmpInfo(String ipAddr)
           
 javax.ws.rs.core.Response setSnmpInfo(String ipAddr, SnmpInfo snmpInfo)
           
 javax.ws.rs.core.Response updateInterface(String ipAddress, MultivaluedMapImpl params)
          Updates a specific interface
 
Methods inherited from class org.opennms.web.rest.OnmsRestService
addFiltersToCriteria, addOrdering, convertNameToPropertyName, log, setLimitOffset, setLimitOffset, setProperties, throwException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnmpConfigRestService

public SnmpConfigRestService()
Method Detail

getSnmpInfo

public SnmpInfo getSnmpInfo(String ipAddr)

setSnmpInfo

public javax.ws.rs.core.Response setSnmpInfo(String ipAddr,
                                             SnmpInfo snmpInfo)

updateInterface

@Transactional
public javax.ws.rs.core.Response updateInterface(String ipAddress,
                                                               MultivaluedMapImpl params)
Updates a specific interface



Copyright © 2009. All Rights Reserved.