Use the invoke method of the ObjectAccess interface to perform operations on EM objects. This method takes the following parameters:
Object identifier for the target object (input)
Operation name (input)
Input arguments specified using an XML string (input)
Results in an XML string, and possibly an iterator (output)
ObjectAccess Interface Definition
The ObjectAccess interface is defined using the Interface Definition Language (IDL), as shown below.
interface resultIterator
{
boolean getNext(in short howMany, out string outargs);
};
interface ObjectAccess {
enum ExceptionType
{
EXCPT_NOT_IMPLEMENTED,
EXCPT_INTERNAL_ERROR,
EXCPT_INVALID_INPUT,
EXCPT_ENTITY_NOT_FOUND,
EXCPT_FTP_ERROR,
EXCPT_FILEACCESS_ERROR,
EXCPT_NOT_IN_VALID_STATE
};
exception invokeException
{
ExceptionTypetype;
string errorReason;
};
boolean invoke(in string oid, in string func, in string inargs,
out string outargs, out resultIterator reIt) raises(invokeException);
};
The two IDL interfaces, resultIterator and ObjectAccess, are described in subsequent sections.
ObjectAccess invoke Method
The invoke method provides access to all Cisco gateway device objects.
boolean invoke(in string oid,
in string func,
in string inargs,
out string outargs,
out resultIterator reIt)
raises(invokeException);
Syntax Description
This section describes the parameters for invoke.
Specifying the OID Argument
Network management layer applications use object identifiers to specify the objects on which to perform operations. Object identifiers are exported as part of the containment hierarchy, and may be obtained by using the operations that traverse the containment hierarchy of the underlying object model.
Identify objects in the model by containment and identifier:
Containment path—The EM site and Cisco Gateway IP address
Object identifier—The identifier for a specific object in the containment path
The following table identifies all the containment characteristics and object identifiers for Cisco Gateway objects:
Specifying the func, inargs, and outargs Arguments
The func parameter of the invoke method supports the following operations. The table also summarizes inargs and outargs usage.
Table 3-2 Operation Keywords
Operation
Description
ACTION
Performs a specific action on the specified Cisco Gateway object, such as adding a DS1 line. The type of action depends on the type of object. Client applications specify the action type and attribute names and values as an XML encoded string using the inargs argument.
QUERY
Returns a list of containment paths that satisfy the conditions of the input statement. Clients can use this operation to discover the path for all objects of a specific type that satisfy filter criteria. Clients specify the scope and filter values as an XML encoded string using the inarg argument.
The results of the query are returned as an XML string in the outarg argument. An iterator, described in the "ObjectAccess getNext Method" section, may be returned.
UPLOAD
Selects the objects in the EM's containment hierarchy according to a set of criteria, and FTPs their OIDs and attributes to the specified host. Clients specify the selection criteria as an XML encoded string, which includes the following types of information:
Starting point (root path) specified as a path to a portion of the containment hierarchy. A special value, EM:, indicates that the starting point is the absolute root, and to upload the entire tree.
FTP destination file name.
FTP host name and account information.
Selection filter.
GET
Obtains a list of attribute values for an object. The client application selects the desired object using an XML encoded string. Returns the results in an XML string that contains a list of attribute names and values for the objects.
SET
Changes one or more attributes for an object. The client application specifies a list of attribute names and values as an XML string. Cisco Voice CORBA Gateway triggers an attribute change event for objects that have changed.
BULKGET
Obtains object attributes from one or more Cisco Gateways. Clients select the desired objects and attributes using an XML encoded string. Returns the results in an XML string that contains a list of attribute names and values organized by chassis.
BULKSET
Changes object attributes in one or more Cisco Gateways. Clients specify a list of attributes and their new values as an XML string. Cisco Voice CORBA Gateway triggers an attribute change event for the object or objects that have changed.
BULKACTION
Downloads software images to multiple Cisco Gateway nodes.
The resultIterator parameter facilitates iteration through a sequence of operations. If a non-null iterator object is returned with the results, use the GetNext function of the iterator to obtain the next set of results.
ObjectAccess getNext Method
This method provides an iterator for return values of the invoke method.
Syntax
boolean getNext(in short howMany, out string outargs);
Syntax Description
The following table describes the valid arguments.
Table 3-3 Arguments for getNext
howMany
The number of additional results to return, expressed as a number
outargs
The results, encoded as an XML string
Usage Guidelines
This function takes a single parameter, an integer, that specifies how many more ResultUnit sections of the XML encoded results need to be returned. The function returns the next set of ResultUnit sections of the XML.
ObjectAccess Exceptions
ObjectAccess defines the following exception types:
Table 3-4 Exceptions
Exception
Cause
EXCPT_NOT_IMPLEMENTED
The client invokes an invalid operation.
EXCPT_INTERNAL_ERROR
A ObjectAccess internal error.
EXCPT_INVALID_INPUT
The XML string is incorrect or incomplete.
EXCPT_ENTITY_NOT_FOUND
The object does not exist.
EXCPT_FTP_ERROR
The upload or software download operation failed due to incorrect host or user information.
EXCPT_FILEACCESS_ERROR
A file access problem exists.
EXCPT_NOT_IN_VALID_STATE
A chassis is not in a valid state.
Catch these exceptions using standard procedures for the specific programming language in use.
Example Program
The following example shows how to connect to VCG Server (ObjectAccess) using naming service and also shows how to perform an operation using the invoke IDL method:
The ACTION, GET, SET, BULKGET, BULKSET, and QUERY operations require operation details that are encoded in an XML string. The input argument varies by operation type.
For example, an ACTION request specifies the action type and provides a list of attribute names and values:
Encloses the attributes for a BULKACTION operation
<BULKGETREQUEST></BULKGETREQUEST>
Encloses the attributes for a BULKGETREQUEST operation
<BULKSETREQUEST></BULKSETREQUEST>
Encloses the attributes for a BULKSETREQUEST operation
<MO identity="value"></MO>
Specifies the identity of a Managed Object and encloses a list of attributes
<QUERY></QUERY>
Encloses the criteria for a QUERY operation
<CHILDCLASS></CHILDCLASS>
Specifies class name of the Managed Objects on which QUERY operation has to be performed
<OBJECTATTRIBUTE name="value"> </OBJECTATTRIBUTE>
Specifies the attribute name of an object for GET, SET, and ACTION operations
<OA name="value"></OA>
Specifies the attribute name of an object for BULKGETREQUEST, BULKSETREQUEST, and BULKACTION operations
Specifying Attribute Names
When creating an input argument, identify the target parameter with an attribute name. These names are based on the storage location and the relevant RFC standard. The storage location is one of the following:
SNMP—Specifies an attribute stored in a Cisco Gateway
LocalDB—Specifies an attribute stored in the local EM database
EMCtlr—Specifies a controller attribute
To construct an attribute name, follow these steps:
Step 2 Prefix the attribute name with the desired source keyword and a colon. The source keyword is SNMP, LocalDB, or EMCtlr. For example:
SNMP:RFC1213-MIB.sysContact
Interpreting Result Strings
The ACTION, SET, GET, BULKGET, BULKSET, and QUERY operations return results as an XML string. All results are wrapped in the <OPERATIONRESULTS> and <RESULTUNIT> tags. The other XML tags vary by operation type.
For example, an ACTION request returns the results of the operation:
<OPERATIONRESULTS>
<RESULTUNIT>
<ACTIONRESULTS> Text message and status </ACTIONRESULTS>
</RESULTUNIT>
</OPERATIONRESULTS>.
A GET request returns a string of attribute names and values:
Encloses the containment PATH of the Managed Object where UPLOAD starts.
<USERNAME></USERNAME>
Encloses a username for the host used during FTP upload.
<PASSWORD></PASSWORD>
Encloses a password for the host used during FTP upload.
<FTPFILENAME></FTPFILENAME>
Encloses the destination file name on the client host for the uploaded information.
<FTPHOSTNAME> </FTPHOSTNAME>
Encloses the host name of the destination machine to be used.
<CLASSFILTER></CLASSFILTER>
Encloses filter strings that apply during UPLOAD. Only the information related to the classes and attributes specified in the class filter is uploaded.
<MO identity ="value"></ MO>
Specifies the identity of a Managed Object and encloses a list of attributes.
<TB name="value"></ TB>
Specifies the name of a table.
<ROW></ ROW>
Specifies the row in the table.
<TA name="value"></ TA>
Specifies the multiple columns for each row
<OA name="value"></OA>
Specifies name of the Object Attribute for the UPLOAD operation.
<INVENTORYUPLOAD> </INVENTORYUPLOAD>
Encloses the UPLOAD results.
<PATH></PATH>
Encloses the containment path of the Managed Object. The PATH and OID uniquely identify an object.
<OID></OID>
Encloses the object identifier of the Managed Object.