@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
OnmsRestService.ComparisonOperation
DEFAULT_LIMIT
Constructor and Description |
---|
SnmpConfigRestService() |
Modifier and Type | Method and Description |
---|---|
SnmpInfo |
getSnmpInfo(String ipAddr)
getSnmpInfo
|
javax.ws.rs.core.Response |
setSnmpInfo(String ipAddress,
SnmpInfo snmpInfo)
setSnmpInfo
|
javax.ws.rs.core.Response |
updateInterface(String ipAddress,
MultivaluedMapImpl params)
Updates a specific interface
|
applyQueryFilters, convertNameToPropertyName, getBeanWrapperForClass, getException, getException, getRedirectUri, log, readLock, readUnlock, removeParameter, removeParameter, setProperties, writeLock, writeUnlock
public javax.ws.rs.core.Response setSnmpInfo(String ipAddress, SnmpInfo snmpInfo)
setSnmpInfo
@Transactional public javax.ws.rs.core.Response updateInterface(String ipAddress, MultivaluedMapImpl params)
ipAddress
- a String
object.params
- a MultivaluedMapImpl
object.Response
object.Copyright © 2015. All Rights Reserved.