|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cisco.provisioning.cpe.api.DeviceOperation
public final class DeviceOperation
The DeviceOperation class is used to represent various operations to perform on a device, including generation the device's configuration, resetting the device, and enabling SNMP v3 access to the device.
| Field Summary | |
|---|---|
static DeviceOperation |
CHANGE_PROVISIONING_GROUP
Reserved for future use. |
static DeviceOperation |
ENABLE_SNMPV3_ACCESS
Specifies a device operation to enable SNMP v3 access to a remote device. |
static DeviceOperation |
GENERATE_CONFIGURATION
Specifies a device operation to generate configuration for a device. |
static DeviceOperation |
INCREMENTAL_UPDATE
An operation which allows for the setting of MIB Variable(s) on a remote device. |
static DeviceOperation |
RESET
Specifies a device operation to reset a device. |
static long |
serialVersionUID
Description of the Field |
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Determines if this device operation object is equal to the specified object. |
int |
hashCode()
The hash code of this object. |
String |
toString()
Returns a String description of this device operation |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final long serialVersionUID
public static final DeviceOperation GENERATE_CONFIGURATION
Note : The constant should be used with ActivationMode.NO_ACTIVATION, otherwise
IPDevice.performOperation(DeviceOperation, DeviceID, Map) will return
the error CommandStatusCode.CMD_ERROR_VALIDATE.
...
Batch batch = conn.newBatch(ActivationMode.NO_ACTIVATION);
batch.performOperation(DeviceOperation.GENERATE_CONFIGURATION,
new MACAddress("1,6,00:00:00:00:00:99"),
null);
BatchStatus status = batch.post();
if ( status.isError() )
{
fail(status);
}
else
{
pass(status);
}
...
public static final DeviceOperation RESET
Note : The constant should be used with ActivationMode.AUTOMATIC, otherwise IPDevice.performOperation will return the
error CommandStatusCode.CMD_ERROR_VALIDATE.
This command may return BatchStatusCode.BATCH_WARNING or BatchStatusCode#BATCH_FAILED_DISRUPTION depending on the ConfirmationMode and the status of the reset operation.
...
Batch batch = conn.newBatch(ActivationMode.AUTOMATIC);
batch.performOperation(DeviceOperation.RESET,
new MACAddress("1,6,00:00:00:00:00:99"),
null);
BatchStatus status = batch.post();
if ( status.isError() )
{
fail(status);
}
else
{
pass(status);
}
...
public static final DeviceOperation ENABLE_SNMPV3_ACCESS
The auth and priv passwords for the user (USM table entry)
created by this API are specified by setting SNMPPropertyKeys.CLONING_AUTH_PASSWORD and SNMPPropertyKeys.CLONING_PRIV_PASSWORD
properties respectively in the rdu.properties configuration file.
...
// The goal here is to create a new user on the MTA indicated
// by the MAC address. The other param needed here is the new
// user name, which is passed in the Map.
// Create a batch
Batch batch = conn.newBatch();
// Create a map which will contain one element - the
// name of the new user to be created on the MTA
HashMap map = new HashMap();
map.put( SNMPPropertyKeys.CLONING_USERNAME, "newUser" );
// The first param is the actual device operation to perform.
batch.performOperation(DeviceOperation.ENABLE_SNMPV3_ACCESS,
new MACAddress("1,6,00:00:00:00:00:99"), map);
BatchStatus status = batch.post();
if ( status.isError() )
{
fail(status);
}
else
{
pass(status);
}
...
SNMPPropertyKeyspublic static final DeviceOperation INCREMENTAL_UPDATE
Note : Changes made to writable MIB variables using this API will not be permanent and will not be updated in the system configuration for the device.
...
// The goal here is to set a MIB variable on the MTA. In this
// example we will be setting the pktcMtaDevEnabled variable,
// which is used to indicate if the voice status is enabled or
// disabled.
// Create a batch
Batch batch = conn.newBatch();
// Create a map which will contain one element - the list of SNMP
// variables to set on the MTA
HashMap map = new HashMap();
SnmpVarList list = new SnmpVarList();
// An SnmpVariable represents a oid/value/type triple.
SnmpVariable variable = new SnmpVariable(
".1.3.6.1.4.1.4491.2.2.1.1.1.7.0", //pktcMtaDevEnabled OID
"1",
SnmpType.INTEGER );
list.add( variable );
map.put( SNMPPropertyKeys.SNMPVAR_LIST, list );
// The first param is the actual device operation to perform.
batch.performOperation(DeviceOperation.INCREMENTAL_UPDATE,
new MACAddress("1,6,00:00:00:00:00:99"), map);
BatchStatus status = batch.post();
if ( status.isError() )
{
fail(status);
}
else
{
pass(status);
}
...
public static final DeviceOperation CHANGE_PROVISIONING_GROUP
| Method Detail |
|---|
public int hashCode()
Object.hashCode
for more information
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectobj - Description of the Parameter
public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||