org.opennms.web.rest
Class SnmpConfigRestService
java.lang.Object
org.opennms.web.rest.OnmsRestService
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:
- community string
- SNMP version
- Port
- Retries
- Timeouts
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SnmpConfigRestService
public SnmpConfigRestService()
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.