HP Intelligent Management Center Extended API Guide Abstract This manual provides detailed information about the HP Intelligent Management Center Extended API (eAPI), which enables users to customize their installation of IMC. It is designed for network administrators and programmers experienced with Java development environments and XML. The information presented in this manual was up-to-date at publication time. The most current collection of IMC eAPI help and support files is available at h t tp://w w w .hp .co m/ne t w o r king/IM C-eAP I . HP Part Number: 5998-3320 Published: June 2012 Edition: 1
438
Embed
HP Intelligent Management Center Extended API Guide
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
HP Intelligent Management CenterExtended API Guide
AbstractThis manual provides detailed information about the HP Intelligent Management Center Extended API (eAPI), which enablesusers to customize their installation of IMC. It is designed for network administrators and programmers experienced with Javadevelopment environments and XML. The information presented in this manual was up-to-date at publication time. The mostcurrent collection of IMC eAPI help and support files is available at http://www.hp.com/networking/IMC-eAPI.
HP Part Number: 5998-3320Published: June 2012Edition: 1
Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, CommercialComputer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government undervendor's standard commercial license.
The information contained herein is subject to change without notice. The only warranties for HP products and services are set forth in the expresswarranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shallnot be liable for technical or editorial errors or omissions contained herein.
Acknowledgments
Java and Oracle are registered trademarks of Oracle and/or its affiliates.
UNIX® is a registered trademark of The Open Group.
Welcome to iMC RESTful Web Services ....................................................................................22The First iMC-RS Client............................................................................................................22
2 Client Access...........................................................................................26Access iMC-RS Resources with Apache Commons HTTP Client 3.x................................................26Access iMC-RS Resources with Apache HTTP Client 4.x...............................................................26Access iMC-RS Resources with RestTemplate of SpringFramework 3.0............................................26Access iMC-RS Resources with Jersey Client................................................................................26Access iMC-RS Resources with Android SDK..............................................................................26
Interfaces for accessing resources.........................................................................................27Interfaces for registering and receiving real-time events...........................................................27
Real-Time Event Registration and Receipt....................................................................................27Event registration...............................................................................................................27Event receipt.....................................................................................................................28Java client.........................................................................................................................29Security control..................................................................................................................29
Conventions and Constraints....................................................................................................29HTTP methods...................................................................................................................30Content types and character encoding..................................................................................30Status codes......................................................................................................................30Wildcard characters supported in queries.............................................................................31Data types and ranges.......................................................................................................31Result set of multi-criteria batch queries..................................................................................31
4 System Management.................................................................................33Query All Operators...............................................................................................................34
Query Device Series Information List..........................................................................................71Interface URI.....................................................................................................................71Access Method..................................................................................................................71Returned Result..................................................................................................................72Example...........................................................................................................................73
Query Device Series Information...............................................................................................74Interface URI.....................................................................................................................74Access Method..................................................................................................................74Returned Result..................................................................................................................74Example...........................................................................................................................75
Query Device Model Information List.........................................................................................76Interface URI.....................................................................................................................76Access Method..................................................................................................................76Returned Result..................................................................................................................77Example...........................................................................................................................78
Query Device Model Information..............................................................................................79Interface URI.....................................................................................................................79Access Method..................................................................................................................79Returned Result..................................................................................................................79Example...........................................................................................................................80
Returned Result..................................................................................................................87Example...........................................................................................................................87
Modify Web Network Management Parameters.......................................................................108Interface URI...................................................................................................................108Access Method................................................................................................................108Returned Result................................................................................................................108Example.........................................................................................................................109
Query Service Monitoring Information List................................................................................110Interface URI...................................................................................................................110Access Method................................................................................................................110
6 Contents
Returned Result................................................................................................................110Example.........................................................................................................................111
Modify Service Monitoring Information....................................................................................112Interface URI...................................................................................................................112Access Method................................................................................................................112Returned Result................................................................................................................113Example.........................................................................................................................113
Bring Up an Interface............................................................................................................136Interface URI...................................................................................................................136Access Method................................................................................................................136Returned Result................................................................................................................136Example.........................................................................................................................136
Shut Down an Interface.........................................................................................................137Interface URI...................................................................................................................137Access Method................................................................................................................137Returned Result................................................................................................................137Example.........................................................................................................................137
6 User Management..................................................................................177Query Users........................................................................................................................178
Query User Additional Information Definitions..........................................................................188Interface URI...................................................................................................................188Access Method................................................................................................................188Returned Result................................................................................................................188Example.........................................................................................................................189
Query User Additional Information Definition...........................................................................190Interface URI...................................................................................................................190Access Method................................................................................................................190Returned Result................................................................................................................190Example.........................................................................................................................192
Add User Additional Information Definition..............................................................................193Interface URI...................................................................................................................193Access Method................................................................................................................193Returned Result................................................................................................................194Example 1......................................................................................................................194Example 2......................................................................................................................195
Modify User Additional Information Definition..........................................................................196Interface URI...................................................................................................................196Access Method................................................................................................................196
10 Contents
Returned Result................................................................................................................197Example.........................................................................................................................197
Delete User Additional Information Definition...........................................................................198Interface URI...................................................................................................................198Access Method................................................................................................................198Returned Result................................................................................................................198Example.........................................................................................................................198
Query All IP Segments..........................................................................................................215Interface URI...................................................................................................................215Access Method................................................................................................................215Returned Result................................................................................................................215Example.........................................................................................................................217
Query IP Segment................................................................................................................218Interface URI...................................................................................................................218Access Method................................................................................................................218Returned Result................................................................................................................218Example.........................................................................................................................220
Add IP Segment...................................................................................................................221Interface URI...................................................................................................................221Access Method................................................................................................................221Returned Result................................................................................................................221Example 1......................................................................................................................222Example 2......................................................................................................................222
Add Child IP Segment...........................................................................................................223Interface URI...................................................................................................................223Access Method................................................................................................................223Returned Result................................................................................................................223Example.........................................................................................................................224
Contents 11
Modify IP Segment...............................................................................................................225Interface URI...................................................................................................................225Access Method................................................................................................................225Returned Result................................................................................................................225Example.........................................................................................................................226
Release IP Segment...............................................................................................................227Interface URI...................................................................................................................227Access Method................................................................................................................227Returned Result................................................................................................................227Example.........................................................................................................................227
Automatically Scan IP Segment...............................................................................................228Interface URI...................................................................................................................228Access Method................................................................................................................228Returned Result................................................................................................................228Example.........................................................................................................................230
Automatically Scan Assigned IP Segment.................................................................................231Interface URI...................................................................................................................231Access Method................................................................................................................231Returned Result................................................................................................................231Example.........................................................................................................................232
Query IP Addresses..............................................................................................................233Interface URI...................................................................................................................233Access Method................................................................................................................233Returned Result................................................................................................................234Example.........................................................................................................................235
Assign IP Address.................................................................................................................236Interface URI...................................................................................................................236Access Method................................................................................................................236Returned Result................................................................................................................236Example.........................................................................................................................237
Release Assigned IP Address..................................................................................................238Interface URI...................................................................................................................238Access Method................................................................................................................238Returned Result................................................................................................................238Example.........................................................................................................................238
Example 2......................................................................................................................246Modify Terminal Access Binding.............................................................................................247
Returned Result................................................................................................................266Example.........................................................................................................................267
Get History File of a Periodic Report........................................................................................354Interface URI...................................................................................................................354Access Method................................................................................................................354Returned Result................................................................................................................354Example.........................................................................................................................354
13 Network Service Management................................................................364Query VLANs......................................................................................................................365
Add Port to VLAN.................................................................................................................375Interface URI...................................................................................................................375Access Method................................................................................................................375Returned Result................................................................................................................375Example.........................................................................................................................376
Remove Port from VLAN.........................................................................................................377Interface URI...................................................................................................................377Access Method................................................................................................................377Returned Result................................................................................................................377Example.........................................................................................................................377
Query a Specific VLAN Interface ...........................................................................................399Interface URI...................................................................................................................399Access Method................................................................................................................399Returned Result................................................................................................................399Example.........................................................................................................................400
14 ACL Management.................................................................................404Query the Device List of ACL Configuration..............................................................................405
Synchronize ACL Configuration Information for a Device............................................................408Interface URI...................................................................................................................408Access Method................................................................................................................408Returned Result................................................................................................................408Example.........................................................................................................................408
Query the ACL Definitions of a Device.....................................................................................409Interface URI...................................................................................................................409Access Method................................................................................................................409Returned Result................................................................................................................409Example.........................................................................................................................411
Add ACL on a Device...........................................................................................................412Interface URI...................................................................................................................412Access Method................................................................................................................412Returned Result................................................................................................................415Example.........................................................................................................................415
Delete ACL from a Device......................................................................................................420Interface URI...................................................................................................................420Access Method................................................................................................................420Returned Result................................................................................................................420Example.........................................................................................................................420
Query ACL Applications of a Device.......................................................................................421Interface URI...................................................................................................................421Access Method................................................................................................................421Returned Result................................................................................................................421Example.........................................................................................................................423
Add ACL Application on a Device..........................................................................................424Interface URI...................................................................................................................424Access Method................................................................................................................424Returned Result................................................................................................................425Example.........................................................................................................................425
Delete ACL Application from a Device.....................................................................................426Interface URI...................................................................................................................426Access Method................................................................................................................426Returned Result................................................................................................................426Example.........................................................................................................................426
Query ACL Time Ranges of a Device.......................................................................................427Interface URI...................................................................................................................427Access Method................................................................................................................427Returned Result................................................................................................................427Example.........................................................................................................................428
Add ACL Time Range on a Device..........................................................................................429Interface URI...................................................................................................................429
Delete ACL Time Range from a Device.....................................................................................431Interface URI...................................................................................................................431Access Method................................................................................................................431Returned Result................................................................................................................431Example.........................................................................................................................431
15 Support and other resources...................................................................435Contacting HP......................................................................................................................435Subscription service..............................................................................................................435Warranty............................................................................................................................435Documentation.....................................................................................................................435Prerequisites.........................................................................................................................436Typographic conventions.......................................................................................................436About the HP IMC documentation set......................................................................................436
1 Quick StartThis guide provides overview and reference information for the iMC extended API, a set ofcommands and support files that enables you to customize your iMC experience.
Welcome to iMC RESTful Web ServicesiMC provides web services based on open service-oriented architecture (SOA). Web services areprimarily implemented using these methods: REST, SOAP, and XML-RPC. Compared with the othertwo methods, the REST-style web services feature clearness and simplicity.Using the Hypermedia as the Engine of Application State (HATEOAS) feature of the REST applicationarchitecture, together with the systematic and extendable web services, iMC becomes very flexibleto offer various and customized services. Almost all iMC services can be integrated into targetsoftware as RESTful web services, meeting various service integration requirements at present andin future.The user guide is intended for RESTful web services users, and comprises the following contents:Quick StartDescribes the basic structure and access method of iMC RESTful web services, helping you quicklyestablish the client environment for accessing the basic service interfaces.Client AccessDescribes how to access iMC RESTful web services by using the following Java REST clients:
• Apache Commons HTTP Client (3.1)
• Apache HTTP Client (4.x)
• SpringFramework (3.x) RestTemplate
• Jersey Client
• Android SDKThis document covers the access method based on Java only, but not other languages or systems.R & D ReferencesDescribes the iMC-RS design ideas, conventions, and development constraints.
The First iMC-RS ClientThis section guides you to quickly access iMC-RS services and to create your first iMC-RS clientprogram.The following shows you how to access iMC-RS with Java. Ensure that you are familiar with Javaand the Eclipse environment.
PreparationsMake sure you have finished the following tasks:1. Install and deploy iMC 5.1 or a later version, run iMC, and perform device auto discovery.2. Download and install Eclipse 3.6 or a later version.3. Download and install JDK 6 or JRE 6.4. Download Apache HttpClient 4.1 or a later version, and decompress it to the local host.
Verify iMC-RS availabilityFollow these steps to verify the availability of iMC-RS:
22 Quick Start
1. Enter "http://imc_host:port/imcrs/application.wadl" in the address bar of your browser(Firefox is recommended), where imc_host is the hostname or IP address of the iMC server,and port is the service port number (8080 by default).
2. In the identity authentication dialog box that appears, enter "admin" as the username andpassword, and click OK.
3. If the browser displays an XML document with "<application>" as the root node, iMC-RS isready for you to use. If you encounter an error (such as a 404 error) in step 2 or 3, checkyour iMC version and service.
Create projectLaunch the Eclipse environment and create a new project.1. Select File > New > Java Project.2. Type the project name such as "MyRestClient" and click Next.3. Click the Libraries tab, click Add External JARs, and add the decompressed Apache HttpClient
files httpcore-4.1.jar, httpclient-4.1.jar, and commons-logging-1.1.1.jarto the project.
4. Click Finish.
Compile iMC-RS client codesRight-click the project and select New > Class from the shortcut menu.In the wizard, type the package name (for example, com.mycompany.rest) and class name(for example, MyClient), select Create Main Class, and click Finish.Enter the following codes in the new class:
public class MyClient { public static void main(String[] args) throws Exception { DefaultHttpClient client = new DefaultHttpClient(); client.getCredentialsProvider().setCredentials( new AuthScope("imc_host", 8080, "iMC RESTful Web Services"), new UsernamePasswordCredentials("admin", "admin")); HttpGet get = new HttpGet("http://imc_host:8080/imcrs/plat/res/device"); get.addHeader("accept", "application/xml"); HttpResponse response = client.execute(get); System.out.println(response.getStatusLine()); System.out.println(EntityUtils.toString(response.getEntity())); }}
In the previous codes, "imc_host" and "8080" represent the iMC server address and port number,and the two "admin" strings represent the login username and password.
Run codes and view resultSelect Run > Run or press Ctrl + F11 to run the codes. The Eclipse console will display the following:
The output indicates that you have successfully accessed the device query interface and get thefirst ten device entries in XML format.
iMC-RS Security MechanismThe iMC-RS framework allows you to access iMC resources and services in secure mode. It featuresin the following:
• Identity authentication: iMC-RS offers a simple and effective identify authentication modecalled HTTP digest authentication (see RFC 2617). It does not transfer passwords on thenetwork and thus effectively protects the REST user passwords. This authentication process isrequired, or in other words, all attempts to access iMC-RS must pass authentication first.
• Secure communication: To ensure data encryption and secure communication, iMC-RS canbe accessed through HTTPS when necessary.
• Password protection: With this feature, iMC-RS denies access from a client for a minute bygiving a 403 Forbidden error message if the client continuously enters an incorrect usernameor password five times.
Identification authenticationAn iMC operator is used for iMC-RS identity authentication, if the operator is a member of thedefault administrator group, or a group with administrator rights and with the RESTful Web ServicesCall option selected (Figure 1).
Figure 1 Add Operator Group dialog box
In addition, iMC-RS identity authentication and privilege restrictions are different from those of theiMC system in the following ways:
• iMC-RS identity authentication does not check the ACLs and password control policy of theoperator.
• iMC operators use the "simple password authentication" method to access iMC-RS. If anoperator uses RADIUS or LDAP authentication, the operator must successfully log in to iMCfirst and then can pass iMC-RS authentication. If the authentication password is changed, the
24 Quick Start
operator must successfully log in to iMC with the new password, and then can pass iMC-RSauthentication.
• By default, an operator can use all RESTful services offered by iMC-RS, regardless of theoperation rights restricted by the group to which the operator belongs.
• An operator can access all iMC-RS resources, regardless of the access restrictions of the deviceand user groups.
Once iMC is installed, you can directly access iMC-RS with "admin" as the username and password.The admin operator can always access iMC-RS.
Verify iMC-RS availabilityFollow these steps to verify the availability of iMC-RS:1. Enter "http://imc_host:port/imcrs/application.wadl" in the address bar of your browser
(Firefox is recommended), where imc_host is the hostname or IP address of the iMC server,and port is the service port number (8080 by default).
2. In the identity authentication dialog box that appears, enter "admin" as the username andpassword, and click OK.
3. If the browser displays an XML document with "<application>" as the root node, iMC-RS isready for you to use. If you encounter an error (such as a 404 error) in step 2 or 3, checkyour iMC version and service.
iMC-RS Security Mechanism 25
2 Client AccessThe IMC Extended API (eAPI) provides a number of Java test code examples based on commonweb services:
• Apache Commons HTTP Client 3.x
• Apache HTTP Client 4.x
• SpringFramework 3.0
• Jersey Client
• Android SDKThese Java test code examples are located in the rest_en\manual\client folder in your eAPIpackage.
Access iMC-RS Resources with Apache Commons HTTP Client 3.xFor more information, see the Test Code Example: CommonsClientTest.java.
Access iMC-RS Resources with Apache HTTP Client 4.xFor more information, see the Test Code Example: HttpClientTest.java.
Access iMC-RS Resources with RestTemplate of SpringFramework 3.0For more information, see the Test Code Example: RestTemplateTest.java.
Access iMC-RS Resources with Jersey ClientFor more information, see the Test Code Example: JerseyClientTest.java.
Access iMC-RS Resources with Android SDKFor more information, see the Test Code Example: AndroidTest.java.
26 Client Access
3 R&D ReferencesThis section provides information about the following topics:
• Interface categories
• Real-time event registration and receipt
• Conventions and constraints
• Error codes
• Frequently-asked questions (FAQ)
Interface CategoriesThe interfaces of the iMC-RS framework can be classified into two categories, one for accessingiMC resources, and the other for registering and receiving real-time events.
Interfaces for accessing resourcesThis category of interface works in the synchronous request/response mode to response the requestfrom the client for accessing resources. The access requests include operations such as read,update, insert, and delete.Unless otherwise specified, all iMC-RS APIs are of this category.You can select a proper class library to access iMC-RS. For information on how to use this categoryof interface, see “Client Access.”
Interfaces for registering and receiving real-time eventsThis category of interface processes registration of particular types of event from the client, andinforms the client of the latest events in real time with asynchronous notification. The interfaceimplements HTTP server push to register events such as real-time alarms and real-time device statuschanges, and informs the client of the event immediately after it occurs.For more information about this category of interface, see “Real-Time Event Registration andReceipt.”
Real-Time Event Registration and ReceiptThe iMC-RS framework can receive and accept the registration requests of real-time events. Afterreceiving an event registration request from the client, the server checks the validity of the request,and if the request is valid, returns the 202 (Accepted) status code to the client and maintains theHTTP connection (which is a long connection) to the client. When the client registration event occurs,the server pushes the event to the client. In addition, the server sends periodic heartbeat events tothe client every minute to verify network connections.This section describes real-time event registration and receipt by using the java.net.URL accessmethod.
Event registrationiMC-RS receives an event registration request in GET method.
URL url = new URL("http://imc_host:8080/imcrs/events?type=type_code");HttpURLConnection conn = (HttpURLConnection) url.openConnection();conn.setRequestMethod("GET");conn.setRequestProperty("accept", "application/xml");if (conn.getResponseCode() == 202) { // Registration succeeds. Start to receive the event notification. BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); ......}
Interface Categories 27
Notes:1. The strings "imc_host" and "8080" represent the iMC server address and port number. The
"type_code" string represents the message type of the registration. For more information aboutmessage types, see the related API references.
2. The "accept" message header defines the format of notification messages. The valid messageformats include XML (application/xml) and JSON (application/json).
3. The query criteria must include the "type" parameter, which defines the type of the messageto be registered. You can set other parameters (see related API references) to narrow downthe query results.
4. If the registration succeeds, the server returns the 202 (Accepted) status code, and maintainsthe HTTP connection for transmitting subsequent notifications. If the registration fails, the serverreturns other status codes and closes the HTTP connection.
The server can return the following status codes for event registration:
• 202 (Accepted): Registration succeeded. The server maintains the HTTP connection fortransmitting subsequent messages.
• 400 (Bad Request): Invalid query parameters. The server returns this status code if the registrationrequest message does not include the "type" parameter, or the event type specified by theparameter is not supported.
• 403 (Forbidden): The client denied registration of the message. For more information, see theSecurity Control section.
• 405 (Method Not Allowed): The HTTP method of the registration request is not GET. The iMC-RSframework supports only the GET type message in event registration and notification.
• 406 (Not Acceptable): Unsupported content type (which is the "accept" message header inthe registration request). The iMC-RS framework supports only the following content types inevent registration and notification: application/xml and application/json.
Event receiptWhen the server generates a registration event, it pushes the event in real time to the correspondingclient by using the existing HTTP connection. The following is an example.
......if (conn.getResponseCode() == 202) { // Registration succeeds. Start to receive the event notification. BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); String line = null; StringBuilder sb = new StringBuilder(); while ((line = br.readLine()) != null) { if (line.length() != 0) { // The event message is not over. Continue to read the message. sb.append(line); } else { // Read a complete event. Process the event. String str = sb.toString(); sb.delete(0, sb.length()); if (!"#HEART_BEAT".equals(str)) { // The event is not a heartbeat event. Process the event message. ...... } } } ......}
Notes:
28 R&D References
1. Event messages are separated with a blank line. Once the server reads a blank line, it decidesthat it has read a complete event and should process the event. After complete processing theevent, the server continues to read subsequent events.
2. The server sends a heartbeat message "#HEART_BEAT" every minute, which can be ignoredby the client
3. The received events are represented in strings, which can be converted into class entities withJAXB or other libraries as needed.
Java clientIf you use Java to access iMC-RS real-time events, integrate file EventClient.java into yoursource codes, and register or receive iMC-RS real-time event notifications with the following method:
EventClient client = new EventClient( new URL("http://localhost:8080/imcrs/events?type=1"), SampleEntity.class) { @Override public void onMessage(SampleEntity entity) { // Receive a real-time event. Process the event. ...... } @Override public void onError(Throwable t) { // An error occurs (such as network connection interrupts) when the real-time event is received. You can call client.start () again as needed. ...... } }; // Start event registration and receipt.if (client.start()) { // Successfully connect to the server. Start to receive events. ...... // Stop receiving events from the server as needed. client.stop(); }
Security controlThe iMC-RS event notification framework maintains a long connection with the client for receivingevents in real time, and uses a security control mechanism different from iMC-RS security mechanism.When the event notification framework registers or receives an event, it does not authenticate theidentity of the operator that uses the client. Instead, the framework implements iMC-RS event accesscontrol based on the client addresses.By default, iMC-RS only allows the server (127.0.0.1) to access iMC-RS events. To allow a clientto access iMC-RS events, open file web\apps\imcrs\WEB-INF\web.xml in the iMC installationpath, and locate the following contents:
Replace 127.0.0.1 with the client address expressed in a regular expression. For more information,see Javadoc in java.util.regex.Pattern.If the client address is not allowed to access iMC-RS events, the server returns the 403 (Forbidden)status code.
Conventions and ConstraintsThis section describes the conventions and constraints in iMC-RS interfaces.
Conventions and Constraints 29
HTTP methodsThe iMC-RS interfaces use GET, POST, PUT, and DELETE to query (or read), add, modify (orconfigure), and delete iMC resources. These HTTP methods comply with the recommendations inRESTful web services.In addition, you can query the methods supported by each URI with the OPTIONS method.The HEAD method is also supported, which is identical to GET except that the server returns thestatus code and message header only, but does not return a message body in the response.
Content types and character encodingBy default, the iMC-RS framework supports XML (application/xml) and JSON (application/json)content types unless otherwise specified. You can specify these content types (accept/contentType)in the HTTP request/response messages on the client.Other content types are supported by certain interfaces. For more information, see the APIdocuments.All message bodies in the packets exchanged by iMC-RS are encoded in UTF-8.
Status codesThe HTTP status codes returned by iMC-RS interfaces comply with the recommendations in RESTfulweb services.
• Multi-criteria batch query (GET method): 200 (OK) for success.
• Single object query (GET method): 200 (OK) for success, 204 (No Content) for failure causedby non-existent object.
• Add (POST method): 201 (Created) for success and returning link to the object, 204 (NoContent) for success without returning any content.
• Modify (PUT method): 204 (No Content) for success without returning any content, 404 (NotFound) for failure caused by non-existent object.
• Delete (DELETE method): 204 (No Content) for success without returning any content, 410(Gone) for failure caused by non-existent object.
When performing operations, you may encounter errors due to service restrictions. For example,if you try to delete an online operator, the server will return the status code 409 (Conflict), theError-Code attribute, and the Error-Message attribute. For more information about the error codesand their descriptions, see “Error Codes.”In addition, you may encounter errors that are caused by error encoding or iMC server errors. Thefollowing describes these errors, their status codes, and solutions:
• Non-existent service specified by the URI: 404 (Not Found). Check the URI against the APIdocumentation and correct the URI. Note that when this error occurs, the returned packetcontains the message body in HTML format. When the object of the GET or PUT method doesnot exist, the returned packet does not contain any message body, though its status code is404 (Not Found).
• Unsupported method: 405 (Method Not Allowed). Check the API documentation or use theOPTIONS method to get the supported methods.
• Unsupported content type: 406 (Not Acceptable). Set a valid content type (accept messageheader) according to the API documentation.
• Illegitimate parameters carried in the requested URI (such as the type cannot be changed):400 (Bad Request). Check the API documentation for parameter restrictions.
• Unauthorized request: 401 (Unauthorized). Set valid authentication parameters according tothe Identity Authentication and Privilege Control section and test code example.
30 R&D References
• Prohibited or unauthorized operation of the user: 403 (Forbidden).
• iMC server error: 500 (Internal Server Error). Check whether or not the iMC server worksnormally (for example, whether or not the web page can be normally accessed), or contactthe technical support.
Wildcard characters supported in queriesIn multi-criteria queries, some string-type criteria support wildcard characters asterisk (*) andquestion mark (?), the former matching zero or more characters and the latter matching a singlecharacter. A query without any wildcard character specified returns an exact match.
Data types and rangesiMC-RS supports the following data types:
• Integer (int): Ranges from -2147483648 to 2147483647 (0x80000000 to 0x7fffffff inhexadecimal notation).
• Long integer (long): Ranges from -9223372036854775808 to 9223372036854775807(0x8000000000000000 to 0x7fffffffffffffff in hexadecimal notation)
• Floating point (float): Ranges from 1.4E-45 to 3.4028235E38
• Double precision (double): Ranges from 4.9E-324 to 1.7976931348623157E308.
Result set of multi-criteria batch queriesMulti-criteria batch queries (or lists) support the start size. A query returns ten records by default,and can return up to 1000 records.The returned result is included within <list>...</list>. In addition to the result list of the currentoperation, previous and next resource URIs are also presented as atom:link elements in "Previous(<link> rel=”previous” href=”...”/>)” and “Next (<link> rel=”previous” href=”...”/>)” format.The resource URI of each entity in the result set is represented in <link> rel=”self” href=”...”/>format.If the total parameter is used, then the returned message body is empty, and the Total attribute ofthe message header returns the number of records that meet the requirements.
Error CodesIf an HTTP response message gives the 409 (Conflict) status code, the Error-Code and Error Messageattributes in the message header show the iMC error code and error description. For example:
Table 1 shows all error codes and their descriptions that you might encounter in iMC-RS.
Table 1 Error codes and descriptions
Query Parameters
Operation timeout.The server performance may be insufficient. Please check the data later to see if the operation succeeds.
3
Database error.Please check the database status.
4
Database error.2003
Failed to access the device.2013
Error Codes 31
Table 1 Error codes and descriptions (continued)
Query Parameters
The device already exists.2014
Unknown device.2015
The device cannot be pinged.2024
The number of devices exceeds the limit set in the license.2032
Failed to obtain the limit of the device number from the license.2033
Domain name resolution or reverse domain name resolution failure.2038
The parent symbol has been deleted.2041
The SNMP template has been deleted.2046
The Telnet template has been deleted.2047
The device IP address is invalid when the device is added.2054
The SNMP parameters on the device are invalid.2078
Failed to operate the SSH key file.2094
The operator already exists.50311
The operator group already exists.50334
The operator group is in use.50339
The default operator group cannot be deleted.50340
FAQThis section describes the problems you may encounter when developing iMC-RS, and providessolutions to them.How to query the services that iMC-RS offers?In the API documents, you can query the services based on the deployed components. Or you canview the list of all services at http://imc_host:port/imcrs/application.wadl.Explain the wildcard characters and special characters used in multi-criteria queries.In multi-criteria queries, some string-type criteria support wildcard characters asterisk (*) andquestion mark (?). The former matches zero or more characters, and the latter matches a singlecharacter. A query without any wildcard character specified returns an exact match. Whenperforming a fuzzy match, note the special characters reserved in the database. For example,square brackets ([ ]) in SQL server databases. If the query criteria contain special characters, youmay obtain undesired results. To prevent such problems, escape special characters with the methoddescribed in the corresponding database documentHow to enable the call logs feature on iMC-RS?You can query and view call logs in iMC-RS. To ensure performance, the call logs feature is disabledby default. You can enable this feature with the following method:Open file client\conf\log4j.properties in the iMC installation path, locate thelog4j.appender.IMCRS.Threshold string, and change its value from INFO to DEBUG orTRACE. In the DEBUG level, iMC-RS records the header of each request or response message thatis called. In the TRACE level, iMC-RS records both the header and the message body. iMC-RSsaves the call logs in file client\log\imcrs.log in the iMC installation path.
32 R&D References
4 System ManagementThis section provides eAPI commands that enable you to manage the users who can operate yourIMC system. It includes descriptions of the following commands:• Query All Operators
• Query Individual Operators
• Add Operator
• Modify Operators
• Delete Operator
• Query Operator Groups
• Query Operator Group Details
• Add Operator Group
• Modify Operator Group
• Delete Operator Group
33
Query All OperatorsQuery and list all operators.
Interface URI/plat/operator
Access Method
HTTPGET
Parameters
Query parameters
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value is uploaded, the default value isused.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value is uploaded, the default value isused.
The sequencing field of the returned result set.orderByString type. Optional. The default value is id. Valid values include ip, mac, name and type.
Whether or not the result is sequenced in reverse order.descBoolean type. Optional. The default value is false. The parameter is valid only when the orderByparameter is specified.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Total attribute of the message headerreturns the number of records that meet the requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
HTTP/1.1 200 OKTotal 2
34 System Management
Message body
<list> <operator> <id>1</id> <name>admin</name> <fullName>admin</fullName> <authType>0</authType> <desc>Super administrator that has all privileges.</desc> <link href=”http://localhost:8080/imcrs/plat/operator/1” op=”GET” rel=”self”/> </operator> . . .
</list>
ElementsFor meanings of the fields in the message body, see “Query All Operators” (page 34).
ExampleQuery and list all operators.
Request
GET http://imc_host:8080/imcrs/plat/operatoraccept: application/xml. . .
<list> <operator> <id>1</id> <name>admin</name> <fullName>admin</fullName> <authType>O</authType> <desc>Super administrator that has all privileges.</desc> <link href=”http://localhost:8080/imcrs/plat/operator/1” op=”GET” rel=”self”/> </operator> . . .</list>
Query All Operators 35
Query Individual OperatorsQuery an operator with certain ID.
Interface URI/plat/operator/{id}
Access Method
HTTPGET
Parameters
Path parameters
Operator ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<operator> <id>1</id> <name>admin</name> <fullName>admin</fullName> <desc>Super admin who has all the privileges.</desc> <authType>0</authType> <operatorGroup>http://localhost:8080/imcrs/plat/operatorGroup/1</operatorGroup></operator>
Element description
Operator elements
Operator ID.idLong integer type. It is not required when you add an operator and is required when youmodify an operator.
Operator logon name.nameString type. It is required when you add an operator and cannot be modified when you modifyan operator.
Operator full name.fullNameString type. It is optional when you add or modify an operator.
Operator description.descString type. It is optional when you add or modify an operator.
36 System Management
Operator elements
Authentication type.authTypeInteger type. 0: simple password authentication. 1: RADUIS authentication. 2:LDAPauthentication. It is required when you add or modify an operator.
Operator password.passwordString type. It is required when you add or modify an operator if the authentication type is0.
Idle timeout.sessionTimeoutInteger type, in the range of 1 to 9999999. When you add or modify an operator withoutsetting this parameter, the system parameter will take affect.
OperatorGroup ID.operatorGroupLong integer type. It is required when you add or modify an operator.
Default value of operator ACL control.default AclInteger type, 0 refers to permission and 1 refers to disable. It is required when you add ormodify an operator.
Operator ACL List.operatorAclListOperator ACL information list. It is optional when you add or modify an operator.
Operator ACL information.operatorAclSuboption startlp refers to the start IP, the string type, and the required option.Suboption endlp refers to the end IP, the string type, and the required option.Subotion authType refers to the access type, the integer type, 0 referring to permission and1 referring to restriction and the required option.Suboption desc refers to descriptions, the string type, and the optional item.Suboption aclOrder refers to priority, the integer type, and the required option.
Operator Group information.operatorGroupFunction link. It is not required when you add or modify a group and it is contained in theresponse message when you query a group.
Query Individual Operators 37
ExampleQuery the operator whose ID is 1.
Request
GET http://imc_host:8080/imcrs/plat/operator/1accept: application/xml. . .
<operator> <id>1</id> <id>1</id> <name>admin</name> <fullName>admin</fullName> <authType>O</authType> <desc>Super administrator that has all privileges.</desc> <link href=http://localhost:8080/imcrs/plat/operatorGroup/1</operator></operator>
38 System Management
Add OperatorAdd an operator with specified information.
Delete OperatorDelete an operator with the specified ID. Make sure that the operator to be deleted is offline.Otherwise, the login operator will be unavailable.
Interface URI/plat/operator/{id}
Access Method
HTTPDELETE
Parameters
Path parameters
Operator ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
• 410 (Gone): No data is found with the specified ID.
Query Operator GroupsQuery and list operator groups.
Interface URI/plat/operatorGroup
Access Method
HTTPGET
Parameters
Query parameters
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value is uploaded, the default value isused.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value is uploaded, the default value isused.
The sequencing field of the returned result set.orderByString type. Optional. The default value is id. Valid values include ip, groupName, and groupDesc.
Whether or not the result is sequenced in reverse order.descBoolean type. Optional. The default value is false. The parameter is valid only when the orderByparameter is specified.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Total attribute of the message headerreturns the number of records that meet the requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
HTTP/1.1 200 OKTotal: 2
44 System Management
Message body
<list> <operatorGroup> <id>1</id> <groupName>Administrator group</groupName> <groupDesc>The group of operators that have the administrative rights.</groupDesc> <roleDesc>Administrator</roleDesc> <link href=”http://localhost:8080/imcrs/plat/operatorGroup/1” op=”GET” rel=”self” /> </operatorGroup> . . .
</list>
ElementsFor meanings of the fields in the message body, see “Query All Operators” (page 34).
ExampleQuery and list operator groups.
Request
GET http://imc+host:8080/imcrs/plat/operatorGroupaccept: application/xml. . .
Response
HTTP/1.1 200 OKContent-Type: application/xml. . .
<list> <operatorGroup> <id>1</id> <groupName>Administrator group</groupName> <groupDesc>The group of operators that have the administrative rights.</groupDesc> <roleDesc>Administrator</roleDesc> <link href=”http://localhost:8080/imcrs/plat/operatorGroup/1” op=”GET” rel=”self” /> </operatorGroup> . . .
</list>
Query Operator Groups 45
Query Operator Group DetailsQuery detailed information about an operator group with the specified ID.
Interface URI/plat/operatorGroup/{id}
Access Method
HTTPGET
Path parameters
Operator ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<operatorGroup> <id>1</id> <groupName>Administrator group</groupName> <groupDesc>The group of operators that have the administrative rights.</groupDesc> <roleDesc>Administrator</roleDesc> <role>http://localhost:8080/imcrs/plat/role/1</role> <privileges>http://localhost:8080/imcrs/plat/operatePrivilege?groupId=1</privileges></operatorGroup>
Elements
operatorGroup sub-elements
Operator ID.idLong integer type. This element is not needed when you add an operator group and it is requiredwhen you modify an operator group.
Operator group name.groupNameString type.This element is required when you add an operator group and cannot be changed whenyou modify an operator group.
Operator group description.groupDescString type. This element is optional when you add or modify an operator group.
Role description.roleDescString type. This element is optional when you add or modify an operator group and is returned inthe response message for queries.
Role ID.roleId
46 System Management
operatorGroup sub-elements
Long integer type. This element is required when you add or modify an operator group.
List of operator privileges. This element is optional when you add or modify an operator group.operatePrivilegeList
Operator privilege.operatePrivilegeThe id suboption represents the operator privilege ID. String type. Required.The desc suboption represents the privilege description. String type. Optional.The level suboption represents the privilege level. The value is —1 for the function privilege leveland is 1 for the component privilege level (privilege named by the component ID). Integer type.Required.
Role link.roleFunction link. This element is not needed when you add or modify an operator group and is returnedin the response message for queries.
Operator privilege link.privilegesFunction link. This element is not needed when you add or modify an operator group and is returnedin the response message for queries.
ExampleQuery information about the operator group with ID 1.
Request
GET http://imc_host:8080/imcrs/plat/operatorGroup/1accept: application/xml. . .
Response
HTTP/1.1 200 OKContent-Type: application/xml. . .<operatorGroup> <id>1</id> <groupName>Administrator group</groupName> <groupDesc>The group of operators that have the administrative rights.</groupDesc> <roleDesc>Administrator</roleDesc> <role>http://localhost:8080/imcrs/plat/role/1</role> <privileges>http://localhost:8080/imcrs/plat/operatePrivilege?groupId=1</privileges></operatorGroup>
Query Operator Group Details 47
Add Operator GroupAdd an operator group with specified information.
5 Network Resource ManagementThis section provides eAPI commands that enable you to control your devices and other networkresources. It includes descriptions of the following commands:
• Query Device Information List
• Query Device Information
• Query Device Types
• Query Device Type
• Query Vendor Information List
• Query Vendor Information
• Query Device Series Information List
• Query Device Series Information
• Query Device Model Information List
• Query Device Model Information
• Add Device
• Synchronize Device
• Manage Device
• Unmanage Device
• Delete Device
• Modify Device Label
• Modify System Information
• Modify Login Method
• Modify Device Group
• Modify SNMP Settings
• Modify Telnet Settings
• Modify SSH Settings
• Modify Polling Interval
• Modify Ping Parameters
• Modify Web Network Management Parameters
• Query Service Monitoring Information List
• Modify Service Monitoring Information
• Ping
• Tracert
• Query Links
• Query Link Information
• Start Automatic Discovery
• Stop Automatic Discovery
• Query Automatic Discovery Status
• Query Automatic Device Discovery Results
53
• Query Automatically Discovered Devices
• Query Device Interface Information
• Query Interface Details
• Bring Up an Interface
• Shut Down an Interface
• Query Custom View List
• Query Custom View Information
• Add Custom View
• Modify Custom View
• Delete Custom View
• Query Interface Views
• Query Interface View Information
• Add Interface View
• Modify Interface View
• Delete Interface View
• Query IP Views
• Query IP View
• Export Topology in Visio Format
• Query SNMP Template Information List
• Query SNMP Template Information
• Query Telnet Template Information List
• Query Telnet Template Information
• Query SSH Template Information List
• Query SSH Template Information
• Query SQL Statements
54 Network Resource Management
Query Device Information ListQuery device information based on predefined criteria.
Interface URI/plat/res/device
Access Method
HTTPGET
Parameters
Query parameter
Filter resources by access right.resPrivilegeFilterBoolean type. Optional. The default value is false.
Device type.categoryInteger type. Optional. No default value. Valid values can be obtained through SNMP TemplateQuery Interfaces.
Device label.labelString type. Wildcards are supported. Optional. No default value.
Device IP address.ipString type. Wildcards are supported. Optional. No default value.
MAC address.macString type. Wildcards are supported. Optional. No default value.
Device status.statusInteger type. Optional. No default value. For valid values, see “Device status description.”
Device status.seriesInteger type. Optional. No default value. Valid values can be obtained through Device SeriesQuery Interfaces.
Contact.contactString type. Wildcards are supported. Optional. No default value.
Device location.locationString type. Wildcards are supported. Optional. No default value.
Location of the first returned record in the query result.startInteger type. Optional. The default value is 0. If the input value is smaller than 0, the defaultvalue is used.
Total returned records.sizeInteger type. Optional. The default value is 10. If the input value is smaller than 0, the defaultvalue is used.
Sort field of the returned result.orderByString type. Optional. The default value is id. Valid values include id, label, ip, mask, status,contact, location, sysoid, and sysName.
Sort records in descending order.desc
Query Device Information List 55
Query parameter
Boolean type. Optional. The default value is false. It is valid only when the orderBy parameteris specified.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and sizeattributes are invalid, the returned message body is empty, and the Message Header fieldgives the records that match the sort criteria.
Returned Result
Status codes
• 200 (OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Nomessage body is included.
HTTP/1.1 200 OKTotal: 150
Message body
HTTP/1.1 200 OKTotal: 150
For the description on each field of the returned value, see the API document for Query DeviceInformation.
ExampleQuery the 10th to the 20th pieces of information about devices whose IP address starts from192.168.0.
Request
GET jttp://imc_host:8080/imcrs/plat/res/device?ip=192.168.0. *&start=10&size=10accept: application/xml. . .
Query Device InformationQuery device basic information based on device ID. Besides device basic information, the methodfor accessing device extended information and access interface for device-related operations arealso returned.
Interface URI/plat/res/device/{id}
Access Method
HTTPGET
Path parameter
Device ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message headerThe following links are provided through the Link field:
Synchronize Devicesynchronize
Manage Devicesmanage
Unmanage Deviceunmanage
Delete Devicedelete
Pingping
Track Device by Routingtracert
Modify Device LabelupdateLabel
Modify System Information (System Name, Contact, and LocationupdateSysGrpAttr
Modify Login MethodupdateLoginType
Modify Device TypeupdateCategory
Modify SNMP ConfigurationupdateSnmp
Modify Telnet ConfigurationupdateTelenet
Modify SSH ConfigurationupdateSsh
Modify Poll IntervalupdatePollInterval
Modify Ping ParametersupdatePingParam
Modify Web Network Management ParametersupdateWebMrgParam
Last 10 Unacknowledged Alarmslatest10UnrecoveryFault
Query Device TypesQuery device types based on predefined criteria.
Interface URI/plat/res/category
Access Method
HTTPGET
Parameters
Query parameter
Type name.nameString type. Wildcards are supported. Optional. No default value.
Location of the first returned record in the query result.startInteger type. Optional. The default value is 0. If the input parameter is smaller than 0, the parameteris automatically changed to 0.
Total returned records.sizeInteger type. Optional. The default value is 10. If the input parameter is smaller than 0, the parameteris automatically changed to 0. If the input parameter is greater than 1000, the parameter isautomatically changed to 1000.
Sort field of the returned result.orderByString type. Optional. The default value is id. Valid values include id, name, and preDefined.
Sort field of the returned result.descBoolean type. Optional. The default value is false. It is valid only when the orderby parameter isspecified.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
Returned Result
Status codes
• 200 (OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Nomessage body is included.
Query Vendor Information ListQuery device vendor information list.
Interface URI/plat/res/vendor
Access Method
HTTPGET
Parameters
Query parameter
Vendor name.nameString type. Wildcards are supported. Optional. No default value.
Location of the first returned record in the query result.startInteger type. Optional. The default value is 0. If the input parameter is smaller than 0, the parameteris automatically changed to 0.
Total returned records.sizeInteger type. Optional. The default value is 10. If the input parameter is smaller than 0, the parameteris automatically changed to 0. If the input parameter is greater than 1000, the parameter isautomatically changed to 1000.
Sort field of the returned result.orderByString type. Optional. The default value is id. Values include id, name, description, phone, contact,and preDefined.
Sort records in descending order.descBoolean type.Optional.The default value is false. It is valid only when the orderBy parameter is specified.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
Returned Result
Status codes
• 200 (OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Nomessage body is included.
Query Device Series Information ListQuery device series information list based on predefined criteria.
Interface URI/plat/res/series
Access Method
HTTPGET
Parameters
Query parameter
Device series name.seriesNameString type. Wildcards are supported. Optional. No default value.
Vendor name.vendorNameString type. Wildcard is supported. Optional. No default value.
Only devices managed by iMC can be found.managedOnlyBoolean type. Optional. The default value is false. If the value is true, only device series managedby iMC is listed in the query result.
Location of the first returned record in the query result.startInteger type. Optional. The default value is 0. If the input parameter is smaller than 0, the parameteris automatically changed to 0.
Total returned records.sizeInteger type. Optional. The default value is 10. If the input parameter is smaller than 0, the parameteris automatically changed to 0. If the input parameter is greater than 1000, the parameter isautomatically changed to 1000.
Sort field of the returned result.orderByString type. Optional. The default value is id. Values include id, name, description, and preDefined.
Sort records in descending order.descBoolean type. Optional. The default value is false. It is valid only when the orderBy parameter isspecified.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
Query Device Series Information List 71
Returned Result
Status codes
• 200 (OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Nomessage body is included.
Query Device Model Information ListQuery device information based on predefined criteria.
Interface URI/plat/res/model
Access Method
HTTPGET
Parameters
Query parameter
Model name.nameString type. Wildcards are supported. Optional. No default value.
Model sysOID.sysOidString type. Wildcards are supported. Optional. No default value.
Vendor.vendorInteger type. Optional. No default value. Valid values can be obtained through Vendor QueryInterface.
Device series.seriesInteger type. Optional. No default value. Valid values can be obtained through Device Series QueryInterface.
Device type.categoryInteger type. Optional. No default value. Valid values can be obtained through Device Type QueryInterface.
Location of the first returned record in the query result.startInteger type. Optional. The default value is 0. If the input parameter is smaller than 0, the defaultvalue 0 is used.
Total returned records.sizeInteger type. Optional. The default value is 10. If the input parameter is smaller than 0, the parameteris automatically changed to 0. If the input parameter is greater than 1000, the parameter isautomatically changed to 1000.
Sort field of the returned result.orderByString type. Optional. The default value is id. Valid values include id, name, and predefined.
Sort records in descending order.descBoolean type. Optional. The default value is false. It is valid only when the orderBy parameter isspecified.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
76 Network Resource Management
Returned Result
Status codes
• 200 (OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Nomessage body is included.
Send traps to the network management system.registerTrapBoolean type. Optional. The default value is true. It is valid only when the alarm componentis installed.
Support for the ping operation.supportPingBoolean type. Optional. The default value is true.
Add the device even if the device cannot be pinged successfully.forceAdd
Add Device 81
device sub-elements
Boolean type. Optional. The default value is false.
Use the loopback address as the management IP address.loopbackAsMgrIpBoolean type. Optional. The default value is false.
SNMP template ID.snmpTmplIdInteger type. Required. No default value. Valid values can be obtained through SNMPTemplate Query Interfaces. If both snmpTmplId and snmpParameter exist, snmpTmplId ispreferred, and snmpParameter is omitted.
Telnet template ID.telnetTmplIdInteger type. Required. No default value. Valid values can be obtained through TelnetTemplate Query Interfaces. If both telnetTmplId and telnetParameter exist, telnetTmplId ispreferred, and telnetParameter is omitted.
SSH template ID.sshTmplIdInteger type. Required. No default value. Valid values can be obtained through SSHTemplate Query Interfaces. If both sshTmplId and sshParameter exist, sshTmplId is preferred,and sshParameter is omitted.
SNMP parameters.snmpParameterFor SNMP parameters, see SNMP Parameter Description. Required. No default value. Ifboth snmpTmplId and snmpParameter exist, snmpTmplId is preferred, and snmpParameteris omitted.
Telnet parameters.telnetParameterFor Telnet parameters, see Telnet Parameter Description. Required. No default value. Ifboth telnetTmplId and telnetParameter exist, telnetTmplId is preferred, and telnetParameteris omitted.
SSH parameters.sshParameterFor SSH parameters, see SSH Parameter Description. Required. No default value. If bothsshTmplId and sshParameter exist, sshTmplId is preferred, and sshParameter is omitted.
Returned Result
Status codes
• 201 (Created): Success.
• 409 (Conflict): Failure. See “Error Codes.”
Message headerIf the operation succeeds, the Location field gives the URI of the new resource. The message bodyis empty.
Device ID.idLong integer type. Required. No default value.
Message body
<device> <loginType>2</loginType></device>
Element description
device sub-elements
Login method. 0: None. 1: Telnet. 2: SSH.loginTypeInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
92 Network Resource Management
ExampleChange the login method for the device with the ID 10 to 2.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updateLoginTypeaccept: application/xml...<device> <loginType>2</loginType></device>
Response
HTTP/1.1 204 No Content...
Modify Login Method 93
Modify Device GroupModify a device group based on device ID and device group.
Interface URI/plat/res/device/{id}/updateCategory
Access Method
HTTPPUT
Parameters
Path parameter
Device ID.idLong integer type. Required. No default value.
Message body
<device> <categoryId>1</categoryId></device>
Element description
device sub-elements
Device type ID.categoryIdInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
94 Network Resource Management
ExampleChange the device group for the device with the ID 1 to 1.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/updateCategoryaccept: application/xml...<device> <categoryId>1</categoryId></device>
Response
HTTP/1.1 204 No Content...
Modify Device Group 95
Modify SNMP SettingsModify SNMP settings for a device based on device ID.
Interface URI/plat/res/device/{id}/updateSnmp
Access Method
HTTPPUT
Parameters
Path parameter
Device ID.idLong integer type. Required. No default value.
SNMPv3 Priv-Aes128 Auth-Md5, SNMPv3 Priv-Aes128 Auth-Sha, SNMPv3 Priv-Aes192 Auth-Md5,SNMPv3 Priv-Aes192 Auth-Sha, SNMPv3 Priv-Aes256 Auth-Md5, and SNMPv3 Priv-Aes256 Auth-Sha.String type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Read-only community name.roCommunityString type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
96 Network Resource Management
snmpParameter sub-elements
Read-write community string.rwCommunityString type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Timeout time.timeoutLong integer type. Optional. If the element does not exist, the value is not changed. If the elementexists, the value cannot be null.
Number of retries.retriesLong integer type. Optional. If the element does not exist, the value is not changed. If the elementexists, the value cannot be null.
Username.securityNameString type. Optional. It is effective only for SNMPv3. If the element does not exist, the value is notchanged. If the element exists, the value cannot be null.
Authentication password.authPasswordString type. Optional. It is effective only for SNMP authentication. If the element does not exist, thevalue is not changed. If the element exists, the value cannot be null.
Encryption password.privPasswordString type. Optional. It is effective only for SNMP encryption. If the element does not exist, the valueis not changed. If the element exists, the value cannot be null.
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
Modify SNMP Settings 97
ExampleChange the SNMP settings for the device with the ID 10.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updateSnmpaccept: application/xml...<device> <snmpParameter> <paraType>SNMPv1</paraType> <roCommunity>public</roCommunity> <rwCommunity>private</rwCommunity> <timeout>10</timeout> <retries>10</retries> </snmpParameter></device>
Response
HTTP/1.1 204 No Content...
98 Network Resource Management
Modify Telnet SettingsModify Telnet settings for a device based on device ID.
Interface URI/plat/res/device/{id}/updateTelnet
Access Method
HTTPPUT
Parameters
Path parameter
Device ID.idLong integer type. Required. No default value.
Telnet parameters.telnetParameterElement type. See the following description.
Telnet template ID.telnetTmplIdInteger type. If both telnetTmplId and telnetParameter exist, telnetParameter is preferred, andtelnetTmplId is omitted.
telnetParameter sub-elements
Authentication mode. 0: Password. 1: Username + password. 2: Super password. 3: Password +super password. 4: Username + password + super password. 5: No username, no password. 6:Username without password.
authType
Integer type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Username.userNameString type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Modify Telnet Settings 99
telnetParameter sub-elements
Password.userPasswordString type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Super password.superPasswordString type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Timeout time.timeoutLong integer type. Optional. If the element does not exist, the value is not changed. If the elementexists, the value cannot be null.
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
ExampleChange the Telnet settings for the device with the ID 10.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updateTelnetaccept: application/xml...<telnetParameter> <authType>1</authType> <userName>admin</userName> <userPassword>admin</userPassword> <superPassword>admin</superPassword> <timeout>5</timeout></telnetParameter>
Response
HTTP/1.1 204 No Content...
100 Network Resource Management
Modify SSH SettingsModify SSH settings for a device based on device ID.
Interface URI/plat/res/device/{id}/updateSsh
Access Method
HTTPPUT
Parameters
Path parameter
Device ID.idLong integer type. Required. No default value.
SSH settings.sshParameterElement type. See the following description.
SSH template ID.sshTmplIdInteger type. If both sshTmplId and sshParameter exist, sshParameter is preferred, and sshTmplId isomitted.
sshParameter sub-elements
Authentication mode. 0: Password authentication. 3: Key authentication + super password. Integertype. Optional. If the element does not exist, the value is not changed. If the element exists, the valuecannot be null.
authType
Username.userNameString type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Password.password
Modify SSH Settings 101
sshParameter sub-elements
String type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Port.portInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Timeout time.timeoutInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Number of retries.retriesInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Super password.superPasswordString type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
102 Network Resource Management
ExampleChange the SSH settings for the device with the ID 10.
Set polling interval.configPollTimeInteger type, in minutes. Optional. If the element does not exist, the value is not changed. If theelement exists, the value cannot be null
Status polling interval.statePollTimeInteger type, in seconds. Optional. If the element does not exist, the value is not changed. If theelement exists, the value cannot be null.
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
104 Network Resource Management
ExampleChange the polling interval for the device with the ID 1 to 1.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updatePollIntervalaccept: application/xml...<device> <configPollTime>1800</configPollTime> <statePollTime>100</statePollTime></device>
Response
HTTP/1.1 204 No Content...
Modify Polling Interval 105
Modify Ping ParametersModify ping parameters for a device based on device ID.
Support for the ping operation.supportPingBoolean type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
106 Network Resource Management
ExampleChange the ping parameters for the device with the ID 10. The device does not support the pingoperation.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updatePingParamaccept: application/xml...<device> <supportPing>false</supportPing></device>
Response
HTTP/1.1 204 No Content...
Modify Ping Parameters 107
Modify Web Network Management ParametersModify web network management settings for a device based on device ID.
Protocol used by a lower-level network managementwebMgrProtocolString type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Login port for a lower-level network management.webMgrPortLong integer type. Optional. If the element does not exist, the value is not changed. If the elementexists, the value cannot be null.
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
108 Network Resource Management
ExampleChange the web network management parameters for the device with the ID 10.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updateWebMgrParamaccept: application/xml...<device> <webMgrProtocol>HTTP</webMgrProtocol> <webMgrPort>80</webMgrPort> </device>
Response
HTTP/1.1 204 No Content...
Modify Web Network Management Parameters 109
Query Service Monitoring Information ListQuery device service monitoring information based on predefined criteria.
Interface URI/plat/res/device/service
Access Method
HTTPGET
Parameters
Query parameter
Device ID.deviceIdLong integer type. Required. No default value.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
Returned Result
Status codes
• 200 (OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Themessage body is empty.
Device ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message body
<ping> <result>ping -l 32 -n 5 10.153.89.12 Pinging 10.153.89.12 with 32 bytes of data: Reply from 10.153.89.12: bytes=32 time=9ms TTL=251 Reply from 10.153.89.12: bytes=32 time=2ms TTL=251 Reply from 10.153.89.12: bytes=32 time=2ms TTL=251 Reply from 10.153.89.12: bytes=32 time=2ms TTL=251 Reply from 10.153.89.12: bytes=32 time=2ms TTL=251 Ping statistics for 10.153.89.12: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 2ms, Maximum = 9ms, Average = 3ms</result></ping>
Element description
ping sub-elements
Ping results.resultString type.
114 Network Resource Management
ExamplePing the device with the ID 10.
Request
GET http://imc_host:8080/imcrs/plat/device/10/pingaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<ping> <result>ping -l 32 -n 5 10.153.89.12 Pinging 10.153.89.12 with 32 bytes of data: Reply from 10.153.89.12: bytes=32 time=9ms TTL=251 Reply from 10.153.89.12: bytes=32 time=2ms TTL=251 Reply from 10.153.89.12: bytes=32 time=2ms TTL=251 Reply from 10.153.89.12: bytes=32 time=2ms TTL=251 Reply from 10.153.89.12: bytes=32 time=2ms TTL=251 Ping statistics for 10.153.89.12: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 2ms, Maximum = 9ms, Average = 3ms</result></ping>
Ping 115
TracertTracert a device based on device ID.
Interface URI/plat/res/device/{id}/tracert
Access Method
HTTPGET
Parameters
Path parameter
Device ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message body
<tracert> <result>tracert 10.153.89.12 Tracing route to 10.153.89.12 over a maximum of 30 hops 1 * * * Request timed out. 2 * * * Request timed out. 3 * * * Request timed out. 4 5 ms 9 ms 2 ms 10.153.89.12 Trace complete.</result></tracert>
Element description
tracert sub-elements
Tracert results.resultString type.
116 Network Resource Management
ExampleTracert the device with the ID 10.
Request
GET http://imc_host:8080/imcrs/plat/device/10/tracertaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<tracert> <result>tracert 10.153.89.12 Tracing route to 10.153.89.12 over a maximum of 30 hops 1 * * * Request timed out. 2 * * * Request timed out. 3 * * * Request timed out. 4 5 ms 9 ms 2 ms 10.153.89.12 Trace complete.</result></tracert>
Tracert 117
Query LinksQuery device links based on predefined criteria.
Interface URI/plat/res/link
Access Method
HTTPGET
Parameters
Query parameter
Topology ID, or custom view ID. See the API document in Query Custom Views.topoIdLong integer type. Required. No default value.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
Returned Result
Status codes
• 200 (OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Themessage body is empty.
Start Automatic DiscoveryThis function helps you discover manageable devices and add them to the network managementsystem. Automatic discovery can be in simple or advanced mode.
Subnet for automatic discovery. Required. No default value. Multiple subnets are supported.ipSection
Start IP address of the subnet. String type. Required. No default value.begin
End IP address of the subnet. String type. Required. No default value.end
Send traps to the network management system. Boolean type. Optional. The default value istrue.
sendTrap
Advanced type. 1: Subnet. 2: Routing. 3: IPsec. 4: Reserved (invalid). 5: ARP. 6: PPP. Integertype. Optional. The default value is routing.
discoverType
Use the loopback address as the management IP address. Boolean type. Optional. The defaultvalue is false.
loopBackAsManageIP
Discover non-SNMP devices. Boolean type. Optional. The default value is true.discoverNonSnmpDevice
Scan devices on the subnet. Boolean type. Optional. The default value is false.pingAll
Seed IP address. String type. Required. No default value. Multiple seed IP addresses aresupported.
seedIp
Filter subnet IP addresses. String type. Required. No default value. Multiple subnet IP addressesare supported.
filterSubNetIp
Filter subnets. 1: No (discover devices in the filtered subnet). 2: Yes (not discover devices inthe filtered subnet). Long integer type. Optional. The default value is no.
filterSubNet
Discover hops. Integer type. Optional. The default value is 3.level
SNMP parameters. For SNMP parameters, see SNMP Parameter Description. Required. Nodefault value. Multiple SNMP parameters are supported. If both snmpTmplId andsnmpParameter exist, snmpTmplId is preferred, and snmpParameter is omitted.
snmpParameter
122 Network Resource Management
autoDiscoverConfig sub-elements
Telnet parameters. For Telnet parameters, see Telnet Parameter Description. Optional. Nodefault value. If both telnetTmplId and telnetParameter exist, telnetTmplId is preferred, andtelnetParameter is omitted.
telnetParameter
SSH parameters. For SSH parameters, see SSH Parameter Description. Optional. No defaultvalue. If both sshTmplId and sshParameter exist, sshTmplId is preferred, and sshParameter isomitted.
sshParameter
SNMP template ID. Integer type. Optional. No default value. Multiple elements are supported.Valid values can be obtained through SNMP Template Query Interfaces. If both snmpTmplIdand snmpParameter exist, snmpTmplId is preferred, and snmpParameter is omitted.
snmpTmplId
Telnet template ID. Integer type. Optional. No default value. Valid values can be obtainedthrough Telnet Template Query Interfaces. If both telnetTmplId and telnetParameter exist,telnetTmplId is preferred, and telnetParameter is omitted.
telnetTmplId
SSH template ID. Integer type. Optional. No default value. Valid values can be obtainedthrough SSH Template Query Interfaces. If both sshTmplId and sshParameter exist, sshTmplIdis preferred, and sshParameter is omitted.
sshTmplId
Returned Result
Status codes
• 200 (OK): Success.
Message bodyIf the operation succeeds, the message body is returned.
<list> <discoverResult> <cmdCode>3</cmdCode> <type>4</type> <time>2011-07-01 13:59:34</time> Automatic discovery has finished. </content> <deviceIp>finished</deviceIp> <result>Six devices have been discovered, where five are SNMP devices, and one is an ICMP device. 0 devices are added.</result> </discoverResult> ...</list>
Element description
discoverResult sub-elements
Command codes. 0: Start automatic discovery. 1: Common message. 2: Automatic discover alarm.3: Automatic discovery has stopped.
cmdCode
Integer type.
Command type. 0: Error message common value. 1: Informational message common value. 2: Alarmmessage common value. 4: Successful message common value.
type
Integer type.
Discovered at.timeString type.
Content.contentString type.
Device IP.deviceIpString type.
Result.resultString type.
Protocol. String type.deviceProtocol
Query Automatic Device Discovery Results 127
ExampleQuery automatic device discovery results.
Request
GET http://imc_host:8080/imcrs/plat/res/autodiscover/resultaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <discoverResult> <cmdCode>3</cmdCode> <type>4</type> <time>2011-07-01 13:59:34</time> Automatic discovery has finished. </content> <deviceIp>finished</deviceIp> <result>Six devices have been discovered, where five are SNMP devices, and one is an ICMP device. 0 devices are added.</result> </discoverResult> <discoverResult> <cmdCode>2</cmdCode> <type>0</type> <time>2011-07-01 13:59:33</time> <content>10.153.89.7(10.153.89.7)</content> <deviceIp>10.153.89.7</deviceIp> <deviceProtocol/> <result>Device "10.153.89.7(10.153.89.7)" has already existed.</result> </discoverResult> ...</list>
Device ID.deviceIdLong integer type. Required. No default value.
Query parameters
Query parameter
Location of the first returned record in the query result.startInteger type. Optional. The default value is 0. If the input parameter is smaller than 0, the defaultvalue 0 is used.
Total returned records.sizeInteger type. Optional. The default value is 10. If the input parameter is smaller than 0, the defaultvalue 10 is used.
Sort records in descending order.descBoolean type. Optional. The default value is false. Interface index is used to sort interfaces by default.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
Returned Result
Status codes
• 200 (OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Themessage body is empty.
Device ID.deviceIdLong integer type. Required. No default value.
Interface index.ifIndexLong integer type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
ExampleShut down the interface with the index 2 and device ID 2.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/interface/2/downaccept: application/xml...
Response
HTTP/1.1 204 No Content
Shut Down an Interface 137
Query Custom View ListQuery custom view list.
Interface URI/plat/res/view/custom
Access Method
HTTPGET
Parameters
Query parameter
Filter resources by access right.resPrivilegeFilterBoolean type. Optional. The default value is false.
Sort records in descending order.descBoolean type. Optional. The default value is false. Interface index is used to sort interfaces by default.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
View name.nameString type. Optional. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Themessage body is empty.
Query Custom View InformationQuery custom view information based on custom view ID.
Interface URI/plat/res/view/custom/{id}
Access Method
HTTPGET
Path parameter
Path parameter
Custom view ID. Long integer type. Required. No default value.id
Query parameter
Query parameter
Location of the first returned record in the query result.startInteger type. Optional. The default value is 0. If the input value is smaller than 0, the default valueis used.
Total returned records.sizeInteger type. Optional. The default value is 10. If the input value is smaller than 0, the default valueis used.
Sort records in descending order.descBoolean type. Optional. The default value is false. Interface index is used to sort interfaces by default.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
Returned Result
Status codes
• 200 (OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Themessage body is empty.
Automatically add device types. 0: Not add. 1: Add any new device. 2: Add devices in the specifiedsubnet. When the value is 2, inSection takes effect. ipSection
autoAddDevType
Integer type. Optional.
Add all devices in the system. When the value is false, devices takes effect.addAllDevBoolean type. Optional. The default value is false.
Subnet for automatic discovery.ipSectionOptional. No default value.
Start IP address of the subnet.beginString type. Required. No default value.
End IP address of the subnet.endString type. Required. No default value.
144 Network Resource Management
customView sub-elements
Devices added to the custom view.deviceElement type. Optional. No default value.
IDs of the devices added to the custom view.device/idLong integer type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
ExampleModify information about the custom view with the ID 1154.
Query Interface ViewsQuery interface view list based on predefined criteria.
Interface URI/plat/res/view/interface
Access Method
HTTPGET
Parameters
Query parameter
Filter resources by access right.resPrivilegeFilterBoolean type. Optional. The default value is false.
Sort records in descending order.descBoolean type. Optional. The default value is false. Interface view name is used to sort interface viewsby default.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
Query Interface View InformationQuery an interface view based on interface view ID.
Interface URI/plat/res/view/interface/{id}
Access Method
HTTPGET
Path parameter
Path parameter
Interface view ID.idLong integer type. Required. No default value.
Query parameter
Query parameter
Filter resources by access right.resPrivilegeFilterBoolean type. Optional. The default value is false.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
Returned Result
Status codes
• 200 (OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Themessage body is empty.
Query IP ViewsQuery IP views based on predefined criteria.
Interface URI/plat/res/view/ip
Access Method
HTTPGET
Parameters
Query parameter
Filter resources by access right.resPrivilegeFilterBoolean type. Optional. The default value is false.
Sort records in descending order.descBoolean type. Optional. The default value is false. IP view name is used to sort IP views by default.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
Operation status.statusInteger type. Optional.
Display edge subnets.showVergeNetBoolean type. Optional. The default value is false.
Display empty subnets.showNullNetBoolean type. Optional. The default value is false.
Returned Result
Status codes
• 200 (OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Themessage body is empty.
IP view ID.idLong integer type. Required. No default value.
Query parameter
Query parameter
Filter resources by access right.resPrivilegeFilterBoolean type. Optional. The default value is false.
Sort records in descending order.descBoolean type. Optional. The default value is false. Interface index is used to sort interfaces by default.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
Operation status.statusInteger type. Optional.
Display edge subnets.showVergeNetBoolean type. Optional. The default value is false.
Display empty subnets.showNullNetBoolean type. Optional. The default value is false.
Returned Result
Status codes
• 200 (OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Themessage body is empty.
Query SNMP Template Information ListQuery SNMP template information list based on predefined criteria.
Interface URI/plat/res/snmp
Access Method
HTTPGET
Parameters
Query parameter
Location of the first returned record in the query result.startInteger type. Optional. The default value is 0. If the input parameter is smaller than 0, the parameteris automatically changed to 0.
Total returned records. Integer type. Optional. The default value is 10. If the input parameter issmaller than 0, the parameter is automatically changed to 0.
size
Sort records in descending order. Boolean type. Optional. The default value is false. It is valid onlywhen the orderBy parameter is specified.
desc
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
Returned Result
Status codes
• 200(OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Themessage body is empty.
Query Telnet Template Information ListQuery Telnet template information list based on predefined criteria.
Interface URI/plat/res/telnet
Access Method
HTTPGET
Parameters
Query parameter
Location of the first returned record in the query result.startInteger type. Optional. The default value is 0. If the input parameter is smaller than 0, the parameteris automatically changed to 0.
Total returned records.sizeInteger type. Optional. The default value is 10. If the input parameter is smaller than 0, the parameteris automatically changed to 0.
Sort records in descending order.descBoolean type. Optional. The default value is false. It is valid only when the orderBy parameter isspecified.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
Returned Result
Status codes
• 200(OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Themessage body is empty.
Query SSH Template Information ListQuery SSH template information list based on predefined criteria.
Interface URI/plat/res/ssh
Access Method
HTTPGET
Parameters
Query parameter
Location of the first returned record in the query result.startInteger type. Optional. The default value is 0. If the input parameter is smaller than 0, the parameteris automatically changed to 0.
Total returned records.sizeInteger type. Optional. The default value is 10. If the input parameter is smaller than 0, the parameteris automatically changed to 0.
Sort records in descending order.descBoolean type. Optional. The default value is false. It is valid only when the orderBy parameter isspecified.
Only records that match the sort criteria are returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Message Header field gives the recordsthat match the sort criteria.
Returned Result
Status codes
• 200(OK): Success.
Message headerIf the total parameter is true, the Total field gives all the records that match the sort criteria. Themessage body is empty.
Query SQL StatementsQuery database based on component ID and SQL statement.
Interface URI/sql
Access Method
HTTPGET
Parameters
Query parameter
Component ID.componentIdString type. Required. No default value.
Query SQL statements.sqlString type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OKTotal: 7
Message body
<sqlResult total="1000"> <record type="string"> <value>1.0.8802.1.1.2.0.6.1</value> <value>1.0.8802.1.1.2.0</value> <value>6</value> <value>1</value> <value>Neighbor information has changed.</value> <value>0</value> <value>4</value> <value>0</value> <value>0</value> <value>1</value> <value /> <value>Neighbor information has changed. </value> <value /> <value>0</value> <value>0</value> <value /> <value>Status of the neighboring device changed, such as link up, link down, or port change.</value> </record> ... </sqlResult>
Query SQL Statements 175
Element description
sqlResult sub-elements and attributes
Total records.@totalLong integer type.
Result records.recordElement type.
Field type.record/@typeString type. The value can only be string.
Field value.record/valueString type.
ExampleQuery the component iMC-NME-FAULT and SQL statement SELECT * FROM tbl_trap_conf in thedatabase.
Request
GET http://localhost:8080/imcrs/sql?componentId=iMC-NME-FAULT&sql=SELECT * FROM tbl_trap_confaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<sqlResult total="1000"> <record type="string"> <value>1.0.8802.1.1.2.0.6.1</value> <value>1.0.8802.1.1.2.0</value> <value>6</value> <value>1</value> <value>Neighbor information changed</value> <value>0</value> <value>4</value> <value>0</value> <value>0</value> <value>1</value> <value /> <value>Neighbor information changed </value> <value /> <value>0</value> <value>0</value> <value /> <value>Status of the neighbor changed, such as link up, link down, or port change.</value> </record> ... </sqlResult>
176 Network Resource Management
6 User ManagementThe User Management category provides multiple commands for managing, modifying, andquerying user records in your IMC system. User Management commands include:
• Query Users
• Query User Information
• Add User
• Modify User
• Delete User
• Query User Additional Information Definitions
• Query User Additional Information Definition
• Add User Additional Information Definition
• Modify User Additional Information Definition
• Delete User Additional Information Definition
177
Query UsersQuery users with certain criteria.
Interface URI/user
Access Method
HTTPGET
Parameters
Query parameters
userNameuserNameString type, supporting wildcard characters. Optional. No default value.
Identity number.certificationString type, supporting wildcard characters. Optional. No default value.
Contact address.addressString type, supporting wildcard characters. Optional. No default value.
Telephone number.phoneString type, supporting wildcard characters. Optional. No default value.
Email addressemailString type, supporting wildcard characters. Optional. No default value.
User group ID.userGroupIdLong integer type. Optional. No default value.
Self-service account name.ssNameString type. Optional. No default value.
Activate self-service account or not. 1 for active. 2 for inactive.ssTypeInteger type. Optional. No default value.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value, the default value is used.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value, the default value is used.
The sequencing field of the returned result set.orderByString type. Optional. The default value is userName. Valid values include userName and id.
Whether or not the result is sequenced in reverse order.descBoolean type. Optional. The default value is false. Only valid when the orderBy parameter is specified.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Total attribute of the message headerreturns the number of records that meet the requirements.
178 User Management
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Query User Additional Information DefinitionsQuery user additional information definitions with certain criteria.
Interface URI/user/additionalInfo
Access Method
HTTPGET
Parameters
Query parameters
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the returned messagebody is empty, and the Total attribute of the message header returns the number of records that meetthe requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Field name.fieldNameString type. Optional. If the element does not exist, the value is not changed. If the elementexists, the value cannot be null.
Required or not.requiredBoolean type. Optional. If the element does not exist, the value is not changed. If the elementexists, the value cannot be null.
Field type. 1 for integer. 2 for decimal. 3 for alphanumeric character. 4 for any character. 5for option.
fieldType
Integer type. Optional. If the element does not exist, the value is not changed. If the elementexists, the value cannot be null.
Maximum field length.fieldLenInteger type. Required when fieldType is 3 or 4. No default value.
Maximum field value.fieldMaxString type. Required when fieldType is 1 or 2. No default value.
Minimum field value.fieldMinString type. Required when fieldType is 1 or 2. No default value.
Default value.defaultValue
196 User Management
userAdditionalInfo sub-elements
String type. Optional. If the element does not exist, the value is not changed. If the elementexists, the value cannot be null.
Display pre-registered users or not.showForPreRegisterUserBoolean type. Optional. If the element does not exist, the value is not changed. If the elementexists, the value cannot be null.
Option elements.optionsElement type. Required when fieldType is 5. No default value.
Option ID.options/idLong integer type. Required. No default value.
Option value.options/optionsValueString type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
ExampleModify the user additional information definition with ID 1.
Request
PUT http://imc_host:8080/imcrs/user/additionalInfo/1accept: application/xml...<userAdditionalInfo> <fieldName>job</fieldName> <required>true</required> <fieldType>3</fieldType> <fieldLen>12</fieldLen> <defaultValue>google</defaultValue> <priority>2</priority> <showForPreRegisterUser>false</showForPreRegisterUser></userAdditionalInfo>
Response
HTTP/1.1 204 No Content...
Modify User Additional Information Definition 197
Delete User Additional Information DefinitionDelete the user additional information definition of a specified ID.
Interface URI/user/additionalInfo/{id}
Access Method
HTTPDELETE
Parameters
Path parameters
ID of a user additional information definition.idLong integer type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
• 410 (Gone): No data is found with the specified ID.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
ExampleDelete the user additional information definition with ID 1.
7 Terminal Access ManagementThese commands provides tools for managing network access, and include the following:
• Query Unauthorized Access Attempts
• Query Unauthorized Access Logs
• Query Access Log Histories
• Query Current Accesses
• Query Real-Time Locations
• Query All IP Segments
• Query IP Segment
• Add IP Segment
• Add Child IP Segment
• Modify IP Segment
• Release IP Segment
• Automatically Scan IP Segment
• Automatically Scan Assigned IP Segment
• Query IP Addresses
• Assign IP Address
• Release Assigned IP Address
• Query Terminal Access Bindings
• Query Terminal Access Binding
• Automatically Scan Terminal Access Bindings
• Add Terminal Access Binding
• Modify Terminal Access Binding
• Delete Terminal Access Binding
• Query Switch Access Bindings
• Query Switch Access Binding
• Automatically Scan Switch Access Bindings
• Add Switch Access Binding
• Modify Switch Access Binding
• Delete Switch Access Binding
• Query IP-to-MAC Address Bindings
• Query IP-to-MAC Address Binding
• Automatically Scan IP-to-MAC Address Bindings
• Add IP-to-MAC Address Binding
• Delete IP-to-MAC Address Binding
• Query Conflict and Unauthorized Access Policy
• Query Unknown Access Policy
199
• Modify Conflict and Unauthorized Access Policy
• Modify Unknown Access Policy
200 Terminal Access Management
Query Unauthorized Access AttemptsQuery unauthorized access attempts with certain criteria.
Interface URI/res/access/unauthorizedAccess
Access Method
HTTPGET
Parameters
Query Parameters
Whether or not to filter the rights for resources.resPrivilegeFilterBoolean type. Optional. The default value is false.
Terminal IP address.terminalIpString type, supporting wildcard characters. Optional. No default value.
Terminal MAC address.terminalMacString type, supporting wildcard characters. Optional. No default value.
Terminal name.terminalNameString type, supporting wildcard characters. Optional. No default value.
Device label.deviceLabelString type. Optional. No default value.
Device IP address.deviceIpString type. Optional. No default value.
Interface description.ifDescString type. Optional. No default value.
Processing status.processStatusInteger type. Optional. No default value.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value, the default value is used.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value, the default value is used.
The sequencing field of the returned result set.orderByString type. Optional. The default value is deviceIp. Valid values include deviceIp, deviceLabel,ifDesc, terminalIp, terminalMac, terminalName, and processStatus.
Whether or not the result is sequenced in reverse order.descBoolean type. Optional. Default value is false. Valid only when the orderBy parameter isspecified.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. Default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Total attribute of the message headerreturns the number of records that meet the requirements.
Query Unauthorized Access Attempts 201
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Query Unauthorized Access LogsQuery unauthorized access logs with certain criteria.
Interface URI/res/access/unauthorizedAccessLog
Access Method
HTTPGET
Parameters
Query Parameters
Whether or not to filter the rights for resources.resPrivilegeFilterBoolean type. Optional. The default value is false.
Terminal IP address.terminalIpString type, supporting wildcard characters. Optional. No default value.
Terminal MAC address.terminalMacString type, supporting wildcard characters. Optional. No default value.
Terminal name.terminalNameString type, supporting wildcard characters. Optional. No default value.
Device label.deviceLabelString type. Optional. No default value.
Device IP address.deviceIpString type. Optional. No default value.
Interface description.ifDescString type. Optional. No default value.
Action status.actionStatusInteger type. Optional. No default value.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value is uploaded, the default valueis used.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value is uploaded, the default valueis used.
The sequencing field of the returned result set.orderByString type. Optional. The default value is deviceIp. Valid values include deviceIp, deviceLabel,ifDesc, terminalIp, terminalMac, terminalName, actionStatus, and conflictType.
Whether or not the result is sequenced in reverse order.descBoolean type. Optional. The default value is false. The parameter is valid only when the orderByparameter is specified.
Only the number of records that meet the requirements is returned.total
204 Terminal Access Management
Query Parameters
Boolean type. Optional. The default value is false. When the value is true, the start and sizeattributes are invalid, the returned message body is empty, and the Total attribute of the messageheader returns the number of records that meet the requirements.
Conflict type.conflictTypeInteger type. Optional.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
HTTP/1.1 200 OKTotal: 976
Message body
<list> <unauthorizedAccessLog> <id>1</id> <actionStatus>1</actionStatus> <terminalIp>10.153.89.182</terminalIp> <terminalMac>00:e0:fc:00:39:01</terminalMac>> <terminalName/> <deviceLabel>Quidway</deviceLabel> <deviceIp>10.153.89.2</deviceIp> <ifDesc>Ethernet1/0/14</ifDesc> <deviceId>17</deviceId> <conflictType>4</conflictType> <conflictFindTime>1308747088</conflictFindTime> <conflictFindTimeDesc>2011-06-22 20:51:28</conflictFindTimeDesc> <conflictDesc>When the device 10.153.89.2 is polled, unauthorized MAC address 00:e0:fc:00:39:01 is detected with the connecting interface 10.153.89.2-Ethernet1/0/14. </conflictDesc> </unauthorizedAccessLog> ...
</list>
Elements
unauthorizedAccessLog sub-elements
Action status. 1 for no action. 2 for initializing. 3 for action conflict. 4 for waiting for execution.5 for executing. 6 for execution completed.
actionStatus
Integer type.
Terminal IP address.terminalIpString type.
Terminal MAC address.terminalMacString type.
Terminal name.terminalNameString type.
Device ID.deviceIdLong integer type.
Query Unauthorized Access Logs 205
unauthorizedAccessLog sub-elements
Device label.deviceLabelString type.
Device IP address.deviceIpString type.
Interface description.ifDescString type.
Conflict type. 1 for terminal access conflict. 2 for switch access conflict. 3 for switch and terminalaccess conflict. 4 for access binding not configured.
conflictType
Integer type.
Time when the conflict was detected.conflictFindTimeLong integer type.
Conflict type.conflictFindTimeDescString type.
Conflict description.conflictDescString type.
ExampleQuery and list unauthorized access logs.
Request
GET http://localhost:8080/imcrs/res/access/unauthorizedAccessLogaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <unauthorizedAccessLog> <id>1</id> <actionStatus>1</actionStatus> <terminalIp>10.153.89.182</terminalIp> <terminalMac>00:e0:fc:00:39:01</terminalMac> <terminalName/> <deviceLabel>Quidway</deviceLabel> <deviceIp>10.153.89.2</deviceIp> <ifDesc>Ethernet1/0/14</ifDesc> <deviceId>17</deviceId> <conflictType>4</conflictType> <conflictFindTime>1308747088</conflictFindTime> <conflictFindTimeDesc>2011-06-22 20:51:28</conflictFindTimeDesc> <conflictDesc>When the device 10.153.89.2 is polled, unauthorized MAC address 00:e0:fc:00:39:01 is detected with the connecting interface 10.153.89.2-Ethernet1/0/14.</conflictDesc> </unauthorizedAccessLog> ...</list>
206 Terminal Access Management
Query Access Log HistoriesQuery access log histories with certain criteria.
Interface URI/res/access/historyAccessLog
Access Method
HTTPGET
Parameters
Query Parameters
Whether or not to filter the rights for resources.resPrivilegeFilterBoolean type. Optional. The default value is false.
Terminal IP address.terminalIpString type, supporting wildcard characters. Optional. No default value.
Terminal MAC address.terminalMacString type, supporting wildcard characters. Optional. No default value.
Terminal name.terminalNameString type, supporting wildcard characters. Optional. No default value.
Device label.deviceLabelString type. Optional. No default value.
Device IP address.deviceIpString type. Optional. No default value.
Interface description.ifDescString type. Optional. No default value.
VLAN ID.vlanIdInteger type. Optional. No default value.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value is uploaded, the default valueis used.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value is uploaded, the default valueis used
The sequencing field of the returned result set.orderByString type. Optional. The default value is deviceIp. Valid values include deviceIp, deviceLabel,ifDesc, terminalIp, terminalMac, terminalName, actionStatus, and conflictType.
Whether or not the result is sequenced in reverse order.descBoolean type. Optional. The default value is false. The parameter is valid only when the orderByparameter is specified.
Only the number of records that meet the requirements is returned.total
Query Access Log Histories 207
Query Parameters
Boolean type. Optional. The default value is false. When the value is true, the start and sizeattributes are invalid, the returned message body is empty, and the Total attribute of the messageheader returns the number of records that meet the requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Query Current AccessesQuery current accesses on a device with certain criteria.
Interface URI/res/access/ipMacLearn/{deviceId}
Access Method
HTTPGET
Path parameters
Path parameters
Device ID.deviceIdLong integer type. Required. No default value.
Query parameters
Query parameters
Device ID.deviceIdLong integer type. Required. No default value.
Learned MAC address.macString type. Optional.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. Default value is false. When true, the returned message body is empty, andthe Total attribute of the message header returns the required number of records.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value, the default value is used.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value, the default value is used.
The sequencing field of the returned result set.orderByString type. Optional. The default value is ifDesc. Valid values include ifDesc, vlanId, ip, and mac.
Whether or not the result is sequenced in reverse order.descBoolean type. Optional. The default value is false. The parameter is valid only when the orderByparameter is specified.
210 Terminal Access Management
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Query Real-Time LocationsQuery real-time locations with certain criteria.
Interface URI/res/access/realtimeLocate
Access Method
HTTPGET
Parameters
Query parameters
Location type. 1 for MAC address. 2 for IP address.typeInteger type. Required. The default value is 2.
Location address.valueString type. Required. The default value is an empty string.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the returned messagebody is empty, and the Total attribute of the message header returns the number of records that meetthe requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Query All IP SegmentsQuery information about all IP segments.
Interface URI/res/access/assignedIpScope
Access Method
HTTPGET
Path parametersNone
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<assignedIpScope> <percent>0.0</percent> <assignedIpScope> <id>-299</id> <ip>System default IP segment</ip> <name>Administrator.</name> <description>Does not belong to any set of assigned IP addresses in the assigned IP segment range.</description> <parentId>-300</parentId> <percent>0.0</percent> </assignedIpScope> <assignedIpScope> <id>1</id> <ip>10.153.89.1-10.153.89.10</ip> <startIp>10.153.89.1</startIp> <endIp>10.153.89.10</endIp> <name>1to10</name> <description>10.153.89.1 to 10.153.89.10</description> <parentId>-300</parentId> <percent>0.0</percent> <operatorGroup>http://localhost:8080/imcrs/plat/operatorGroup/1</operatorGroup> <operatorGroup>http://localhost:8080/imcrs/plat/operatorGroup/2</operatorGroup> <assignedIpScope> <id>3</id> <ip>10.153.89.1-10.153.89.4</ip> <startIp>10.153.89.1</startIp> <endIp>10.153.89.4</endIp> <name>1to4</name> <description>10.153.89.1 to 10.153.89.4</description> <parentId>1</parentId> <rightIpId>1</rightIpId> <percent>0.0</percent> </assignedIpScope> </assignedIpScope> ...</assignedIpScope>
Query All IP Segments 215
Elements
assignedIpScope sub-elements
IP segment ID.idLong integer type.
IP segment.ipString type.
Start IP address.startIpString type.
End IP address.endIpString type.
Owner.nameString type.
Description.descriptionString type.
Parent IP segment ID.parentIdLong integer type.
Ratio of the assigned IP address number to the total number of IP addresses in the IP segment,expressed in a percentage value.
percent
Double-precision floating-point type.
ID of the parent IP segment that the child IP segment inherit rights from.rightIpIdLong integer type.
URI of the operator group.operatorGroupString type.
216 Terminal Access Management
ExampleQuery information about all IP segments.
Request
GET http://localhost:8080/imcrs/asset/access/assignedIpScopeaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<assignedIpScope> <percent>0.0</percent> <assignedIpScope> <id>-299</id> <ip>System default IP segment</ip> <name>Administrator.</name> <description>Does not belong to any set of assigned IP addresses in the assigned IP segment range.</description> <parentId>-300</parentId> <percent>0.0</percent> </assignedIpScope> <assignedIpScope> <id>1</id> <ip>10.153.89.1-10.153.89.10</ip> <startIp>10.153.89.1</startIp> <endIp>10.153.89.10</endIp> <name>1to10</name> <description>10.153.89.1 to 10.153.89.10</description> <parentId>-300</parentId> <percent>0.0</percent> <operatorGroup>http://localhost:8080/imcrs/plat/operatorGroup/1</operatorGroup> <operatorGroup>http://localhost:8080/imcrs/plat/operatorGroup/2</operatorGroup> <assignedIpScope> <id>3</id> <ip>10.153.89.1-10.153.89.4</ip> <startIp>10.153.89.1</startIp> <endIp>10.153.89.4</endIp> <name>1to4</name> <description>10.153.89.1 to 10.153.89.4</description> <parentId>1</parentId> <rightIpId>1</rightIpId> <percent>0.0</percent> </assignedIpScope> </assignedIpScope> ...</assignedIpScope>
Query All IP Segments 217
Query IP SegmentQuery information about an IP segment with the specified ID.
Interface URI/res/access/assignedIpScope/{id}
Access Method
HTTPGET
Path parameters
Path parameters
IP segment ID.idLong integer type. Required. No default value.
<assignedIpScope> <startIp>10.153.89.21</startIp> <endIp>10.153.89.30</endIp> <name>21to30</name> <description>10.153.89.21 to 10.153.89.30</description></assignedIpScope>
Elements
assignedIpScope sub-elements
Start IP address.startIpString type. Required. No default value.
End IP address.endIpString type. Required. No default value.
Owner.nameString type. Required. No default value.
Description.descriptionString type. Optional. The default value is empty.
Operator group ID.operatorGroupIdLong integer type. Optional, supporting multiple elements. If there is zero elements, the defaultvalue contains 1, 2, and 3. If there is at least one element, the default value contains 1. For thevalid values, see Query Operator Groups.
Returned Result
Status codes
• 201 (Created): Success.
• 409 (Conflict): Failure. See “Error Codes.”
Message headerIf the operation succeeds, the Location field gives the URI of the new resource. The message bodyis empty.
Modify IP SegmentModify an IP segment with the specified ID.
Interface URI/res/access/assignedIpScope/{id}
Access Method
HTTPPUT
Parameters
Path parameters
IP segment ID.idLong integer type. Required. No default value.
Message body
<assignedIpScope> <name>21to30 update</name> <description>10.153.89.21 to 10.153.89.30 update</description></assignedIpScope>
Elements
assignedIpScope sub-elements
Owner.nameString type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Description.descriptionString type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Operator group ID.operatorGroupIdLong integer type. Optional, supporting multiple elements. If the element does not exist, the valueis not changed. If the element exists, the value cannot be null. If there is at least one element, thedefault value contains 1. For the valid values, see “Query Operator Groups.”
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
Modify IP Segment 225
ExampleModify the IP segment with ID 13.
Request
PUT http://imc_host:8080/imcrs/asset/access/assignedIpScope/13accept: application/xml...<assignedIpScope> <name>21to30 update</name> <description>10.153.89.21 to 10.153.89.30 update</description></assignedIpScope>
Response
HTTP/1.1 204 No Content...
226 Terminal Access Management
Release IP SegmentRelease an IP segment with the specified ID.
Interface URI/res/access/assignedIpScope/{id}
Access Method
HTTPDELETE
Parameters
Path parameters
IP segment ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
• 410 (Gone): No data is found with the specified ID.
Automatically Scan IP SegmentAutomatically scan an IP segment with the specified start and end IP addresses.
Interface URI/res/access/assignedIpScope/autoScan
Access Method
HTTPGET
Query parameters
Query parameters
Start IP address.startIpString type. Required. No default value.
End IP address.endIpString type. Required. No default value.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the returned messagebody is empty, and the Total attribute of the message header returns the number of records that meetthe requirements.
The sequencing field of the returned result set.orderByString type. Optional. The default value is ip. Valid values include ip and name.
Whether or not the result is sequenced in reverse order.descBoolean type. Optional. The default value is false. The parameter is valid only when the orderlByparameter is specified.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
IP segment ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Query IP AddressesQuery the assigned IP addresses with the specified IP segment ID.
Interface URI/res/access/assignedIpScope/ip
Access Method
HTTPGET
Query parameters
Query parameters
ID of the IP address segment.ipScopeIdLong integer type. Required. No default value.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the returned messagebody is empty, and the Total attribute of the message header returns the number of records that meetthe requirements.
The sequencing field of the returned result set.orderByString type. Optional. The default value is ip. Valid values include ip and name.
Whether or not the result is sequenced in reverse order.descBoolean type. Optional. The default value is false. The parameter is valid only when the orderByparameter is specified.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value is uploaded, the default value isused.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value is uploaded, the default value isused.
IP addressipString type. Optional. No default value.
Owner.nameString type. Optional. No default value.
Description.descriptionString type. Optional. No default value.
Query IP Addresses 233
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Query Terminal Access BindingsQuery terminal access bindings with certain criteria.
Interface URI/res/access/macAccessBind
Access Method
HTTPGET
Parameters
Query parameters
Whether or not to filter the rights for resources.resPrivilegeFilterBoolean type. Optional. The default value is false.
Terminal IP address.terminalIpString type, supporting wildcard characters. Optional. No default value.
Terminal MAC address.terminalMacString type, supporting wildcard characters. Optional. No default value.
Terminal name.terminalNameString type, supporting wildcard characters. Optional. No default value.
Device label.deviceLabelString type. Optional. No default value.
Device IP address.deviceIpString type. Optional. No default value.
Interface description.ifDescString type. Optional. No default value.
Binding type. 1 for no authentication. 2 for MAC-to-interface binding.bindTypeInteger type. Optional. No default value.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value, the default value is used.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value, the default value is used.
The sequencing field of the returned result set.orderByString type. Optional. The default value is terminalMac. Valid values include deviceIp, deviceLabel,ifDesc, terminalIp, terminalMac, terminalName, and bindType.
Whether or not the result is sequenced in reverse order.descBoolean type. Optional. Default value is false. Valid only when the orderBy parameter is specified.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false.When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Total attribute of the message headerreturns the number of records that meet the requirements.
Query Terminal Access Bindings 239
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the returned messagebody is empty, and the Total attribute of the message header returns the number of records that meetthe requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
ElementsFor meanings of the fields in the message body, see “Query Terminal Access Binding.” If theelement does not exist, the value is not changed. If the element exists, the value cannot be null.
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
Modify Terminal Access Binding 247
ExampleModify the terminal access binding with ID 2.
Request
PUT http://localhost:8080/imcrs/res/access/macAccessBind/2accept: application/xml...<macAccessBind> <terminalName>a1</terminalName> <bindType>2</bindType> <ifInfo> <deviceId>5</deviceId> <ifIndex>1</ifIndex> </ifInfo></macAccessBind>
Response
HTTP/1.1 204 No Content...
248 Terminal Access Management
Delete Terminal Access BindingDelete a terminal access binding with the specified ID.
Interface URI/res/access/macAccessBind/{id}
Access Method
HTTPDELETE
Parameters
Path parameters
Terminal access binding ID.idLong integer type.Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
• 410 (Gone): No data is found with the specified ID.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
ExampleDelete the terminal access binding with ID 1.
Query Switch Access BindingsQuery switch access bindings with certain criteria.
Interface URI/res/access/ifAccessBind
Access Method
HTTPGET
Parameters
Query parameters
Whether or not to filter the rights for resources.resPrivilegeFilterBoolean type. Optional. The default value is false.
Terminal IP address.terminalIpString type, supporting wildcard characters. Optional. No default value.
Terminal MAC address.terminalMacString type, supporting wildcard characters. Optional. No default value.
Terminal name.terminalNameString type, supporting wildcard characters. Optional. No default value.
Device label.deviceLabelString type. Optional. No default value.
Device IP address.deviceIpString type. Optional. No default value.
Interface description.ifDescString type. Optional. No default value.
Binding type. 1 for MAC-to-interface binding. 2 for no authentication.bindTypeInteger type. Optional. No default value.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. Default value is 0. If a negative value, the default value is used.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value, the default value is used.
The sequencing field of the returned result set.orderByString type. Optional. The default value is terminalMac. Valid values include deviceIp, deviceLabel,ifDesc, terminalIp, terminalMac, terminalName, and bindType.
Whether or not the result is sequenced in reverse order.descBoolean type. Optional. Default value is false. Valid only when the orderBy parameter is specified.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and sizeattributes are invalid, the returned message body is empty, and the Total attribute of the messageheader returns the number of records that meet the requirements.
250 Terminal Access Management
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
ElementsFor meanings of the fields in the message body, see “Add Switch Access Binding.” If the elementdoes not exist, the value is not changed. If the element exists, the value cannot be null.
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
Modify Switch Access Binding 259
ExampleModify the switch access binding with ID 5.
Request
PUT http://localhost:8080/imcrs/res/access/ifAccessBind/5accept: application/xml...<ifAccessBind> <terminalMac>11:21:31:41:11:21</terminalMac> <terminalName>a1</terminalName> <terminalMaintainer>tm1</terminalMaintainer> <bindType>1</bindType></ifAccessBind>
Response
HTTP/1.1 204 No Content...
260 Terminal Access Management
Delete Switch Access BindingDelete a switch access binding with the specified ID.
Interface URI/res/access/ifAccessBind/{id}
Access Method
HTTPDELETE
Parameters
Path parameters
Switch access binding ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
• 410 (Gone): No data is found with the specified ID.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
ExampleDelete the switch access binding with ID 3.
Query IP-to-MAC Address BindingsQuery the IP-to-MAC address bindings with certain criteria.
Interface URI/res/access/ipMacBind
Access Method
HTTPGET
Parameters
Query parameters
Whether or not to filter the rights for resources.resPrivilegeFilterBoolean type. Optional. The default value is false.
IP address.ipString type, supporting wildcard characters. Optional. No default value.
MAC address.macString type, supporting wildcard characters. Optional. No default value.
Owner.nameString type, supporting wildcard characters. Optional. No default value.
Type.typeLong integer type. Optional. No default value.
The sequencing field of the returned result set.orderByString type. Optional. The default value is ip. Valid values include ip, mac, name and type.
Whether or not the result is sequenced in reverse order.descBoolean type. Optional. The default value is false. The parameter is valid only when the orderByparameter is specified.
Only the number of records that meet the requirements is returned. Boolean type. Optional. Thedefault value is false. When the value is true, the start and size attributes are invalid, the returned
total
message body is empty, and the Total attribute of the message header returns the number of recordsthat meet the requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Automatically Scan IP-to-MAC Address BindingsAutomatically scan the IP-to-MAC address bindings with certain criteria.
Interface URI/res/access/ipMacBind/autoScan
Access Method
HTTPGET
Parameters
Query parameters
Start IP address.startIpString type. Required. No default value.
End IP address.endIpString type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Whether or not to send alarms. 0 for no. 1 for yes.sendFaultTypeInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Interface shutdown type. 0 for no shutdown. 1 for immediate shutdown. 2 for delayed shutdown.closeIfTypeInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Whether or not to bring up the interface after it is shut down. 0 for no. 1 for yes.openIfTypeInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Time delay before shutting down the interface, in seconds.closeIfDelayInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Time delay before bringing up the interface, in seconds.openIfDelayInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
Modify Conflict and Unauthorized Access Policy 275
ExampleModify the conflict and unauthorized access policy.
Request
PUT http://imc_host:8080/imcrs/asset/access/strategy/conflictaccept: application/xml...<accessStrategy> <accessType>0</accessType> <sendFaultType>1</sendFaultType> <closeIfType>2</closeIfType> <openIfType>1</openIfType> <closeIfDelay>180</closeIfDelay> <openIfDelay>180</openIfDelay></accessStrategy>
Response
HTTP/1.1 204 No Content...
276 Terminal Access Management
Modify Unknown Access PolicyModify the unknown access policy.
Whether or not to send alarms. 0 for no. 1 for yes.sendFaultTypeInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Interface shutdown type. 0 for no shutdown. 1 for immediate shutdown. 2 for delayed shutdown.closeIfTypeInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Whether or not to bring up the interface after it is shut down. 0 for no. 1 for yes.openIfTypeInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Time delay before shutting down the interface, in seconds.closeIfDelayInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Time delay before bringing up the interface, in seconds.openIfDelayInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Whether or not the policy is valid when an unknown access is detected.0 for yes. 1 for no.accessTypeInteger type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Modify Unknown Access Policy 277
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
ExampleModify the unknown access policy.
Request
PUT http://localhost:8080/imcrs/res/access/strategy/unknownaccept: application/xml...<accessStrategy> <accessType>0</accessType> <sendFaultType>1</sendFaultType> <closeIfType>2</closeIfType> <openIfType>1</openIfType> <closeIfDelay>180</closeIfDelay> <openIfDelay>180</openIfDelay></accessStrategy>
Response
HTTP/1.1 204 No Content...
278 Terminal Access Management
8 Network Alarm ManagementThis set of API commands provides tools for managing alarm conditions on your network. Networkalarm management commands include the following:
• Query Alarms
• Query Alarm Information
• Query Root Alarm Information
• Query Child Alarms
• Query TopN Alarming Devices
• Query Alarming Enterprises
• Query Alarm Events
• Query Alarm Categories
• Query Alarm Levels
• Query Alarm Source Types
• Query Alarm Recovery Status
• Query Alarm Acknowledgement Status
• Query Alarm Time Ranges
• Recover Alarm
• Acknowledge Alarm
• Delete Alarm
• Register Send-Alarm-to-Server Event
279
Query AlarmsQuery alarms with certain criteria.
Interface URI/fault/alarm
Access Method
HTTPGET
Parameters
Query parameters
Alarm level.alarmLevelInteger type, supporting multiple elements. Optional. No default value. For the valid values, seeQuery Alarm Levels.
Alarm recovery status.recStatusInteger type. Optional. No default. For valid values, see Query Alarm Recovery Status.
Alarm acknowledgement status.ackStatusInteger type. Optional. No default. For valid values, see Query Alarm Acknowledgement Status.
Time range for the alarm query.timeRangeInteger type. Optional. No default. For valid values, see Query Alarm Time Ranges.
Start time for the alarm query.startAlarmTimeLong integer type. Optional. No default value.
End time for the alarm query.endAlarmTimeLong integer type. Optional. No default value.
Alarm description.alarmDescString type, supporting wildcard characters. Optional. No default value.
User who recovered the alarm.ackerString type, supporting wildcard characters. Optional. No default value.
Alarm parameters.parasString type, supporting wildcard characters. Optional. No default value.
Custom view ID.customViewLong integer type. Optional. No default value.
Device IP address.deviceIpString type, supporting wildcard characters and multiple elements. Optional. No default value.
Device ID.deviceIdString type, supporting wildcard characters and multiple elements. Optional. No default value.
Alarm source type.originalTypeInteger type. Optional. No default value. For the valid values, see Query Alarm Sources.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value is uploaded, the default value isused.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value is uploaded, the default value isused.
The sequencing field of the returned result set.orderByString type. Optional. The default value is id. Valid values include id, label, ip, mask, status, contact,location, sysOid, and sysName.
Whether or not the result is sequenced in reverse order.descBoolean type. Optional. The default value is false. The parameter is valid only when the orderByparameter is specified.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Total attribute of the message headerreturns the number of records that meet the requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Query Alarm InformationQuery basic information about an alarm with the specified ID.In addition to basic alarm information, the result also includes the method for accessing alarmdetails and performing related operations.
Interface URI/fault/alarm/{id}
Access Method
HTTPGET
Parameters
Path parameters
Alarm ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message headerThe message header offers the following resource links with the Link attribute:
Query Child AlarmsQuery and list the child alarms of an alarm with the specified ID.
Interface URI/fault/alarm/childAlarm/{id}
Access Method
HTTPGET
Parameters
Path parameters
Alarm ID.idLong integer type. Required. No default value.
Query parameters
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value is uploaded, the default value isused.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value is uploaded, the default value isused.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Total attribute of the message headerreturns the number of records that meet the requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Query Alarming EnterprisesQuery and list alarming enterprises.
Interface URI/fault/trapEnterprise
Access Method
HTTPGET
Parameters
Query parameters
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the returned messagebody is empty, and the Total attribute of the message header returns the number of records that meetthe requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Alarming enterprise ID.trapEnterpriseIdString type. Required. No default value. For the valid values, see “Query Alarming Enterprises.”
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the returned messagebody is empty, and the Total attribute of the message header returns the number of records that meetthe requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
HTTP/1.1 200 OKTotal: 133
Elements
trapEvent sub-elements
Event OID, which uniquely identifies an event.eventOIDString type.
Event name.eventNameString type.
Specific ID of the event.specificIDInteger type.
Query Alarm Events 295
ExampleQuery and list the alarm events of the enterprise whose ID is 1.3.6.1.4.1.43.
Request
GET http://imc_host:8080/imcrs/fault/trapEvent?trapEnterpriseId=1.3.6.1.4.1.43accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...Message body
Query Alarm Acknowledgement StatusQuery and list alarm acknowledgement status.The results include the acknowledgement status of all alarms and their descriptions.
HTTP/1.1 204 No Content...The message body is empty.
310 Network Alarm Management
Register Send-Alarm-to-Server EventRegister the send-alarm-to-server event and filter alarms to be sent with certain criteria.
Interface URI/events
Access Method
HTTPGET
Parameters
Query parameters
Event type.typeInteger type. The value is 11, indicating the send-alarm-to-server event.
UUID.uuidString type. Uniquely identifies a client.
Alarm level.alarmLevelInteger type, supporting multiple elements. Optional. No default value. If this parameter is not set,then all levels of alarms will be forwarded. For the valid values, see Query Alarm Levels.
Custom view ID.customViewLong integer type. Optional. No default value.
Device IP address.deviceIpString type, supporting multiple elements. Optional. No default value.
IP segment.ipSegmentString type, supporting multiple elements. Optional. No default value. The IP range is expressed witha hyphen (-). For example, 192.168.0.1-192.168.0.254.
9 Network Syslog ManagementThis set of eAPI commands enables you to query system log and unmanaged device filteringinformation. Network syslog management commands include:
• Query Syslog Information
• Query Syslog Information List
• Query Unmanaged Device Filtering Rule Status
• Query Unmanaged Device Filtering Rule Status List
• Modify Unmanaged Device Filtering Rule Status
313
Query Syslog InformationQuery syslog information with the specified ID.
Interface URI/syslog/log/{id}
Access Method
HTTPGET
Returned Result
Status codes
• 200 (OK): Success.
Message body
<log> <id>1>/id> <recvTime>2011-08-29 16:39:11</recvTime> <deviceId>12</deviceId> <deviceName>L07069A</deviceName> <deviceIp>10.153.129.35</deviceIp> <sysName>H3C </sysName> <module>DHCP-SNP</module> <severity>5</severity> <digest>dhcp-snooping server guard</digest> <repeats>3</repeats> <content><182>Oct 12 11:02:52 19.82.2.20 Apr 2 00:04:42 2000 H3C %%DHCP-SNP/5/dhcp-snooping server guard:- 1 -Port 0 detect DHCP server in VLAN 1 MAC is 00e0-fc05-53b1 IP is 10.153.89.1!</content> </log>
Elements
log sub-elements
Syslog source type ID, which uniquely identifies a syslog source type.idInteger type.
Time when the syslog was received.recvTimeString type.
Device ID.deviceIdLong integer type.
Device name.deviceNameString type.
IP address.deviceIpString type.
System NamesysNameString type.
Module name.moduleString type.
Severity level.severityInteger type.
314 Network Syslog Management
log sub-elements
Log digest.digestString type.
Repeat time.repeatsInteger type.
Log content.contentString type.
ExampleQuery the detailed information about the syslog with ID 1.
Request
GET http://imc_host:8080/imcrs/fault/syslog/log/1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<log> <id>1>/id> <recvTime>2011-08-29 16:39:11</recvTime> <deviceId>12</deviceId> <deviceName>L07069A</deviceName> <deviceIp>10.153.129.35</deviceIp> <sysName>H3C </sysName> <module>DHCP-SNP</module> <severity>5</severity> <digest>dhcp-snooping server guard</digest> <repeats>3</repeats> <content><182>Oct 12 11:02:52 19.82.2.20 Apr 2 00:04:42 2000 H3C %%DHCP-SNP/5/dhcp-snooping server guard:- 1 -Port 0 detect DHCP server in VLAN 1 MAC is 00e0-fc05-53b1 IP is 10.153.89.1!</content> </log>
Query Syslog Information 315
Query Syslog Information ListQuery the syslog information list.
Interface URI/syslog/log/
Access Method
HTTPGET
Returned Result
Status codes
• 200 (OK): Success.
Message body
</list> <log> <id>1>/id> <recvTime>2011-08-29 16:39:11</recvTime> <deviceId>12</deviceId> <deviceName>L07069A</deviceName> <deviceIp>10.153.129.35</deviceIp> <sysName>H3C </sysName> <module>DHCP-SNP</module> <severity>5</severity> <digest>dhcp-snooping server guard</digest> <repeats>3</repeats> <content><182>Oct 12 11:02:52 19.82.2.20 Apr 2 00:04:42 2000 H3C %%DHCP-SNP/5/dhcp-snooping server guard:- 1 -Port 0 detect DHCP server in VLAN 1 MAC is 00e0-fc05-53b1 IP is 10.153.89.1! </content> </log> ...</list>
Elements
log sub-elements
Syslog source type ID, which uniquely identifies a syslog source type.idInteger type.
Time when the syslog was received.recvTimeString type.
Device ID.deviceIdLong integer type.
Device name.deviceNameString type.
IP address.deviceIpString type.
System name.sysNameString type.
Module name.moduleString type.
316 Network Syslog Management
log sub-elements
Severity level.severityInteger type.
Log digest.digestString type.
Repeat time.repeatsInteger type.
Log content.contentString type.
ExampleQuery and list syslogs. The first ten entries are listed by default.
Request
GET http://imc_host:8080/imcrs/fault/syslog/log/accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
</list> <log> <id>1>/id> <recvTime>2011-08-29 16:39:11</recvTime> <deviceId>12</deviceId> <deviceName>L07069A</deviceName> <deviceIp>10.153.129.35</deviceIp> <sysName>H3C </sysName> <module>DHCP-SNP</module> <severity>5</severity> <digest>dhcp-snooping server guard</digest> <repeats>3</repeats> <content><182>Oct 12 11:02:52 19.82.2.20 Apr 2 00:04:42 2000 H3C %%DHCP-SNP/5/dhcp-snooping server guard:- 1 -Port 0 detect DHCP server in VLAN 1 MAC is 00e0-fc05-53b1 IP is 10.153.89.1! </content> </log> ... <log> <id>10</id> <recvTime>2011-08-29 16:39:11</recvTime> <deviceId>12</deviceId> <deviceName>L07069A</deviceName> <deviceIp>10.153.129.35</deviceIp> <sysName>Monza_IRF </sysName> <module>10PORTSEC</module> <severity>2</severity> <digest>LOGINFAILURE(l)</digest> <repeats>3</repeats> <content><182>Oct 12 11:02:52 19.82.2.20 Apr 3 03:23:53 2000 Monza_IRF %%10PORTSEC/2/LOGINFAILURE(l):- 8 - OID: 1.3.6.1.4.1.2011.10.2.26.1.3.3(h3cSecureLoginFailure) A user login failure occurs due to the user not being successfully authorised IfIndex: 503316834 Port:Ethernet8/0/42 MAC Addr: 0010-5ce8-89fa VLAN id:999 PortNum:503316834 UserName: local@local </content> </log> <link href="http://localhost:8080/imcrs/syslog/log/?start=10&size=10" op="GET" rel="next"/></list>
Query Syslog Information List 317
Query Unmanaged Device Filtering Rule StatusQuery the status of the filtering rule for unmanaged devices. The status can be Enabled or Disabled.
Query Unmanaged Device Filtering Rule Status List 321
Modify Unmanaged Device Filtering Rule StatusModify the status of the filtering rule for unmanaged devices.You can switch between the Enabled state and the Disabled state.
Status ID.idInteger type. No default value. Valid values include 0 and 1.
Returned Result
Status codes
• 204 (No Content): Success.
ExampleChange the status of the filtering rule for unmanaged devices to 1, which indicates the Enabledstate.
Request
PUT http://imc_host:8080/imcrs/syslog/filter/currentUnmanagedDeviceRuleState/1accept: application/xml...
Response
HTTP/1.1 204 No Content...
The message body is empty.
322 Network Syslog Management
10 Network Performance ManagementNetwork performance management commands enable you to query on network, server, and deviceperformance data and to maintain performance indexes. This category includes the followingcommands:
• Query Summaries
• Query Index Groups
• Query Performance Indexes
• Query Single-Device Single-Index Instances
• Query Single-Index Multi-Device Performance Summary Data
• Query Single-Index Single-Interface Performance Summary Data
Query Performance IndexesQuery performance indexes with certain criteria.
Interface URI/perf/task
Access Method
HTTPGET
Parameters
Query parameters
Type name.nameString type, supporting wildcard characters. Optional. No default value.
The sequencing field of the returned result set.orderByString type. Optional. The default value is taskId. The valid value is taskId.
Whether or not the result is sequenced in reverse order.descBoolean type. Optional. The default value is false. The parameter is valid only when the orderByparameter is specified.
Query Single-Index Multi-Device Performance Summary DataQuery single-index multi-device performance summary data with certain criteria.
Interface URI/perf/summaryData
Access Method
HTTPGET
Parameters
Query parameters
Index ID.taskIdInteger type. Required. No default value. For the valid values, see “Query Performance Indexes.”
Device ID.devIdLong integer type. Required. No default value. For the valid values, see “Query Device Information.”
Start time.beginTimeLong integer type. Optional. The value is the seconds counted from 00:00 on January 1, 1970 tothe specified time. An empty value indicates that the latest data is queried.
End time.endTimeLong integer type. Optional. The value is the seconds counted from 00:00 on January 1, 1970 tothe specified time.
Data granularity.dataGranularityInteger type. Optional. The default value is 0. Valid values include 0 (automatically calculated data),1 (original data), 2 (hourly data), and 3 (daily data).
Returned Result
Status codes
• 200 (OK): Success.
Message header
200 (OK): Success.
Query Single-Index Multi-Device Performance Summary Data 333
Index ID, which uniquely identifies an index.taskIdInteger type.
Index name.taskNameString type.
Device ID.devIdLong integer type.
Device name.devNameString type.
Instance ID.instIdInteger type
Object index.objIndexString type.
Object index description (or instance name).objIndexDescString type.
Task name including the unit.taskNameWithUnitString type
Device IP address.devIPString type.
Device name. String type.devDisplayName
Average value of the detailed data set.averageValueDouble-precision floating-point type.
Maximum value of the detailed data set.maximumValueDouble-precision floating-point type.
Minimum value of the detailed data set.minimumValueDouble-precision floating-point type.
Current value of the detailed data set.currentValueDouble-precision floating-point type.
Summary value of the detailed data set.summaryValueDouble-precision floating-point type.
Query Single-Index Single-Interface Performance Summary Data 337
ExampleQuery the performance detailed data, the parameters are as follows: the index ID is 1, the deviceID is 25, the data granularity is 1, and the object index is 1.
Request
GET http://imc_host:port/imcrs/perf/summaryData/interface?taskId=1&devId=25&dataGranularity=1&objIndex=2accept: application/xml...
11 Report ManagementThe Report Management commands enable you to query and view history for periodic reports.This category includes the following commands:
• Query Periodic Reports
• Query Periodic Report Details
• Query Periodic Report Histories
• Get History File of a Periodic Report
347
Query Periodic ReportsQuery periodic reports with certain criteria.
Get History File of a Periodic ReportGet the history file of a periodic report with the specified file name and report ID.
Interface URI/report/task/download
Access Method
HTTPGET
Parameters
Query parameters
Periodic report ID.taskIdLong integer type.
History file name.fileNameString type.
Returned Result
Status codes
• 200 (OK): Success.
Message body
The browser displays the download file dialog box or directly opens the file.
ExampleGet the history file named 20100223.pdf for periodic report with ID 1.
Request
GET http://imc_host:8080/imcrs/report/task/download?taskId=1&filename=20101223.pdfaccept: application/pdf,application/msexcel,text/comma-separated-values...
Response
The browser displays the download file dialog box or directly opens the file.
354 Report Management
12 Network Asset ManagementNetwork asset management commands enable you to query network assets with specified criteriaand to gain details on specific devices. Available commands in this category include:
• Query Assets
• Query Asset Details
355
Query AssetsQuery network assets with certain criteria.
Interface URI/netasset/asset
Access Method
HTTPGET
Parameters
Query parameters
Asset name.assetNameString type, supporting wildcard characters. Optional. No default value.
Asset description.assetDescString type, supporting wildcard characters. Optional. No default value.
Asset type.assetPhyClassLong integer type. Optional. No default value. -1 for device. 1 for other. 2 for unknown. 3 forstandalone device. 4 for backplane. 5 for container. 6 for power module. 7 for fan. 8 for sensor.9 for module. 10 for port. 11 for stack device.
Asset serial number.assetSerialNumString type. Optional. No default value.
Asset number.assetNumString type. Optional. No default value.
Field replaceable or not.assetIsFRULong integer type. Optional. No default value. 1 for field replaceable. 2 for not field replaceable.
Physical asset or not.assetPhysicalFlagLong integer type. Optional. No default value. 1 for no. 2 for yes.
Asset OID.assetVendorTypeString type. Optional. No default value.
Device name.assetDevice.nameString type. Optional. No default value.
Device IP address.assetDevice.ipString type. Optional. No default value.
Device ID, which uniquely identifies a device.devIdLong integer type.
Asset physical index.phyIndexLong integer type.
Device name.deviceNameString type.
Device IP address.deviceIpString type.
Asset description.descString type.
Asset OID.vendorTypeString type.
Physical index of the parent entity.containedInLong integer type.
Asset type.phyClass
Query Assets 357
netAsset sub-elements
Long integer type. -1 for device. 1 for other. 2 for unknown. 3 for standalone device. 4 forbackplane. 5 for container. 6 for power module. 7 for fan. 8 for sensor. 9 for module. 10 forport. 11 for stack device.
Position serial number of the asset in the parent entity.relPosLong integer type.
Asset name.nameString type.
Hardware version.hardVersionString type.
Firmware version.firmwareVersionString type.
Software version.softVersionString type.
Serial number.serialNumString type.
Manufacturer name.mfgNameString type.
Model.modelString type.
Alias.aliasString type.
Field replaceable or not.isFRUInteger type. 1 for field replaceable. 2 for not field replaceable.
cleiCode.cleiCodeString type.
Build information.buildInfoString type.
BOM number.bomString type.
Card number.boardNumInteger type.
Time in service.serverDateDate/time type.
Remark.remarkString type.
Asset number.assetNumberString type.
Physical entity flag.physicalFlagLong integer type. 0 or 1 for no. 2 or 3 for yes.
358 Network Asset Management
netAsset sub-elements
Link to device details .deviceString type.
Link to device details .assetString type.
ExampleQuery and list network assets.
Request
GET http://imc_host:8080/imcrs/netasset/assetaccept: application/xml...
Device ID, which uniquely identifies a device.devIdLong integer type.
Asset physical index.phyIndexLong integer type.
Device name.deviceNameString type.
Device IP address.deviceIpString type.
Asset description.descString type.
Asset OID.vendorTypeString type.
Physical index of the parent entity.containedInLong integer type.
Asset type.phyClassLong integer type. -1 for device. 1 for other. 2 for unknown. 3 for standalone device. 4 for backplane.5 for container. 6 for power module. 7 for fan. 8 for sensor. 9 for module. 10 for port. 11 for stackdevice.
Position serial number of the asset in the parent entity.relPosLong integer type.
Asset name.nameString type.
Hardware version.hardVersionString type.
Firmware version.firmwareVersionString type.
Software version.softVersionString type.
Serial number.serialNumString type.
Manufacturer name.mfgNameString type.
Model.modelString type.
Alias.aliasString type.
Field replaceable or not.isFRUInteger type. 1 for field replaceable. 2 for not field replaceable.
Query Asset Details 361
netAsset sub-elements
cleiCode.cleiCodeString type.
Build information.buildInfoString type.
BOM number.bomString type.
Card number.boardNumInteger type.
Time in service.serverDateDate/time type.
Remark.remarkString type.
Asset number.assetNumberString type.
Physical entity flag.physicalFlagLong integer type. 0 or 1 for no. 2 or 3 for yes.
Link to device details .deviceString type.
362 Network Asset Management
ExampleQuery information about the network asset whose device ID is 1 and asset physical index is 1001.
Request
GET http://imc_host:8080/imcrs/netasset/asset/detail?devId=27&phyIndex=1001accept: application/xml...
13 Network Service ManagementNetwork service management commands enable you to query on and manage VLANs, ports, andinterfaces. This category includes the following commands:
• Query VLANs
• Query VLAN Ports
• Add VLAN
• Delete VLAN
• Change VLAN Name
• Add Port to VLAN
• Remove Port from VLAN
• Query Access Ports
• Change PVID of Access Port
• Query Hybrid Ports
• Add Hybrid Port
• Delete Hybrid Port
• Modify Hybrid Port
• Query Trunk Ports
• Add Trunk Port
• Delete Trunk Port
• Modify Trunk Port
• Query VLAN Interfaces
• Query VLAN Interfaces
• Add VLAN Interface
• Delete VLAN Interface
364 Network Service Management
Query VLANsQuery and list VLAN information on the device with certain criteria.
Interface URI/vlan
Access Method
HTTPGET
Parameters
Query parameters
Device type ID.devIdInteger type. Required. No default value.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value is uploaded, the default value isused.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value is uploaded, the value takes 0.If the uploaded value is bigger than 1000, the value takes 1000.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Total attribute of the message headerreturns the number of records that meet the requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Query VLAN PortsQuery and list information about VLAN ports on the device with certain criteria.
Interface URI/vlan/{vlanId}
Access Method
HTTPGET
Parameters
Query parameters
VLAN ID.vlanIdInteger type. Required. No default value.
Device type ID.devIdInteger type. Required. No default value.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value is uploaded, the default value isused.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value is uploaded, the value takes 0.If the uploaded value is bigger than 1000, the value takes 1000.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Total attribute of the message headerreturns the number of records that meet the requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Device type ID.devIdInteger type. Required. No default value.
VLAN IDvlanIdInteger type. Required. No default value.
VLAN name.vlanNameString type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
• 409 (Conflict): Failure. See “Error Codes.”
ExampleChange the name to "VLAN 111" for the VLAN with ID 1111 on the device whose ID is 13.
Request
PUT http://localhost:8080/imcrs/vlan?devId=13accept: application/xml...<vlan> <vlanId>1111</vlanId> <vlanName>VLAN 1111</vlanName></vlan>
Response
HTTP/1.1 204 No Content...
374 Network Service Management
Add Port to VLANAdd a port to a VLAN.
Interface URI/vlan/{vlanId}
Access Method
HTTPPOST
Message body
POST http://imc_host:8080/imcrs/vlan/777?devId=33&ifIndex=1538accept: application/xml...
Parameters
VLAN port sub-elements
Device type ID.devIdInteger type. Required. No default value.
VLAN IDvlanIdInteger type. Required. No default value.
VLAN name.vlanNameString type. Required. No default value.
Returned Result
Status codes
• 201 (Created): Success.
• 409 (Conflict): Failure. See “Error Codes.”If the operation succeeds, the Location field gives the URI of the VLAN resource where the port islocated. The message body is empty.
Query Access PortsQuery and list access ports on the device with certain criteria.
Interface URI/vlan/access
Access Method
HTTPGET
Parameters
Query parameters
Device type ID.devIdInteger type. Required. No default value.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value is uploaded, the default value isused.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value is uploaded, the value takes 0.If the uploaded value is bigger than 1000, the value takes 1000.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Total attribute of the message headerreturns the number of records that meet the requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Change PVID of Access PortChange the PVID of an access port.
Interface URI/vlan/access
Access Method
HTTPPUT
Message body
PUT http://imc_host:8080/imcrs/vlan/access?devId=33&destVlanId=4&ifIndex=1794accept: application/xml...
Parameters
Access port sub-elements
Device type ID.devIdInteger type. Required. No default value.
Target VLAN ID.destVlanIdInteger type. Required. No default value.
Port index, which uniquely identifies a port.ifIndexInteger type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
• 409 (Conflict): Failure. See “Error Codes.”
ExampleChange the PVID to 4 for a port indexed 1794 on the device with ID 33.
Request
PUT http://imc_host:8080/imcrs/vlan/access?devId=33&destVlanId=4&ifIndex=1794accept: application/xml...
ResponseNone.
380 Network Service Management
Query Hybrid PortsQuery and list hybrid ports on the device with certain criteria.
Interface URI/vlan/hybrid
Access Method
HTTPGET
Parameters
Query parameters
Device type ID.devIdInteger type. Required. No default value.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value is uploaded, the default value isused.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value is uploaded, the value takes 0.If the uploaded value is bigger than 1000, the value takes 1000.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Total attribute of the message headerreturns the number of records that meet the requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Query Trunk PortsQuery and list trunk ports on the device with certain criteria.
Interface URI/vlan/trunk
Access Method
HTTPGET
Parameters
Query parameters
Device type ID.devIdInteger type. Required. No default value.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value is uploaded, the default value isused.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value is uploaded, the value takes 0.If the uploaded value is bigger than 1000, the value takes 1000.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false.When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Total attribute of the message headerreturns the number of records that meet the requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Modify Trunk PortModify the parameters of a trunk port on the device.
Interface URI/vlan/trunk
Access Method
HTTPPUT
Message body
PUT http://imc_host:8080/imcrs/vlan/trunk?devId=33accept: application/xml...<trunkIf allowedVlans="3,7" ifIndex="2423" pvid="1"/>
Elements
Trunk port sub-elements
Device type ID.devIdInteger type. Required. No default value.
Port index, which uniquely identifies a port.ifIndexInteger type. Required. No default value.
PVID of the trunk port.pvidInteger type. Required. No default value.
Allowed VLAN.allowedVlansString type. Optional. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
• 409 (Conflict): Failure. See “Error Codes.”
ExampleModify a trunk port on the device whose ID is 33. The new parameters are as follows: ifIndex=2434,pvid=1, allowedVlan=3,7.
Request
PUT http://imc_host:8080/imcrs/vlan/trunk?devId=33accept: application/xml...<trunkIf allowedVlans="3,7" ifIndex="2423" pvid="1"/>
ResponseNone
Modify Trunk Port 395
Query VLAN InterfacesQuery and list VLAN interfaces on the device with certain criteria.
Interface URI/vlan/vlanif
Access Method
HTTPGET
Parameters
Query parameters
Device type ID.devIdInteger type. Required. No default value.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value is uploaded, the default value isused.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value is uploaded, the value takes 0.If the uploaded value is bigger than 1000, the value takes 1000.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Total attribute of the message headerreturns the number of records that meet the requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
Query a Specific VLAN InterfaceQuery and list information about VLAN interfaces for a VLAN on the device with certain criteria.
Interface URI/vlan/vlanif/{vlanId}
Access Method
HTTPGET
Parameters
Query parameters
VLAN ID.vlanIdInteger type. Required. No default value.
Device type ID.devIdInteger type. Required. No default value.
The position where the first returned record is located in the whole returned result.startInteger type. Optional. The default value is 0. If a negative value is uploaded, the default value isused.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value is uploaded, the value takes 0.If the uploaded value is bigger than 1000, the value takes 1000.
Only the number of records that meet the requirements is returned.totalBoolean type. Optional. The default value is false. When the value is true, the start and size attributesare invalid, the returned message body is empty, and the Total attribute of the message headerreturns the number of records that meet the requirements.
Returned Result
Status codes
• 200 (OK): Success.
Message headerWhen the total parameter takes true, the Total attribute returns the total number of records thatmeet the requirements. The message body is empty.
VLAN ID, which uniquely identifies a VLAN. Integer type. Required. No default value.vlanId
Primary IP address or not. Boolean type. Optional. The default value is true.isPrimary
Whether or not the IP address is assigned through DHCP. If the value takes true, then the ipAddressand ipMask parameters are empty. Boolean type. Optional. The default value is false.
enableDHCP
IP address. String type. Optional. If the enableDHCP parameter is false then neither ipAddress oripMask can be empty.
ipAddress
Network mask of an IP address. String type. Optional. If the enableDHCP parameter is false, thenneither ipAddress nor ipMask can be empty.
ipMask
Returned Result
Status codes
• 204 (No Content): Success.
• 409 (Conflict): Failure. See “Error Codes.”
ExampleDelete a VLAN interface from the device whose ID is 3. The interface parameters are as follows:vlanId=600, ipAddress=1.1.1.1, ipMask=255.0.0.0.
14 ACL ManagementThe ACL Management category of commands enables you to query on and manage ACL devicesand applications. This category includes the following commands:
• Query the Device List of ACL Configuration
• Synchronize ACL Configuration Information for a Device
• Query the ACL Definitions of a Device
• Add ACL on a Device
• Delete ACL from a Device
• Query ACL Applications of a Device
• Add ACL Application on a Device
• Delete ACL Application from a Device
• Query ACL Time Ranges of a Device
• Add ACL Time Range on a Device
• Delete ACL Time Range from a Device
404 ACL Management
Query the Device List of ACL ConfigurationQuery the device list of the specified ACL configuration according to certain conditions.
Interface URI/acl/res/aclDevice
Access Method
HTTPGET
Parameters
Query parameters
Device name.deviceNameString type. Optional. No default value.
Device IP address.deviceIpString type. Optional. No default value.
The position of the first returned record in the query result set.startInteger type. Optional. The default value is 0. If a value smaller than 0 is input, the default value 0is used.
Total number of returned records.sizeInteger type. Optional. The default value is 10. If a value smaller than 0 is input, the default value10 is used.
Specify that only the number of matched records is returned.totalBoolean type. Optional. The default value is false. When this field is set to true, the start and sizefields are ineffective, the message body returned is empty, and the Total field in the message headerreturns the number of matched records.
Returned Result
Status codes
• 200(OK): Success.
Message headerWhen the total parameter is true, the Total field gives the total number of matched child time ranges.No message body is included.
Synchronize ACL Configuration Information for a DeviceSynchronize ACL configuration information for a device specified by its ID.
Interface URI/acl/res/aclDevice/{id}/synchronize
Access Method
HTTPPUT
Parameters
Path parameters
Device ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 204(No Content): Success.
• 404(Not Found): Failure.
• 409(Conflict): Failure. For more information, see “Conventions and Constraints.”
ExampleSynchronize ACL configuration information for a device whose device ID is 68.
Request
PUT http://imc_host:8080/imcrs/acl/res/aclDevice/68/synchronizeaccept: application/xml...
Response
HTTP/1.1 204 No ContentContent-Type: application/xml...No message body is included.
408 ACL Management
Query the ACL Definitions of a DeviceQuery the ACL definitions of a device according to the specified device ID.
Interface URI/acl/res/acl/{deviceId}
Access Method
HTTPGET
Parameters
Path parameters
Device ID.deviceIdLong integer type. Required. No default value.
Query parameters
The position of the first returned record in the query result set.startInteger type. Optional. The default value is 0. If a value smaller than 0 is input, the default value 0is used.
Total number of returned records.sizeInteger type. Optional. The default value is 10. If a value smaller than 0 is input, the default value10 is used.
Specify that only the number of matched records is returned.totalBoolean type. Optional. The default value is false. When this field is set to true, the start and sizefields are ineffective, the message body returned is empty, and the Total field in the message headerreturns the number of matched records.
Returned Result
Status codes
• 200(OK): Success.
Message headerWhen the total parameter is true, the Total field gives the total number of matched records. Nomessage body is included.
HTTP/1.1 204 No ContentContent-Type: application/xml...No message body is included.
420 ACL Management
Query ACL Applications of a DeviceQuery the ACL application list of a device specified by its device ID.
Interface URI/acl/res/aclUse/{deviceId}
Access Method
HTTPGET
Parameters
Path parameters
Device ID.deviceIdLong integer type. Required. No default value.
Query parameters
The position of the first returned record in the query result set.startInteger type. Optional. The default value is 0. If a value smaller than 0 is input, the default value 0is used.
Total number of returned records.sizeInteger type. Optional. The default value is 10. If a value smaller than 0 is input, the default value10 is used.
Specify that only the number of matched records is returned.totalBoolean type. Optional. The default value is false. When this field is set to true, the start and sizefields are ineffective, the message body returned is empty, and the Total field in the message headerreturns the number of matched records.
Returned Result
Status codes
• 200(OK): Success.
Message headerWhen the total parameter is true, the Total field gives the total number of matched records. Nomessage body is included.
HTTP/1.1 204 No ContentContent-Type: application/xml...No message body is included.
426 ACL Management
Query ACL Time Ranges of a DeviceQuery the ACL time ranges of a device specified by its device ID.
Interface URI/acl/res/aclTimeRange/{deviceId}
Access Method
HTTPGET
Parameters
Path parameters
Device ID.deviceIdLong integer type. Required. No default value.
Query parameters
The position of the first returned record in the query result set.startInteger type. Optional. The default value is 0. If a value smaller than 0 is input, the default value 0is used.
Total number of returned records.
sizeInteger type. Optional. The default value is 10. If a value smaller than 0 is input, the default value10 is used.
Specify that only the number of matched records is returned.totalBoolean type. Optional. The default value is false. When this field is set to true, the start and sizefields are ineffective, the message body returned is empty, and the Total field in the message headerreturns the number of matched records.
Returned Result
Status codes
• 200(OK): Success.
Message headerWhen the total parameter is true, the Total field gives the total number of matched records. Nomessage body is included.
Child time range sub-elements of of an ACL time range
Child time range ID of an ACL time range, which uniquely identifies a child time range of anACL time range.
trChildId
Long integer type.
ACL time range ID.aclTimeRangeIdLong integer type.
Type.trChildTypeLong integer type.
Period.trPerDayofweekString type.
Start time.trStartTimeString type.
End time.trEndTimeString type.
Note:1. When trChildType=0, the time range type is absolute. When trChildType=1, the time type is
periodic.2. For an absolute time range, the trPerDayofweek field is not required, and the start time and
end time are required. For example, to cover the time range 2011-08-01 08:00 to 2011-08-1518:00, you must set trStartTime=2011-08-01 08:00 and trEndTime=2011-08-15 18:00.
3. For a periodic time range, set the trPerDayofweek field as follows: Sunday=0, Monday=1,Tuesday=2, Wennesday=3, Thursday=4, Friday=5, Saturday=6, week=7, weekend=8, andworking days=9;Example 1: To cover 08:00 to 18:00 of each Tuesday, you must set trPerDayofweek to 2,trStartTime=08:00, and trEndTime=18:00;Example 2: To cover 08:00 to 18:00 of working days, you must set trPerDayofweek to 9,trStartTime=08:00, and trEndTime=18:00;Example 3: To cover 08:00 to 18:00 on each day of a week, you must set trPerDayofweekto 7, trStartTime=08:00, and trEndTime=18:00;Example 4: to periodically cover 08:00 to 18:00 on each Monday, Wednesday, Tuesday,and Saturday, you must set trPerDayofweek to 1:3:4:6, trStartTime=08:00, andtrEndTime=18:00;
4. You can input the trStartTime and trEndTime in the format of yyyy-MM-dd HH:mm or HH:mm.For example, 2011-08-01 08:00.
Query Child Time 433
ExampleQuery the child time ranges of ACL time range 80 of the device whose device ID is 25.
Request
GET http://imc_host:8080/imcrs/acl/res/aclTimeRange/25,80accept: application/xml...
For worldwide technical support information, see the HP support website:http://www.hp.com/support
Before contacting HP, collect the following information:
• Product model names and numbers
• Technical support registration number (if applicable)
• Product serial numbers
• Error messages
• Operating system type and revision level
• Detailed questions
Subscription serviceHP recommends that you register your product at the Subscriber's Choice for Business website:http://www.hp.com/go/e-updatesAfter registering, you receive email notification of product enhancements, new driver versions,firmware updates, and other product resources.
WarrantyThe Hewlett-Packard Limited Warranty Statement for this product and the HP Software LicenseTerms which apply to any software accompanying this product are available on the HP networkingWeb site at www.hp.com/networking/warranty. The customer warranty support and servicesinformation are available on the HP networking Web site at www.hp.com/networking/support.Additionally, your HP authorized network reseller can provide you with assistance, both withservices that they offer and with services offered by HP.
DocumentationFor the latest documentation, visit the HP website, www.hp.com, and select the Support &Troubleshooting link.
• Choose See support and troubleshooting information radio button.
• Enter product name/number OR choose the automatic product name/number detection ORselect a product category.
• From the product page, choose the Manuals link to the documentation associated with yourproduct.
16 Documentation feedbackHP is committed to providing documentation that meets your needs. To help us improve thedocumentation, send any errors, suggestions, or comments to Documentation Feedback([email protected]). Include the document title and part number, version number, or the URLwhen submitting your feedback.