Upload
edieealvitres
View
221
Download
3
Tags:
Embed Size (px)
Citation preview
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
© Copyright 2012, Hewlett-Packard Development Company, L.P.
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.
Revision History
June 2012Revision 1First publication
Contents1 Quick Start..............................................................................................22
Welcome to iMC RESTful Web Services ....................................................................................22The First iMC-RS Client............................................................................................................22
Preparations......................................................................................................................22Verify iMC-RS availability....................................................................................................22Create project...................................................................................................................23Compile iMC-RS client codes...............................................................................................23Run codes and view result...................................................................................................23
iMC-RS Security Mechanism.....................................................................................................24Identification authentication.................................................................................................24Verify iMC-RS availability....................................................................................................25
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
3 R&D References........................................................................................27Interface Categories................................................................................................................27
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
Error Codes...........................................................................................................................31FAQ......................................................................................................................................32
4 System Management.................................................................................33Query All Operators...............................................................................................................34
Interface URI.....................................................................................................................34Access Method..................................................................................................................34Returned Result..................................................................................................................34Example...........................................................................................................................35
Query Individual Operators.....................................................................................................36Interface URI.....................................................................................................................36Access Method..................................................................................................................36Returned Result..................................................................................................................36Example...........................................................................................................................38
Add Operator........................................................................................................................39Interface URI.....................................................................................................................39Access Method..................................................................................................................39Returned Result..................................................................................................................39
Contents 3
Example...........................................................................................................................40Modify Operators...................................................................................................................41
Interface URI.....................................................................................................................41Access Method..................................................................................................................41Returned Result..................................................................................................................41Example...........................................................................................................................42
Delete Operator.....................................................................................................................43Interface URI.....................................................................................................................43Access Method..................................................................................................................43Returned Result..................................................................................................................43Example...........................................................................................................................43
Query Operator Groups..........................................................................................................44Interface URI.....................................................................................................................44Access Method..................................................................................................................44Returned Result..................................................................................................................44Example...........................................................................................................................45
Query Operator Group Details.................................................................................................46Interface URI.....................................................................................................................46Access Method..................................................................................................................46Returned Result..................................................................................................................46Example...........................................................................................................................47
Add Operator Group..............................................................................................................48Interface URI.....................................................................................................................48Access Method..................................................................................................................48Returned Result..................................................................................................................48Example...........................................................................................................................49
Modify Operator Group..........................................................................................................50Interface URI.....................................................................................................................50Access Method..................................................................................................................50Returned Result..................................................................................................................50Example...........................................................................................................................51
Delete Operator Group...........................................................................................................52Interface URI.....................................................................................................................52Access Method..................................................................................................................52Returned Result..................................................................................................................52Example...........................................................................................................................52
5 Network Resource Management.................................................................53Query Device Information List...................................................................................................55
Interface URI.....................................................................................................................55Access Method..................................................................................................................55Returned Result..................................................................................................................56Example...........................................................................................................................56
Query Device Information........................................................................................................57Interface URI.....................................................................................................................57Access Method..................................................................................................................57Returned Result..................................................................................................................57Example...........................................................................................................................61
Query Device Types................................................................................................................63Interface URI.....................................................................................................................63Access Method..................................................................................................................63Returned Result..................................................................................................................63Example...........................................................................................................................64
Query Device Type.................................................................................................................65Interface URI.....................................................................................................................65
4 Contents
Access Method..................................................................................................................65Returned Result..................................................................................................................65Example...........................................................................................................................66
Query Vendor Information List..................................................................................................67Interface URI.....................................................................................................................67Access Method..................................................................................................................67Returned Result..................................................................................................................67Example...........................................................................................................................68
Query Vendor Information.......................................................................................................69Interface URI.....................................................................................................................69Access Method..................................................................................................................69Example...........................................................................................................................70
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
Add Device............................................................................................................................81Interface URI.....................................................................................................................81Access Method..................................................................................................................81Returned Result..................................................................................................................82Example...........................................................................................................................83
Synchronize Device.................................................................................................................84Interface URI.....................................................................................................................84Access Method..................................................................................................................84Returned Result..................................................................................................................84Example...........................................................................................................................84
Manage Device......................................................................................................................85Interface URI.....................................................................................................................85Access Method..................................................................................................................85Returned Result..................................................................................................................85Example...........................................................................................................................85
Unmanage Device..................................................................................................................86Interface URI.....................................................................................................................86Access Method..................................................................................................................86Returned Result..................................................................................................................86Example...........................................................................................................................86
Delete Device.........................................................................................................................87Interface URI.....................................................................................................................87Access Method..................................................................................................................87
Contents 5
Returned Result..................................................................................................................87Example...........................................................................................................................87
Modify Device Label...............................................................................................................88Interface URI.....................................................................................................................88Access Method..................................................................................................................88Returned Result..................................................................................................................88Example...........................................................................................................................89
Modify System Information.......................................................................................................90Interface URI.....................................................................................................................90Access Method..................................................................................................................90Returned Result..................................................................................................................90Example...........................................................................................................................91
Modify Login Method..............................................................................................................92Interface URI.....................................................................................................................92Access Method..................................................................................................................92Returned Result..................................................................................................................92Example...........................................................................................................................93
Modify Device Group..............................................................................................................94Interface URI.....................................................................................................................94Access Method..................................................................................................................94Returned Result..................................................................................................................94Example...........................................................................................................................95
Modify SNMP Settings............................................................................................................96Interface URI.....................................................................................................................96Access Method..................................................................................................................96Returned Result..................................................................................................................97Example...........................................................................................................................98
Modify Telnet Settings.............................................................................................................99Interface URI.....................................................................................................................99Access Method..................................................................................................................99Returned Result................................................................................................................100Example.........................................................................................................................100
Modify SSH Settings.............................................................................................................101Interface URI...................................................................................................................101Access Method................................................................................................................101Returned Result................................................................................................................102Example.........................................................................................................................103
Modify Polling Interval...........................................................................................................104Interface URI...................................................................................................................104Access Method................................................................................................................104Returned Result................................................................................................................104Example.........................................................................................................................105
Modify Ping Parameters.........................................................................................................106Interface URI...................................................................................................................106Access Method................................................................................................................106Returned Result................................................................................................................106Example.........................................................................................................................107
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
Ping....................................................................................................................................114Interface URI...................................................................................................................114Access Method................................................................................................................114Returned Result................................................................................................................114Example.........................................................................................................................115
Tracert................................................................................................................................116Interface URI...................................................................................................................116Access Method................................................................................................................116Returned Result................................................................................................................116Example.........................................................................................................................117
Query Links.........................................................................................................................118Interface URI...................................................................................................................118Access Method................................................................................................................118Returned Result................................................................................................................118Example.........................................................................................................................119
Query Link Information..........................................................................................................120Interface URI...................................................................................................................120Access Method................................................................................................................120Returned Result................................................................................................................120Example.........................................................................................................................121
Start Automatic Discovery......................................................................................................122Interface URI...................................................................................................................122Access Method................................................................................................................122Returned Result................................................................................................................123Example 1......................................................................................................................123Example 2......................................................................................................................124Example 3......................................................................................................................124
Stop Automatic Discovery......................................................................................................125Interface URI...................................................................................................................125Access Method................................................................................................................125Returned Result................................................................................................................125Example.........................................................................................................................125
Query Automatic Discovery Status..........................................................................................126Interface URI...................................................................................................................126Access Method................................................................................................................126Returned Result................................................................................................................126Example.........................................................................................................................126
Query Automatic Device Discovery Results...............................................................................127Interface URI...................................................................................................................127Access Method................................................................................................................127Returned Result................................................................................................................127Example.........................................................................................................................128
Query Automatically Discovered Devices.................................................................................129Interface URI...................................................................................................................129Access Method................................................................................................................129Returned Result................................................................................................................129Example.........................................................................................................................130
Query Device Interface Information.........................................................................................131
Contents 7
Interface URI...................................................................................................................131Access Method................................................................................................................131Returned Result................................................................................................................131Example.........................................................................................................................132
Query Interface Details..........................................................................................................133Interface URI...................................................................................................................133Access Method................................................................................................................133Returned Result................................................................................................................133Example.........................................................................................................................135
Bring Up an Interface............................................................................................................136Interface URI...................................................................................................................136Access Method................................................................................................................136Returned Result................................................................................................................136Example.........................................................................................................................136
Shut Down an Interface.........................................................................................................137Interface URI...................................................................................................................137Access Method................................................................................................................137Returned Result................................................................................................................137Example.........................................................................................................................137
Query Custom View List.........................................................................................................138Interface URI...................................................................................................................138Access Method................................................................................................................138Returned Result................................................................................................................138Example.........................................................................................................................139
Query Custom View Information.............................................................................................140Interface URI...................................................................................................................140Access Method................................................................................................................140Returned Result................................................................................................................140Example.........................................................................................................................141
Add Custom View.................................................................................................................142Interface URI...................................................................................................................142Access Method................................................................................................................142Returned Result................................................................................................................142Example.........................................................................................................................143
Modify Custom View.............................................................................................................144Interface URI...................................................................................................................144Access Method................................................................................................................144Returned Result................................................................................................................145Example.........................................................................................................................145
Delete Custom View..............................................................................................................146Interface URI...................................................................................................................146Access Method................................................................................................................146Returned Result................................................................................................................146Example.........................................................................................................................146
Query Interface Views...........................................................................................................147Interface URI...................................................................................................................147Access Method................................................................................................................147Returned Result................................................................................................................147Example.........................................................................................................................148
Query Interface View Information...........................................................................................149Interface URI...................................................................................................................149Access Method................................................................................................................149Returned Result................................................................................................................149Example.........................................................................................................................150
Add Interface View...............................................................................................................151
8 Contents
Interface URI...................................................................................................................151Access Method................................................................................................................151Returned Result................................................................................................................151Example.........................................................................................................................152
Modify Interface View...........................................................................................................153Interface URI...................................................................................................................153Access Method................................................................................................................153Returned Result................................................................................................................154Example.........................................................................................................................154
Delete Interface View............................................................................................................155Interface URI...................................................................................................................155Access Method................................................................................................................155Returned Result................................................................................................................155Example.........................................................................................................................155
Query IP Views....................................................................................................................156Interface URI...................................................................................................................156Access Method................................................................................................................156Returned Result................................................................................................................156Example.........................................................................................................................157
Query IP View......................................................................................................................158Interface URI...................................................................................................................158Access Method................................................................................................................158Returned Result................................................................................................................158Example.........................................................................................................................159
Export Topology in Visio Format.............................................................................................160Interface URI...................................................................................................................160Access Method................................................................................................................160Returned Result................................................................................................................160Example.........................................................................................................................161
Query SNMP Template Information List....................................................................................162Interface URI...................................................................................................................162Access Method................................................................................................................162Returned Result................................................................................................................162Example.........................................................................................................................163
Query SNMP Template Information.........................................................................................164Interface URI...................................................................................................................164Access Method................................................................................................................164Returned Result................................................................................................................164Example.........................................................................................................................166
Query Telnet Template Information List.....................................................................................167Interface URI...................................................................................................................167Access Method................................................................................................................167Returned Result................................................................................................................167Example.........................................................................................................................168
Query Telnet Template Information..........................................................................................169Interface URI...................................................................................................................169Access Method................................................................................................................169Returned Result................................................................................................................169Example.........................................................................................................................170
Query SSH Template Information List.......................................................................................171Interface URI...................................................................................................................171Access Method................................................................................................................171Returned Result................................................................................................................171Example.........................................................................................................................172
Query SSH Template Information............................................................................................173
Contents 9
Interface URI...................................................................................................................173Access Method................................................................................................................173Returned Result................................................................................................................173Example.........................................................................................................................174
Query SQL Statements..........................................................................................................175Interface URI...................................................................................................................175Access Method................................................................................................................175Returned Result................................................................................................................175Example.........................................................................................................................176
6 User Management..................................................................................177Query Users........................................................................................................................178
Interface URI...................................................................................................................178Access Method................................................................................................................178Returned Result................................................................................................................179Example.........................................................................................................................180
Query User Information.........................................................................................................181Interface URI...................................................................................................................181Access Method................................................................................................................181Returned Result................................................................................................................181Example.........................................................................................................................182
Add User.............................................................................................................................183Interface URI...................................................................................................................183Access Method................................................................................................................183Returned Result................................................................................................................183Example.........................................................................................................................184
Modify User.........................................................................................................................185Interface URI...................................................................................................................185Access Method................................................................................................................185Returned Result................................................................................................................186Example.........................................................................................................................186
Delete User..........................................................................................................................187Interface URI...................................................................................................................187Access Method................................................................................................................187Returned Result................................................................................................................187Example.........................................................................................................................187
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
7 Terminal Access Management..................................................................199Query Unauthorized Access Attempts......................................................................................201
Interface URI...................................................................................................................201Access Method................................................................................................................201Returned Result................................................................................................................202Example.........................................................................................................................203
Query Unauthorized Access Logs............................................................................................204Interface URI...................................................................................................................204Access Method................................................................................................................204Returned Result................................................................................................................205Example.........................................................................................................................206
Query Access Log Histories....................................................................................................207Interface URI...................................................................................................................207Access Method................................................................................................................207Returned Result................................................................................................................208Example.........................................................................................................................209
Query Current Accesses........................................................................................................210Interface URI...................................................................................................................210Access Method................................................................................................................210Returned Result................................................................................................................211Example.........................................................................................................................212
Query Real-Time Locations.....................................................................................................213Interface URI...................................................................................................................213Access Method................................................................................................................213Returned Result................................................................................................................213Example.........................................................................................................................214
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
Query Terminal Access Bindings.............................................................................................239Interface URI...................................................................................................................239Access Method................................................................................................................239Returned Result................................................................................................................240Example.........................................................................................................................240
Query Terminal Access Binding..............................................................................................241Interface URI...................................................................................................................241Access Method................................................................................................................241Returned Result................................................................................................................241Example.........................................................................................................................242
Automatically Scan Terminal Access Bindings...........................................................................243Interface URI...................................................................................................................243Access Method................................................................................................................243Returned Result................................................................................................................243Example.........................................................................................................................244
Add Terminal Access Binding.................................................................................................245Interface URI...................................................................................................................245Access Method................................................................................................................245Returned Result................................................................................................................245Example 1......................................................................................................................246
12 Contents
Example 2......................................................................................................................246Modify Terminal Access Binding.............................................................................................247
Interface URI...................................................................................................................247Access Method................................................................................................................247Returned Result................................................................................................................247Example.........................................................................................................................248
Delete Terminal Access Binding..............................................................................................249Interface URI...................................................................................................................249Access Method................................................................................................................249Returned Result................................................................................................................249Example.........................................................................................................................249
Query Switch Access Bindings...............................................................................................250Interface URI...................................................................................................................250Access Method................................................................................................................250Returned Result................................................................................................................251Example.........................................................................................................................252
Query Switch Access Binding.................................................................................................253Interface URI...................................................................................................................253Access Method................................................................................................................253Returned Result................................................................................................................253Example.........................................................................................................................254
Automatically Scan Switch Access Bindings..............................................................................255Interface URI...................................................................................................................255Access Method................................................................................................................255Returned Result................................................................................................................255Example.........................................................................................................................256
Add Switch Access Binding....................................................................................................257Interface URI...................................................................................................................257Access Method................................................................................................................257Returned Result................................................................................................................257Example 1......................................................................................................................258Example 2......................................................................................................................258
Modify Switch Access Binding................................................................................................259Interface URI...................................................................................................................259Access Method................................................................................................................259Returned Result................................................................................................................259Example.........................................................................................................................260
Delete Switch Access Binding.................................................................................................261Interface URI...................................................................................................................261Access Method................................................................................................................261Returned Result................................................................................................................261Example.........................................................................................................................261
Query IP-to-MAC Address Bindings.........................................................................................262Interface URI...................................................................................................................262Access Method................................................................................................................262Returned Result................................................................................................................262Example.........................................................................................................................263
Query IP-to-MAC Address Binding..........................................................................................264Interface URI...................................................................................................................264Access Method................................................................................................................264Returned Result................................................................................................................264Example.........................................................................................................................265
Automatically Scan IP-to-MAC Address Bindings.......................................................................266Interface URI...................................................................................................................266Access Method................................................................................................................266
Contents 13
Returned Result................................................................................................................266Example.........................................................................................................................267
Add IP-to-MAC Address Binding.............................................................................................268Interface URI...................................................................................................................268Access Method................................................................................................................268Returned Result................................................................................................................268Example.........................................................................................................................269
Delete IP-to-MAC Address Binding..........................................................................................270Interface URI...................................................................................................................270Access Method................................................................................................................270Returned Result................................................................................................................270Example.........................................................................................................................270
Query Conflict and Unauthorized Access Policy........................................................................271Interface URI...................................................................................................................271Access Method................................................................................................................271Returned Result................................................................................................................271Example.........................................................................................................................272
Query Unknown Access Policy...............................................................................................273Interface URI...................................................................................................................273Access Method................................................................................................................273Returned Result................................................................................................................273Example.........................................................................................................................274
Modify Conflict and Unauthorized Access Policy.......................................................................275Interface URI...................................................................................................................275Access Method................................................................................................................275Returned Result................................................................................................................275Example.........................................................................................................................276
Modify Unknown Access Policy..............................................................................................277Interface URI...................................................................................................................277Access Method................................................................................................................277Returned Result................................................................................................................278Example.........................................................................................................................278
8 Network Alarm Management...................................................................279Query Alarms......................................................................................................................280
Interface URI...................................................................................................................280Access Method................................................................................................................280Returned Result................................................................................................................281Example.........................................................................................................................282
Query Alarm Information.......................................................................................................283Interface URI...................................................................................................................283Access Method................................................................................................................283Returned Result................................................................................................................283Example.........................................................................................................................286
Query Root Alarm Information................................................................................................287Interface URI...................................................................................................................287Access Method................................................................................................................287Returned Result................................................................................................................287Example.........................................................................................................................288
Query Child Alarms..............................................................................................................289Interface URI...................................................................................................................289Access Method................................................................................................................289Returned Result................................................................................................................289Example.........................................................................................................................290
Query Top N Alarming Devices..............................................................................................291
14 Contents
Interface URI...................................................................................................................291Access Method................................................................................................................291Returned Result................................................................................................................291Example.........................................................................................................................292
Query Alarming Enterprises...................................................................................................293Interface URI...................................................................................................................293Access Method................................................................................................................293Returned Result................................................................................................................293Example.........................................................................................................................294
Query Alarm Events..............................................................................................................295Interface URI...................................................................................................................295Access Method................................................................................................................295Returned Result................................................................................................................295Example.........................................................................................................................296
Query Alarm Categories.......................................................................................................297Interface URI...................................................................................................................297Access Method................................................................................................................297Returned Result................................................................................................................297Example.........................................................................................................................298
Query Alarm Levels...............................................................................................................299Interface URI...................................................................................................................299Access Method................................................................................................................299Returned Result................................................................................................................299Example.........................................................................................................................300
Query Alarm Source Types....................................................................................................301Interface URI...................................................................................................................301Access Method................................................................................................................301Returned Result................................................................................................................301Example.........................................................................................................................302
Query Alarm Recovery Status.................................................................................................303Interface URI...................................................................................................................303Access Method................................................................................................................303Returned Result................................................................................................................303Example.........................................................................................................................304
Query Alarm Acknowledgement Status....................................................................................305Interface URI...................................................................................................................305Access Method................................................................................................................305Returned Result................................................................................................................305
Query Alarm Time Ranges.....................................................................................................306Interface URI...................................................................................................................306Access Method................................................................................................................306Returned Result................................................................................................................306Example.........................................................................................................................307
Recover Alarm......................................................................................................................308Interface URI...................................................................................................................308Access Method................................................................................................................308Returned Result................................................................................................................308Example.........................................................................................................................308
Acknowledge Alarm.............................................................................................................309Interface URI...................................................................................................................309Access Method................................................................................................................309Returned Result................................................................................................................309Example.........................................................................................................................309
Delete Alarm........................................................................................................................310Interface URI...................................................................................................................310
Contents 15
Access Method................................................................................................................310Returned Result................................................................................................................310Example.........................................................................................................................310
Register Send-Alarm-to-Server Event.........................................................................................311Interface URI...................................................................................................................311Access Method................................................................................................................311Returned Result................................................................................................................311Example.........................................................................................................................312
9 Network Syslog Management..................................................................313Query Syslog Information......................................................................................................314
Interface URI...................................................................................................................314Access Method................................................................................................................314Returned Result................................................................................................................314Example.........................................................................................................................315
Query Syslog Information List.................................................................................................316Interface URI...................................................................................................................316Access Method................................................................................................................316Returned Result................................................................................................................316Example.........................................................................................................................317
Query Unmanaged Device Filtering Rule Status.........................................................................318Interface URI...................................................................................................................318Access Method................................................................................................................318Returned Result................................................................................................................318Example.........................................................................................................................319
Query Unmanaged Device Filtering Rule Status List...................................................................320Interface URI...................................................................................................................320Access Method................................................................................................................320Returned Result................................................................................................................320Example.........................................................................................................................321
Modify Unmanaged Device Filtering Rule Status.......................................................................322Interface URI...................................................................................................................322Access Method................................................................................................................322Returned Result................................................................................................................322Example.........................................................................................................................322
10 Network Performance Management........................................................323Query Summaries.................................................................................................................324
Interface URI...................................................................................................................324Access Method................................................................................................................324Returned Result................................................................................................................324Example.........................................................................................................................325
Query Index Groups.............................................................................................................326Interface URI...................................................................................................................326Access Method................................................................................................................326Returned Result................................................................................................................326Example.........................................................................................................................327
Query Performance Indexes...................................................................................................328Interface URI...................................................................................................................328Access Method................................................................................................................328Returned Result................................................................................................................328Example.........................................................................................................................329
Query Single-Device Single-Index Instances.............................................................................331Interface URI...................................................................................................................331Access Method................................................................................................................331Returned Result................................................................................................................331
16 Contents
Example.........................................................................................................................332Query Single-Index Multi-Device Performance Summary Data.....................................................333
Interface URI...................................................................................................................333Access Method................................................................................................................333Returned Result................................................................................................................333Example.........................................................................................................................334
Query Single-Index Single-Interface Performance Summary Data................................................336Interface URI...................................................................................................................336Access Method................................................................................................................336Returned Result................................................................................................................336Example.........................................................................................................................338
Query Single Instance Performance Details..............................................................................339Interface URI...................................................................................................................339Access Method................................................................................................................339Returned Result................................................................................................................339Example.........................................................................................................................340
Query Single-Index TopN Data..............................................................................................341Interface URI...................................................................................................................341Access Method................................................................................................................341Returned Result................................................................................................................341Example.........................................................................................................................342
Add Custom Performance Index..............................................................................................344Interface URI...................................................................................................................344Access Method................................................................................................................344Returned Result................................................................................................................344Example.........................................................................................................................345
Delete Custom Performance Index...........................................................................................346Interface URI...................................................................................................................346Access Method................................................................................................................346Returned Result................................................................................................................346Example.........................................................................................................................346
11 Report Management..............................................................................347Query Periodic Reports..........................................................................................................348
Interface URI...................................................................................................................348Access Method................................................................................................................348Returned Result................................................................................................................348Example.........................................................................................................................349
Query Periodic Report Details.................................................................................................350Interface URI...................................................................................................................350Access Method................................................................................................................350Returned Result................................................................................................................350Example.........................................................................................................................351
Query Periodic Report Histories..............................................................................................352Interface URI...................................................................................................................352Access Method................................................................................................................352Returned Result................................................................................................................352Example.........................................................................................................................353
Get History File of a Periodic Report........................................................................................354Interface URI...................................................................................................................354Access Method................................................................................................................354Returned Result................................................................................................................354Example.........................................................................................................................354
12 Network Asset Management..................................................................355Query Assets.......................................................................................................................356
Contents 17
Interface URI...................................................................................................................356Access Method................................................................................................................356Returned Result................................................................................................................357Example.........................................................................................................................359
Query Asset Details..............................................................................................................360Interface URI...................................................................................................................360Access Method................................................................................................................360Returned Result................................................................................................................360Example.........................................................................................................................363
13 Network Service Management................................................................364Query VLANs......................................................................................................................365
Interface URI...................................................................................................................365Access Method................................................................................................................365Returned Result................................................................................................................365Example.........................................................................................................................367
Query VLAN Ports................................................................................................................368Interface URI...................................................................................................................368Access Method................................................................................................................368Returned Result................................................................................................................368Example.........................................................................................................................370
Add VLAN..........................................................................................................................371Interface URI...................................................................................................................371Access Method................................................................................................................371Returned Result................................................................................................................371Example.........................................................................................................................372
Delete VLAN........................................................................................................................373Interface URI...................................................................................................................373Access Method................................................................................................................373Returned Result................................................................................................................373Example.........................................................................................................................373
Change VLAN Name............................................................................................................374Interface URI...................................................................................................................374Access Method................................................................................................................374Returned Result................................................................................................................374Example.........................................................................................................................374
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 Access Ports...............................................................................................................378Interface URI...................................................................................................................378Access Method................................................................................................................378Returned Result................................................................................................................378Example.........................................................................................................................379
Change PVID of Access Port...................................................................................................380Interface URI...................................................................................................................380Access Method................................................................................................................380Returned Result................................................................................................................380
18 Contents
Example.........................................................................................................................380Query Hybrid Ports...............................................................................................................381
Interface URI...................................................................................................................381Access Method................................................................................................................381Returned Result................................................................................................................381Example.........................................................................................................................383
Add Hybrid Port...................................................................................................................384Interface URI...................................................................................................................384Access Method................................................................................................................384Returned Result................................................................................................................384Example.........................................................................................................................385
Delete Hybrid Port.................................................................................................................386Interface URI...................................................................................................................386Access Method................................................................................................................386Returned Result................................................................................................................386Example.........................................................................................................................386
Modify Hybrid Port...............................................................................................................387Interface URI...................................................................................................................387Access Method................................................................................................................387Returned Result................................................................................................................387Example.........................................................................................................................388
Query Trunk Ports.................................................................................................................389Interface URI...................................................................................................................389Access Method................................................................................................................389Returned Result................................................................................................................389Example.........................................................................................................................391
Add Trunk Port.....................................................................................................................392Interface URI...................................................................................................................392Access Method................................................................................................................392Returned Result................................................................................................................392Example.........................................................................................................................393
Delete Trunk Port...................................................................................................................394Interface URI...................................................................................................................394Access Method................................................................................................................394Returned Result................................................................................................................394Example.........................................................................................................................394
Modify Trunk Port.................................................................................................................395Interface URI...................................................................................................................395Access Method................................................................................................................395Returned Result................................................................................................................395Example.........................................................................................................................395
Query VLAN Interfaces.........................................................................................................396Interface URI...................................................................................................................396Access Method................................................................................................................396Returned Result................................................................................................................396Example.........................................................................................................................398
Query a Specific VLAN Interface ...........................................................................................399Interface URI...................................................................................................................399Access Method................................................................................................................399Returned Result................................................................................................................399Example.........................................................................................................................400
Add VLAN Interface..............................................................................................................401Interface URI...................................................................................................................401Access Method................................................................................................................401Returned Result................................................................................................................401
Contents 19
Example.........................................................................................................................402Delete VLAN Interface...........................................................................................................403
Interface URI...................................................................................................................403Access Method................................................................................................................403Returned Result................................................................................................................403Example.........................................................................................................................403
14 ACL Management.................................................................................404Query the Device List of ACL Configuration..............................................................................405
Interface URI...................................................................................................................405Access Method................................................................................................................405Returned Result................................................................................................................405Example.........................................................................................................................407
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
20 Contents
Access Method................................................................................................................429Returned Result................................................................................................................430Example.........................................................................................................................430
Delete ACL Time Range from a Device.....................................................................................431Interface URI...................................................................................................................431Access Method................................................................................................................431Returned Result................................................................................................................431Example.........................................................................................................................431
Query Child Time.................................................................................................................432Interface URI...................................................................................................................432Access Method................................................................................................................432Returned Result................................................................................................................432Example.........................................................................................................................434
15 Support and other resources...................................................................435Contacting HP......................................................................................................................435Subscription service..............................................................................................................435Warranty............................................................................................................................435Documentation.....................................................................................................................435Prerequisites.........................................................................................................................436Typographic conventions.......................................................................................................436About the HP IMC documentation set......................................................................................436
16 Documentation feedback.......................................................................438
Contents 21
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:
package com.mycompany.rest;
import org.apache.http.HttpResponse;import org.apache.http.auth.AuthScope;import org.apache.http.auth.UsernamePasswordCredentials;import org.apache.http.client.methods.HttpGet;import org.apache.http.impl.client.DefaultHttpClient;import org.apache.http.util.EntityUtils;
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:
HTTP/1.1 200 OK<?xml version=”;1.0” encoding=”UTF-8” standalone=”yes”?><list start=”0”>.....
The First iMC-RS Client 23
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:
<servlet> <servlet-name>Events Registration</servlet-name> <servlet-class>com.h3c.imc.rs.ext.event.EventRegistrationServlet</servlet-class> <init-param> <param-name>com.h3c.imc.rs.ext.event.config.PermittedRemoteAddrRegex</param-name> <param-value>127.0.0.1</param-value> </init-param></servlet>
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:
HTTP/1.1 409 ConflictError-Code: 4Error-Message: Database access error.
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. . .
Response
HTTP/q.q 200 OKContent-Type: application/html. . .
<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. . .
Response
HTTP/1.1 200 OKContent-Type: application/html. . .
<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.
Interface URI/plat/operator
Access Method
HTTPPOST
Message body
<operator> <name>cccc</name> <fullName>cccc</fullName> <authType>0</authType> <password>cccc</password> <sessionTimeout>10</sessionTimeout> <operatorGroupId>1</operatorGroupId> <desc>cccc</desc> <defaultAcl>0</defaultAcl> <operatorAclList> <operatorAcl> <startIp>10.153.89.1</startIp> <endIp>10.153.89.2</endIp> <accessType>0</accessType> <desc>allow 10.153.89.1–10.153.89.2</desc> <aclOrder>1</aclOrder> </operatorAcl> </operatorAclList></operator>
Element descriptionFor meanings of fields in the message body, see “Query All Operators” (page 34).
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.
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/plat/operator/4
Add Operator 39
ExampleAdd an operator.
Request
POST http://imic_host:8080/imcrs/plat/operatoraccept: application/xmlContent-Type: application/xml; charset=UTF-8. . .
<operator> <name>cccc</name> <fullName>cccc</fullName> <authType>0</authType> <password>cccc</password> <sessionTimeout>10</sessionTimeout> <operatorGroupId>1</operatorGroupId> <desc>cccc</desc> <defaultAcl>0</defaultAcl> <operatorAclList> <operatorAcl> <startIp>10.153.89.1</startIp> <endIp>10.153.89.2</endIp> <accessTyp>e0</accessType> <desc>allow 10.153.89.1–10.153.89.2</desc> <aclOrder>1</aclOrder> </operatorAcl> <operatorAcl> <startIp>10.153.89.3</startIp> <endIp>10.153.89.4</endIp> <desc>block 10.153.89.3–10.153.89.4</desc> <aclOrder>2</aclOrder </operatorAcl> </operatorAclList></operator>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/plat/operator/4
40 System Management
Modify OperatorsModify an operator with certain ID.
Interface URI/plat/operator/{id}
Access Method
HTTPPUT
Parameters
Path parameters
Operator ID.idLong integer type. Required. No default value.
Message body
<operator> <fullName>cccccc</fullName> <authType>1</authType> <sessionTimeout>20</sessionTimeout> <operatorGroupId>2</operatorGroupId> <desc>cccccc</desc> <defaultAcl>1</defaultAcl> <operatorAclList> <operatorAcl> <startIp>10.153.89.5</startIp> <endIp>10.153.89.6</endIp> <accessType>0</accessType> <desc>allow 10.153.89.5–10.153.89.6</desc> <aclOrder>1</aclOrder> </operatorAcl> <operatorAcl> <startIp>10.153.89.7</startIp> <endIp>10.153.89.8</endIp> <accessType>1</accessType> <desc>block 10.153.89.7–10.153.89.8</desc> <aclOrder>2</aclOrder> </operatorAcl> </operatorAclList></operator>
Element remarksFor descriptions of the fields in the message body, see “Query Operator Groups” (page 44).
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): Data corresponding to the ID is not found.
• 409 (Conflict): Failure. See “Error Codes.”
Modify Operators 41
ExampleModify the operator whose ID is 2.
Request
PUT http://imc_host:8080/imcrs/plat/operator/2accept: application/xml. . .<operator> <fullName>cccccc</fullName> <authType>1</authType> <sessionTimeout>20</sessionTimeout> <operatorGroupId>2</operatorGroupId> <desc>cccccc</desc> <defaultAcl>1</defaultAcl> <operatorAclList> <operatorAcl> <startIp>10.153.89.5</startIp> <endIp>10.153.89.6</endIp> <accessType>0</accessType> <desc>allow 10.153.89.5–10.153.89.6</desc> <aclOrder>1</aclOrder> </operatorAcl> <operatorAcl> <startIp>10.153.89.7</startIp> <endIp>10.153.89.8</endIp> <accessType>1</accessType> <desc>block 10.153.89.7–10.153.89.8</desc> <aclOrder>2</aclOrder> </operatorAcl> </operatorAclList></operator>
Response
HTTP/1.1 204 No Content. . .
42 System Management
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.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content. . .
ExampleDelete the operator with ID 4.
Request
DELETE http://imc_host:8080/imcrs/plat/operator/4accept: application/xml. . .
Response
HTTP/1.1 204 No Content
Delete Operator 43
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.
Interface URI/plat/opertorGroup
Access Method
HTTPPOST
Message body
<operatorGroup> <groupName>cccc</groupName> <groupDesc>desc</groupDesc> <roleId>1</roleId> <operatePrivilegeList> <operatePrivilege><id>iMC-PLAT_SystemMnt_OperatorMng</id><desc>Operator</desc><level>-1</level></operatePrivilege> <opertePrivliege><id>iMC-Plat_SystemMng_OperatorGroupMng</id><desc>Operator group</desc><level>-1</level></operatorPrivilege> </operatePrivilegeList></operatorGroup>
Element descriptionFor meanings of the fields in the message body, see “Query Operator Group Details” (page 46).
Returned Result
Status codes
• 201 (Created): Success.
• 409 (Conflict): Failure. See “Error Codes.”
Message headerIf the operator succeeds, the Location field gives the URI of the new resource. The message bodyis empty.
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/plat/operatorGroup/4
48 System Management
ExampleAdd an operator group.
Request
POST http://imc_host:8080/imcrs/plat/operatorGroupaccept: application/xmlContent-Type: application/xml; charset+UTF-8. . .
<operatorGroup> <groupName>cccc</groupName> <groupDesc>desc</groupDesc> <roleId>1</roleId> <operatePrivilegeList> <operatePrivilege><id>iMC-PLAT_SystemMnt_OperatorMng</id><desc>Operator</desc><level>-1</level></operatePrivilege> <opertePrivliege><id>iMC-Plat_SystemMng_OperatorGroupMng</id><desc>Operator group</desc><level>-1</level></operatorPrivilege> </operatePrivilegeList></operatorGroup>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/plat/operatorGroup/4
Add Operator Group 49
Modify Operator GroupModify an operator group with the specified ID.
Interface URI/plat/operatorGroup/{id}
Access Method
HTTPPUT
Parameters
Path parameters
Operator ID.idLong integer type. Required. No default value.
Message body
<operatorGroup> <groupDesc>desc</groupDesc> <roleId>1</roleId> <operatePrivilegeList> <operatePrivilege><id>iMC-PLAT_SystemMnt_OperatorMng</id><desc>Operator</desc><level>-1</level></operatePrivilege> <opertePrivliege><id>iMC-Plat_SystemMng_OperatorGroupMng</id><desc>Operator group</desc><level>-1</level></operatorPrivilege> </operatePrivilegeList></operatorGroup>
Element descriptionFor meanings of the fields in the message body, see “Query All Operators” (page 34).
Returned Result
Status codes
• 204 (No Content): Success.
• 404 (Not Found): No data is found with the ID.
• 409 (Conflict): Failure. See “Error Codes.”
50 System Management
ExampleModify the operator group with ID 4.
Request
PUT http://imc_host:8080/imcrs/plat/operatorGroup/4accept: application/xml. . .<operatorGroup> <groupDesc>desc</groupDesc> <roleId>1</roleId> <operatePrivilegeList> <operatePrivilege><id>iMC-PLAT_SystemMnt_OperatorMng</id><desc>Operator</desc><level>-1</level></operatePrivilege> <opertePrivliege><id>iMC-Plat_SystemMng_OperatorGroupMng</id><desc>Operator group</desc><level>-1</level></operatorPrivilege> </operatePrivilegeList></operatorGroup>
Response
HTTP/1.1 204 No Content
. . .
Modify Operator Group 51
Delete Operator GroupDelete an operator group with the specified ID.
Interface URI/plat/operatorGroup/{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.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content. . .
ExampleDelete the operator group with ID 4.
Request
Delete http://imc_host:8080/imcrs/plat/operatorGroup/4accept: application/xml. . .
Response
HTTP/1.1 204 No Content
52 System Management
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. . .
Response
HTTP/1.1 200 OKContent-Type: application/xml. . .
<list> <device> <id>122</id> <label>Dev Label1</label> <ip>192.168.0.1</ip> <mask>255.255.255.0</mask> <status>1</status> <contact>My Address</contact> <location>Device Location</location> <sysOid>1.3.6.1.4.1.25506.1.160</sysOid> <sysName>Dev1</sysName> <link rel=”self” href=”http://imc_host:port/incrs/plat/res/device/122”/</device> . . . <link rel=”previous” href=”http://imc_host:port/imcrs/plat/res/device?start=0&size=10”/> <link rel=”next” href=”http://imc_host:port/imcrs/plat/res/device?start=2–&size=10”/></list>
56 Network Resource Management
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 Information 57
Message body
<device> <id>2</id> <label>H3C</label> <ip>10.153.89.1.</ip> <mask>255.255.255.0</mask> <status>1</status> <statusDesc>Normal</statusDesc> <sysName>H3C</sysName> <contact>Hangzhou H3C Technologies Co., Ltd.</contact> <location>Hangzhou, China</location> <sysOid>1.3.6.1.4.1.25506.1.208</sysOid> <runTime>13 days 17 hours 42 minutes 19 seconds 660 milliseconds</runTime> <lastPoll>2011–08–31 14:32:51</lastPoll> <loginType>1</loginType> <sysDescription>H3C Comware Platform Software, Software Version 5.20, Release 6605 H3C S7503E Copyright (c) 2004-2009 Hangzhou H3C Tech. Co., Ltd. All rights reserved.</sysDescription> <categoryId>1</categoryId> <supportPing>false</supportPing> <snmpTmp1Id>101</supportTmpiId> <telnetTmp1ID>101</telnetTmpiId> <sshTmp1ID>101</sshTmp1Id> <webMgrPort>0</webMgrPort> <configPollTime>7200</configPollTime> <statePollTime>60</statePollTime> <symbolId>1002</symbolId> <symbolName>H3C</symbolName> <symbolType>3</symbolType> <symbolDesc /> <symbolLevel>2</symbolLevel> <parentId>1</parentId> <typeName>H3C S7503E</typeName> <viewType>1</viewType> <positionX>0</positionX> <positionY>0</positionY> <visibleFlag>0</visibleFlag> <statusImg>/images/icons/state-normal.gif</statusImg> <version>s7900e-cmw-520–r6605.app</version> <mac>00:0f:e2:e1:ca:be</mac> <categoryImg>Switch</categoryImg> <vendorImg>/res/images/defaultVerdor-16.gif</vendorImg> <childrenNum>1</childrenNum> <vergeNet>1</vergeNet> <phyName /> <phyCreateTime>2011–08–18 20:17:26</phyCreateTime> <phyCreator /> <appendUnicode /> <snmpTmp1>http://localhost:8080/imcrs/plat/res/snmp/101/</snmpTemp1> <telnetTmp1>http://localhost:8080/imcrs/plat/res/telnet/101</telnetTmp1> <sshTmp1>http://localhost:8080/imcrs/plat/res/ssh/101</sshTmp1> <series>http://localhost:8080/imcrs/plat/res/series/163</series> <category>http://localhost:8080/imcrs/plat/res/category/1</category> <model>http://localhost:8080/imcrs/plat/res/model/10178</model> <interfaces>http://localhost:8080/imcrs/plat/res/device/2/interface</interfaces></device>
Element description
device sub-elements
Device ID which uniquely identifies a device.idLong integer type.
Device label.labelString type.
Device IP address.ipString type.
Mask.mask
58 Network Resource Management
device sub-elements
String type.
Device status.statusInteger type. See “Device status description.”
System name.sysNameString type.
Contact.contactString type.
Location.locationString type.
sysOID.sysOidString type.
Running time.runtimeString type.
Last poll.lastPollString type, in the format of yyyy-MM-dd HH:mm:ss.
Login method. 0: None. 1: Telnet. 2: SSH.loginTypeInteger type.
System description.sysDescriptionString type.
Device type ID.categoryIdInteger type.
Support ping operation.supportPingBoolean type.
SNMP template ID.snmpTmplIdBoolean type.
Telnet template ID.telnetTmplIdInteger type.
SSH Template ID.sshTmplIdInteger type.
Login port for a lower-level network management.webMgrPortLong integer type.
Set polling interval.configPollTimeInteger type, in minutes.
Status poll interval.statePollTimeInteger type, in seconds.
Device services.device ServiceElement type. Multiple elements can be used. See the API document for Query Service MonitoringInformation.
Query Device Information 59
device sub-elements
Device symbol ID.symbolIdInteger type.
Device symbol name.symbolNameString type.
Device symbol type.symbolTypeInteger type.
Device symbol description.symbolDescString type.
Device symbol level.symbolLevelInteger type.
Device parent symbol ID.parentIdInteger type.
Device type name.typeNameString type.
Device parent symbol ID.parentIdInteger type.
View type.viewTypeInteger type.
Icon corresponding to the symbol.iconFileNameString type.
X location.positionXInteger type.
Y location.positionYInteger type.
Display symbol.visibleFlagInteger type.
Device status icon file.statusImgString type.
Device bin file.versionString type.
MAC address.macString type.
Device type icon file.categoryImgString type.
Device vendor icon file.vendorImgString type.
Number of sub-symbols for a device symbol.childrenNumInteger type.
60 Network Resource Management
device sub-elements
Edge subnet identifier.vergeNetInteger type.
Physical name.phyNameString type.
Created at.phyCreateTimeString type.
Creator.phyCreatorString type.
Attached unicode.appendUnicodeString type.
SNMP template URI.snmpTmplString type.
Telnet template URI.telnetTmplString type.
SSH template URI.sshTmplString type.
Device Series URI.seriesString type.
Device Model URI.modelString type.
Device Interfaces URI.interfacesString type.
Device Type URI.categoryString type.
Device status descriptionThe following describes the device status:
Unmanaged (Gray)—1
Unknown (Blue)0
Normal (Green)1
Alarm (Cyan)2
Minor (Yellow)3
Important (Orange)4
Warning (Red)5
ExampleQuery information about the device with the ID 2.
Request
GET http://localhost:8080/imcrs/plat/res/device/2accept: application/xml. . .
Query Device Information 61
Response
HTTP/1.1. 200 OKContent-Type: application/xmlLink: <http://localhost:8080/imcrs/plat/res/device/2/synchronize>;rel=synchronize;op=”PUT”Link: <http://localhost:8080/imcrs/plat/res/device/2/manage>;rel=manage;op=”PUT”Link: <http://localhost:8080/imcrs/plat/res/device/2/unmanage;rel=unmanage;op=”PUT. . .
<device> <id>2</id> <label>H3C</label> <ip>10.153.89.1.</ip> <mask>255.255.255.0</mask> <status>1</status> <statusDesc>Normal</statusDesc> <sysName>H3C</sysName> <contact>Hangzhou H3C Technologies Co., Ltd.</contact> <location>Hangzhou, China</location> <sysOid>1.3.6.1.4.1.25506.1.208</sysOid> <runTime>13 days 17 hours 42 minutes 19 seconds 660 milliseconds</runTime> <lastPoll>2011–08–31 14:32:51</lastPoll> <loginType>1</loginType> <sysDescription>H3C Comware Platform Software, Software Version 5.20, Release 6605 H3C S7503E Copyright (c) 2004-2009 Hangzhou H3C Tech. Co., Ltd. All rights reserved.</sysDescription> <categoryId>1</categoryId> <supportPing>false</supportPing> <snmpTmp1Id>101</supportTmpiId> <telnetTmp1ID>101</telnetTmpiId> <sshTmp1ID>101</sshTmp1Id> <webMgrPort>0</webMgrPort> <configPollTime>7200</configPollTime> <statePollTime>60</statePollTime> <symbolId>1002</symbolId> <symbolName>H3C</symbolName> <symbolType>3</symbolType> <symbolDesc /> <symbolLevel>2</symbolLevel> <parentId>1</parentId> <typeName>H3C S7503E</typeName> <viewType>1</viewType> <positionX>0</positionX> <positionY>0</positionY> <visibleFlag>0</visibleFlag> <statusImg>/images/icons/state-normal.gif</statusImg> <version>s7900e-cmw-520–r6605.app</version> <mac>00:0f:e2:e1:ca:be</mac> <categoryImg>Switch</categoryImg> <vendorImg>/res/images/defaultVerdor-16.gif</vendorImg> <childrenNum>1</childrenNum> <vergeNet>1</vergeNet> <phyName /> <phyCreateTime>2011–08–18 20:17:26</phyCreateTime> <phyCreator /> <appendUnicode /> <snmpTmp1>http://localhost:8080/imcrs/plat/res/snmp/101/</snmpTemp1> <telnetTmp1>http://localhost:8080/imcrs/plat/res/telnet/101</telnetTmp1> <sshTmp1>http://localhost:8080/imcrs/plat/res/ssh/101</sshTmp1> <series>http://localhost:8080/imcrs/plat/res/series/163</series> <category>http://localhost:8080/imcrs/plat/res/category/1</category> <model>http://localhost:8080/imcrs/plat/res/model/10178</model> <interfaces>http://localhost:8080/imcrs/plat/res/device/2/interface</interfaces></device>
62 Network Resource Management
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.
HTTP/1.1 200 OKTotal: 15
Query Device Types 63
Message body
<list> <deviceCategory> <id>0</id> <name>Router</name> <preDefined>true</preDefined> <link rel=”self” href=”http://imc_host:port/imcrs/plat/res/category/0”/> </deviceCategory> . . . <link rel=”next” href=”http://imc_host:port/imcrs/plat/res/category?start=1–&size=10”/</list>
For the description on each field of the returned value, see the API document for Query DeviceType.
ExampleQuery all device types.
Request
Get http://imc_host:8080/imcrs/plat/res/category?start=0&size=1000accept: application/xml. . .
Response
HTTP/1.1 200 OKContent-Type: application/xml. . .
<list> <deviceCategory> <id>0</id> <name>Router</name> <preDefined>true</preDefined> <link rel=”self” href=”http://imc_host:port/imcrs/plat/res/category/0”/> </deviceCategory> <deviceCategory> <id>1</id> <name>Switch</name> <preDefined>true</preDefined> <link rel=”self” href=”http://imc_host:port/imcrs/plat/res/category/1”/> </deviceCategory> . . .</list>
64 Network Resource Management
Query Device TypeQuery device type based on device ID.
Interface URI/plat/res/category/{id}
Access Method
HTTPGET
Parameters
Path parameter
Device type ID.idInteger type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message body
<deviceCategory> <id>0</id> <name>Router</name> <preDefined>true</preDefined></deviceCategory>
Element description
deviceCategory sub-elements
Device type Id, which uniquely identifies a device type.idInteger type.
Device type name.nameString type.
System defined.preDefinedBoolean type.
Query Device Type 65
ExampleQuery device type with the ID 0.
Request
Get http://imc_host:8080/imcrs/plat/res/category/0accept: application/xml. . .
Response
HTTP/1.1 200 OKContent-Type: application/xml. . .
<deviceCategory> <id>0</id> <name>Router</name> <preDefined>true</preDefined></deviceCategory>
66 Network Resource Management
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.
HTTP/1.1 200 OKTotal: 17
Query Vendor Information List 67
Message body
<list> <deviceVendor> <id>1</id> <name>H3C</name> <description></description> <phone></phone> <contact></contact> <preDefined>true</preDefined> <link rel=”self” href=”http://imc_host:port/imcrs/res/vendor/1”/> </deviceVendor> . . . <link rel=”next” href=”http://imc_host:port/imcrs/plat/res/vendor?start=10&size=10”/></list>
For the description on each field of the returned value, see the API document for Query DeviceVendor Information.
ExampleQuery device vendor starting with H.
Request
GET http://imc_host:8080/imcrs/plat/res/vendor?name=H*&start=0&size=1000accept: application/xml. .
Response
HTTP/1.1 200 OKContent-Type: application/xml. . .
<list> <deviceVendor> <id>1</id> <name>H3C</name> <description></description> <phone></phone> <contact></contact> <preDefined>true</preDefined> <link rel=”self” href=”http://imc_host:port/imcrs/res/vendor/1”/> </deviceVendor> <deviceVendor> <id>1</id> <name>HP</name> <description></description> <phone></phone> <contact></contact> <preDefined>true</preDefined> <link rel=”self” href=”http://imc_host:port/imcrs/res/vendor/2”/> </deviceVendor> . . . </list>
68 Network Resource Management
Query Vendor InformationQuery vendor information based on vendor ID.
Interface URI/plat/res/vendor/{id}
Access Method
HTTPGET
Parameters
Query parameter
Device vendor ID.idInteger type. Required. No default value.
Status codes
• 200 (OK): Success.
Message body
<deviceVendor> <id>1</id> <name>H3C</name> <description></description> <phone></phone> <contact></contact> <preDefined>true</preDefined></deviceVendor>
Element description
deviceVendor sub-elements
Device vendor ID, which uniquely identifies a device vendor.idInteger type.
Device vendor name.nameString type.
Device vendor description.descriptionString type.
Vendor contact information.phoneString type.
Vendor address.contactString type.
System defined.preDefinedBoolean type.
Query Vendor Information 69
ExampleQuery device vendor with the ID 1.
Request
GET http://imc_host:8080/imcrs/plat/res/vendor/1accept: application/xml. . .
Response
HTTP/1.1 200 OKContent-Type: application/xml. . .
<deviceVendor> <id>1</id> <name>H3C</name> <description></description> <phone></phone> <contact></contact> <preDefined>true</preDefined></deviceVendor>
70 Network Resource Management
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.
HTTP/1.1 200 OKTotal: 41
Message body
<list> <deviceSeries> <id>1</id> <name>H3C AR18–2x</name> <description></description> <preDefined>true</preDefined> <link rel=”self” href=”http://imc_host:port/imcrs/plat/res/series/1”/> </deviceSeries> . . . <link rel=”next” href=”http://imc_host:port/imcrs/plat/res/series?start=10&size=10”/></list>
For the description on each field of the returned vale, see the API document for Query DeviceSeries Information.
72 Network Resource Management
ExampleQuery the first 100 device series of H3C.
Request
GET http://imc_host:8080/imcrs/palt/res/series?vendorName=H3C&start=0&size=100accept: application/xml. . .
Response
HTTP/1.1 200 OKContent-Type: application/xml. . .
<list> <deviceSeries> <id>1</id> <name>H3C AR18–2x</name> <description></description> <preDefined>true</preDefined> <link rel=”self” href=”http://imc_host:port/imcrs/plat/res/series/1”/> </deviceSeries> <deviceSeries> <id>2</id> <name>H3C AR18–3x</name> <description></description> <preDefined>true</preDefined> <link rel=”self” href=”http://imc_host:port/imcrs/plat/res/series/2”/> </deviceSeries> . . . <link rel=”next” href=”http://imc_host:port/imcrs/plat/res/series?start=100&size=100”/></list>
Query Device Series Information List 73
Query Device Series InformationQuery device series information based on device ID. >
Interface URI/plat/res/series/{id}
Access Method
HTTPGET
Parameters
Path parameter
Device series ID.idInteger type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message body
<deviceSeries> <id>1</id> <name>H3C AR18-2x</name> <description></description> <preDefined>true</preDefined> <vendor>http://imc_host:port/imcrs/plat/res/vendor/2</vendor></deviceSeries>
Element description
deviceSeries sub-elements
Device series ID, which uniquely identifies a device series.idInteger type.
Device series name.nameString type.
Device series description.descriptionString type.
System defined.preDefinedBoolean type.
Vendor information URI.vendorString type.
74 Network Resource Management
ExampleQuery device series with the ID 1.
Request
GET http://imc_host:8080/imcrs/plat/res/series/1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<deviceSeries> <id>1</id> <name>H3C AR18-2x</name> <description></description> <preDefined>true</preDefined> <vendor>http://imc_host:port/imcrs/plat/res/vendor/2</vendor></deviceSeries>
Query Device Series Information 75
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.
HTTP/1.1 200 OKTotal: 512
Message body
<list> <deviceModel> <id>1</id> <name>3Com OSR3720</name> <description></description> <sysOid>1.3.6.1.4.1.43.1.16.4.2.34</sysOid> <preDefined>true</preDefined> <link rel="self" href="http://imc_host:port/imcrs/plat/res/model/1"/> </deviceModel> ... <link rel="next" href="http://imc_host:port/imcrs/plat/res/model?start=10&size=10"/></list>
For the description on each field of the returned value, see the API document for “Query DeviceModel Information.”
Query Device Model Information List 77
ExampleQuery device model information about all routers.
Request
GET http://imc_host:8080/imcrs/plat/res/model?category=0&start=0&size=1000accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <deviceModel> <id>1</id> <name>3Com OSR3720</name> <description></description> <sysOid>1.3.6.1.4.1.43.1.16.4.2.34</sysOid> <preDefined>true</preDefined> <link rel="self" href="http://imc_host:port/imcrs/plat/res/model/1"/> </deviceModel> <deviceModel> <id>2</id> <name>3Com OSR3740</name> <description></description> <sysOid>1.3.6.1.4.1.43.1.16.4.2.35</sysOid> <preDefined>true</preDefined> <link rel="self" href="http://imc_host:port/imcrs/plat/res/model/2"/> </deviceModel> ...</list>
78 Network Resource Management
Query Device Model InformationQuery device model based on device ID.
Interface URI/plat/res/model/{id}
Access Method
HTTPGET
Parameters
Path parameter
Device model ID.idInteger type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message body
<deviceModel> <id>1</id> <name>3Com OSR3720</name> <description></description> <sysOid>1.3.6.1.4.1.43.1.16.4.2.34</sysOid> <preDefined>true</preDefined> <vendor>http://imc_host:port/imcrs/plat/res/vendor/3</vendor> <series>http://imc_host:port/imcrs/plat/res/series/20</category> <category>http://imc_host:port/imcrs/plat/res/category/0</category></deviceModel>
Element description
deviceModel sub-elements
Device model ID, which uniquely identifies a device model.idInteger type.
Device model name.nameString type.
Device model description.descriptionString type.
Device model sysOID.sysOidString type.
System defined.preDefinedBoolean type.
Vendor information URI.vendor
Query Device Model Information 79
deviceModel sub-elements
String type.
Vendor information URI.seriesBoolean type.
Device Type URI.categoryString type.
ExampleQuery device model with the ID 1.
Request
GET http://imc_host:8080/imcrs/plat/res/model/1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<deviceModel> <id>1</id> <name>3Com OSR3720</name> <description></description> <sysOid>1.3.6.1.4.1.43.1.16.4.2.34</sysOid> <preDefined>true</preDefined> <vendor>http://imc_host:port/imcrs/plat/res/vendor/3</vendor> <series>http://imc_host:port/imcrs/plat/res/series/20</category> <category>http://imc_host:port/imcrs/plat/res/category/0</category></deviceModel>
80 Network Resource Management
Add DeviceAdd a device to iMC.
Interface URI/plat/res/device
Access Method
HTTPPOST
Message body
<device> <nameOrIp>192.168.1.100</nameOrIp> <label>Dev Label1</label> <mask></mask> <loginType>1</loginType> <registerTrap>true</registerTrap> <supportPing>true</supportPing> <forceAdd>false</forceAdd> <loopbackAsMgrIp>false</loopbackAsMgrIp> <snmpTmplId>10</snmpTmplId> <telnetTmplId>11</telnetTmplId> <sshTmplId>12</sshTmplId> <snmpParameter> ...... </snmpParameter> <telnetParameter> ...... </telnetParameter> <sshParameter> ...... </sshParameter></device>
Element description
device sub-elements
Host or IP address.nameOrIpString type. Required. No default value.
Device label.labelString type. Optional. The default value is empty.
Mask.maskString type. Optional. The default value is empty.
Login method. 0: None. 1: Telnet. 2: SSH.loginTypeInteger type.
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.
HTTP/1.1 201 CreatedLocation: http://imc_host:port/imcrs/res/device/1
82 Network Resource Management
ExampleAdd a device with the IP address 192.168.1.100.
Request
POST http://imc_host:8080/imcrs/plat/res/deviceaccept: application/xmlContent-Type: application/xml; charset=UTF-8...
<device> <nameOrIp>192.168.1.100</nameOrIp> <label>Dev Label1</label> <mask></mask> <loginType>1</loginType> <registerTrap>true</registerTrap> <supportPing>true</supportPing> <forceAdd>false</forceAdd> <loopbackAsMgrIp>false</loopbackAsMgrIp> <snmpTmplId>10</snmpTmplId> <telnetTmplId>11</telnetTmplId> <sshTmplId>12</sshTmplId></device>
Response
HTTP/1.1 201 CreatedLocation: http://imc_host:port/imcrs/res/device/1
Add Device 83
Synchronize DeviceSynchronize a device based on device ID.
Interface URI/plat/res/device/{id}/synchronize
Access Method
HTTPPUT
Parameters
Path parameter
Device ID.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.”
Message header
HTTP/1.1 204 No Content...
ExampleSynchronize the device with the ID 2.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/synchronizeaccept: application/xml...
Response
HTTP/1.1 204 No Content
84 Network Resource Management
Manage DeviceManage a device based on device ID.
Interface URI/plat/res/device/{id}/manage
Access Method
HTTPPUT
Parameters
Path parameter
Device ID.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.”
Message header
HTTP/1.1 204 No Content...
ExampleManage the device with the ID 2.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/manageaccept: application/xml...
Response
HTTP/1.1 204 No Content
Manage Device 85
Unmanage DeviceUnmanage a device based on device ID.
Interface URI/plat/res/device/{id}/unmanage
Access Method
HTTPPUT
Parameters
Path parameter
Device ID.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.”
Message header
HTTP/1.1 204 No Content...
ExampleUnmanage a device with the ID 2.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/unmanageaccept: application/xml...
Response
HTTP/1.1 204 No Content
86 Network Resource Management
Delete DeviceDelete a device based on device ID.
Interface URI/plat/res/device/{id}/delete
Access Method
HTTPDELETE
Parameters
Path parameter
Device ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
• 410 (Gone): The data with the specified ID does not exist.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
ExampleDelete a device with the ID 2.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/deleteaccept: application/xml...
Response
HTTP/1.1 204 No Content
Delete Device 87
Modify Device LabelModify device label based on device ID.
Interface URI/plat/res/device/{id}/updateLabel
Access Method
HTTPPUT
Parameters
Path parameter
Device ID.idLong integer type. Required. No default value.
Message body
<device> <label>Dev Label1</label></device>
Element description
device sub-elements
Device label.labelString 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...
88 Network Resource Management
ExampleChange the device label for the device with the ID 2 to Dev Label2.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/updateLabelaccept: application/xml...
<device> <label>Dev Label2</label></device>
Response
HTTP/1.1 204 No Content...
Modify Device Label 89
Modify System InformationModify the system information for a device based on device ID.
Interface URI/plat/res/device/{id}/updateSysGrpAttr
Access Method
HTTPPUT
Parameters
Path parameter
Device ID.idLong integer type. Required. No default value.
Message body
<device> <sysName>H3C</sysName> <contact>Hangzhou H3C Technologies Co., Ltd.</contact> <location>Hangzhou, China</location></device>
Element description
device sub-elements
System name.sysNameString type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Contact.contactString type. Optional. If the element does not exist, the value is not changed. If the element exists,the value cannot be null.
Location.locationString 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...
90 Network Resource Management
ExampleChange the system information for the device with the ID 10.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updateSysGrpAttraccept: application/xml...<device> <sysName>H3Cx</sysName> <contact>Hangzhou H3C Technologies Co., Ltd.</contact> <location>Hangzhou, China</location></device>
Response
HTTP/1.1 204 No Content...
Modify System Information 91
Modify Login MethodModify login method for a device based on device ID.
Interface URI/plat/res/device/{id}/updateLoginType
Access Method
HTTPPUT
Parameters
Path parameter
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.
Message body
<device> <snmpParameter> <paraType>SNMPv1</paraType> <roCommunity>public</roCommunity> <rwCommunity>private</rwCommunity> <timeout>10</timeout> <retries>10</retries> </snmpParameter></device>or<device> <snmpTmplId>159</snmpTmplId></device>
Element description
device sub-elements
SNMP parameters.snmpParameterElement type. See the following description.
SNMP template ID.snmpTmplIdInteger type. If both snmpTmplId and snmpParameter exist, snmpParameter is preferred, andsnmpTmplId is omitted.
snmpParameter sub-elements
Parameter type. Valid values: SNMPv1, SNMPv2c, SNMPv3 No-Priv No-Auth, SNMPv3 No-PrivAuth-Md5, SNMPv3 No-Priv Auth-Sha, SNMPv3 Priv-Des Auth-Md5, SNMPv3 Priv-Des Auth-Sha,
paraType
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.
Message body
<device> <telnetParameter> <authType>1</authType> <userName>admin</userName> <userPassword>admin</userPassword> <superPassword>admin</superPassword> <timeout>5</timeout> </telnetParameter></device>or<device> <telnetTmplId>156</telnetTmplId></device>
Element description
device sub-elements
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.
Message body
<device> <sshParameter> <authType>0</authType> <userName>admin</userName> <password>admin</password> <port>22</port> <timeout>5</timeout> <retries>5</retries> </sshParameter></device>or<device> <sshTmplId>156</sshTmplId></device>
Element description
device sub-elements
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.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updateSshaccept: application/xml...<device> <sshParameter> <authType>0</authType> <userName>admin</userName> <password>admin</password> <port>22</port> <timeout>5</timeout> <retries>5</retries> </sshParameter></device>
Response
HTTP/1.1 204 No Content...
Modify SSH Settings 103
Modify Polling IntervalModify polling interval for a device based on device ID.
Interface URI/plat/res/device/{id}/updatePollInterval
Access Method
HTTPPUT
Parameters
Path parameter
Device ID.idLong integer type. Required. No default value.
Message body
<device> <configPollTime>1800</configPollTime> <statePollTime>100</statePollTime></device>
Element description
device sub-elements
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.
Interface URI/plat/res/device/{id}/updatePingParam
Access Method
HTTPPUT
Parameters
Path parameter
Device ID.idLong integer type. Required. No default value.
Message body
<device> <supportPing>false</supportPing></device>
Element description
device sub-elements
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.
Interface URI/plat/res/device/{id}/updateWebMgrParam
Access Method
HTTPPUT
Parameters
Path parameter
Device ID.idLong integer type. Required. No default value.
Message body
<device> <webMgrProtocol>HTTP</webMgrProtocol> <webMgrPort>80</webMgrPort></device>
Element description
device sub-elements
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.
HTTP/1.1 200 OKTotal: 3
Message body
<list> <deviceService> <deviceId>10</deviceId> <serviceBit>0</serviceBit> <name>Telnet</name> <port>23</port> <type>1</type> <status>1</status> </deviceService> ...</list>
110 Network Resource Management
Element description
deviceService sub-elements
Device ID.deviceIdLong integer type.
Service bits.serviceBitInteger type.
Name.nameString type.
Port.portInteger type.
Type. 0: No monitoring. 1: TCP. 2: UDP.typeInteger type.
Service running status: 0: Not running. 1: Running.statusInteger type.
ExampleQuery service monitoring about the device with the ID 10.
Request
GET http://imc_host:8080/imcrs/plat/res/device/service?deviceId=10accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <deviceService> <deviceId>10</deviceId> <serviceBit>0</serviceBit> <name>Telnet</name> <port>23</port> <type>1</type> <status>1</status> </deviceService> ...</list>
Query Service Monitoring Information List 111
Modify Service Monitoring InformationModify service monitoring information for a device based on device ID.
Interface URI/plat/res/device/service/{id}
Access Method
HTTPPUT
Parameters
Path parameter
Device ID.idLong integer type. Required. No default value.
Message body
<device> <deviceService> <deviceId>10</deviceId> <serviceBit>0</serviceBit> <name>Telnet</name> <port>23</port> <type>1</type> <status>1</status> <monitor>false</monitor> </deviceService> <deviceService> <deviceId>10</deviceId> <serviceBit>1</serviceBit> <name>FTP</name> <port>21</port> <type>1</type> <status>0</status> <monitor>true</monitor> </deviceService> ...</device>
Element description
deviceService sub-elements
Device ID.deviceIdLong integer type. Optional. Obtained from the path parameter.
Service bits.serviceBitInteger type. Required. No default value.
Name.nameString type. Required. No default value.
Port.portInteger type. Required. No default value.
Type. 0: No monitoring. 1: TCP. 2: UDP.type
112 Network Resource Management
deviceService sub-elements
Integer type. Required. No default value.
Monitor services.monitorBoolean type. Optional. The default value is true.
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 service monitoring information for the device with the ID 10.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/service/10accept: application/xml...<device> <deviceService> <deviceId>10</deviceId> <serviceBit>0</serviceBit> <name>Telnet</name> <port>23</port> <type>1</type> <status>1</status> <monitor>false</monitor> </deviceService> <deviceService> <deviceId>10</deviceId> <serviceBit>1</serviceBit> <name>FTP</name> <port>21</port> <type>1</type> <status>0</status> <monitor>true</monitor> </deviceService></device>
Response
HTTP/1.1 204 No Content...
Modify Service Monitoring Information 113
PingPing a device based on device ID.
Interface URI/plat/res/device/{id}/ping
Access Method
HTTPGET
Parameters
Path parameter
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.
HTTP/1.1 200 OKTotal: 7
Message body
<list> <deviceLink> <id>80</id> <type>0</type> <leftSymbolId>1092</leftSymbolId> <leftIfDesc>Ethernet1/0/2</leftIfDesc> <rightSymbolId>1029</rightSymbolId> <rightIfDesc>GigabitEthernet4/0/15</rightIfDesc> <status>1</status> <bandWidth>100000000</bandWidth> </deviceLink> ...</list>
For description on each field, see the API document in “Query Link Information.”
118 Network Resource Management
ExampleQuery device links with the topology ID 1027.
Request
GET http://imc_host:8080/imcrs/plat/res/link?topoId=1027accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <deviceLink> <id>80</id> <type>0</type> <leftSymbolId>1092</leftSymbolId> <leftIfDesc>Ethernet1/0/2</leftIfDesc> <rightSymbolId>1029</rightSymbolId> <rightIfDesc>GigabitEthernet4/0/15</rightIfDesc> <status>1</status> <bandWidth>100000000</bandWidth> </deviceLink> ...</list>
Query Links 119
Query Link InformationQuery device link information based on topology and link ID.
Interface URI/plat/res/link/{id}
Access Method
HTTPGET
Path parameter
Path parameter
Link ID.idLong integer type. Required. No default value.
Query parameter
Query parameter
Topology ID, or view ID. To obtain it, query the view list.topoIdLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OKContent-Type: application/xml
Message body
<deviceLink> <id>556</id> <type>0</type> <leftSymbolId>1920</leftSymbolId> <leftIfDesc>GigabitEthernet4/0/19</leftIfDesc> <rightSymbolId>1918</rightSymbolId> <rightIfDesc>Ethernet0/1</rightIfDesc> <status>1</status> <bandWidth>100000000</bandWidth> <leftDevice>http://localhost:8080/imcrs/plat/res/device/403</leftDevice> <rightDevice>http://localhost:8080/imcrs/plat/res/device/400</rightDevice></deviceLink>
Element description
deviceLink sub-elements
Device link ID.id
120 Network Resource Management
deviceLink sub-elements
Long integer type.
Link type.typeInteger type.
Link left node ID.leftSymbolIdLong integer type.
Link left interface description.leftIfDescString type.
Link right node ID.rightSymbolIdLong integer type.
Link right interface description.rightIfDescString type
Link state. 0: Unknown. 1: Normal. 2: Down. 3: Urgent. 4: Important. 5: Minor. 6: Warning. 7:Event. 8: Virtual.
status
Integer type.
Link bandwidth.bandWidthString type.
Link left node device link.leftDeviceString type.
Link right node device link.rightDeviceString type.
ExampleQuery link with the topology ID 1914 and link ID 556.
Request
GET http://imc_host:8080/imcrs/plat/res/link/556?topoId=1914accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<deviceLink> <id>556</id> <type>0</type> <leftSymbolId>1920</leftSymbolId> <leftIfDesc>GigabitEthernet4/0/19</leftIfDesc> <rightSymbolId>1918</rightSymbolId> <rightIfDesc>Ethernet0/1</rightIfDesc> <status>1</status> <bandWidth>100000000</bandWidth> <leftDevice>http://localhost:8080/imcrs/plat/res/device/403</leftDevice> <rightDevice>http://localhost:8080/imcrs/plat/res/device/400</rightDevice></deviceLink>
Query Link Information 121
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.
Interface URI/plat/res/autodiscover/start
Access Method
HTTPPOST
Message body
<autoDiscoverConfig> <mode>0</mode> <ipSection> <begin>10.153.88.20</begin> <end>10.153.88.30</end> </ipSection> <sendTrap>true</sendTrap></autoDiscoverConfig>
Element description
autoDiscoverConfig sub-elements
Automatic discovery modes. 0: Simple mode. 1: Advanced mode. Integer type. Required.No default value.
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.
<autoDiscoverStatus> <status>2</status></autoDiscoverStatus>
Element descriptionSee “Query Automatic Discovery Status.”
Example 1Use the simple mode to automatically discover devices.
Request
POST http://imc_host:8080/imcrs/plat/res/autodiscover/startaccept: application/xmlContent-Type: application/xml; charset=UTF-8...<autoDiscoverConfig> <mode>0</mode> <ipSection> <begin>10.153.88.20</begin> <end>10.153.88.30</end> </ipSection> <sendTrap>true</sendTrap></autoDiscoverConfig>
Response
HTTP/1.1 200 OKContent-Type: application/xml
Start Automatic Discovery 123
Example 2Use the routing mode to automatically discover devices.
Request
POST http://imc_host:8080/imcrs/plat/res/autodiscover/startaccept: application/xmlContent-Type: application/xml; charset=UTF-8...<autoDiscoverConfig> <mode>1</mode> <discoverType>2</discoverType> <loopBackAsManageIP>false</loopBackAsManageIP> <discoverNonSnmpDevice>true</discoverNonSnmpDevice> <pingAll>false</pingAll> <sendTrap>true</sendTrap> <seedIp>10.153.89.199</seedIp></autoDiscoverConfig>
Response
HTTP/1.1 200 OKContent-Type: application/xml
Example 3Use the segment mode to automatically discover devices.
Request
POST http://imc_host:8080/imcrs/plat/res/autodiscover/startaccept: application/xmlContent-Type: application/xml; charset=UTF-8...<autoDiscoverConfig> <mode>1</mode> <discoverType>1</discoverType> <ipSection> <begin>10.153.88.10</begin> <end>10.153.88.20</end> </ipSection> <loopBackAsManageIP>false</loopBackAsManageIP> <discoverNonSnmpDevice>true</discoverNonSnmpDevice> <pingAll>false</pingAll> <sendTrap>true</sendTrap></autoDiscoverConfig>
Response
HTTP/1.1 200 OKContent-Type: application/xml
124 Network Resource Management
Stop Automatic DiscoveryStop automatic discovery.
Interface URI/plat/res/autodiscover/stop
Access Method
HTTPGET
ParametersNone
Returned Result
Status codes
• 200 (OK): Success.
Message bodyIf the operation succeeds, the message body is returned.
<autoDiscoverStatus> <status>4</status></autoDiscoverStatus>
Element descriptionSee “Query Automatic Discovery Status.”
ExampleStop the running automatic discovery.
Request
GET http://imc_host:8080/imcrs/plat/res/autodiscover/stopaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<autoDiscoverStatus> <status>4</status></autoDiscoverStatus>
Stop Automatic Discovery 125
Query Automatic Discovery StatusQuery automatic discovery status.
Interface URI/plat/res/autodiscover/status
Access Method
HTTPGET
ParametersNone
Returned Result
Status codes
• 200 (OK): Success.
Message body
<autoDiscoverStatus> <status>1</status></autoDiscoverStatus>
Element description
autoDiscoverStatus sub-elements
Automatic discovery status. 1: Stopped. 2: Running. 3: Periodic automatic discovery is running (notsupported). 4: Stopping.
status
Integer type.
ExampleQuery automatic discoveries that have stopped.
Request
GET http://imc_host:8080/imcrs/plat/res/autodiscover/statusaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml... <autoDiscoverStatus> <status>1</status></autoDiscoverStatus>
126 Network Resource Management
Query Automatic Device Discovery ResultsQuery automatic device discovery results.
Interface URI/plat/res/autodiscover/result
Access Method
HTTPGET
ParametersNone
Returned Result
Status codes
• 200 (OK): Success.
Message body
<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>
128 Network Resource Management
Query Automatically Discovered DevicesQuery automatically discovered devices.
Interface URI/plat/res/autodiscover
Access Method
HTTPGET
ParametersNone
Returned Result
Status codes
• 200 (OK): Success.
Message body
<list> <discoveredDevice> <discoverTime>2011-07-01 10:59:42</discoverTime> <deviceId>106</deviceId> <deviceIP>10.153.89.3</deviceIP> <deviceName>MyDev.mydomain</deviceName> <deviceProtocol>SNMP</deviceProtocol> <deviceSysDescription>Cisco Internetwork Operating System Software IOS (tm) Catalyst 4000 L3 Switch Software (cat4000-I5S-M), Version 12.2(20)EWA, RELEASE SOFTWARE (fc1)Technical Support: http://www.cisco.com/techsupportCopyright (c) 1986-2004 by cisco Systems, Inc.Com</deviceSysDescription> <discoverResult>2001</discoverResult> </discoveredDevice> ...</list>
Element description
discoveredDevice sub-elements
Discovered at.discoverTimeString type.
Device ID.deviceIdLong integer type.
Device IP.deviceIPString type.
Device name.deviceNameString type.
Protocol.deviceProtocolString type.
System description.deviceSysDescriptionString type.
Result. 2001: Success. Other error codes. See “Error Codes.” Integer type.discoverResult
Query Automatically Discovered Devices 129
ExampleQuery automatically discovered devices.
Request
GET http://imc_host:8080/imcrs/plat/res/autodiscoveraccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <discoveredDevice> <discoverTime>2011-07-01 10:59:42</discoverTime> <deviceId>106</deviceId> <deviceIP>10.153.89.3</deviceIP> <deviceName>MyDev.mydomain</deviceName> <deviceProtocol>SNMP</deviceProtocol> <deviceSysDescription>Cisco Internetwork Operating System Software IOS (tm) Catalyst 4000 L3 Switch Software (cat4000-I5S-M), Version 12.2(20)EWA, RELEASE SOFTWARE (fc1)Technical Support: http://www.cisco.com/techsupportCopyright (c) 1986-2004 by cisco Systems, Inc.Com</deviceSysDescription> <discoverResult>2001</discoverResult> </discoveredDevice> ...</list>
130 Network Resource Management
Query Device Interface InformationQuery device interface information based on predefined criteria.
Interface URI/plat/res/device/{deviceId}/interface
Access Method
HTTPGET
Path parameter
Path parameter
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.
HTTP/1.1 200 OKTotal: 47
Query Device Interface Information 131
Message body
<list> <interface> <ifIndex>2</ifIndex> <ifType>6</ifType> <ifTypeDesc>ETHERNETCSMACD</ifTypeDesc> <ifDescription>GigabitEthernet1/1</ifDescription> <adminStatus>1</adminStatus> <adminStatusDesc>Up</adminStatusDesc> <operationStatus>2</operationStatus> <operationStatusDesc>Down</operationStatusDesc> <ifspeed>1000000000</ifspeed> <appointedSpeed>-1</appointedSpeed> <ifAlias/> <phyAddress>00:12:00:40:a2:c0</phyAddress> <mtu>1500</mtu> <lastChange>0 days 0 hours 0 minutes 35 seconds 100 milliseconds</lastChange> </interface> ... <link href="http://localhost:8080/imcrs/plat/res/device/2/interface?start=10&size=10" op="GET" rel="next"/></list>
For description on each field, see the API document in “Query Device Interface Information.”
ExampleQuery information about the interface with the device ID 5.
Request
GET http://imc_host:8080/imcrs/plat/res/device/5/interfaceaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <interface> <ifIndex>2</ifIndex> <ifType>6</ifType> <ifTypeDesc>ETHERNETCSMACD</ifTypeDesc> <ifDescription>GigabitEthernet1/1</ifDescription> <adminStatus>1</adminStatus> <adminStatusDesc>Up</adminStatusDesc> <operationStatus>2</operationStatus> <operationStatusDesc>Down</operationStatusDesc> <ifspeed>1000000000</ifspeed> <appointedSpeed>-1</appointedSpeed> <ifAlias/> <phyAddress>00:12:00:40:a2:c0</phyAddress> <mtu>1500</mtu> <lastChange>0 days 0 hours 0 minutes 35 seconds 100 milliseconds</lastChange> </interface> ... <link href="http://localhost:8080/imcrs/plat/res/device/5/interface?start=10&size=10" op="GET" rel="next"/></list>
132 Network Resource Management
Query Interface DetailsQuery interface details based on interface index and device ID.
Interface URI/plat/res/device/{deviceId}/interface/{ifIndex}
Access Method
HTTPGET
Parameters
Path parameter
Device ID.deviceIdLong integer type. Required. No default value.
Interface index.ifIndexLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OKContent-Type: application/xml
Message body
<interface> <ifIndex>1</ifIndex> <ifType>24</ifType> <ifTypeDesc>SOFTWARELOOPBACK</ifTypeDesc> <ifDescription>lo</ifDescription> <adminStatus>1</adminStatus> <adminStatusDesc>Up</adminStatusDesc> <operationStatus>1</operationStatus> <operationStatusDesc>Up</operationStatusDesc> <ifspeed>10000000</ifspeed> <appointedSpeed>-1</appointedSpeed> <ifAlias/> <phyAddress/> <mtu>1500</mtu> <lastChange>0 days 0 hours 0 minutes 0 seconds 0 milliseconds</lastChange> <ipHash> <item>127.0.0.1</item> <item>255.0.0.0</item> </ipHash></interface>
Query Interface Details 133
Element description
interface sub-elements
Interface index.ifIndexLong integer type.
Interface type.ifTypeInteger type.
Interface type description.ifTypeDescString type.
Interface description.ifDescriptionString type.
Management status. 1: Up. 2: Down.adminStatusInteger type.
Management status description.adminStatusDescString type.
Operation status. 1: Up. 2: Down. 3: Testing. 4: Unknown. 5: Dormant. 6: Not present. 7:LowerLayerDown.
operationStatus
Integer type.
Operation status description.operationStatusDescString type.
Interface speed.ifspeedLong integer type.
Specify speed.appointedSpeedLong integer type.
Interface alias.ifAliasString type.
MAC address.phyAddressString type.
MTU.mtuInteger type.
Last change.lastChangeString type.
The first item is IP. The second item is mask.ipHashString type.
Last change.lastChangeTimeLong integer type.
134 Network Resource Management
ExampleQuery information about the interface with the index 1 and device ID 2.
Request
GET http://imc_host:8080/imcrs/plat/res/device/2/interface/1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml... <interface> <ifIndex>1</ifIndex> <ifType>24</ifType> <ifTypeDesc>SOFTWARELOOPBACK</ifTypeDesc> <ifDescription>lo</ifDescription> <adminStatus>1</adminStatus> <adminStatusDesc>Up</adminStatusDesc> <operationStatus>1</operationStatus> <operationStatusDesc>Up</operationStatusDesc> <ifspeed>10000000</ifspeed> <appointedSpeed>-1</appointedSpeed> <ifAlias/> <phyAddress/> <mtu>1500</mtu> <lastChange>0 days 0 hours 0 minutes 0 seconds 0 milliseconds</lastChange> <ipHash> <item>127.0.0.1</item> <item>255.0.0.0</item> </ipHash></interface>
Query Interface Details 135
Bring Up an InterfaceBring up an interface on a device based on device ID and interface index.
Interface URI/plat/res/device/{deviceId}/interface/{ifIndex}/up
Access Method
HTTPPUT
Parameters
Path parameter
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...
ExampleBring up the interface with index 2 and device ID 2.
Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/interface/2/upaccept: application/xml...
Response
HTTP/1.1 204 No Content
136 Network Resource Management
Shut Down an InterfaceShut down an interface on a device based on device ID.
Interface URI/plat/res/device/{deviceId}/interface/{ifIndex}/down
Access Method
HTTPPUT
Parameters
Path parameter
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.
HTTP/1.1 200 OKTotal: 1
Message body
<list> <customView> <symbolId>11</symbolId> <name>My network topology</name> <runStatus>4</runStatus> <statusImgSrc>/res/images/group-major.gif</statusImgSrc> <statusDesc>Important</statusDesc> </customView> ... </list>
138 Network Resource Management
Element description
customView sub-elements
Custom view ID.symbolIdLong integer type.
Custom view name.nameString type.
Operation status.runStatusInteger type.
Running picture.statusImgSrcString type.
Operation status description.statusDescString type.
ExampleQuery custom view information list.
Request
GET http://imc_host:8080/imcrs/plat/res/view/customaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <customView> <symbolId>11</symbolId> <name>My network topology</name> <runStatus>4</runStatus> <statusImgSrc>/res/images/group-major.gif</statusImgSrc> <statusDesc>Important</statusDesc> </customView> ... </list>
Query Custom View List 139
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.
HTTP/1.1 200 OKTotal: 50
140 Network Resource Management
Message body
<list> <device> <id>69</id> <label>10.153.89.164</label> <ip>10.153.89.164</ip> <mask>255.255.255.0</mask> <status>1</status> <sysName/> <contact/> <location/> <sysOid/> <sysDescription/> <devCategoryImgSrc>pc</devCategoryImgSrc> <topoIconName>iconpc</topoIconName> <categoryId>9</categoryId> <link href="http://localhost:8080/imcrs/plat/res/device/69" op="GET" rel="self"/> </device> ...... <link href="http://localhost:8080/imcrs/plat/res/view/custom/11?start=10&size=10" op="GET" rel="next"/></list>
Element descriptionFor description on each field, see the API document in “Query Device Information.”
ExampleQuery information about the custom view with the ID 11.
Request
GET http://imc_host:8080/imcrs/plat/res/view/custom/11accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <device> <id>69</id> <label>10.153.89.164</label> <ip>10.153.89.164</ip> <mask>255.255.255.0</mask> <status>1</status> <sysName/> <contact/> <location/> <sysOid/> <sysDescription/> <devCategoryImgSrc>pc</devCategoryImgSrc> <topoIconName>iconpc</topoIconName> <categoryId>9</categoryId> <link href="http://localhost:8080/imcrs/plat/res/device/69" op="GET" rel="self"/> </device> ...... <link href="http://localhost:8080/imcrs/plat/res/view/custom/11?start=10&size=10" op="GET" rel="next"/></list>
Query Custom View Information 141
Add Custom ViewAdd a custom view to iMC.
Interface URI/plat/res/view/custom
Access Method
HTTPPOST
Message body
<customView> <name>myView</name> <device> <id>1</id> </device> <device> <id>2</id> </device></customView>
Element description
customView sub-elements
Custom view name.nameString type. Required. No default value.
Devices added to the custom view.deviceElement type. Optional. No default value. Multiple elements are supported.
IDs of the devices added to the custom view.device/idLong integer type. Required. No default value.
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.
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/plat/res/view/custom/1179
142 Network Resource Management
ExampleAdd a custom view named myView. Devices with IDs 1 and 2 are added to the custom view.
Request
POST http://imc_host:8080/imcrs/plat/res/view/customaccept: application/xmlContent-Type: application/xml; charset=UTF-8...<customView> <name>myView</name> <device> <id>1</id> </device> <device> <id>2</id> </device></customView>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/plat/res/view/custom/1179
Add Custom View 143
Modify Custom ViewModify a custom view based on custom view ID.
Interface URI/plat/res/view/custom/{id}
Access Method
HTTPPUT
Parameters
Path parameter
Custom view ID.idLong integer type. Required. No default value.
Message body
<customView> <name>myView</name> <autoAddDevType>0</autoAddDevType> <addAllDev>false</addAllDev> <ipSection> <begin>10.153.88.1</begin> <end>10.153.88.20</end> </ipSection> <device> <id>1</id> </device> <device> <id>2</id> </device></customView>
Element description
customView sub-elements
Custom view name.nameString type. Optional.
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.
Request
PUT http://imc_host:8080/imcrs/plat/res/view/custom/1154accept: application/xml...<customView> <name>myView</name> <autoAddDevType>0</autoAddDevType> <addAllDev>false</addAllDev> <device> <id>2</id> </device> <device> <id>5</id> </device></customView>
Response
HTTP/1.1 204 No Content...
Modify Custom View 145
Delete Custom ViewDelete a custom view based on custom view ID.
Interface URI/plat/res/view/custom/{id}
Access Method
HTTPDELETE
Parameters
Path parameter
Custom view ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
• 410 (Gone): The data specified with the ID does not exist.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
ExampleDelete a custom view with the ID 1154.
Request
DELETE http://imc_host:8080/imcrs/plat/res/view/custom/1154accept: application/xml...
Response
HTTP/1.1 204 No Content
146 Network Resource Management
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.
View name.nameString type. Optional.
View creator.createByString type. Optional.
Interface description.ifDescString type. Optional.
Interface alias.ifAliasString type. Optional.
Interface status.statusInteger type. Optional.
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.
HTTP/1.1 200 OKTotal: 1
Query Interface Views 147
Message body
<list> <interfaceView> <id>1</id> <name>myIfView</name> <desc>my interface view</desc> <createBy>admin</createBy> <createDate>2011-06-17T16:51:04.582+08:00</createDate> </interfaceView> ... </list>
Element description
interfaceView sub-elements
Interface view ID.idLong integer type.
Interface view name.nameString type.
Interface view description.descString type.
Creator.createByString type.
Created at.createDateDate type.
ExampleQuery interface view list.
Request
GET http://imc_host:8080/imcrs/plat/res/view/interfaceaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <interfaceView> <id>1</id> <name>myIfView</name> <desc>my interface view</desc> <createBy>admin</createBy> <createDate>2011-06-17T16:51:04.582+08:00</createDate> </interfaceView> ... </list>
148 Network Resource Management
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.
HTTP/1.1 200 OKTotal: 6
Query Interface View Information 149
Message body
<list> <interface> <deviceId>61</deviceId> <ifIndex>4</ifIndex> <ifType>6</ifType> <ifDescription>Ethernet1/0/4</ifDescription> <adminStatus>1</adminStatus> <operationStatus>2</operationStatus> <ifspeed>100000000</ifspeed> <appointedSpeed>-1</appointedSpeed> <ifAlias>Ethernet1/0/4 Interface</ifAlias> <phyAddress>00:e0:fc:00:35:00</phyAddress> <mtu>1552</mtu> <lastChange>0 days 0 hours 0 minutes 20 seconds 930 milliseconds</lastChange> </interface> ... </list>
Element descriptionFor the description on each field of the returned value, see “Query Device Information.”
ExampleQuery interface view with the ID 1.
Request
GET http://imc_host:8080/imcrs/plat/res/view/interface/1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <interface> <deviceId>61</deviceId> <ifIndex>4</ifIndex> <ifType>6</ifType> <ifDescription>Ethernet1/0/4</ifDescription> <adminStatus>1</adminStatus> <operationStatus>2</operationStatus> <ifspeed>100000000</ifspeed> <appointedSpeed>-1</appointedSpeed> <ifAlias>Ethernet1/0/4 Interface</ifAlias> <phyAddress>00:e0:fc:00:35:00</phyAddress> <mtu>1552</mtu> <lastChange>0 days 0 hours 0 minutes 20 seconds 930 milliseconds</lastChange> </interface> ...</list>
150 Network Resource Management
Add Interface ViewAdd an interface view to iMC.
Interface URI/plat/res/view/interface
Access Method
HTTPPOST
Message body
<interfaceView> <name>yourIfView</name> <desc>yourIfView</desc> <ifInfo> <deviceId>55</deviceId> <ifIndex>1</ifIndex> </ifInfo> <ifInfo> <deviceId>55</deviceId> <ifIndex>3</ifIndex> </ifInfo></interfaceView>
Element description
interfaceView sub-elements
Interface view name.nameString type. Required. No default value.
Interface view description.descString type. Optional. No default value.
Interfaces to be added to an interface view.ifInfoString type. Optional. No default value.
Device ID.ifInfo/deviceIdLong integer type. Required. No default value.
Interfaces to be added to an interface view.ifInfo/ifIndexLong integer type. Required. No default value.
Returned Result
Status codes
• 201 (Created): Success.
• 409 (Conflict): Failure. See “Error Codes.”
Add Interface View 151
Message headerIf the operation succeeds, the Location field gives the URI of the new resource. The message bodyis empty.
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/plat/res/view/interface/3
ExampleAdd an interface view named yourIfView. The device with ID 5 and interface indexes 1 and 3 isadded to the interface view.
Request
POST http://imc_host:8080/imcrs/plat/res/view/interfaceaccept: application/xmlContent-Type: application/xml; charset=UTF-8...<interfaceView> <name>yourIfView</name> <desc>yourIfView</desc> <ifInfo> <deviceId>55</deviceId> <ifIndex>1</ifIndex> </ifInfo> <ifInfo> <deviceId>55</deviceId> <ifIndex>3</ifIndex> </ifInfo></interfaceView>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/plat/res/view/interface/3
152 Network Resource Management
Modify Interface ViewModify interface view based on interface view ID.
Interface URI/plat/res/view/interface/{id}
Access Method
HTTPPUT
Parameters
Path parameter
Interface view ID.idLong integer type. Required. No default value.
Message body
<interfaceView> <name>yourIfView</name> <desc>yourIfView</desc> <ifInfo> <deviceId>55</deviceId> <ifIndex>1</ifIndex> </ifInfo> <ifInfo> <deviceId>55</deviceId> <ifIndex>2</ifIndex> </ifInfo></interfaceView>
Element description
interfaceView sub-elements
Interface view name.nameString type. Required. No default value.
Interface view description.descString type. Optional. No default value.
Interfaces to be added to an interface view.ifInfoString type. Optional. No default value.
Device ID.ifInfo/deviceIdLong integer type. Optional. No default value.
Interfaces to be added to an interface view.ifInfo/ifIndexLong integer type. Required. No default value.
Modify Interface View 153
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 interface view with the ID 3.
Request
PUT http://imc_host:8080/imcrs/plat/res/view/interface/3accept: application/xml...<interfaceView> <name>yourIfView</name> <desc>yourIfView</desc> <ifInfo> <deviceId>55</deviceId> <ifIndex>1</ifIndex> </ifInfo> <ifInfo> <deviceId>55</deviceId> <ifIndex>2</ifIndex> </ifInfo></interfaceView>
Response
HTTP/1.1 204 No Content...
154 Network Resource Management
Delete Interface ViewDelete an interface view based on interface view ID.
Interface URI/plat/res/view/interface/{id}
Access Method
HTTPDELETE
Parameters
Path parameter
Interface view ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
• 410 (Gone): The data specified with the ID does not exist.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
ExampleDelete an interface view with the ID 2.
Request
DELETE http://imc_host:8080/imcrs/plat/res/view/interface/2accept: application/xml...
Response
HTTP/1.1 204 No Content
Delete Interface View 155
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.
HTTP/1.1 200 OKTotal: 2
156 Network Resource Management
Message body
<list> <ipView> <symbolId>1041</symbolId> <name>10.153.0.0/24</name> <runStatus>5</runStatus> <statusImgSrc>/res/images/subnet-critical.gif</statusImgSrc> <statusDesc>Warning</statusDesc> </ipView> ... </list>
Element description
ipView sub-elements
IP view symbol ID.symbolIdLong integer type.
IP view name.nameString type.
Operation status.runStatusInteger type.
Running picture.statusImgSrcString type.
Operation status description.statusDescString type.
ExampleQuery IP views.
Request
GET http://imc_host:8080/imcrs/plat/res/view/ipaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml... <list> <ipView> <symbolId>1041</symbolId> <name>10.153.0.0/24</name> <runStatus>5</runStatus> <statusImgSrc>/res/images/subnet-critical.gif</statusImgSrc> <statusDesc>Warning</statusDesc> </ipView> ... </list>
Query IP Views 157
Query IP ViewQuery IP views based on IP view ID.
Interface URI/plat/res/view/ip/{id}
Access Method
HTTPGET
Path parameter
Path parameter
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.
HTTP/1.1 200 OKTotal: 46
158 Network Resource Management
Message body
<list> <device> <id>22</id> <label>10.153.0.17</label> <ip>10.153.0.17</ip> <mask>255.255.255.0</mask> <status>1</status> <sysName/> <contact/> <location/> <sysOid/> <sysDescription/> <devCategoryImgSrc>pc</devCategoryImgSrc> <topoIconName>iconpc</topoIconName> <categoryId>9</categoryId> <link href="http://localhost:8080/imcrs/plat/res/device/22" op="GET" rel="self"/> </device> ...
</list>
Element descriptionFor the description on each field of the returned value, see “Query Device Information.”
ExampleQuery IP view with the ID 1041.
Request
GET http://imc_host:8080/imcrs/plat/res/view/ip/1041accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <device> <id>22</id> <label>10.153.0.17</label> <ip>10.153.0.17</ip> <mask>255.255.255.0</mask> <status>1</status> <sysName/> <contact/> <location/> <sysOid/> <sysDescription/> <devCategoryImgSrc>pc</devCategoryImgSrc> <topoIconName>iconpc</topoIconName> <categoryId>9</categoryId> <link href="http://localhost:8080/imcrs/plat/res/device/22" op="GET" rel="self"/> </device> ...
</list>
Query IP View 159
Export Topology in Visio FormatExport topology in visio format.
Interface URI/plat/res/topo/export/visio
Access Method
HTTPGET
Query parameter
Query parameter
Topology ID.topoIdLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<VisioDocument xmlns="urn:schemas-microsoft-com:office:visio"> ...</VisioDocument>
Element descriptionFor the description on the fields of the returned value, see the Visio help.
DescriptionBefore you export topology in REST or Visio format, save the topology in iMC. Otherwise, alldevices will overlap in (0, 0).
160 Network Resource Management
ExampleExport topology information with the topology ID 1027 in Visio format.
Request
GET http://imc_host:8080/imcrs/plat/res/topo/export/visio?topoId=1027accept: application/x-visio...
Response
HTTP/1.1 200 OKContent-Type: application/x-visio...<VisioDocument xmlns="urn:schemas-microsoft-com:office:visio"> ...</VisioDocument>
Export Topology in Visio Format 161
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.
HTTP/1.1 200 OKTotal: 17
162 Network Resource Management
Message body
<list> <snmpParamTemplate> <id>1</id> <name>default</name> <paraType>SNMPv1</paraType> <roCommunity>public</roCommunity> <rwCommunity>private</rwCommunity> <timeout>4</timeout> <retries>3</retries> <contextName/> <securityName/> <securityMode>1</securityMode> <authScheme>0</authScheme> <authPassword/> <privScheme>0</privScheme> <privPassword/> <snmpPort>161</snmpPort> <link href="http://imc_host:port/imcrs/plat/res/snmp/1" op="GET" rel="self"/> </snmpParamTemplate> ... <link rel="next" href="http://imc_host:port/imcrs/plat/res/snmp?start=10&size=10"/></list>
For the description on each field of the returned value, see “Query SNMP Template Information.”
ExampleQuery SNMP template information list.
Request
GET http://imc_host:8080/imcrs/plat/res/snmpaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml... <list> <snmpParamTemplate> <id>1</id> <name>default</name> <paraType>SNMPv1</paraType> <roCommunity>public</roCommunity> <rwCommunity>private</rwCommunity> <timeout>4</timeout> <retries>3</retries> <contextName/> <securityName/> <securityMode>1</securityMode> <authScheme>0</authScheme> <authPassword/> <privScheme>0</privScheme> <privPassword/> <snmpPort>161</snmpPort> <link href="http://localhost:8080/imcrs/plat/res/snmp/1" op="GET" rel="self"/> </snmpParamTemplate> ...</list>
Query SNMP Template Information List 163
Query SNMP Template InformationQuery SNMP template information based on device ID.
Interface URI/plat/res/snmp/{id}
Access Method
HTTPGET
Parameters
Path parameter
SNMP template ID.idInteger type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message body
<snmpParamTemplate> <id>1</id> <version>1</version> <name>default</name> <paraType>SNMPv1</paraType> <roCommunity>public</roCommunity> <rwCommunity>private</rwCommunity> <timeout>4</timeout> <retries>3</retries> <contextName/> <securityName/> <securityMode>1</securityMode> <authScheme>0</authScheme> <authPassword/> <privScheme>0</privScheme> <privPassword/> <snmpPort>161</snmpPort></snmpParamTemplate>
Element description
snmpParamTemplate sub-elements
SNMP template ID.idLong integer type.
Template name.nameString type.
Version.versionInteger type.
164 Network Resource Management
snmpParamTemplate sub-elements
Parameter type.paraTypeString type
Read-only community name.roCommunityString type.
Read-write community string.rwCommunityString type.
Timeout time.timeoutLong integer type.
Number of retries.retriesLong integer type.
SNMPv3 context.contextNameString type.
Security name.securityNameString type.
Authorization mode.authSchemeInteger type.
Authorization password.authPasswordString type.
Encryption mode.privSchemeInteger type.
Encryption password.privPasswordString type.
Port.snmpPortLong integer type.
Security mode.securityModeInteger type.
Query SNMP Template Information 165
ExampleQuery SNMP template information with the template ID 1.
Request
GET http://imc_host:8080/imcrs/plat/res/snmp/1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<snmpParamTemplate> <id>1</id> <version>1</version> <name>default</name> <paraType>SNMPv1</paraType> <roCommunity>public</roCommunity>> <rwCommunity>private</rwCommunity> <timeout>4</timeout> <retries>3</retries> <contextName/> <securityName/> <securityMode>1</securityMode> <authScheme>0</authScheme> <authPassword/> <privScheme>0</privScheme> <privPassword/> <snmpPort>161</snmpPort></snmpParamTemplate>
166 Network Resource Management
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.
HTTP/1.1 200 OKTotal: 17
Query Telnet Template Information List 167
Message body
<list> <telnetParamTemplate> <id>1</id> <type>0</type> <name>default</name> <authType>5</authType> <userName/> <userPassword/> <superPassword/> <authTypeStr>No username, no password</authTypeStr> <timeout>4</timeout> <retries>1</retries> <port>23</port> <version>1</version> <link href="http://localhost:8080/imcrs/plat/res/telnet/1" op="GET" rel="self"/> </telnetParamTemplate> ... <link rel="next" href="http://imc_host:port/imcrs/plat/res/telnet?start=10&size=10"/></list>
For the description on each field of the returned value, see “Query Telnet Template Information.”
ExampleQuery Telnet template information list.
Request
GET http://imc_host:8080/imcrs/plat/res/telnetaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml... <list> <telnetParamTemplate> <id>1</id> <type>0</type> <name>default</name> <authType>5</authType> <userName/> <userPassword/> <superPassword/> <authTypeStr>No username, no password</authTypeStr> <timeout>4</timeout> <retries>1</retries> <port>23</port> <version>1</version> <link href="http://localhost:8080/imcrs/plat/res/telnet/1" op="GET" rel="self"/> </telnetParamTemplate> ...</list>
168 Network Resource Management
Query Telnet Template InformationQuery Telnet template information based on device ID.
Interface URI/plat/res/telnet/{id}
Access Method
HTTPGET
Parameters
Path parameter
Telnet template ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message body
<telnetParamTemplate> <id>1</id> <type>0</type> <name>default</name> <authType>5</authType> <userName/> <userPassword/> <superPassword/> <authTypeStr>No username, no password</authTypeStr> <timeout>4</timeout> <retries>1</retries> <port>23</port> <version>1</version></telnetParamTemplate>
Element description
telnetParamTemplate sub-elements
Telnet template ID.idLong integer type.
Template name.nameString type.
Version.versionLong integer type.
Authentication type.authTypeInteger type.
Query Telnet Template Information 169
telnetParamTemplate sub-elements
Username.userNameString type.
User password.userPasswordString type.
Super password.superPasswordString type.
Authentication mode.authTypeStrString type.
Timeout time.timeoutLong integer type.
Number of retries.retriesLong integer type.
Port.portLong integer type.
Template type.typeInteger type.
ExampleQuery Telnet template information with the template ID 1.
Request
GET http://imc_host:8080/imcrs/plat/res/telnet/1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml... <telnetParamTemplate> <id>1</id> <type>0</type> <name>default</name> <authType>5</authType> <userName/> <userPassword/> <superPassword/> <authTypeStr>No username, no password</authTypeStr> <timeout>4</timeout> <retries>1</retries> <port>23</port> <version>1</version></telnetParamTemplate>
170 Network Resource Management
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.
HTTP/1.1 200 OKTotal: 17
Query SSH Template Information List 171
Message body
<list> <sshParamTemplate> <id>101</id> <type>2</type> <name>101</name> <authType>0</authType> <authTypeStr>Password</authTypeStr> <userName>admin</userName> <password/> <port>22</port> <timeout>10</timeout> <retries>3</retries> <keyFileName/> <keyPhrase/> <superPassword/> <link href="http://localhost:8080/imcrs/plat/res/ssh/101" op="GET" rel="self"/> </sshParamTemplate> ... <link rel="next" href="http://imc_host:port/imcrs/plat/res/ssh?start=10&size=10"/></list>
For the description on each field of the returned value, see “Query SSH Template Information.”
ExampleQuery SSH template information list.
Request
GET http://imc_host:8080/imcrs/plat/res/sshaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml... <list> <sshParamTemplate> <id>101</id> <type>2</type> <name>101</name> <authType>0</authType> <authTypeStr>Password</authTypeStr> <userName>admin</userName> <password/> <port>22</port> <timeout>10</timeout> <retries>3</retries> <keyFileName/> <keyPhrase/> <superPassword/> <link href="http://localhost:8080/imcrs/plat/res/ssh/101" op="GET" rel="self"/> </sshParamTemplate> ...</list>
172 Network Resource Management
Query SSH Template InformationQuery SSH template information based on device ID.
Interface URI/plat/res/ssh/{id}
Access Method
HTTPGET
Parameters
Path parameter
SSH template ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message body
<sshParamTemplate> <id>101</id> <type>2</type> <name>101</name> <authType>0</authType> <authTypeStr>Password</authTypeStr> <userName>admin</userName> <password/> <port>22</port> <timeout>10</timeout> <retries>3</retries> <keyFileName/> <keyPhrase/> <superPassword/> <link href="http://localhost:8080/imcrs/plat/res/ssh/101" op="GET" rel="self"/> </sshParamTemplate>
Element description
sshParamTemplate sub-elements
SSH template ID.idLong integer type.
Parameter name.nameString type.
Parameter type.typeInteger type.
Authentication mode.authTypeInteger type.
Query SSH Template Information 173
sshParamTemplate sub-elements
Authentication mode description.authTypeStrString type.
Username.userNameString type.
Timeout time.timeoutInteger type.
Number of retries.retriesInteger type.
Password.passwordString type.
Port.portInteger type.
Key file name for key authentication.keyFileNameString type.
Key phrase for key authentication.keyPhraseString type.
Super password.superPasswordString type.
ExampleQuery SSH template information with the template ID 101.
Request
GET http://imc_host:8080/imcrs/plat/res/ssh/101accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<sshParamTemplate> <id>101</id> <type>2</type> <name>101</name> <authType>0</authType> <authTypeStr>Password</authTypeStr> <userName>admin</userName> <password/> <port>22</port> <timeout>10</timeout> <retries>3</retries> <keyFileName/> <keyPhrase/> <superPassword/> <link href="http://localhost:8080/imcrs/plat/res/ssh/101" op="GET" rel="self"/> </sshParamTemplate>
174 Network Resource Management
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.
HTTP/1.1 200 OKTotal: 2
Message body
<list> <user> <id>2</id> <userName>lisi</userName> <certification>lisi002</certification> <address>Tianjin</address> <phone>13810561010</phone> <email>[email protected]</email> <ssType>2</ssType> <groupId>1</groupId> <groupName>ungroup</groupName> <additionalInfoId>2</additionalInfoId> <link href="http://localhost:8080/imcrs/user/2" op="GET" rel="self"/> </user>
Element descriptionFor meanings of the fields in the message body, see “Query User Information.”
Query Users 179
ExampleQuery and list users.
Request
GET http://imc_host:8080/imcrs/useraccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <user> <id>2</id> <userName>lisi</userName> <certification>lisi002</certification> <address>Tianjin</address> <phone>13810561010</phone> <email>[email protected]</email> <ssType>2</ssType> <groupId>1</groupId> <groupName>ungroup</groupName> <additionalInfoId>2</additionalInfoId> <link href="http://localhost:8080/imcrs/user/2" op="GET" rel="self"/> </user> ...</list>
180 User Management
Query User InformationQuery information about a user with the specified ID.
Interface URI/user/{id}
Access Method
HTTPGET
Parameters
Path parameters
User ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<user> <id>1</id> <userName>zhangsan</userName> <certification>zhangsan001</certification> <address>Bejing</address> <phone>01088101023</phone> <email>[email protected]</email> <ssType>2</ssType></user>
Element description
user sub-elements
User ID.idLong integer type. Required. No default value.
User name.userNameString type.
Identity number.certificationString type.
Contact address.addressString type.
Query User Information 181
user sub-elements
Telephone number.phoneString type.
Email address.emailString type.
Activate self-service account or not. 1 for active. 2 for inactive.ssTypeInteger type.
ExampleQuery information about the user with ID 1.
Request
GET http://imc_host:8080/imcrs/user/1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<user> <id>1</id> <userName>zhangsan</userName> <certification>zhangsan001</certification> <address>Bejing</address> <phone>01088101023</phone> <email>[email protected]</email> <ssType>2</ssType></user>
182 User Management
Add UserAdd a user with specified information.
Interface URI/user
Access Method
HTTPPOST
Message body
<user> <userName>wanger</userName> <certification>wanger001</certification> <address>Shanghai</address> <phone>02088784567</phone> <email>[email protected]</email> <ssType>1</ssType> <groupId>1</groupId></user>
Element description
user sub-elements
User name.userNameString type. Required. No default value.
Identity number.certificationString type. Required. No default value.
Contact address.addressString type. Optional. The default value is empty.
Telephone number.phoneString type. Optional. The default value is empty.
Email address.emailString type. Optional. The default value is empty.
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. No message bodyis included.
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/user/4
Add User 183
ExampleAdd a user.
Request
POST http://imc_host:8080/imcrs/useraccept: application/xmlContent-Type: application/xml; charset=UTF-8...<user> <userName>wanger</userName> <certification>wanger001</certification> <address>Shanghai</address> <phone>02088784567</phone> <email>[email protected]</email></user>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/user/4
184 User Management
Modify UserModify information about a user with the specified ID.
Interface URI/user/{id}
Access Method
HTTPPUT
Parameters
Path parameters
User ID.idLong integer type. Required. No default value.
Message body
<user> <userName>wanger</userName> <certification>wanger001</certification> <address>Shanghai</address> <phone>02088784567</phone> <email>[email protected]</email></user>
Element description
Path parameters
User name.userNameOptional. If the element does not exist, the value is not changed. If the element exists, the valuecannot be null.
Identity number.certificationOptional. If the element does not exist, the value is not changed. If the element exists, the valuecannot be null.
Contact address.addressOptional. If the element does not exist, the value is not changed. If the element exists, the valuecannot be null.
Telephone number.phoneOptional. If the element does not exist, the value is not changed. If the element exists, the valuecannot be null.
Email address.emailOptional. If the element does not exist, the value is not changed. If the element exists, the valuecannot be null.
Modify User 185
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 user with ID 2.
Request
PUT http://imc_host:8080/imcrs/user/2accept: application/xml...<user> <userName>wanger</userName> <certification>wanger001</certification> <address>Shanghai</address> <phone>02088784567</phone> <email>[email protected]</email> <ssType>1</ssType> <groupId>1</groupId></user>
Response
HTTP/1.1 204 No Content...
186 User Management
Delete UserDelete a user with the specified ID.
Interface URI/user{id}
Access Method
HTTPDELETE
Parameters
Path parameters
User 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 user with ID 4.
Request
DELETE http://imc_host:8080/imcrs/user/4accept: application/xml...
Response
HTTP/1.1 204 No Content
Delete User 187
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.
HTTP/1.1 200 OKTotal: 2
Message body
<list> <userAdditionalInfo> <id>1</id> <columnId>COLUMN_01</columnId> <fieldName>school</fieldName> <required>true</required> <fieldType>4</fieldType> <fieldLen>40</fieldLen> <defaultValue>Bejing University</defaultValue> <priority>1</priority> <showForPreRegisterUser>false</showForPreRegisterUser> </userAdditionalInfo> ...</list>
Element descriptionFor meanings of the fields in the message body, see “Query User Additional Information Definition.”
188 User Management
ExampleQuery and list user additional information definitions.
Request
GET http://imc_host:8080/imcrs/user/additionalInfoaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <userAdditionalInfo> <id>1</id> <columnId>COLUMN_01</columnId> <fieldName>school</fieldName> <required>true</required> <fieldType>4</fieldType> <fieldLen>40</fieldLen> <defaultValue>Bejing University</defaultValue> <priority>1</priority> <showForPreRegisterUser>false</showForPreRegisterUser> </userAdditionalInfo> ...</list>
Query User Additional Information Definitions 189
Query User Additional Information DefinitionQuery the user additional information definition of a specified ID.
Interface URI/user/additionalInfo/{id}
Access Method
HTTPGET
Parameters
Path parameters
ID of a user additional information definition.idLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<userAdditionalInfo> <id>1</id> <columnId>COLUMN_01</columnId> <fieldName>school</fieldName> <required>true</required> <fieldType>4</fieldType> <fieldLen>40</fieldLen> <defaultValue>Bejing University</defaultValue> <priority>1</priority> <showForPreRegisterUser>false</showForPreRegisterUser></userAdditionalInfo>
Element description
userAdditionalInfo sub-elements
ID of a user additional information definition.idLong integer type.
Column name of the user additional information definition.columnIdString type.
Field name.fieldNameString type.
Required or not.required
190 User Management
userAdditionalInfo sub-elements
Boolean type.
Field type. 1 for integer. 2 for decimal. 3 for alphanumeric character. 4 for any character. 5for option.
fieldType
Integer type.
Maximum field length.fieldLenInteger type.
Maximum field value.fieldMaxString type.
Minimum field value.fieldMinString type.
Default value.defaultValueString type.
The display priority of a field.priorityInteger type.
Display pre-registered users or not.showForPreRegisterUserBoolean type.
Option elements.optionsElement type.
Option ID.options/idLong integer type.
Option value.options/optionsValueString type.
Query User Additional Information Definition 191
ExampleQuery the user additional information definition with ID 2.
Request
GET http://imc_host:8080/imcrs/user/additionalInfo/2accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<userAdditionalInfo> <id>2</id> <columnId>COLUMN_02</columnId> <fieldName>age</fieldName> <required>true</required> <fieldType>1</fieldType> <fieldMax>100</fieldMax> <fieldMin>20</fieldMin> <defaultValue>25</defaultValue> <priority>2</priority> <showForPreRegisterUser>false</showForPreRegisterUser></userAdditionalInfo>
192 User Management
Add User Additional Information DefinitionAdd a user additional information definition with specified information.
Interface URI/user/additionalInfo
Access Method
HTTPPOST
Message body
<userAdditionalInfo> <fieldName>digits</fieldName> <required>true</required> <fieldType>5</fieldType> <defaultValue>1</defaultValue> <priority>3</priority> <showForPreRegisterUser>false</showForPreRegisterUser> <options> <id>1</id> <optionsValue>1</optionsValue> </options> <options> <id>2</id> <optionsValue>2</optionsValue> </options> </userAdditionalInfo>
Element description
Query parameters
Field name.fieldNameString type. Required. No default value.
Required or not.requiredBoolean type. Optional. The default value is true.
Field type. 1 for integer. 2 for decimal. 3 for alphanumeric character. 4 for any character. 5for option.
fieldType
Integer type. Required. No default value.
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.
Display pre-registered users or not.defaultValueString type. Required. No default value.
Display pre-registered users or not.showForPreRegisterUserBoolean type. Optional. The default value is false.
Add User Additional Information Definition 193
Query parameters
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
• 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.
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/user/additionalInfo/3
Example 1Add a user additional information definition of the option type.
Request
POST http://localhost:8080/imcrs/user/additionalInfoaccept: application/xmlContent-Type: application/xml; charset=UTF-8...
<userAdditionalInfo> <fieldName>digits</fieldName> <required>true</required> <fieldType>5</fieldType> <defaultValue>1</defaultValue> <priority>3</priority> <showForPreRegisterUser>false</showForPreRegisterUser> <options> <id>1</id> <optionsValue>1</optionsValue> </options> <options> <id>2</id> <optionsValue>2</optionsValue> </options></userAdditionalInfo>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/user/additionalInfo/1
194 User Management
Example 2Add a user additional information definition of the integer type.
Request
POST http://localhost:8080/imcrs/user/additionalInfoaccept: application/xmlContent-Type: application/xml; charset=UTF-8...
<userAdditionalInfo> <id>2</id> <fieldName>age</fieldName> <required>true</required> <fieldType>1</fieldType> <fieldMax>100</fieldMax> <fieldMin>20</fieldMin> <defaultValue>25</defaultValue> <priority>2</priority> <showForPreRegisterUser>false</showForPreRegisterUser></userAdditionalInfo>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/user/additionalInfo/2
Add User Additional Information Definition 195
Modify User Additional Information DefinitionModify a user additional information definition with the specified ID.
Interface URI/user/additionalInfo/{id}
Access Method
HTTPPUT
Parameters
Path parameters
ID of a user additional information definition.idLong integer type. Required. No default value.
Message body
<userAdditionalInfo> <fieldName>job</fieldName> <required>true</required> <fieldType>3</fieldType> <fieldLen>12</fieldLen> <defaultValue>google</defaultValue> <priority>2</priority> <showForPreRegisterUser>false</showForPreRegisterUser> </userAdditionalInfo>
Element description
userAdditionalInfo sub-elements
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.
Request
DELETE http://imc_host:8080/imcrs/user/additionalInfo/1accept: application/xml...
Response
HTTP/1.1 204 No Content
198 User Management
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.
HTTP/1.1 200 OKTotal: 4
Message body
<list> <unauthorizedAccess> <id>-6750808576775831498</id> <deviceId>17</deviceId> <deviceLabel>Quidway</deviceLabel> <deviceIp>10.153.89.2</deviceIp> <ifDesc>Ethernet1/0/31</ifDesc> <processStatus>0</processStatus> <terminalMac>00:e0:86:10:7f:50</terminalMac> <terminalName/> <terminalIp>10.153.89.16</terminalIp> </unauthorizedAccess> ...</list>
Elements
unauthorizedAccess sub-elements
Terminal IP address.terminalIpString type.
Terminal MAC address.terminalMacString type.
Terminal name.terminalNameString type.
Device ID.deviceIdLong integer type.
Device label.deviceLabelString type.
Device IP address.deviceIpString type.
Interface description.ifDescString type.
Processing status. 0 for unprocessed. 1 for processed.processStatusInteger type.
202 Terminal Access Management
ExampleQuery and list information about unauthorized access attempts.
Request
GET http://localhost:8080/imcrs/res/access/unauthorizedAccessaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <unauthorizedAccess> <id>-6750808576775831498</id> <deviceId>17</deviceId> <deviceLabel>Quidway</deviceLabel> <deviceIp>10.153.89.2</deviceIp> <ifDesc>Ethernet1/0/31</ifDesc> <processStatus>0</processStatus> <terminalMac>00:e0:86:10:7f:50</terminalMac> <terminalName/> <terminalIp>10.153.89.16</terminalIp> </unauthorizedAccess> ...</list>
Query Unauthorized Access Attempts 203
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.
HTTP/1.1 200 OKTotal: 976
Message body
<list> <historyAccessLog> <id>-8132800096806244989</id> <terminalIp>10.153.88.171</terminalIp> <terminalMac>00:0c:29:ff:e8:2d</terminalMac> <terminalName/> <deviceSymbolName>H3C</deviceSymbolName> <deviceId>4</deviceId> <deviceIp>10.153.89.1</deviceIp> <ifDesc>GigabitEthernet4/0/3</ifDesc> <vlanId>2</vlanId> <upLineTime>1308794210</upLineTime> <downLineTime>0</downLineTime> </historyAccessLog> ...</list>
Elements
unauthorizedAccessLog sub-elements
Terminal IP address.terminalIpString type.
Terminal MAC address.terminalMacString type.
Terminal name.terminalNameString type.
Device ID.deviceIdLong integer type.
Device label.deviceLabelString type.
Device IP address.deviceIpString type.
208 Terminal Access Management
unauthorizedAccessLog sub-elements
Interface description.ifDescString type.
VLAN ID.vlanIdInteger type.
Time when the user logged on.upLineTimeLong integer type.
Time when the user logged off.downLineTimeLong integer type.
ExampleQuery and list access log histories.
Request
GET http://localhost:8080/imcrs/res/access/historyAccessLogaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <historyAccessLog> <id>-8132800096806244989</id> <terminalIp>10.153.88.171</terminalIp> <terminalMac>00:0c:29:ff:e8:2d</terminalMac> <terminalName/> <deviceSymbolName>H3C</deviceSymbolName> <deviceId>4</deviceId> <deviceIp>10.153.89.1</deviceIp> <ifDesc>GigabitEthernet4/0/3</ifDesc> <vlanId>2</vlanId> <upLineTime>1308794210</upLineTime> <downLineTime>0</downLineTime> </historyAccessLog> ...</list>
Query Access Log Histories 209
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.
HTTP/1.1 200 OKTotal: 51
Message body
<list> <ipMacLearnResult> <deviceId>2</deviceId> <deviceIp>10.153.89.1</deviceIp> <ifIndex>33</ifIndex> <ifDesc>GigabitEthernet4/0/3</ifDesc> <vlanId>2</vlanId> <learnIp>10.153.88.167</learnIp> <learnMac>00:09:6b:b0:6e:14</learnMac> <device>http://localhost:8080/imcrs/plat/res/device/2</device> <iface>http://localhost:8080/imcrs/plat/res/device/2/interface/33</iface> </ipMacLearnResult> ...</list>
Elements
ipMacLearnResult sub-elements
Location address.deviceIdString type.
Device IP address.deviceIpString type.
Interface description.ifDescString type.
Interface index.ifIndexLong integer type.
VLAN ID.vlanIdInteger type.
Learned IP address.learnIpString type.
Learned MAC address.learnMacString type.
URI of the device link.deviceString type.
URI of the interface link.iface
Query Current Accesses 211
ipMacLearnResult sub-elements
String type.
ExampleQuery and list current accesses on the device whose ID is 10.
Request
GET http://localhost:8080/imcrs/res/access/ipMacLearn/10accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <ipMacLearnResult> <deviceId>2</deviceId> <deviceIp>10.153.89.1</deviceIp> <ifIndex>33</ifIndex> <ifDesc>GigabitEthernet4/0/3</ifDesc> <vlanId>2</vlanId> <learnIp>10.153.88.167</learnIp> <learnMac>00:09:6b:b0:6e:14</learnMac> <device>http://localhost:8080/imcrs/plat/res/device/2</device> <iface>http://localhost:8080/imcrs/plat/res/device/2/interface/33</iface> </ipMacLearnResult> ...</list>
212 Terminal Access Management
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.
HTTP/1.1 200 OKTotal: 976
Message body
<list> <realtimeLocation> <locateIp>10.153.89.1</locateIp> <deviceIp>10.153.89.77</deviceIp> <ifDesc>Ethernet0/6</ifDesc> </realtimeLocation> ...</list>
Query Real-Time Locations 213
Elements
realtimeLocation sub-elements
Location address.locateIpString type.
Device IP address.deviceIpString type.
Interface description.ifDescString type.
ExampleQuery and list real-time locations.
Request
GET http://imc_host:8080/imcrs/asset/access/realtimeLocateaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list><realtimeLocation> <locateIp>10.153.89.1</locateIp> <deviceIp>10.153.89.77</deviceIp> <ifDesc>Ethernet0/6</ifDesc> </realtimeLocation> ...</list>
214 Terminal Access Management
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.
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<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> <operatorGroupId>2</operatorGroupId> <operatorGroupId>1</operatorGroupId> <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>
218 Terminal Access Management
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.
Operator group ID.operatorGroupIdLong integer type.
Query IP Segment 219
ExampleQuery information about the IP segment with ID 1.
Request
GET http://localhost:8080/imcrs/res/access/assignedIpScope/1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<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> <operatorGroupId>2</operatorGroupId> <operatorGroupId>1</operatorGroupId> <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>
220 Terminal Access Management
Add IP SegmentAdd an IP segment.
Interface URI/res/access/assignedIpScope
Access Method
HTTPPOST
Message body
<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.
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/res/access/assignedIpScope/7
Add IP Segment 221
Example 1Add an IP segment ranging from 10.153.89.21 to 10.153.89.30 and grant rights to the IP segmentto the default operator groups.
Request
POST http://localhost:8080/imcrs/res/access/assignedIpScopeaccept: application/xmlContent-Type: application/xml; charset=UTF-8...<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>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/res/access/assignedIpScope/7
Example 2Add an IP segment ranging from 10.153.89.60 to 10.153.89.80, and grant rights to the IPsegment to operator groups with IDs 1, 2, and 4.
Request
POST http://localhost:8080/imcrs/res/access/assignedIpScopeaccept: application/xmlContent-Type: application/xml; charset=UTF-8...<assignedIpScope> <startIp>10.153.89.60</startIp> <endIp>10.153.89.80</endIp> <name>60to80</name> <description>10.153.89.60 to 10.153.89.80</description> <operatorGroupId>1</operatorGroupId> <operatorGroupId>2</operatorGroupId> <operatorGroupId>4</operatorGroupId></assignedIpScope>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/res/access/assignedIpScope/12
222 Terminal Access Management
Add Child IP SegmentAdd a child IP segment.
Interface URI/res/access/assignedIpScope/{id}
Access Method
HTTPPOST
Parameters
Path parameters
IP segment ID.idLong integer type. Required. No default value.
Message body
<assignedIpScope> <startIp>10.153.89.21</startIp> <endIp>10.153.89.25</endIp> <name>21to25</name> <description>10.153.89.21 to 10.153.89.25</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. No default value.
Returned Result
Status codes
• 201 (Created): Success.
• 409 (Conflict): Failure. See “Error Codes.”
Add Child IP Segment 223
Message headerIf the operation succeeds, the Location field gives the URI of the new resource. The message bodyis empty.
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/res/access/assignedIpScope/8
ExampleAdd a child IP segment ranging from 10.153.89.21 to 10.153.89.25 for the IP segment with ID7.
Request
POST http://localhost:8080/imcrs/res/access/assignedIpScope/7accept: application/xmlContent-Type: application/xml; charset=UTF-8...<assignedIpScope> <startIp>10.153.89.21</startIp> <endIp>10.153.89.25</endIp> <name>21to25</name> <description>10.153.89.21 to 10.153.89.25</description></assignedIpScope>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/res/access/assignedIpScope/8
224 Terminal Access Management
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.
• 409 (Conflict): Failure. See “Error Codes.”
Message header
HTTP/1.1 204 No Content...
ExampleRelease the IP segment with ID 13.
Request
DELETE http://localhost:8080/imcrs/res/access/assignedIpScope/13accept: application/xml...
Response
HTTP/1.1 204 No Content
Release IP Segment 227
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.
HTTP/1.1 200 OKTotal: 12
228 Terminal Access Management
Message body
<list> <assignedIpInfo> <ip>10.153.89.1</ip> <name>H3C</name> </assignedIpInfo> <assignedIpInfo> <ip>10.153.89.10</ip> </assignedIpInfo> <assignedIpInfo> <ip>10.153.89.13</ip> </assignedIpInfo> ...</list>
Elements
assignedIpInfo sub-elements
ID of the IP address.idLong integer type.
IP address.ipString type.
Owner.nameString type.
Description.descriptionString type.
Automatically Scan IP Segment 229
ExampleAutomatically scan the IP segment with start IP address 10.153.89.1 and end IP address10.153.89.20.
Request
GET http://localhost:8080/imcrs/res/access/assignedIpScope/autoScan?startIp=10.153.89.1&endIP=10.153.89.20accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <assignedIpInfo> <ip>10.153.89.1</ip> <name>H3C</name> </assignedIpInfo> <assignedIpInfo> <ip>10.153.89.10</ip> </assignedIpInfo> <assignedIpInfo> <ip>10.153.89.13</ip> </assignedIpInfo> ...</list>
230 Terminal Access Management
Automatically Scan Assigned IP SegmentAutomatically scan an IP segment with the specified ID.
Interface URI/res/access/assignedIpScope/autoScan/{id}
Access Method
HTTPGET
Parameters
Path parameters
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.
HTTP/1.1 200 OKTotal: 4
Message body
<list> <assignedIpInfo> <ip>10.153.89.1</ip> <name>H3C</name> </assignedIpInfo> <assignedIpInfo> <ip>10.153.89.10</ip> </assignedIpInfo> ...</list>
Elements
assignedIpInfo sub-elements
ID of the IP address.idLong integer type.
IP address.ipString type.
Owner.name
Automatically Scan Assigned IP Segment 231
assignedIpInfo sub-elements
String type.
Description.descriptionString type.
ExampleAutomatically scan the IP segment with ID 2.
Request
GET http://localhost:8080/imcrs/res/access/assignedIpScope/autoScan/2accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <assignedIpInfo> <ip>10.153.89.1</ip> <name>H3C</name> </assignedIpInfo> <assignedIpInfo> <ip>10.153.89.10</ip> </assignedIpInfo> ...</list>
232 Terminal Access Management
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.
HTTP/1.1 200 OKTotal: 3
Message body
<list> <assignedIpInfo> <id>4</id> <ip>10.153.89.12</ip> <parentId>2</parentId> </assignedIpInfo> <assignedIpInfo> <id>5</id> <ip>10.153.89.2</ip> <parentId>3</parentId> </assignedIpInfo> ...</list>
Elements
assignedIpInfo sub-elements
ID of the IP address.idLong integer type.
IP address.ipString type.
Owner.nameString type.
Description.descriptionString type.
ID of the IP address segment.parentIdLong integer type.
234 Terminal Access Management
ExampleQuery and list the assigned IP addresses that belong to the IP segment with ID 1.
Request
GET http://localhost:8080/imcrs/res/access/assignedIpScope/ip?ipScopeId=1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list>2</parentId> </assignedIpInfo> <assignedIpInfo> <id>5</id> <ip>10.153.89.2</ip> <parentId>3</parentId> </assignedIpInfo> ...</list>
Query IP Addresses 235
Assign IP AddressAssign an IP address.
Interface URI/res/access/assignedIpScope/ip
Access Method
HTTPPOST
Query parameters
Query parameters
IP segment ID.ipScopeIdLong integer type. Required. No default value.
Message body
<assignedIpInfo> <ip>10.153.89.8</ip> <name>H3C111</name> <description>10.153.89.8 rest</description></assignedIpInfo>
Elements
assignedIpInfo sub-elements
IP address.ipString type. Required. No default value.
Owner.nameString type. Required. No default value.
Description.descriptionString type. Optional. No default value.
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.
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/res/access/assignedIpScope/ip/15
236 Terminal Access Management
ExampleAssign IP address 10.153.89.8 to the IP segment with ID 1.
Request
POST http://imc_host:8080/imcrs/asset/access/assignedIpScope/ip?ipScopeId=1accept: application/xmlContent-Type: application/xml; charset=UTF-8...<assignedIpInfo> <ip>10.153.89.8</ip> <name>H3C111</name> <description>10.153.89.8 rest</description></assignedIpInfo>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/res/access/assignedIpScope/ip/15
Assign IP Address 237
Release Assigned IP AddressRelease an assigned IP address with specific ID.
Interface URI/res/access/assignedIpScope/ip/{id}
Access Method
HTTPDELETE
Parameters
Path parameters
ID of the IP address.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...
ExampleRelease the IP segment with ID 13.
Request
DELETE http://imc_host:8080/imcrs/asset/access/assignedIpScope/ip/15accept: application/xml...
Response
HTTP/1.1 204 No Content
238 Terminal Access Management
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.
HTTP/1.1 200 OKTotal: 3
Message body
<list> <macAccessBind> <id>3</id> <deviceId>0</deviceId> <deviceLabel/> <deviceIp/> <ifDesc/> <terminalMac>10:20:30:40:50:60</terminalMac> <terminalName>yourTerminal</terminalName> <terminalIp/> <bindType>1</bindType> <link href="http://localhost:8080/imcrs/res/access/macAccessBind/3" op="GET" rel="self"/> </macAccessBind> ...</list>
ElementsFor meanings of the fields in the message body, see “Query Terminal Access Binding.”
ExampleQuery and list terminal access bindings.
Request
GET http://localhost:8080/imcrs/res/access/macAccessBindaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <macAccessBind> <id>3</id> <deviceId>0</deviceId> <deviceLabel/> <deviceIp/> <ifDesc/> <terminalMac>10:20:30:40:50:60</terminalMac> <terminalName>yourTerminal</terminalName> <terminalIp/> <bindType>1</bindType> <link href="http://localhost:8080/imcrs/res/access/macAccessBind/3" op="GET" rel="self"/> </macAccessBind> ...</list>
240 Terminal Access Management
Query Terminal Access BindingQuery information about a terminal access binding with the specified ID.
Interface URI/res/access/macAccessBind/{id}
Access Method
HTTPGET
Parameters
Path parameters
Terminal access bindingidID. Long integer type.Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<macAccessBind> <id>1</id> <deviceId>2</deviceId> <deviceLabel>H3C</deviceLabel> <deviceIp>10.153.89.1</deviceIp> <ifDesc>GigabitEthernet4/0/3</ifDesc> <terminalMac>11:22:33:44:55:66</terminalMac> <terminalName>myTerminal</terminalName> <terminalIp/> <bindType>2</bindType> <device>http://localhost:8080/imcrs/plat/res/device/2</device></macAccessBind>
Elements
macAccessBind sub-elements
Terminal access bindingidID. Long integer type.
Terminal IP address.terminalIpString type.
Terminal MAC address.terminalMacString type.
Query Terminal Access Binding 241
macAccessBind sub-elements
Terminal name.terminalNameString type.
Device ID.deviceIdLong integer type.
Device label.deviceLabelString type.
Device IP address.deviceIpString type.
Interface description.ifDescString type.
Binding type. 1 for no authentication. 2 for MAC-to-interface binding.bindTypeInteger type.
URI of the device link.deviceString type.
ExampleQuery information about the terminal access binding with ID 1.
Request
GET http://localhost:8080/imcrs/res/access/macAccessBind/1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<macAccessBind> <id>1</id> <deviceId>2</deviceId> <deviceLabel>H3C</deviceLabel> <deviceIp>10.153.89.1</deviceIp> <ifDesc>GigabitEthernet4/0/3</ifDesc> <terminalMac>11:22:33:44:55:66</terminalMac> <terminalName>myTerminal</terminalName> <terminalIp/> <bindType>2</bindType> <device>http://localhost:8080/imcrs/plat/res/device/2</device></macAccessBind>
242 Terminal Access Management
Automatically Scan Terminal Access BindingsAutomatically scan the terminal access bindings with certain criteria.
Interface URI/res/access/macAccessBind/autoScan
Access Method
HTTPGET
Parameters
Query parameters
Device ID.deviceIdLong integer type. Required, supporting multiple query elements. 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.
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: 257
Message body
<list> <macAccessBindScanResult> <id>515</id> <deviceId>2</deviceId> <deviceLabel>H3C</deviceLabel> <deviceIp>10.153.89.1</deviceIp> <ifDesc>GigabitEthernet4/0/17</ifDesc> <terminalMac>00:00:00:11:11:01</terminalMac> <terminalName/> <terminalIp>10.153.89.66</terminalIp> </macAccessBindScanResult> ...</list>
ElementsFor meanings of the fields in the message body, see “Query Terminal Access Binding.”
Automatically Scan Terminal Access Bindings 243
ExampleAutomatically scan the terminal access bindings on the device whose ID is 2.
Request
GET http://localhost:8080/imcrs/res/access/macAccessBind/autoScan?deviceId=2accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <macAccessBindScanResult> <id>515</id> <deviceId>2</deviceId> <deviceLabel>H3C</deviceLabel> <deviceIp>10.153.89.1</deviceIp> <ifDesc>GigabitEthernet4/0/17</ifDesc> <terminalMac>00:00:00:11:11:01</terminalMac> <terminalName/> <terminalIp>10.153.89.66</terminalIp> </macAccessBindScanResult> ...</list>
244 Terminal Access Management
Add Terminal Access BindingAdd a terminal access binding.
Interface URI/res/access/macAccessBind
Access Method
HTTPPOST
Message body
<macAccessBind> <terminalMac>1a:2a:3a:4c:1c:2c</terminalMac> <terminalName>a1</terminalName> <bindType>2</bindType> <ifInfo> <deviceId>2</deviceId> <ifIndex>1</ifIndex> </ifInfo></macAccessBind>
Elements
macAccessBind sub-elements
Terminal MAC address.terminalMacString type. Required. No default value.
Terminal name.terminalNameString type. Optional. No default value.
Binding type. 1 for no authentication. 2 for MAC-to-interface binding.bindTypeInteger type. Required. No default value.
Maintainer.maintainerString type. Optional. No default value.
Interface information.ifInfoElement type. Required when bindType takes 2. Multiple elements are supported.
Device ID.ifInfo/deviceIdLong integer type.
Interface index.ifInfo/ifIndexLong integer type.
Returned Result
Status codes
• 201 (Created): Success.
• 409 (Conflict): Failure. See “Error Codes.”
Add Terminal Access Binding 245
Message headerIf the operation succeeds, the Location field gives the URI of the new resource. The message bodyis empty.
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/res/access/macAccessBind/4
Example 1Add a terminal access binding, which maps MAC address 1a:2a:3a:4c:1c:2c to the interfacewhose index is 1 on device whose ID is 2.
Request
POST http://localhost:8080/imcrs/res/access/macAccessBindaccept: application/xmlContent-Type: application/xml; charset=UTF-8...<macAccessBind> <terminalMac>1a:2a:3a:4c:1c:2c</terminalMac> <terminalName>a1</terminalName> <bindType>2</bindType> <ifInfo> <deviceId>2</deviceId> <ifIndex>1</ifIndex> </ifInfo></macAccessBind>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/res/access/macAccessBind/4
Example 2Exclude MAC address 1a:2a:3a:4a:1a:2a from authentication.
Request
POST http://localhost:8080/imcrs/res/access/macAccessBindaccept: application/xmlContent-Type: application/xml; charset=UTF-8...<macAccessBind> <terminalMac>1a:2a:3a:4a:1a:2a</terminalMac> <terminalName>a1</terminalName> <bindType>1</bindType></macAccessBind>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/res/access/macAccessBind/1
246 Terminal Access Management
Modify Terminal Access BindingModify a terminal access binding with the specified ID.
Interface URI/res/access/macAccessBind/{id}
Access Method
HTTPPUT
Parameters
Path parameters
Terminal access binding ID.idID. Long integer type. Required. No default value.
Message body
<macAccessBind> <terminalName>a1</terminalName> <bindType>2</bindType> <ifInfo> <deviceId>5</deviceId> <ifIndex>1</ifIndex> </ifInfo></macAccessBind>
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.
Request
DELETE http://localhost:8080/imcrs/res/access/macAccessBind/1accept: application/xml...
Response
HTTP/1.1 204 No Content
Delete Terminal Access Binding 249
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.
HTTP/1.1 200 OKTotal: 2
Message body
<list> <ifAccessBind> <id>1</id> <deviceId>5</deviceId> <deviceIp>10.153.89.1</deviceIp> <deviceName>H3C</deviceName> <ifDesc>GigabitEthernet4/0/7</ifDesc> <bindType>1</bindType> <terminalMac>2a:2b:2c:2d:2e:2f</terminalMac> <terminalIp/> <terminalName>2</terminalName> <terminalMaintainer>2abcdef</terminalMaintainer> <link href="http://localhost:8080/imcrs/res/access/ifAccessBind/1" op="GET" rel="self"/> </ifAccessBind> ...</list>
ElementsFor meanings of the fields in the message body, see “Query Switch Access Binding.”
Query Switch Access Bindings 251
ExampleQuery switch access bindings.
Request
GET http://localhost:8080/imcrs/res/access/ifAccessBindaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <ifAccessBind> <id>1</id> <deviceId>5</deviceId> <deviceIp>10.153.89.1</deviceIp> <deviceName>H3C</deviceName> <ifDesc>GigabitEthernet4/0/7</ifDesc> <bindType>1</bindType> <terminalMac>2a:2b:2c:2d:2e:2f</terminalMac> <terminalIp/> <terminalName>2</terminalName> <terminalMaintainer>2abcdef</terminalMaintainer> <link href="http://localhost:8080/imcrs/res/access/ifAccessBind/1" op="GET" rel="self"/> </ifAccessBind> ...</list>
252 Terminal Access Management
Query Switch Access BindingQuery information about a switch access binding with the specified ID.
Interface URI/res/access/ifAccessBind/{id}
Access Method
HTTPGET
Parameters
Path parameters
Switch access binding ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<ifAccessBind> <id>1</id> <deviceId>5</deviceId> <deviceIp>10.153.89.1</deviceIp> <deviceName>H3C</deviceName> <ifDesc>GigabitEthernet4/0/7</ifDesc> <bindType>1</bindType> <terminalMac>2a:2b:2c:2d:2e:2f</terminalMac> <terminalIp/> <terminalName>2</terminalName> <terminalMaintainer>2abcdef</terminalMaintainer> <device>http://localhost:8080/imcrs/plat/res/device/5</device></ifAccessBind>
Elements
ifAccessBind sub-elements
Terminal access binding ID.idLong integer type.
Terminal IP address.terminalIpString type.
Terminal MAC address.terminalMacString type.
Query Switch Access Binding 253
ifAccessBind sub-elements
Terminal name.terminalNameString type.
Device ID.deviceIdLong integer type.
Device label.deviceNameString type.
Device IP address.deviceIpString type.
Interface description.ifDescString type.
Binding type. 1 for MAC-to-interface binding. 2 for no authentication.bindTypeInteger type.
Maintainer.terminalMaintainerString type
URI of the device link.deviceString type.
ExampleQuery information about the switch access binding with ID 1.
Request
GET http://localhost:8080/imcrs/res/access/ifAccessBind/1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<ifAccessBind> <id>1</id> <deviceId>5</deviceId> <deviceIp>10.153.89.1</deviceIp> <deviceName>H3C</deviceName> <ifDesc>GigabitEthernet4/0/7</ifDesc> <bindType>1</bindType> <terminalMac>2a:2b:2c:2d:2e:2f</terminalMac> <terminalIp/> <terminalName>2</terminalName> <terminalMaintainer>2abcdef</terminalMaintainer> <device>http://localhost:8080/imcrs/plat/res/device/5</device></ifAccessBind>
254 Terminal Access Management
Automatically Scan Switch Access BindingsAutomatically scan the terminal access bindings with certain criteria.
Interface URI/res/access/macAccessBind/autoScan
Access Method
HTTPGET
Parameters
Query parameters
Device ID.deviceIdLong integer type. Required, supporting multiple elements. 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.
HTTP/1.1 200 OKTotal: 257
Message body
<list> <macAccessBindScanResult> <id>515</id> <deviceId>2</deviceId> <deviceLabel>H3C</deviceLabel> <deviceIp>10.153.89.1</deviceIp> <ifDesc>GigabitEthernet4/0/17</ifDesc> <terminalMac>00:00:00:11:11:01</terminalMac> <terminalName/> <terminalIp>10.153.89.66</terminalIp> </macAccessBindScanResult> ...</list>
ElementsFor meanings of the fields in the message body, see “Query Terminal Access Binding.”
Automatically Scan Switch Access Bindings 255
ExampleAutomatically scan the terminal access bindings on the device whose ID is 2.
Request
GET http://localhost:8080/imcrs/res/access/macAccessBind/autoScan?deviceId=2accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <macAccessBindScanResult> <id>515</id> <deviceId>2</deviceId> <deviceLabel>H3C</deviceLabel> <deviceIp>10.153.89.1</deviceIp> <ifDesc>GigabitEthernet4/0/17</ifDesc> <terminalMac>00:00:00:11:11:01</terminalMac> <terminalName/> <terminalIp>10.153.89.66</terminalIp> </macAccessBindScanResult> ...</list>
256 Terminal Access Management
Add Switch Access BindingAdd a switch access binding.
Interface URI/res/access/ifAccessBind
Access Method
HTTPPOST
Message body
<ifAccessBind> <terminalMac>18:28:38:47:17:26</terminalMac> <terminalName>a2</terminalName> <bindType>1</bindType> <ifInfo> <deviceId>5</deviceId> <ifIndex>29</ifIndex> </ifInfo></ifAccessBind>
Elements
ifAccessBind sub-elements
Terminal MAC address.terminalMacString type. Required when bindType takes 1.
Terminal name.terminalNameString type.
Binding type. 1 for MAC-to-interface binding. 2 for no authentication.bindTypeInteger type.
Maintainer.terminalMaintainerString type.
Interface information.ifInfoElement type. Required. No default value.
Device ID.deviceIdLong integer type.
Interface index.ifIndexLong integer type.
Returned Result
Status codes
• 201 (Created): Success.
• 409 (Conflict): Failure. See “Error Codes.”
Add Switch Access Binding 257
Message headerIf the operation succeeds, the Location field gives the URI of the new resource. The message bodyis empty.
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/res/access/ifAccessBind/4
Example 1Add a switch access binding, which maps the interface (index 29) of the device (ID 5) to MACaddress 8:28:38:47:17:26.
Request
POST http://imc_host:8080/imcrs/asset/access/ifAccessBindaccept: application/xmlContent-Type: application/xml; charset=UTF-8...<ifAccessBind> <terminalMac>18:28:38:47:17:26</terminalMac> <terminalName>a2</terminalName> <bindType>1</bindType> <ifInfo> <deviceId>5</deviceId> <ifIndex>29</ifIndex> </ifInfo></ifAccessBind>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/asset/access/ifAccessBind/4
Example 2Exclude the interface whose index is 32 of the device whose ID is 5 from authentication.
Request
POST http://imc_host:8080/imcrs/asset/access/ifAccessBindaccept: application/xmlContent-Type: application/xml; charset=UTF-8...<ifAccessBind> <bindType>2</bindType> <ifInfo> <deviceId>5</deviceId> <ifIndex>32</ifIndex> </ifInfo></ifAccessBind>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/asset/access/ifAccessBind/6
258 Terminal Access Management
Modify Switch Access BindingModify a switch access binding with the specified ID.
Interface URI/res/access/ifAccessBind/{id}
Access Method
HTTPPUT
Parameters
Path parameters
Switch access binding ID.idLong integer type. Required. No default value.
Message body
<ifAccessBind> <terminalMac>11:21:31:41:11:21</terminalMac> <terminalName>a1</terminalName> <terminalMaintainer>tm1</terminalMaintainer> <bindType>1</bindType></ifAccessBind>
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.
Request
DELETE http://localhost:8080/imcrs/res/access/ifAccessBind/3accept: application/xml...
Response
HTTP/1.1 204 No Content
Delete Switch Access Binding 261
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.
HTTP/1.1 200 OKTotal: 2
262 Terminal Access Management
Message body
<list> <ipMacBind> <id>1</id> <ip>10.153.89.1</ip> <mac>00:11:22:33:44:55</mac> <name>H3C</name> <type>9</type> <link href="http://localhost:8080/imcrs/res/access/ipMacBind/1" op="GET" rel="self"/> </ipMacBind> ...</list>
ElementsFor meanings of the fields in the message body, see “Query IP-to-MAC Address Binding.”
ExampleQuery and list IP-to-MAC address bindings.
Request
GET http://imc_host:8080/imcrs/res/access/ipMacBindaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <ipMacBind> <id>1</id> <ip>10.153.89.1</ip> <mac>00:11:22:33:44:55</mac> <name>H3C</name> <type>9</type> <link href="http://localhost:8080/imcrs/res/access/ipMacBind/1" op="GET" rel="self"/> </ipMacBind> ...</list>
Query IP-to-MAC Address Bindings 263
Query IP-to-MAC Address BindingQuery information about an IP-to-MAC address binding with the specified ID.
Interface URI/res/access/ipMacBind/{id}
Access Method
HTTPGET
Parameters
Path parameters
IP-to-MAC address binding ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<ipMacBind> <id>1</id> <ip>10.153.89.1</ip> <mac>00:11:22:33:44:55</mac></ipMacBind>
Elements
ipMacBind sub-elements
IP-to-MAC address binding ID.idLong integer type.
IP address.ipString type.
MAC address.macString type.
Owner.nameString type.
264 Terminal Access Management
ExampleQuery information about the IP-to-MAC address binding with ID 1.
Request
GET http://localhost:8080/imcrs/res/access/ipMacBind/1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<ipMacBind> <id>1</id> <ip>10.153.89.1</ip> <mac>00:11:22:33:44:55</mac></ipMacBind>
Query IP-to-MAC Address Binding 265
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.
HTTP/1.1 200 OKTotal: 15
Message body
<list> <ipMacBindScanResult> <id>16</id> <ip>10.153.89.1</ip> <mac>00:0f:e2:e1:ca:be</mac> <name>H3C</name> <type>9</type> </ipMacBindScanResult> ...</list>
ElementsFor meanings of the fields in the message body, see “Query IP-to-MAC Address Binding.”
266 Terminal Access Management
ExampleAutomatically scan the IP-to-MAC address bindings on the IP segment with start IP address10.153.89.1 and end IP address 10.153.89.20.
Request
GET http://imc_host:8080/imcrs/res/access/ipMacBind/autoScan?startIp=10.153.89.1&endIp=10.153.89.2accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <ipMacBindScanResult> <id>16</id> <ip>10.153.89.1</ip> <mac>00:0f:e2:e1:ca:be</mac> <name>H3C</name> <type>9</type> </ipMacBindScanResult> ...</list>
Automatically Scan IP-to-MAC Address Bindings 267
Add IP-to-MAC Address BindingAdd an IP-to-MAC address binding.
Interface URI/res/access/ipMacBind
Access Method
HTTPPOST
Message body
<ipMacBind> <ip>10.153.89.1</ip> <mac>00:0f:e2:e1:ca:be</mac></ipMacBind>
Elements
ipMacBind sub-elements
IP address.ipString type. Required. No default value.
MAC address.macString type. Required. No default value.
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.
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/res/access/ipMacBind/3
268 Terminal Access Management
ExampleAdd an IP-to-MAC address binding, which maps the IP address 10.153.89.1 to the MAC address00:0f:e2:e1:ca:be
Request
POST http://localhost:8080/imcrs/res/access/ipMacBindaccept: application/xmlContent-Type: application/xml; charset=UTF-8...<ipMacBind> <ip>10.153.89.1</ip> <mac>00:0f:e2:e1:ca:be</mac></ipMacBind>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/res/access/ipMacBind/4
Add IP-to-MAC Address Binding 269
Delete IP-to-MAC Address BindingDelete an IP-to-MAC address binding with the specified ID.
Interface URI/res/access/ipMacBind/{id}
Access Method
HTTPDELETE
Parameters
Path parameters
IP-to-MAC address 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 IP-to-MAC address binding with ID 3.
Request
DELETE http://localhost:8080/imcrs/res/access/ipMacBind/3accept: application/xml...
Response
HTTP/1.1 204 No Content
270 Terminal Access Management
Query Conflict and Unauthorized Access PolicyQuery information about the conflict and unauthorized access policy.
Interface URI/res/access/strategy/conflict
Access Method
HTTPGET
ParametersNone
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<accessStrategy> <sendFaultType>1</sendFaultType> <closeIfType>2</closeIfType> <openIfType>1</openIfType> <closeIfDelay>180</closeIfDelay> <openIfDelay>180</openIfDelay></accessStrategy>
Elements
accessStrategy sub-elements
Whether or not to send alarms. 0 for no. 1 for yes.sendFaultTypeInteger type.
Interface shutdown type. 0 for no shutdown. 1 for immediate shutdown. 2 for delayed shutdown.closeIfTypeInteger type.
Whether or not to bring up the interface after it is shut down. 0 for no. 1 for yes.openIfTypeInteger type.
Time delay before shutting down the interface, in seconds.closeIfDelayInteger type.
Time delay before bringing up the interface, in seconds.openIfDelayInteger type.
Query Conflict and Unauthorized Access Policy 271
ExampleQuery information about the conflict and unauthorized access policy.
Request
GET http://localhost:8080/imcrs/res/access/strategy/conflictaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<accessStrategy> <sendFaultType>1</sendFaultType> <closeIfType>2</closeIfType> <openIfType>1</openIfType> <closeIfDelay>180</closeIfDelay> <openIfDelay>180</openIfDelay></accessStrategy>
272 Terminal Access Management
Query Unknown Access PolicyQuery information about the unknown access policy.
Interface URI/res/access/strategy/unknown
Access Method
HTTPGET
ParametersNone
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<accessStrategy> <accessType>0</accessType> <sendFaultType>1</sendFaultType> <closeIfType>2</closeIfType> <openIfType>1</openIfType> <closeIfDelay>180</closeIfDelay> <openIfDelay>180</openIfDelay></accessStrategy>
Elements
accessStrategy sub-elements
Whether or not to send alarms. 0 for no. 1 for yes.sendFaultTypeInteger type.
Interface shutdown type. 0 for no shutdown. 1 for immediate shutdown. 2 for delayed shutdown.closeIfTypeInteger type.
Whether or not to bring up the interface after it is shut down. 0 for no. 1 for yes.openIfTypeInteger type.
Time delay before shutting down the interface, in seconds.closeIfDelayInteger type.
Time delay before bringing up the interface, in seconds.openIfDelayInteger type.
Whether or not the policy is valid when an unknown access is detected. 0 for yes. 1 for no.accessTypeInteger type.
Query Unknown Access Policy 273
ExampleQuery information about the unknown access policy.
Request
GET http://localhost:8080/imcrs/res/access/strategy/unknownaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<accessStrategy> <accessType>0</accessType> <sendFaultType>1</sendFaultType> <closeIfType>2</closeIfType> <openIfType>1</openIfType> <closeIfDelay>180</closeIfDelay> <openIfDelay>180</openIfDelay></accessStrategy>
274 Terminal Access Management
Modify Conflict and Unauthorized Access PolicyModify the conflict and unauthorized access policy.
Interface URI/res/access/strategy/conflict
Access Method
HTTPPUT
ParametersNone
Message body
<accessStrategy> <sendFaultType>1</sendFaultType> <closeIfType>2</closeIfType> <openIfType>1</openIfType> <closeIfDelay>180</closeIfDelay> <openIfDelay>180</openIfDelay></accessStrategy>
Elements
accessStrategy sub-elements
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.
Interface URI/res/access/strategy/unknown
Access Method
HTTPPUT
ParametersNone
Message body
<accessStrategy> <accessType>0</accessType> <sendFaultType>1</sendFaultType> <closeIfType>2</closeIfType> <openIfType>1</openIfType> <closeIfDelay>180</closeIfDelay> <openIfDelay>180</openIfDelay></accessStrategy>
Elements
accessStrategy sub-elements
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 IDidLong integer type, supporting multiple elements. Optional. No default value.
Alarm category.alarmCategoryInteger type. Optional. No default value.For the valid values, see Query Alarm Categories.
280 Network Alarm Management
Query parameters
Alarm event OID.faultOidString type, supporting 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.
HTTP/1.1 200 OKTotal: 150
Message body
<list> <alarm> <id>3655</id> <OID>1.3.6.1.4.1.2011.10.4.1.1.2.6.4</OID> <originalType>3</originalType> <originalTypeDesc>iMC</originalTypeDesc> <deviceId>347</deviceId> <deviceIp>10.153.88.34</deviceIp> <deviceName>Quidway</deviceName> ... <alarmDetail>http://imc_host:port/imcrs/fault/alarm/3655</alarmDetail> </alarm> ... <link rel="next" href="http://imc_host:port/imcrs/fault/alarm?start=10&size=10"/></list>
For meanings of the fields in the returned value, see “Query Alarm Information.”
Query Alarms 281
ExampleQuery and list the level-4 alarms from the 10th to the 20th entries.
Request
GET http://imc_host:8080/imcrs/fault/alarm?alarmLevel=4&start=10&size=10accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <alarm> <id>3655</id> <OID>1.3.6.1.4.1.2011.10.4.1.1.2.6.4</OID> <originalType>3</originalType> <originalTypeDesc>iMC</originalTypeDesc> <deviceId>347</deviceId> <deviceIp>10.153.88.34</deviceIp> <deviceName>Quidway</deviceName> ... <alarmDetail>http://imc_host:port/imcrs/fault/alarm/3655</alarmDetail> </alarm> ... <link rel="previous" href="http://imc_host:port/imcrs/fault/alarm?start=0&size=10&alarmLevel=4"/> <link rel="next" href="http://imc_host:port/imcrs/fault/alarm?start=20&size=10&alarmLevel=4"/></list>
282 Network Alarm Management
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:
Recover alarmrecover
Acknowledge alarmacknowledge
Delete alarmdelete
Message body
<alarmDetail> <id>3665</id> <OID>1.3.6.1.4.1.2011.10.4.1.1.2.6.4</OID> <originalType>3</originalType> <originalTypeDesc>iMC</originalTypeDesc> <device>http://imc_host:8080/imcrs/plat/res/device/181</device> <deviceIp>10.153.88.34</deviceIp> <deviceName>Quidway</deviceName> ...</alarmDetail>
Elements
alarmDetail sub-elements
Alarm ID, which uniquely identifies an alarm.idLong integer type.
Alarm event OID.OIDString type.
Query Alarm Information 283
alarmDetail sub-elements
Alarm source type.originalTypeInteger type.
Description of the alarm source type.originalTypeDescString type.
Device ID.deviceIdLong integer type.
Device IP address.deviceIpString type.
Device name.deviceNameString type.
Alarm level.alarmLevelInteger type.
Alarm level description.alarmLevelDescString type.
Alarm category.alarmCategoryInteger type.
Alarm category description.alarmCategoryDescString type.
Time when the alarm occurred.faultTimeLong integer type.
Detailed information about the time when the alarm occurred.faultTimeDescString type, in the format of yyyy-MM-dd HH:mm:ss.
Time when the alarm was recovered.recTimeLong integer type.
Detailed information about the time when the alarm was recovered.recTimeDescString type, in the format of yyyy-MM-dd HH:mm:ss.
Alarm recovery status.recStatusInteger type.
Alarm recovery description.recStatusDescString type.
User who recovered the alarm.recUserNameString type.
Time when the alarm was acknowledged.ackTimeLong integer type.
Detailed information about the time when the alarm was acknowledged.ackTimeDescString type, in the format of yyyy-MM-dd HH:mm:ss.
Alarm acknowledgement status. Integer type.ackStatus
Alarm acknowledgement status description.ackStatusDesc
284 Network Alarm Management
alarmDetail sub-elements
String type.
User who acknowledged the alarm.ackUserNameString type.
Alarm description.alarmDescString type.
Alarm parameters.parasString type.
Parent ID of the alarm relation analysis.parentIdLong integer type.
Alarm distribution status.somStateInteger type.
Alarm remarks.remarkString type.
Generic ID.genericIdInteger type.
Specific ID.specificIdInteger type.
Alarm event name.eventNameString type.
Alarm event reason.reasonString type.
Restoration suggestion.suggestionString type.
Maintenance experience.experienceString type.
Alarm event location string.tipMessageString type
Alarm definition type. 0 for pre-defined. 1 for user-defined.defineTypeInteger type.
Custom level.customAlarmLevelInteger type
Query Alarm Information 285
ExampleQuery information about the alarm with ID 3665.
Request
GET http://imc_host:8080/imcrs/fault/alarm/3665accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xmlLink: <http://imc_host:port/imcrs/fault/alarm/recover/3665>; rel=recoverLink: <http://imc_host:port/imcrs/fault/alarm/acknowledge/3665>; rel=acknowledgeLink: <http://imc_host:port/imcrs/fault/alarm/delete/3665>; rel=delete...
<alarmDetail> <id>3665</id> <OID>1.3.6.1.4.1.2011.10.4.1.1.2.6.4</OID> <originalType>3</originalType> <originalTypeDesc>iMC</originalTypeDesc> <device>http://imc_host:8080/imcrs/plat/res/device/181</device> <deviceIp>10.153.88.34</deviceIp> <deviceName>Quidway</deviceName> ...</alarmDetail>
286 Network Alarm Management
Query Root Alarm InformationQuery the root alarm for an alarm with the specified ID.
Interface URI/fault/alarm/rootAlarm/{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:
Recover alarmrecover
Acknowledge alarmacknowledge
Delete alarmdelete
Message body
<alarmDetail> <id>51</id> <OID>1.3.6.1.4.1.2011.10.4.2.2.2.6.11</OID> <originalType>3</originalType> <originalTypeDesc>iMC</originalTypeDesc> <deviceId>0</deviceId> <deviceIp>127.0.0.1</deviceIp> <deviceName>NMS</deviceName> <alarmLevel>5</alarmLevel> ...</alarmDetail>
For meanings of the fields in the returned value, see “Query Alarm Information.”
Query Root Alarm Information 287
ExampleQuery information about the root alarm with ID 324.
Request
GET http://imc_host:8080/imcrs/fault/alarm/rootAlarm/324accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xmlLink: <http://imc_host:port/imcrs/fault/alarm/recover/51>; rel=recoverLink: <http://imc_host:port/imcrs/fault/alarm/acknowledge/51>; rel=acknowledgeLink: <http://imc_host:port/imcrs/fault/alarm/delete/51>; rel=delete...
<alarmDetail> <id>51</id> <OID>1.3.6.1.4.1.2011.10.4.2.2.2.6.11</OID> <originalType>3</originalType> <originalTypeDesc>iMC</originalTypeDesc> <deviceId>0</deviceId> <deviceIp>127.0.0.1</deviceIp> <deviceName>NMS</deviceName> <alarmLevel>5</alarmLevel> ...</alarmDetail>
288 Network Alarm Management
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.
HTTP/1.1 200 OKTotal: 116
Query Child Alarms 289
Message body
<list> <alarm> <id>324</id> <OID>1.3.6.1.4.1.2011.10.4.1.2.2.6.2</OID> <originalType>3</originalType> <originalTypeDesc>iMC</originalTypeDesc> <deviceId>94</deviceId> <deviceIp>10.153.88.26</deviceIp> <deviceName>daemon8826</deviceName> ... <alarmDetail>http://imc_host:port/imcrs/fault/alarm/324</alarmDetail> </alarm> ... <link rel="next" href="http://imc_host:port/imcrs/fault/alarm/childAlarm/51?start=10&size=10"/></list>
For meanings of the fields in the returned value, see “Query Alarm Information.”
ExampleQuery and list the 12th to the 20th child alarms of the alarm with ID 51.
Request
GET http://imc_host:8080/imcrs/fault/alarm/childAlarm/51?start=12&size=8accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <alarm> <id>298</id> <OID>1.3.6.1.4.1.2011.10.4.1.2.2.6.1</OID> <originalType>3</originalType> <originalTypeDesc>iMC</originalTypeDesc> <deviceId>14</deviceId> <deviceIp>10.153.89.84</deviceIp> <deviceName>esximf</deviceName> ... <alarmDetail>http://imc_host:port/imcrs/fault/alarm/298</alarmDetail> </alarm> ... <link rel="previous" href="http://imc_host:port/imcrs/fault/alarm/childAlarm/51?start=4&size=8"/> <link rel="next" href="http://imc_host:port/imcrs/fault/alarm/childAlarm/51?start=20&size=8"/></list>
290 Network Alarm Management
Query Top N Alarming DevicesQuery and list top N devices that include the specified alarm level.
Interface URI/fault/alarmDevice
Access Method
HTTPGET
Parameters
Query parameters
Alarm level.alarmLevelInteger type, supporting multiple elements. Optional. No default value. For the valid values, seeQuery Alarm Levels.
The total number of returned records.sizeInteger type. Optional. The default value is 10. If a negative value is uploaded, the default value isused.
Returned Result
Status codes
• 200 (OK): Success.
Message header
Message body
<list> <alarmDevice> <device>http://imc_host:8080/imcrs/plat/res/device/181</device> <alarmCount>3</alarmCount> <alarmLevel>1</alarmLevel> ... </alarmDevice></list>
Elements
alarmDevice sub-elements
Device ID.deviceIdLong integer type.
The total number of alarms of the specified level.alarmCountLong integer type.
Alarm level.alarmLevelInteger type.
Query Top N Alarming Devices 291
ExampleQuery the top 10 devices with the most number of emergency alarms (level 1).
Request
GET http://imc_host:8080/imcrs/fault/alarmDevice?alarmLevel=1&size=10accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <alarmDevice> <device>http://imc_host:8080/imcrs/plat/res/device/181</device> <alarmCount>3</alarmCount> <alarmLevel>1</alarmLevel> ... </alarmDevice></list>
292 Network Alarm Management
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.
HTTP/1.1 200 OKTotal: 495
Message body
<list> <trapEnterprise> <enterpriseId>1.3.6.1.4.1.43</enterpriseId> <enterpriseName>3Com</enterpriseName> <trapEvents>http://imc_host:port/imcrs/fault/trapEvent?trapEnterpriseId=1.3.6.1.4.1.43</trapEvents> </trapEnterprise> ...</list>
Elements
trapEnterprise sub-elements
Enterprise ID, which uniquely identifies an enterprise.enterpriseIdString type.
Enterprise name.enterpriseNameString type.
Link to the current alarm events.trapEventsURI type.
Query Alarming Enterprises 293
ExampleQuery and list all alarming enterprises.
Request
GET http://imc_host:8080/imcrs/fault/trapEnterpriseaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <trapEnterprise> <enterpriseId>1.3.6.1.2.1.47.2</enterpriseId> <enterpriseName>Entity MIB</enterpriseName> <trapEvents>http://imc_host:8080/imcrs/fault/trapEvent?trapEnterpriseId=1.3.6.1.2.1.47.2</trapEvents> </trapEnterprise> ...</list>
294 Network Alarm Management
Query Alarm EventsQuery and list alarm events.
Interface URI/fault/trapEvent
Access Method
HTTPGET
Parameters
Query parameters
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
<list> <trapEvent> <eventOID>1.3.6.1.4.1.43.6.1</eventOID> <eventName>3COM_1</eventName> <specificID>1</specificID> </trapEvent> ...</list>
296 Network Alarm Management
Query Alarm CategoriesQuery and list the alarm categories.The results include all alarm main categories, sub-categories, and their descriptions.
Interface URI/fault/alarmCategory
Access Method
HTTPGET
Returned Result
Status codes
• 200 (OK): Success.
Message body
<list> <alarmCategory> <id>1</id> <baseClass>1</baseClass> <subClass>1</subClass> <baseDesc>Other Alarms</baseDesc> <subDesc>Other Alarms</subDesc> </alarmCategory> <alarmCategory> <id>2</id> <baseClass>2</baseClass> <subClass>1</subClass> <baseDesc>Device Alarm</baseDesc> <subDesc>Device Availability Alarm/subDesc> </alarmCategory> <alarmCategory> <id>3</id> <baseClass>2</baseClass> <subClass>2</subClass> <baseDesc>Device Alarm</baseDesc> <subDesc>Interface\Link Status Alarm</subDesc> </alarmCategory> ...</list>
Query Alarm Categories 297
Elements
alarmCategory sub-elements
Alarm category ID, which uniquely identifies an alarm category.idLong integer type.
Alarm main category.baseClassLong integer type.
Main category description.baseDescString type.
Alarm sub-category.subClassLong integer type.
Sub-category description.subDescString type.
ExampleQuery and list all alarm categories.
Request
GET http://imc_host:8080/imcrs/fault/alarmCategoryaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <alarmCategory> <id>2</id> <baseClass>2</baseClass> <subClass>1</subClass> <baseDesc>Device alarm</baseDesc> <subDesc>Device reachability alarm</subDesc> </alarmCategory> ...</list>
298 Network Alarm Management
Query Alarm LevelsQuery and list the alarm levels.The results include all alarm levels and their descriptions.
Interface URI/fault/alarmLevel
Access Method
HTTPGET
Returned Result
Status codes
• 200 (OK): Success.
Message body
<list> <alarmLevel> <id>255</id> <desc>All levels</desc> </alarmLevel> <alarmLevel> <id>1</id> <desc>Critical</desc> </alarmLevel> <alarmLevel> <id>2</id> <desc>Major</desc> </alarmLevel> <alarmLevel> <id>3</id> <desc>Minor</desc> </alarmLevel> <alarmLevel> <id>4</id> <desc>Warning</desc> </alarmLevel> <alarmLevel> <id>5</id> <desc>Informational</desc> </alarmLevel></list>
Elements
alarmLevel sub-elements
Alarm level ID, which uniquely identifies an alarm level.idInteger type.
Alarm level description.descString type.
Query Alarm Levels 299
ExampleQuery and list all alarm levels.
Request
GET http://imc_host:8080/imcrs/fault/alarmLevelaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <alarmLevel> <id>1</id> <desc>Critical</desc> </alarmLevel> ...</list>
300 Network Alarm Management
Query Alarm Source TypesQuery and list the alarm source types.The results include all alarm source types and their descriptions. Interface URI
Interface URI/fault/alarmOriginalType
Access Method
HTTPGET
Returned Result
Status codes
• 200 (OK): Success.
Message body
<list> <alarmOriginalType> <id>0</id> <desc>All types</desc> </alarmOriginalType> <alarmOriginalType> <id>1</id> <desc>Trap</desc> </alarmOriginalType> <alarmOriginalType> <id>2</id> <desc>Syslog</desc> </alarmOriginalType> <alarmOriginalType> <id>3</id> <desc>iMC</desc> </alarmOriginalType></list>
Elements
alarmOriginalType sub-elements
Alarm source ID, which uniquely identifies an alarm source type.idInteger type.
Description of the alarm source type.descString type.
Query Alarm Source Types 301
ExampleQuery and list all alarm source types.
Request
GET http://imc_host:8080/imcrs/fault/alarmOriginalTypeaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <alarmOriginalType> <id>1</id> <desc>Trap</desc> </alarmOriginalType> ...</list>
302 Network Alarm Management
Query Alarm Recovery StatusQuery and list alarm recovery status.The results include the recovery status of all alarms and their descriptions.
Interface URI/fault/alarmRecStatus
Access Method
HTTPGET
Returned Result
Status codes
• 200 (OK): Success.
Message body
<list> <alarmRecStatus> <id>255</id> <desc>All status</desc> </alarmRecStatus> <alarmRecStatus> <id>1</id> <desc>Recovered</desc> </alarmRecStatus> <alarmRecStatus> <id>0</id> <desc>Unrecovered</desc> </alarmRecStatus></list>
Elements
alarmRecStatus sub-elements
Alarm recovery status ID, which uniquely identifies an alarm recovery state.idInteger type.
Alarm recovery status description.descString type.
Query Alarm Recovery Status 303
ExampleQuery and list all alarm recover status.
Request
GET http://imc_host:8080/imcrs/fault/alarmRecStatusaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <alarmRecStatus> <id>1</id> <desc>Recovered</desc> </alarmRecStatus> ...</list>
304 Network Alarm Management
Query Alarm Acknowledgement StatusQuery and list alarm acknowledgement status.The results include the acknowledgement status of all alarms and their descriptions.
Interface URI/fault/alarmAckStatus
Access Method
HTTPGET
Returned Result
Status codes
• 200 (OK): Success.
Message body
<list> <alarmAckStatus> <id>255</id> <desc>All status</desc> </alarmAckStatus> <alarmAckStatus> <id>1</id> <desc>Acknowledged</desc> </alarmAckStatus> <alarmAckStatus> <id>0</id> <desc>Unacknowledged</desc> </alarmAckStatus></list>
Elements
alarmAckStatus sub-elements
Alarm acknowledgement status ID, which uniquely identifies an alarm acknowledge state.idInteger type.
Alarm acknowledgement status description.descString type.
Query Alarm Acknowledgement Status 305
Query Alarm Time RangesQuery and list alarm time ranges.The results include all alarm time ranges and their descriptions.
Interface URI/fault/alarmTimeRange
Access Method
HTTPGET
Returned Result
Status codes
• 200 (OK): Success.
Message body
<list> <alarmTimeRange> <id>255</id> <desc>All alarms</desc> </alarmTimeRange> <alarmTimeRange> <id>0</id> <desc>Last 1 hour</desc> </alarmTimeRange> <alarmTimeRange> <id>1</id> <desc>Last 2 hours</desc> </alarmTimeRange> ...</list>
Elements
alarmTimeRange sub-elements
Alarm time range ID, which uniquely identifies an alarm time range.idInteger type.
Alarm time range description.descString type.
306 Network Alarm Management
ExampleQuery and list all alarm time ranges.
Request
GET http://imc_host:8080/imcrs/fault/alarmTimeRangeaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <alarmTimeRange> <id>0</id> <desc>Last 1 hour</desc> </alarmTimeRange> ...</list>
Query Alarm Time Ranges 307
Recover AlarmRecover an alarm with the specified ID.
Interface URI/fault/alarm/recover/{id}
Access Method
HTTPPUT
Parameters
Path parameters
Alarm ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
ExampleRecover the alarm with ID 3665.
Request
PUT http://imc_host:8080/imcrs/fault/alarm/recover/3665accept: application/xml...
Response
HTTP/1.1 204 No Content...The message body is empty.
308 Network Alarm Management
Acknowledge AlarmAcknowledge an alarm with the specified ID.
Interface URI/fault/alarm/acknowledge/{id}
Access Method
HTTPPUT
Parameters
Path parameters
Alarm ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
ExampleAcknowledge the alarm with ID 3665.
Request
PUT http://imc_host:8080/imcrs/fault/alarm/acknowledge/3665accept: application/xml...
Response
HTTP/1.1 204 No Content...The message body is empty.
Acknowledge Alarm 309
Delete AlarmDelete an alarm with the specified ID.
Interface URI/fault/alarm/delete/{id}
Access Method
HTTPDELETE
Parameters
Path parameters
Alarm ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
ExampleDelete the alarm with ID 3665.
Request
DELETE http://imc_host:8080/imcrs/fault/alarm/delete/3665accept: application/xml...
Response
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.
Alarm event OID.eventOidString type, supporting multiple elements. Optional. No default value.
Returned Result
Status codes
• 202 (Accepted): Successfully registered.
Message header
HTTP/1.1 202 AcceptedContent-Type: application/xml
Register Send-Alarm-to-Server Event 311
ExampleReregister the send-alarm-to-server event and send all alarms to the server.
Request
GET http://imc_host:8080/imcrs/events?uuid=025c4630-7e38-4a70-bb1c-b47c8d446764&type=11accept: application/xml...
Response
HTTP/1.1 202 AcceptedContent-Type: application/xml...
312 Network Alarm Management
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.
Interface URI/syslog/filter/currentUnmanagedDeviceRuleState/
Access Method
HTTPGET
Returned Result
Status codes
• 200 (OK): Success.
Message body
<list> <unmanagedDeviceRuleStatus> <status>1</status> <desc>Enabled</desc> </unmanagedDeviceRuleStatus> <unmanagedDeviceRuleStatus> <status>0</status> <desc>Disabled</desc> </unmanagedDeviceRuleStatus></list>
Elements
unmanagedDeviceRuleStatus sub-elements
Status of the filtering rule for unmanaged devices.statusInteger type.
Description of the status of the filtering rule for unmanaged devices.descString type.
318 Network Syslog Management
ExampleQuery the status of the filtering rule for unmanaged devices.
Request
GET http://imc_host:8080/imcrs/syslog/filter/currentUnmanagedDeviceRuleState/accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<unmanagedDeviceRuleStatus> <status>0</status> <desc>Disabled</desc></unmanagedDeviceRuleStatus>
Query Unmanaged Device Filtering Rule Status 319
Query Unmanaged Device Filtering Rule Status ListQuery the unmanaged device filtering rule status list.
Interface URI/syslog/filter/unmanagedDeviceRuleStates/
Access Method
HTTPGET
Returned Result
Status codes
• 200 (OK): Success.
Message body
<list> <unmanagedDeviceRuleStatus> <status>1</status> <desc>Enabled</desc> </unmanagedDeviceRuleStatus> <unmanagedDeviceRuleStatus> <status>0</status> <desc>Disabled</desc> </unmanagedDeviceRuleStatus></list>
Elements
unmanagedDeviceRuleStatus sub-elements
Status of the filtering rule for unmanaged devices.statusInteger type.
Description of the status of the filtering rule for unmanaged devices.descString type.
320 Network Syslog Management
ExampleQuery the unmanaged device filtering rule status list.
Request
GET http://imc_host:8080/imcrs/syslog/filter/unmanagedDeviceRuleStates/accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <unmanagedDeviceRuleStatus> <status>1</status> <desc>Enabled</desc> </unmanagedDeviceRuleStatus> <unmanagedDeviceRuleStatus> <status>0</status> <desc>Disabled</desc> </unmanagedDeviceRuleStatus></list>
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.
Interface URI/syslog/filter/currentUnmanagedDeviceRuleState/{id}
Access Method
HTTPPUT
Parameters
Path parameters
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 Single Instance Performance Details
• Query Single-Index TopN Data
• Add Custom Performance Index
• Delete Custom Performance Index
323
Query SummariesQuery and list summaries.
Interface URI/perf/summary
Access Method
HTTPGET
ParametersNone
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<list> <summary> <sumId>1</sumId> <sumName>System</sumName> <groupList>http://imc_host:8080/imcrs/perf/group/1</groupList> </summary> ...</list>
Elements
summary sub-elements
Summary ID.sumIdInteger type.
Summary name.sumNameString type.
URI of the index group list.groupListString type.
324 Network Performance Management
ExampleQuery and list all summaries.
Request
GET http://imc_host:8080/imcrs/perf/summaryaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <summary> <sumId>1</sumId> <sumName>System</sumName> <groupList>http://imc_host:8080/imcrs/perf/group/1</groupList> </summary> ...</list>
Query Summaries 325
Query Index GroupsQuery and list the performance index groups.
Interface URI/perf/group
Access Method
HTTPGET
ParametersNone
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<list> <group> <sumId>1</sumId> <groupId>1</groupId> <groupName>CPU Usage</groupName> <interfaceFlag>0</interfaceFlag> <summary>http://imc_host:8080/imcrs/perf/summary/1</summary> <perfTask>http://imc_host:8080/imcrs/perf/task/1,1</perfTask> </group></list>
Elements
group sub-elements
Summary ID.sumIdInteger type.
Index group ID.groupIdInteger type.
Index group name.groupNameString type.
Interface flag.interfaceFlagInteger type.
URI of the summary.summary
326 Network Performance Management
group sub-elements
String type
URI of the index group list.perfTaskString type.
ExampleQuery and list all performance index groups.
Request
GET http://imc_host:8080/imcrs/perf/groupaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <group> <sumId>1</sumId> <groupId>1</groupId> <groupName>CPU Usage</groupName> <interfaceFlag>0</interfaceFlag> <summary>http://imc_host:8080/imcrs/perf/summary/1</summary> <perfTask>http://imc_host:8080/imcrs/perf/task/1,1</perfTask> </group> ....</list>
Query Index Groups 327
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.
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<list> <task> <taskId>1</taskId> <taskName>Interface Receiving Rate(bits/s)</taskName> <taskDescr>Interface Receiving Rate</taskDescr> <tempId>2048</tempId> <alarmOneThresholdFirst>1.0E7</alarmOneThresholdFirst> <alarmOneThresholdSecond>0.0</alarmOneThresholdSecond> <alarmTwoTimes>3</alarmTwoTimes> <componentID>0</componentID> <unitId>220</unitId> <sumId>1</sumId> <groupId>6</groupId> <perfTemplate>http://imc_host:8080/imcrs/perf/task/template/1</perfTemplate> <tempUnitDependList>http://imc_host:8080/imcrs/perf/task/units/1</tempUnitDependList> <tempUnit>http://imc_host:8080/imcrs/perf/task/unit/1</tempUnit> </task> ...</list>
328 Network Performance Management
Elements
task sub-elements
Index ID.taskIdInteger type.
Index name.taskNameString type.
Index description.taskDescrString type.
Template ID.tempIdString type.
Threshold 1 of alarm 1.alarmOneThresholdFirstDouble-precision floating-point type.
Threshold 2 of alarm 1. The value is not equal to 0 when a range is specified, and is equalto 0 in other cases.
alarmOneThresholdSecond
Double-precision floating-point type.
Repeat time of alarm 2, which is counted when the alarm continuously falls in the alarmrange.
alarmTwoTimes
Integer type.
Component ID.componentIDInteger type.
Unit ID. If there is no unit, the value is 0.unitIdInteger type.
Summary ID.sumIdInteger type.
Index group ID.groupIdInteger type.
Template URI.perfTemplateString type.
URI of the unit set.tempUnitDependListString type.
Unit URI.tempUnitString type.
Example1. Query all performance tasks.
Request
GET http://imc_host:8080/imcrs/perf/taskaccept: application/xml...
Query Performance Indexes 329
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <task> <taskId>1</taskId> <taskName>Interface Receiving Rate(bits/s)</taskName> <taskDescr>Interface Receiving Rate</taskDescr> <tempId>2048</tempId> <alarmOneThresholdFirst>1.0E7</alarmOneThresholdFirst> <alarmOneThresholdSecond>0.0</alarmOneThresholdSecond> <alarmTwoTimes>3</alarmTwoTimes> <componentID>0</componentID> <unitId>220</unitId> <sumId>1</sumId> <groupId>6</groupId> <perfTemplate>http://imc_host:8080/imcrs/perf/task/template/1</perfTemplate> <tempUnitDependList>http://imc_host:8080/imcrs/perf/task/units/1</tempUnitDependList> <tempUnit>http://imc_host:8080/imcrs/perf/task/unit/1</tempUnit> </task> ...</list>
2. Query a performance task with the specified ID.
Request
GET http://imc_host:8080/imcrs/perf/task/get/1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<task> <taskId>1</taskId> <taskName>Interface Receiving Rate(bits/s)</taskName> <taskDescr>Interface Receiving Rate</taskDescr> <tempId>2048</tempId> <alarmOneThresholdFirst>1.0E7</alarmOneThresholdFirst> <alarmOneThresholdSecond>0.0</alarmOneThresholdSecond> <alarmTwoTimes>3</alarmTwoTimes> <componentID>0</componentID> <unitId>220</unitId> <sumId>1</sumId> <groupId>6</groupId> <perfTemplate>http://imc_host:8080/imcrs/perf/task/template/1</perfTemplate> <tempUnitDependList>http://imc_host:8080/imcrs/perf/task/units/1</tempUnitDependList> <tempUnit>http://imc_host:8080/imcrs/perf/task/unit/1</tempUnit></task>
330 Network Performance Management
Query Single-Device Single-Index InstancesQuery and list the instances for the specified index on the specified device.
Interface URI/perf/monitor
Access Method
HTTPGET
Parameters
Query parameters
Device ID. Long integer type. Required. No default value. For the valid values, see “Query DeviceInformation.”
devId
Index ID. Long integer type. Required. No default value. For the valid values, see “Query PerformanceIndexes.”
taskId
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<list> <perfInstance> <deviceName>z00592z(10.153.88.22)</deviceName> <taskId>1</taskId> <instanceId>80</instanceId> <instanceName>[Interface:Software Loopback Interface 1]</instanceName> <ipAddress>10.153.88.22</ipAddress> <unit/> <value/> </perfInstance> ...</list>
Element description
VLAN sub-elements
Device name.deviceNameString type.
Item IDtaskIdInteger type.
Instance ID.instanceId
Query Single-Device Single-Index Instances 331
VLAN sub-elements
String type.
Instance name.instanceNameString type.
IP address.ipAddressString type.
ExampleQuery the performance summary data with the original data for index ID 1 on the device whoseID is 25.
Request
GET http://imc_host:port/imcrs/perf/monitor/25,1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <perfInstance> <deviceName>z00592z(10.153.88.22)</deviceName> <taskId>1</taskId> <instanceId>80</instanceId> <instanceName>[Interface:Software Loopback Interface 1]</instanceName> <ipAddress>10.153.88.22</ipAddress> <unit/> <value/> </perfInstance> ...</list>
332 Network Performance Management
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
Message body
<list> <perfSummaryData> <taskId>1</taskId> <taskName>Interface Receiving Rate(bits/s)</taskName> <devId>1</devId> <instId>504</instId> <objIndex>1</objIndex> <objIndexDesc>[interface:InLoopBack0]</objIndexDesc> <averageValue>0.0</averageValue> <maximumValue>0.0</maximumValue> <minimumValue>0.0</minimumValue> <currentValue>0.0</currentValue> <summaryValue>0.0</summaryValue> </perfSummaryData> ....</list>
For meanings of the fields in the returned value, see ““Query Single-Index Single-InterfacePerformance Summary Data” (page 336).”
ExampleQuery the performance summary data with the original data for index ID 1 on the device whoseID is 25.
Request
GET http://imc_host:port/imcrs/perf/summaryData?taskId=1&devId=25&dataGranularity=1accept: application/xml.
334 Network Performance Management
Response
Content-Type: application/xml...<list> <perfSummaryData> <taskId>1</taskId> <taskName>Interface Receiving Rate(bits/s)</taskName> <devId>1</devId> <instId>504</instId> <objIndex>1</objIndex> <objIndexDesc>[interface:InLoopBack0]</objIndexDesc> <averageValue>0.0</averageValue> <maximumValue>0.0</maximumValue> <minimumValue>0.0</minimumValue> <currentValue>0.0</currentValue> <summaryValue>0.0</summaryValue> </perfSummaryData> <perfSummaryData> <taskId>1</taskId> <taskName>Interface Receiving Rate(bits/s)</taskName> <devId>1</devId> <instId>505</instId> <objIndex>2</objIndex> <objIndexDesc>[interface:NULL0]</objIndexDesc> <averageValue>0.0</averageValue> <maximumValue>0.0</maximumValue> <minimumValue>0.0</minimumValue> <currentValue>0.0</currentValue> <summaryValue>0.0</summaryValue> </perfSummaryData> <perfSummaryData> <taskId>1</taskId> <taskName>Interface Receiving Rate(bits/s)</taskName> <devId>1</devId> <instId>510</instId> <objIndex>40</objIndex> <objIndexDesc>[interface:LoopBack0]</objIndexDesc> <averageValue>49.975</averageValue> <maximumValue>49.975</maximumValue> <minimumValue>49.975</minimumValue> <currentValue>49.975</currentValue> <summaryValue>49.975</summaryValue> </perfSummaryData> <perfSummaryData> <taskId>1</taskId> <taskName>Interface Receiving Rate(bits/s)</taskName> <devId>1</devId> <instId>511</instId> <objIndex>42</objIndex> <objIndexDesc>[interface:Ethernet1/0]</objIndexDesc> <averageValue>13781.966</averageValue> <maximumValue>13781.966</maximumValue> <minimumValue>13781.966</minimumValue> <currentValue>13781.966</currentValue> <summaryValue>13781.966</summaryValue> <minimumValue>13781.966</minimumValue> <currentValue>13781.966</currentValue> <summaryValue>13781.966</summaryValue> </perfSummaryData>
Query Single-Index Multi-Device Performance Summary Data 335
Query Single-Index Single-Interface Performance Summary DataQuery single-index single-interface performance summary data with certain criteria.
Interface URI/perf/summaryData/interface
Access Method
HTTPGET
Parameters
Query parameters
Index ID. Integer type. Required. No default value. For the valid values, see “Query PerformanceIndexes.”
taskId
Device ID. Integer type. Required. No default value. For the valid values, see “Query DeviceInformation.”
devId
Start time. Long integer type. Optional. The value is the seconds counted from 00:00 on January 1,1970 to the specified time.
beginTime
End time. Long integer type. Optional. The value is the seconds counted from 00:00 on January 1,1970 to the specified time.
endTime
Instance index. Integer type. Required. No default value.objIndex
Data granularity. Integer type. Optional. No default value. Valid values include 0 (automaticallycalculated data), 1 (original data), 2 (hourly data), and 3 (daily data).
dataGranularity
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<perfSummaryData> <taskId>1</taskId> <taskName>Interface Receiving Rate(bits/s)</taskName> <devId>1</devId> <instId>504</instId> <objIndex>1</objIndex> <objIndexDesc>[interface:InLoopBack0]</objIndexDesc> <averageValue>0.0</averageValue> <maximumValue>0.0</maximumValue> <minimumValue>0.0</minimumValue> <currentValue>0.0</currentValue> <summaryValue>0.0</summaryValue> </perfSummaryData>
336 Network Performance Management
Elements
perfSummaryData sub-elements
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...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<perfSummaryData> <taskId>1</taskId> <taskName>Interface Receiving Rate(bits/s)</taskName> <devId>1</devId> <instId>505</instId> <objIndex>2</objIndex> <objIndexDesc>[interface:NULL0]</objIndexDesc> <averageValue>0.0</averageValue> <maximumValue>0.0</maximumValue> <minimumValue>0.0</minimumValue> <currentValue>0.0</currentValue> <summaryValue>0.0</summaryValue></perfSummaryData>
338 Network Performance Management
Query Single Instance Performance DetailsQuery single-instance performance details with certain criteria.
Interface URI/perf/summaryData/detail
Access Method
HTTPGET
Parameters
Query parameters
Index ID. Integer type. Required. No default value. For the valid values, see Query PerformanceIndexes.
taskId
Device ID. Integer type. Required. No default value. For the valid values, see Query Devices.devId
Start time. Long integer type. Optional. The value is the seconds counted from 00:00 on January 1,1970 to the specified time.
beginTime
End time. Long integer type. Optional. The value is the seconds counted from 00:00 on January 1,1970 to the specified time.
endTime
Instance ID. Integer type. Required. No default value.instId
Data granularity. Integer type. Optional. No default value. Valid values include 0 (automaticallycalculated data), 1 (original data), 2 (hourly data), and 3 (daily data).
dataGranularity
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<list> <perfDetailData> <dataVal>3.0</dataVal> <dataTime>2011-06-20T16:56:25+08:00</dataTime> <dataTimeStr>2011-06-20 16:56:25</dataTimeStr> <dataType>0</dataType> <minVal>3.0</minVal> <maxVal>3.0</maxVal> <sumVal>3.0</sumVal> <sumCount>1</sumCount> </perfDetailData> </list>
Query Single Instance Performance Details 339
Elements
perfSummaryData sub-elements
Data value.dataValDouble-precision floating-point type.
Data time.dataTimeString type.
Data time displayed.dataTimeStrString type.
Data type.dataTypeInteger type.
Minimum value.minValDouble-precision floating-point type.
Maximum value.maxValDouble-precision floating-point type.
Summarized value.sumValDouble-precision floating-point type.
Data summary count.sumCountInteger type.
ExampleQuery performance details of the monitor instance with ID 1, which belongs to the index with ID2 on the device whose ID is 2.
Request
GET http://imc_host:port/imcrs/perf/summaryData/detail?devId=2&taskId=2&instID=1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <perfDetailData> <dataVal>3.0</dataVal> <dataTime>2011-06-20T16:56:25+08:00</dataTime> <dataTimeStr>2011-06-20 16:56:25</dataTimeStr> <dataType>0</dataType> <minVal>3.0</minVal> <maxVal>3.0</maxVal> <sumVal>3.0</sumVal> <sumCount>1</sumCount> </perfDetailData></list>
340 Network Performance Management
Query Single-Index TopN DataQuery single-index topN data with certain criteria.
Interface URI/perf/topNData
Access Method
HTTPGET
Parameters
Query parameters
Index ID.taskIdInteger type. Required. No default value. For the valid values, see Query Performance Indexes.
Start time.beginTimeLong integer type. Optional. The value is the seconds counted from 00:00 on January 1, 1970 tothe specified time.
End time.endTimeLong integer type. Optional. The value is the seconds counted from 00:00 on January 1, 1970 tothe specified time.
Number of entries.topNInteger type. Optional. The default value is 5.
Returned Result
Status codes
• 200 (OK): Success.
Message header
HTTP/1.1 200 OK
Message body
<list> <perfTopNData> <taskId>1</taskId> <devId>42</devId> <instId>831</instId> <objIndex>4228057</objIndex> <objIndexDesc>[interface:GigabitEthernet1/1/3]</objIndexDesc> <dataVal>18017.037</dataVal> <thresholdQuadrant>0</thresholdQuadrant> <alarmLevel>-1</alarmLevel> </perfTopNData> ...</list>
Query Single-Index TopN Data 341
Elements
perfTopNData sub-elements
Index ID, which uniquely identifies an index.taskIdInteger type.
Device ID.devIdInteger type.
Instance ID.instIdInteger type.
Object index.objIndexString type.
Object index description(or instance name).objIndexDescString type.
Average data value.dataValDouble-precision floating-point type.
Threshold range.thresholdQuadrantInteger type.
Alarm level.alarmLevelInteger type.
ExampleQuery and list the top 5 performance data for index with ID 1.
Request
GET http://imc_host:port/imcrs/perf/topNData?taskId=1&topN=5accept: application/xml...
342 Network Performance Management
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <perfTopNData> <taskId>1</taskId> <devId>31</devId> <instId>611</instId> <objIndex>289407425</objIndex> <objIndexDesc>[interface:GigabitEthernet5/1/2]</objIndexDesc> <dataVal>31191.175</dataVal> <thresholdQuadrant>0</thresholdQuadrant> <alarmLevel>-1</alarmLevel> </perfTopNData> <perfTopNData> <taskId>1</taskId> <devId>31</devId> <instId>664</instId> <objIndex>503316929</objIndex> <objIndexDesc>[interface:GigabitEthernet8/1/2]</objIndexDesc> <dataVal>20852.936</dataVal> <thresholdQuadrant>0</thresholdQuadrant> <alarmLevel>-1</alarmLevel> </perfTopNData> <perfTopNData> <taskId>1</taskId> <devId>42</devId> <instId>831</instId> <objIndex>4228057</objIndex> <objIndexDesc>[interface:GigabitEthernet1/1/3]</objIndexDesc> <dataVal>17566.926</dataVal> <thresholdQuadrant>0</thresholdQuadrant> <alarmLevel>-1</alarmLevel> </perfTopNData> <perfTopNData> <taskId>1</taskId> <devId>31</devId> <instId>581</instId> <objIndex>4228041</objIndex> <objIndexDesc>[interface:GigabitEthernet1/1/1]</objIndexDesc> <dataVal>16502.646</dataVal> <thresholdQuadrant>0</thresholdQuadrant> <alarmLevel>-1</alarmLevel> </perfTopNData> <perfTopNData> <taskId>1</taskId> <devId>31</devId> <instId>534</instId> <objIndex>4227634</objIndex> <objIndexDesc>[interface:Ethernet1/0/2]</objIndexDesc> <dataVal>14941.145</dataVal> <thresholdQuadrant>0</thresholdQuadrant> <alarmLevel>-1</alarmLevel> </perfTopNData></list>
Query Single-Index TopN Data 343
Add Custom Performance IndexAdd a custom performance index.
Interface URI/perf/task
Access Method
HTTPPOST
Message body
<perfItem> <itemName>Added Task</itemName> <unitType>1</unitType> <selectDefaultUnit>10</selectDefaultUnit> <userAddUnit>bps</userAddUnit> <unit>kb/s</unit> <indexType>[index1[2]:interface:1:0]</indexType> <indexDesc>1.3.6.1.2.1.2.2.1.2</indexDesc> <itemFunction>((1.3.6.1.2.1.2.2.1.10-1.3.6.1.2.1.2.2.1.10')+(1.3.6.1.2.1.2.2.1.16-1.3.6.1.2.1.2.2.1.16'))/t</itemFunction></perfItem>
Element description
perfItem sub-elements
Index name.itemNameString type. Required. No default value.
Unit type.unitTypeInteger type. Optional. No default value.
Pre-defined unit selected.selectDefaultUnitInteger type. Optional. No default value.
User-defined unit.userAddUnitString type. Optional. No default value.
Index unit.unitString type. Optional. No default value.
Index type.indexTypeString type. Required. No default value. Valid values can be successfully created.
OID of the index description.indexDescString type. Required. No default value. Valid values can be successfully created.
Index formula.itemFunctionString type. Required. No default value. Valid values can be successfully created.
Returned Result
Status codes
• 201 (Created): Success.
• 409 (Conflict): Failure. See “Error Codes.”
344 Network Performance Management
Message headerIf the operation succeeds, the Location field gives the URI of the new resource. The message bodyis empty.
HTTP/1.1 201 CreatedLocation: http://imc_host:port/imcrs/perf/task/1
ExampleAdd an index named test.
Request
POST http://imc_host:8080/imcrs/perf/taskaccept: application/xmlContent-Type: application/xml; charset=UTF-8...
<perfItem> <itemName>Added Task</itemName> <unitType>1</unitType> <selectDefaultUnit>10</selectDefaultUnit> <userAddUnit>bps</userAddUnit> <unit>kb/s</unit> <indexType>[index1[2]:interface:1:0]</indexType> <indexDesc>1.3.6.1.2.1.2.2.1.2</indexDesc> <itemFunction>((1.3.6.1.2.1.2.2.1.10-1.3.6.1.2.1.2.2.1.10')+(1.3.6.1.2.1.2.2.1.16-1.3.6.1.2.1.2.2.1.16'))/t</itemFunction></perfItem>
Response
HTTP/1.1 201 CreatedLocation: http://imc_host:port/imcrs/perf/task/1
Add Custom Performance Index 345
Delete Custom Performance IndexDelete a custom performance index with the specified ID.
Interface URI/perf/task/delete/{taskId}
Access Method
HTTPDELETE
Parameters
Path parameters
Index ID. Integer type. Required. No default value. For the valid values, see “Query PerformanceIndexes.”
taskId
Returned Result
Status codes
• 204 (No Content): Success.
• 409 (Conflict): Failure. See “Error Codes.”
• 410 (Gone): No data is found with the specified ID.
ExampleDelete the custom index with ID 234.
Request
DELETE http://imc_host:port/imcrs/perf/task/delete/800001accept: application/xml...
Response
HTTP/1.1 204 No Content...
The message body is empty.
346 Network Performance Management
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.
Interface URI/report/task
Access Method
HTTPGET
Parameters
Query parameters
Periodic report name.TaskNameString type, supporting wildcard characters. Optional. No default value.
Report template name.TemplateNameString type, supporting wildcard characters. Optional. No default value.
Periodic report type.TaskTypeInteger type. The default value is 1. Valid values include 1 (all), 2 (daily report), 3 (weekly report),4 (monthly report), 5 (quarterly report), 6 (half-yearly report), and 7 (yearly report).
Returned Result
Status codes
• 200 (OK): Success.
Message body
<list> <reportTask> <id>1</id> <name>Change report</name> <nextExecuteTime>2011-08-20T04:00:00+08:00</nextExecuteTime> <templateId>29</templateId> <templateName>Change report</templateName> <files>http://localhost:8080/imcrs/report/task/file/1</files> <link href="http://localhost:8080/imcrs/report/task/detail/1" op="GET" rel="self"/> </reportTask></list>
Elements
reportTask sub-elements
Periodic report ID, which uniquely identifies a periodic report.idLong integer type.
Periodic report name.nameString type.
Next execution time.nextExecuteTimeDate and time type.
Template ID.templateId
348 Report Management
reportTask sub-elements
Long integer type.
Report template name.templateNameString type.
URI of the report file list.filesString type.
ExampleQuery and list all periodic reports.
Request
GET http:/imc_host:8080/imcrs//report/taskaccept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml... <list> <reportTask> <id>1</id> <name>Change report</name> <nextExecuteTime>2011-08-20T04:00:00+08:00</nextExecuteTime> <templateId>29</templateId> <templateName>Change report</templateName> <link href="http://localhost:8080/imcrs/report/task/detail/1" op="GET" rel="self"/> <files>http://localhost:8080/imcrs/report/task/file/1</files> </reportTask></list>
Query Periodic Reports 349
Query Periodic Report DetailsQuery detailed information about a periodic report with the specified ID.
Interface URI/report/task/detail/{id}
Access Method
HTTPGET
Parameters
Path parameters
Periodic report ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message body
<reportTask> <id>1</id> <name>Change report</name> <nextExecuteTime>2011-08-20T04:00:00+08:00</nextExecuteTime> <templateId>29</templateId> <templateName>Change report</templateName> <files>http://localhost:8080/imcrs/report/task/file/1</files></reportTask>
Elements
reportTask sub-elements
Periodic report ID, which uniquely identifies a periodic report.idLong integer type.
Periodic report name.nameString type.
Next execution time.nextExecuteTimeDate and time type.
Template ID.templateIdLong integer type.
Report template name.templateNameString type.
350 Report Management
ExampleQuery information about the periodic report with ID 1.
Request
GET http://imc_host:8080/imcrs/report/task/detail/1accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml<reportTask> <id>1</id> <name>Change report</name> <nextExecuteTime>2011-08-20T04:00:00+08:00</nextExecuteTime> <templateId>29</templateId> <templateName>Change report</templateName> <files>http://localhost:8080/imcrs/report/task/file/1</files></reportTask>
Query Periodic Report Details 351
Query Periodic Report HistoriesQuery the histories of a periodic report with the specified ID.
Interface URI/report/task/file/{id}
Access Method
HTTPGET
Parameters
Path parameters
Periodic report ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message body
<list> <reportTaskResultFile> <taskId>1</taskId> <fileName>20101214.pdf</fileName> <file>http://localhost:8080/imcrs/report/task/download?taskId=1&fileName=20101214.pdf</file> </reportTaskResultFile> <link href="http://localhost:8080/imcrs/report/task/file/1?start=10&size=10" op="GET" rel="next"/></list>
Elements
reportTaskResultFile sub-elements
Periodic report ID.taskIdLong integer type.
History file name.fileNameString type.
URI of the report file list.fileString type.
352 Report Management
ExampleQuery and list the 10th to the 20th history reports for the periodic report with ID 1.
Request
GET http://imc_host:8080/imcrs/imcrs/report/task/file/1?start=10&size=10accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml... <list><reportTaskResultFile> <taskId>1</taskId> <fileName>20101222.pdf</fileName> <file>http://localhost:8080/imcrs/report/task/download?taskId=1&fileName=20101222.pdf</file></reportTaskResultFile></list>
Query Periodic Report Histories 353
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.
356 Network Asset Management
Returned Result
Status codes
• 200 (OK): Success.
Message body
<list><netAsset> <devId>27</devId> <phyIndex>1001</phyIndex> <deviceIp>10.153.89.231</deviceIp> <deviceName>aaa</deviceName> <desc>WS-C3750E-24TD - Provisioned</desc> <vendorType>1.3.6.1.4.1.9.12.3.1.3.589</vendorType> <containedIn>1</containedIn> <phyClass>3</phyClass> <relPos>1</relPos> <name>1</name> <hardVersion/> <firmwareVersion/> <softVersion/> <serialNum/> <mfgName/> <model/> <alias/> <isFRU>1</isFRU> <cleiCode/> <buildInfo/> <bom/> <boardNum/> <serverDate>2011-08-17T09:34:32+08:00</serverDate> <remark/> <assetNumber>234</assetNumber> <physicalFlag>0</physicalFlag> <device>http://localhost:8080/imcrs/plat/res/device/27</device> <asset>http://localhost:8080/imcrs/netasset/asset/detail?devId=27&phyIndex=1001</asset></netAsset></list>
Elements
netAsset sub-elements
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...
Response
HTTP/1.1 200 OKContent-Type: application/xml... <list><netAsset> <devId>27</devId> <phyIndex>1001</phyIndex> <deviceIp>10.153.89.231</deviceIp> <deviceName>aaa</deviceName> <desc>WS-C3750E-24TD - Provisioned</desc> <vendorType>1.3.6.1.4.1.9.12.3.1.3.589</vendorType> <containedIn>1</containedIn> <phyClass>3</phyClass> <relPos>1</relPos> <name>1</name> <hardVersion/> <firmwareVersion/> <softVersion/> <serialNum/> <mfgName/> <model/> <alias/> <isFRU>1</isFRU> <cleiCode/> <buildInfo/> <bom/> <boardNum/> <serverDate>2011-08-17T09:34:32+08:00</serverDate> <remark/> <assetNumber>234</assetNumber> <physicalFlag>0</physicalFlag> <device>http://localhost:8080/imcrs/plat/res/device/27</device> <asset>http://localhost:8080/imcrs/netasset/asset/detail?devId=27&phyIndex=1001</asset></netAsset></list>
Query Assets 359
Query Asset DetailsQuery details about an asset with the specified device ID and asset physical index.
Interface URI/netasset/asset/detail
Access Method
HTTPGET
Parameters
Query parameters
Device ID.devIdLong integer type. Required. No default value.
Asset physical index.phyIndexLong integer type. Required. No default value.
Returned Result
Status codes
• 200 (OK): Success.
Message body
<netAsset> <devId>27</devId> <phyIndex>1001</phyIndex> <deviceIp>10.153.89.231</deviceIp> <deviceName>aaa</deviceName> <desc>WS-C3750E-24TD - Provisioned</desc> <vendorType>1.3.6.1.4.1.9.12.3.1.3.589</vendorType> <containedIn>1</containedIn> <phyClass>3</phyClass> <relPos>1</relPos> <name>1</name> <hardVersion/> <firmwareVersion/> <softVersion/> <serialNum/> <mfgName/> <model/> <alias/> <isFRU>1</isFRU> <cleiCode/> <buildInfo/> <bom/> <boardNum/> <serverDate>2011-08-17T09:34:32+08:00</serverDate> <remark/> <assetNumber>234</assetNumber> <physicalFlag>0</physicalFlag> <device>http://localhost:8080/imcrs/plat/res/device/27</device></netAsset>
360 Network Asset Management
Elements
netAsset sub-elements
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...
Response
HTTP/1.1 200 OKContent-Type: application/xml<netAsset> <devId>27</devId> <phyIndex>1001</phyIndex> <deviceIp>10.153.89.231</deviceIp> <deviceName>aaa</deviceName> <desc>WS-C3750E-24TD - Provisioned</desc> <vendorType>1.3.6.1.4.1.9.12.3.1.3.589</vendorType> <containedIn>1</containedIn> <phyClass>3</phyClass> <relPos>1</relPos> <name>1</name> <hardVersion/> <firmwareVersion/> <softVersion/> <serialNum/> <mfgName/> <model/> <alias/> <isFRU>1</isFRU> <cleiCode/> <buildInfo/> <bom/> <boardNum/> <serverDate>2011-08-17T09:34:32+08:00</serverDate> <remark/> <assetNumber>234</assetNumber> <physicalFlag>0</physicalFlag> <device>http://localhost:8080/imcrs/plat/res/device/27</device></netAsset>
Query Asset Details 363
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.
HTTP/1.1 200 OKTotal: 20
Query VLANs 365
Message body
<list> <vlan> <vlanId>1</vlanId> <vlanName>VLAN 0001</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>2</vlanId> <vlanName>VLAN 0002</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>3</vlanId> <vlanName>VLAN 0003</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>4</vlanId> <vlanName>VLAN 0004</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>5</vlanId> <vlanName>VLAN 0005</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>6</vlanId> <vlanName>VLAN 0006</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>7</vlanId> <vlanName>VLAN 0007</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>8</vlanId> <vlanName>VLAN 0008</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>9</vlanId> <vlanName>VLAN 0009</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>10</vlanId> <vlanName>VLAN 0010</vlanName> <vlanStatus>1</vlanStatus> </vlan> <link href="http://localhost:8080/imcrs/vlan?start=10&size=10&devId=8" op="GET" rel="next"/></list>
Elements
VLAN sub-elements
VLAN ID, which uniquely identifies a VLAN.vlanIdInteger type.
VLAN name.vlanNameString type.
VLAN status. 1 for static. 2 for dynamic.vlanStatusInteger type.
366 Network Service Management
ExampleQuery and list information about the 10th to the 20th VLAN entries on the device whose ID is 8.
Request
GET http://imc_host:8080/imcrs/vlan?devId=8&start=10&size=10accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <vlan> <vlanId>10</vlanId> <vlanName>VLAN 0010</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>11</vlanId> <vlanName>VLAN 0011</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>12</vlanId> <vlanName>VLAN 0012</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>13</vlanId> <vlanName>VLAN 0013</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>14</vlanId> <vlanName>VLAN 0014</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>15</vlanId> <vlanName>VLAN 0015</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>16</vlanId> <vlanName>VLAN 0016</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>17</vlanId> <vlanName>VLAN 0017</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>18</vlanId> <vlanName>VLAN 0018</vlanName> <vlanStatus>1</vlanStatus> </vlan> <vlan> <vlanId>19</vlanId> <vlanName>VLAN 0019</vlanName> <vlanStatus>1</vlanStatus> </vlan> <link href="http://localhost:8080/imcrs/vlan?start=0&size=10&devId=8" op="GET" rel="previous"/> <link href="http://localhost:8080/imcrs/vlan?start=20&size=10&devId=8" op="GET" rel="next"/></list>
Query VLANs 367
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.
HTTP/1.1 200 OKTotal: 52
368 Network Service Management
Message body
<list> <interface> <ifIndex>4227626</ifIndex> </interface> <interface> <ifIndex>4227634</ifIndex> </interface> <interface> <ifIndex>4227642</ifIndex> </interface> <interface> <ifIndex>4227650</ifIndex> </interface> <interface> <ifIndex>4227658</ifIndex> </interface> <interface> <ifIndex>4227666</ifIndex> </interface> <interface> <ifIndex>4227674</ifIndex> </interface> <interface> <ifIndex>4227682</ifIndex> </interface> <interface> <ifIndex>4227690</ifIndex> </interface> <interface> <ifIndex>4227698</ifIndex> </interface> <link href="http://localhost:8080/imcrs/vlan/1?start=10&size=10&devId=8" op="GET" rel="next"/></list>
Elements
VLAN port sub-elements
Port index, which uniquely identifies a port.ifIndexInteger type.
Query VLAN Ports 369
ExampleQuery and list the 11th to the 20th VLAN port entries for the VLAN with ID 1 on the device whoseID is 8.
Request
GET http://localhost:8080/imcrs/vlan/1?devId=8&start=10&size=10accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <interface> <ifIndex>4227698</ifIndex> </interface> <interface> <ifIndex>4227706</ifIndex> </interface> <interface> <ifIndex>4227714</ifIndex> </interface> <interface> <ifIndex>4227722</ifIndex> </interface> <interface> <ifIndex>4227730</ifIndex> </interface> <interface> <ifIndex>4227738</ifIndex> </interface> <interface> <ifIndex>4227746</ifIndex> </interface> <interface> <ifIndex>4227754</ifIndex> </interface> <interface> <ifIndex>4227762</ifIndex> </interface> <interface> <ifIndex>4227770</ifIndex> </interface> <link href="http://localhost:8080/imcrs/vlan/1?start=0&size=10&devId=8" op="GET" rel="previous"/> <link href="http://localhost:8080/imcrs/vlan/1?start=20&size=10&devId=8" op="GET" rel="next"/></list>
370 Network Service Management
Add VLANAdd a VLAN on the device.
Interface URI/vlan
Access Method
HTTPPOST
Message body
<vlan> <vlanId>1111</vlanId> <vlanName>VLAN 1111</vlanName></vlan>
Parameters
VLAN sub-elements
Device type ID.devIdInteger type. Required. No default value.
VLAN ID.vlanIdInteger 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.”
Message headerIf the operation succeeds, the Location field gives the URI of the new resource. The message bodyis empty.
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/vlan?devId=13
Add VLAN 371
ExampleAdd a VLAN whose ID is 1111 and name VLAN1111 on the device whose ID is 13.
Request
POST http://imc_host:8080/imcrs/vlan?devId=13accept: application/xml...<vlan> <vlanId>1111</vlanId> <vlanName>VLAN 1111</vlanName></vlan>
Response
HTTP/1.1 201 CreatedLocation: http://localhost:8080/imcrs/vlan?devId=13
372 Network Service Management
Delete VLANDelete a VLAN from the device.
Interface URI/vlan
Access Method
HTTPDELETE
Message body
DELETE http://imc_host:8080/imcrs/vlan?devId=33&vlanId=1111accept: application/xml...
Parameters
VLAN sub-elements
Device type ID.devIdInteger type. Required. No default value.
VLAN ID.vlanIdInteger type. Required. No default value.
Returned Result
Status codes
• 204 (No Content): Success.
• 409 (Conflict): Failure. See “Error Codes.”
ExampleDelete the VLAN with ID 1111 from the device whose ID is 33.
Request
DELETE http://imc_host:8080/imcrs/vlan?devId=33&vlanId=1111accept: application/xml...
ResponseNone.
Delete VLAN 373
Change VLAN NameChange the name of a VLAN.
Interface URI/vlan
Access Method
HTTPPUT
Message body
<vlan> <vlanId>1111</vlanId> <vlanName>VLAN 1111</vlanName></vlan>
Parameters
Query parameters
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.
HTTP/1.1 201 Createdhttp://localhost:8080/imcrs/vlan/777?devId=33
Add Port to VLAN 375
ExampleAdd the port with index 1538 of the device with ID 33 to the VLAN whose ID is 777.
Request
POST http://imc_host:8080/imcrs/vlan/777?devId=33&ifIndex=1538accept: application/xml...
Response
HTTP/1.1 201 Createdhttp://localhost:8080/imcrs/vlan/777?devId=33
376 Network Service Management
Remove Port from VLANRemove a port from a VLAN.
Interface URI/vlan/{vlanId}
Access Method
HTTPDELETE
Message body
DELETE 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
• 204 (No Content): Success.
• 409 (Conflict): Failure. See “Error Codes.”
ExampleRemove the port with index 1538 of the device with ID 33 from the VLAN whose ID is 777.
Request
DELETE http://imc_host:8080/imcrs/vlan/777?devId=33&ifIndex=1538accept: application/xml...
ResponseNone.
Remove Port from VLAN 377
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.
HTTP/1.1 200 OKTotal: 113
378 Network Service Management
Message body
<list> <accessIf> <ifIndex>4227626</ifIndex> <pvid>1</pvid> </accessIf> <accessIf> <ifIndex>4227642</ifIndex> <pvid>1</pvid> </accessIf> <accessIf> <ifIndex>4227650</ifIndex> <pvid>1</pvid> </accessIf> <accessIf> <ifIndex>4227658</ifIndex> <pvid>1</pvid> </accessIf> <accessIf> <ifIndex>4227666</ifIndex> <pvid>1</pvid> </accessIf> <link href="http://localhost:8080/imcrs/vlan/access?start=5&size=5&devId=13" op="GET" rel="next"/></list>
Elements
Access port sub-elements
Port index, which uniquely identifies a port.ifIndexInteger type.
PVID of the port.pvidInteger type.
ExampleQuery and list information about the first five access ports on the device whose ID is 33.
Request
GET http://imc_host:8080/imcrs/vlan/access?devId=13&start=0&size=5accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <accessIf> <ifIndex>4227626</ifIndex> <pvid>1</pvid> </accessIf> <accessIf> <ifIndex>4227642</ifIndex> <pvid>1</pvid> </accessIf> <accessIf> <ifIndex>4227650</ifIndex> <pvid>1</pvid> </accessIf> <accessIf> <ifIndex>4227658</ifIndex> <pvid>1</pvid> </accessIf> <accessIf> <ifIndex>4227666</ifIndex> <pvid>1</pvid> </accessIf> <link href="http://localhost:8080/imcrs/vlan/access?start=5&size=5&devId=13" op="GET" rel="next"/></list>
Query Access Ports 379
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.
HTTP/1.1 200 OKTotal: 7
Query Hybrid Ports 381
Message body
<list> <hybridIf> <ifIndex>4227722</ifIndex> <pvid>1</pvid> <taggedVlans/> <untagVlanFlag>false</untagVlanFlag> <untaggedVlans/> <forbidenVlanFlag>false</forbidenVlanFlag> <forbiddenVlans/> </hybridIf> <hybridIf> <ifIndex>4227730</ifIndex> <pvid>78</pvid> <taggedVlans/> <untagVlanFlag>false</untagVlanFlag> <untaggedVlans/> <forbidenVlanFlag>false</forbidenVlanFlag> <forbiddenVlans/> </hybridIf> <hybridIf> <ifIndex>4227802</ifIndex> <pvid>1</pvid> <taggedVlans/> <untagVlanFlag>false</untagVlanFlag> <untaggedVlans/> <forbidenVlanFlag>false</forbidenVlanFlag> <forbiddenVlans/> </hybridIf> <hybridIf> <ifIndex>4227818</ifIndex> <pvid>1</pvid> <taggedVlans>2</taggedVlans> <untagVlanFlag>false</untagVlanFlag> <untaggedVlans>1,5</untaggedVlans> <forbidenVlanFlag>false</forbidenVlanFlag> <forbiddenVlans/> </hybridIf> <hybridIf> <ifIndex>289407098</ifIndex> <pvid>1</pvid> <taggedVlans/> <untagVlanFlag>false</untagVlanFlag> <untaggedVlans/> <forbidenVlanFlag>false</forbidenVlanFlag> <forbiddenVlans/> </hybridIf> <link href="http://localhost:8080/imcrs/vlan/hybrid?start=5&size=5&devId=13" op="GET" rel="next"/></list>
Elements
Hybrid port sub-elements
Port index, which uniquely identifies a port.ifIndexInteger type.
PVID of the port.pvidInteger type.
Tagged VLANs.taggedVlansString type.
Untagged VLANs.untaggedVlansString type.
Forbidden VLANs.forbiddenVlansString type.
382 Network Service Management
ExampleQuery and list information about the first five hybrid ports on the device whose ID is 13.
Request
GET http://imc_host:8080/imcrs/vlan/hybrid?devId=13&start=0&size=5accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <hybridIf> <ifIndex>4227722</ifIndex> <pvid>1</pvid> <taggedVlans/> <untagVlanFlag>false</untagVlanFlag> <untaggedVlans/> <forbidenVlanFlag>false</forbidenVlanFlag> <forbiddenVlans/> </hybridIf> <hybridIf> <ifIndex>4227730</ifIndex> <pvid>78</pvid> <taggedVlans/> <untagVlanFlag>false</untagVlanFlag> <untaggedVlans/> <forbidenVlanFlag>false</forbidenVlanFlag> <forbiddenVlans/> </hybridIf> <hybridIf> <ifIndex>4227802</ifIndex> <pvid>1</pvid> <taggedVlans/> <untagVlanFlag>false</untagVlanFlag> <untaggedVlans/> <forbidenVlanFlag>false</forbidenVlanFlag> <forbiddenVlans/> </hybridIf> <hybridIf> <ifIndex>4227818</ifIndex> <pvid>1</pvid> <taggedVlans>2</taggedVlans> <untagVlanFlag>false</untagVlanFlag> <untaggedVlans>1,5</untaggedVlans> <forbidenVlanFlag>false</forbidenVlanFlag> <forbiddenVlans/> </hybridIf> <hybridIf> <ifIndex>289407098</ifIndex> <pvid>1</pvid> <taggedVlans/> <untagVlanFlag>false</untagVlanFlag> <untaggedVlans/> <forbidenVlanFlag>false</forbidenVlanFlag> <forbiddenVlans/> </hybridIf> <link href="http://localhost:8080/imcrs/vlan/hybrid?start=5&size=5&devId=13" op="GET" rel="next"/></list>
Query Hybrid Ports 383
Add Hybrid PortAdd a hybrid port on the device.
Interface URI/vlan/hybrid
Access Method
HTTPPOST
Message body
POST http://imc_host:8080/imcrs/vlan/hybrid?devId=33accept: application/xml... <hybridIf forbidenVlanFlag="false" forbiddenVlans="" ifIndex="2423" pvid="1" taggedVlans="4,5" untagVlanFlag="true" untaggedVlans="3,7"/>
Parameters
Hybrid 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 hybrid port.pvidInteger type. Required. No default value.
Tagged VLAN.tagVlanString type. Optional. The tagVlan and untagVlan parameters cannot be empty at the same time.
Untagged VLAN flag.untagVlanFlagBoolean type. Required.
Untagged VLAN.untagVlanString type. Optional. The tagVlan and untagVlan parameters cannot be empty at the same time.
Forbidden VLAN flag.forbidenVlanFlagBoolean type. Required.
Forbidden VLAN.forbiddenVlansString type. Optional. This parameter is effective only to HP products.
Returned Result
Status codes
• 201 (Created): Success.
• 409 (Conflict): Failure. See “Error Codes.”
384 Network Service Management
Message headerIf the operation succeeds, the Location field gives the URI of the new resource. The message bodyis empty.
HTTP/1.1 201 CreatedLocation: http://imc_host:port/imcrs/vlan/hybrid?devId=33
ExampleAdd a hybrid port on the device whose ID is 33. The port parameters are as follows: ifIndex=2434,pvid=1, tagVlan=4,5, untagVlan=3,7.
Request
POST http://imc_host:8080/imcrs/vlan/hybrid?devId=33accept: application/xml... <hybridIf forbidenVlanFlag="false" forbiddenVlans="" ifIndex="2423" pvid="1" taggedVlans="4,5" untagVlanFlag="true" untaggedVlans="3,7"/>
Response
HTTP/1.1 201 CreatedLocation: http://imc_host:port/imcrs/vlan/hybrid?devId=33
Add Hybrid Port 385
Delete Hybrid PortDelete a hybrid port from the device.
Interface URI/vlan/hybrid
Access Method
HTTPDELETE
Message body
DELETE http://imc_host:8080/imcrs/vlan/hybrid?devId=33&ifIndex=2434accept: application/xml...
Parameters
Hybrid 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.
Returned Result
Status codes
• 204 (No Content): Success.
• 409 (Conflict): Failure. See “Error Codes.”
ExampleDelete the hybrid port with index 2434 from the device whose ID is 33.
Request
DELETE http://imc_host:8080/imcrs/vlan/hybrid?devId=33&ifIndex=2434accept: application/xml...
ResponseNone
386 Network Service Management
Modify Hybrid PortModify the parameters of a hybrid port on the device.
Interface URI/vlan/hybrid
Access Method
HTTPPUT
Message body
PUT http://imc_host:8080/imcrs/vlan/hybrid?devId=33accept: application/xml... <hybridIf forbidenVlanFlag="false" forbiddenVlans="" ifIndex="2423" pvid="1" taggedVlans="4,5" untagVlanFlag="true" untaggedVlans="3,7"/>
Elements
Hybrid 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 hybrid port.pvidInteger type. Required. No default value.
Tagged VLAN.tagVlanString type. Optional. The tagVlan and untagVlan parameters cannot be empty at the same time.
Untagged VLAN flag.untagVlanFlagBoolean type. Required.
Untagged VLAN.untagVlanString type. Optional. The tagVlan and untagVlan parameters cannot be empty at the same time.
Forbidden VLAN flag.forbidenVlanFlagBoolean type. Required.
Forbidden VLAN.forbiddenVlansString type. Optional. This parameter is effective only to HP products.
Returned Result
Status codes
• 204 (No Content): Success.
• 409 (Conflict): Failure. See “Error Codes.”
Modify Hybrid Port 387
ExampleModify a hybrid port on the device whose ID is 33. The new parameters are as follows:ifIndex=2434, pvid=1, tagVlan=4,5, untagVlan=3,7.
Request
PUT http://imc_host:8080/imcrs/vlan/hybrid?devId=33accept: application/xml... <hybridIf forbidenVlanFlag="false" forbiddenVlans="" ifIndex="2423" pvid="1" taggedVlans="4,5" untagVlanFlag="true" untaggedVlans="3,7"/>
ResponseNone
388 Network Service Management
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.
HTTP/1.1 200 OKTotal: 6
Query Trunk Ports 389
Message body
<list> <trunkIf> <ifIndex>4227634</ifIndex> <pvid>1</pvid> <allowedVlans>1,10</allowedVlans> </trunkIf> <trunkIf> <ifIndex>4227698</ifIndex> <pvid>23</pvid> <allowedVlans>1-1024</allowedVlans> </trunkIf> <trunkIf> <ifIndex>4227706</ifIndex> <pvid>23</pvid> <allowedVlans>1-1024</allowedVlans> </trunkIf> <trunkIf> <ifIndex>4227754</ifIndex> <pvid>56</pvid> <allowedVlans>1-1024</allowedVlans> </trunkIf> <trunkIf> <ifIndex>503316850</ifIndex> <pvid>1</pvid> <allowedVlans>1</allowedVlans> </trunkIf> <link href="http://localhost:8080/imcrs/vlan/trunk?start=5&size=5&total=false&devId=13" op="GET" rel="next"/></list>
Elements
Trunk port sub-elements
Port index, which uniquely identifies a port.ifIndexInteger type.
PVID of the port.pvidInteger type.
Allowed VLANs.allowedVlansString type.
390 Network Service Management
ExampleQuery and list information about the first five trunk ports on the device whose ID is 33.
Request
GET http://imc_host:8080/imcrs/vlan/trunk?devId=13&start=0&size=5accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <trunkIf> <ifIndex>4227634</ifIndex> <pvid>1</pvid> <allowedVlans>1,10</allowedVlans> </trunkIf> <trunkIf> <ifIndex>4227698</ifIndex> <pvid>23</pvid> <allowedVlans>1-1024</allowedVlans> </trunkIf> <trunkIf> <ifIndex>4227706</ifIndex> <pvid>23</pvid> <allowedVlans>1-1024</allowedVlans> </trunkIf> <trunkIf> <ifIndex>4227754</ifIndex> <pvid>56</pvid> <allowedVlans>1-1024</allowedVlans> </trunkIf> <trunkIf> <ifIndex>503316850</ifIndex> <pvid>1</pvid> <allowedVlans>1</allowedVlans> </trunkIf> <link href="http://localhost:8080/imcrs/vlan/trunk?start=5&size=5&total=false&devId=13" op="GET" rel="next"/></list>
Query Trunk Ports 391
Add Trunk PortAdd a trunk port on the device.
Interface URI/vlan/trunk
Access Method
HTTPPOST
Message body
POST http://imc_host:8080/imcrs/vlan/trunk?devId=33accept: application/xml...<trunkIf allowedVlans="4,7" ifIndex="2423" pvid="1"/>
Parameters
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
• 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.
HTTP/1.1 201 CreatedLocation: http://imc_host:port/imcrs/vlan/trunk?devId=33
392 Network Service Management
ExampleAdd a trunk port on the device whose ID is 33. The port parameters are as follows: ifIndex=2434,pvid=1, allowedVlan=4,7.
Request
POST http://imc_host:8080/imcrs/vlan/trunk?devId=33accept: application/xml...<trunkIf allowedVlans="4,7" ifIndex="2423" pvid="1"/>
Response
HTTP/1.1 201 CreatedLocation: http://imc_host:port/imcrs/vlan/trunk?devId=33
Add Trunk Port 393
Delete Trunk PortDelete a trunk port from the device.
Interface URI/vlan/trunk
Access Method
HTTPDELETE
Message body
DELETE http://imc_host:8080/imcrs/vlan/trunk?devId=33&ifIndex=2434accept: application/xml...
Parameters
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.
Returned Result
Status codes
• 204 (No Content): Success.
• 409 (Conflict): Failure. See “Error Codes.”
ExampleDelete the trunk port with index 2434 from the device whose ID is 33.
Request
DELETE http://imc_host:8080/imcrs/vlan/trunk?devId=33&ifIndex=2434accept: application/xml...
ResponseNone
394 Network Service Management
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.
HTTP/1.1 200 OKTotal: 4
396 Network Service Management
Message body
<list> <vlanIf> <vlanId>1</vlanId> <isPrimary>true</isPrimary> <enableDHCP>false</enableDHCP> <ipAddress>10.153.89.12</ipAddress> <ipMask>255.255.255.224</ipMask> </vlanIf> <vlanIf> <vlanId>2</vlanId> <isPrimary>true</isPrimary> <enableDHCP>false</enableDHCP> <ipAddress>12.4.3.2</ipAddress> <ipMask>255.255.255.224</ipMask> </vlanIf> <vlanIf> <vlanId>3</vlanId> <isPrimary>true</isPrimary> <enableDHCP>false</enableDHCP> <ipAddress>10.0.0.1</ipAddress> <ipMask>255.255.255.224</ipMask> </vlanIf> <vlanIf> <vlanId>4</vlanId> <isPrimary>true</isPrimary> <enableDHCP>false</enableDHCP> <ipAddress>5.3.6.9</ipAddress> <ipMask>255.255.255.0</ipMask> </vlanIf></list>
Elements
VLAN interface sub-elements
VLAN ID, which uniquely identifies a VLAN.vlanIdInteger type.
Primary IP address or not.isPrimaryBoolean type.
Whether or not the IP address is assigned through DHCP. If the value takes true, then the ipAddressand ipMask parameters are empty.
enableDHCP
Boolean type.
IP address.ipAddressString type.
Network mask of an IP address.ipMaskString type.
Query VLAN Interfaces 397
ExampleQuery and list information about the first five VLAN interfaces on the device whose ID is 13.
Request
GET http://localhost:8080/imcrs/vlan/vlanif?devId=13&start=0&size=5accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <vlanIf> <vlanId>1</vlanId> <isPrimary>true</isPrimary> <enableDHCP>false</enableDHCP> <ipAddress>10.153.89.12</ipAddress> <ipMask>255.255.255.224</ipMask> </vlanIf> <vlanIf> <vlanId>2</vlanId> <isPrimary>true</isPrimary> <enableDHCP>false</enableDHCP> <ipAddress>12.4.3.2</ipAddress> <ipMask>255.255.255.224</ipMask> </vlanIf> <vlanIf> <vlanId>3</vlanId> <isPrimary>true</isPrimary> <enableDHCP>false</enableDHCP> <ipAddress>10.0.0.1</ipAddress> <ipMask>255.255.255.224</ipMask> </vlanIf> <vlanIf> <vlanId>4</vlanId> <isPrimary>true</isPrimary> <enableDHCP>false</enableDHCP> <ipAddress>5.3.6.9</ipAddress> <ipMask>255.255.255.0</ipMask> </vlanIf></list>
398 Network Service Management
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.
HTTP/1.1 200 OKTotal: 1
Query a Specific VLAN Interface 399
Message body
<list> <vlanIf> <vlanId>2</vlanId> <isPrimary>true</isPrimary> <enableDHCP>false</enableDHCP> <ipAddress>12.4.3.2</ipAddress> <ipMask>255.255.255.224</ipMask> </vlanIf></list>
Elements
VLAN interface sub-elements
VLAN ID, which uniquely identifies a VLAN.vlanIdInteger type.
Primary IP address or not.isPrimaryBoolean type.
Whether or not the IP address is assigned through DHCP. If the value takes true, then the ipAddressand ipMask parameters are empty.
enableDHCP
Boolean type.
IP address.ipAddressString type.
Network mask of an IP address.ipMaskString type.
ExampleQuery and list the first five VLAN interfaces for the VLAN with ID 2 on the device whose ID is 13.
Request
GET http://localhost:8080/imcrs/vlan/vlanif/2?devId=13&start=0&size=5accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...<list> <vlanIf> <vlanId>2</vlanId> <isPrimary>true</isPrimary> <enableDHCP>false</enableDHCP> <ipAddress>12.4.3.2</ipAddress> <ipMask>255.255.255.224</ipMask> </vlanIf></list>
400 Network Service Management
Add VLAN InterfaceAdd a VLAN interface on the device.
Interface URI/vlan/vlanif
Access Method
HTTPPOST
Message body
POST http://imc_host:8080/imcrs/vlan/vlanif?devId=3accept: application/xml... <vlanIf enableDHCP="false" ipAddress="1.1.1.1" ipMask="255.0.0.0" isPrimary="true" vlanId="600"/>
Parameters
VLAN interface sub-elements
VLAN ID, which uniquely identifies a VLAN.vlanIdInteger type. Required. No default value.
Primary IP address or not.isPrimaryBoolean type. Optional. The default value is true.
Whether or not the IP address is assigned through DHCP. If the value takes true, then the ipAddressand ipMask parameters are empty.
enableDHCP
Boolean type. Optional. The default value is false.
IP address.ipAddressString type. Optional. If the enableDHCP parameter is false then neither ipAddress or ipMask canbe empty.
Network mask of an IP address.ipMaskString type. Optional. If the enableDHCP parameter is false, then neither ipAddress nor ipMask canbe empty.
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.
HTTP/1.1 201 CreatedLocation: http://imc_host:port/imcrs/vlan/vlanif?devId=3
Add VLAN Interface 401
ExampleAdd a VLAN interface on the device whose ID is 3. The interface parameters are as follows:vlanId=600, ipAddress=1.1.1.1, ipMask=255.0.0.0.
Request
POST http://imc_host:8080/imcrs/vlan/vlanif?devId=3accept: application/xml... <vlanIf enableDHCP="false" ipAddress="1.1.1.1" ipMask="255.0.0.0" isPrimary="true" vlanId="600"/>
Response
HTTP/1.1 201 CreatedLocation: http://imc_host:port/imcrs/vlan/vlanif?devId=3
402 Network Service Management
Delete VLAN InterfaceDelete a VLAN interface from the device.
Interface URI/vlan/vlanif
Access Method
HTTPDELETE
Message body
DELETE http://imc_host:8080/imcrs/vlan/vlanif?devId=3&vlanId=600&ipAddress=1.1.1.1&ipMask=255.0.0.0accept: application/xml...
Parameters
VLAN interface sub-elements
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.
Request
DELETE http://imc_host:8080/imcrs/vlan/vlanif?devId=3&vlanId=600&ipAddress=1.1.1.1&ipMask=255.0.0.0accept: application/xml...
ResponseNone
Delete VLAN Interface 403
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.
HTTP/1.1 200 OKTotal: 7
Query the Device List of ACL Configuration 405
Message body
<list> <aclDevice> <deviceId>68</deviceId> <deviceName>5500-EI(10.153.89.182)</deviceName> <deviceIp>10.153.89.182</deviceIp> <deviceModel>3Com S5500-52-PWR-EI</deviceModel> <pollInterval>1440</pollInterval> <lastPoll>2011-10-52 10:52:47</lastPoll> <pollResult>1</pollResult> <acl>http://imc_host:8080/imcrs/acl/res/acl/68</acl> <aclResUse>http://imc_host:8080/imcrs/acl/res/aclUse/68</aclResUse> <aclResTimerange>http://imc_host:8080/imcrs/acl/res/aclTimeRange/68</aclResTimerange> </aclDevice> ...</list>
Elements
ACL sub-elements
Device ID, which uniquely identifies a device.deviceIdLong integer type.
Device name.deviceNameString type.
Device IP address.deviceIpString type.
Device type.deviceModelString type.
Polling interval (in hours), which ranges from 0 to 168 and can be -1. The value of -1 indicatesthat polling is disabled.
pollInterval
Long integer type.
Last polling time.lastPollString type.
Last polling result: 0 for failure, 1 for success, and 2 for polling.pollResultInteger type.
ACL Definition URI.aclString type.
ACL Application URI.aclResUseString type.
ACL Time Range URI.aclResTimerangeString type.
406 ACL Management
ExampleQuery basic device information entries 2 through 6 for devices whose IP addresses contain 10.
Request
GET http://imc_host:8080/imcrs/acl/res/aclDevice/deviceIp=10?start=2&size=4accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <aclDevice> <deviceId>74</deviceId> <deviceName>H3C(10.153.89.195)</deviceName> <deviceIp>10.153.89.195</deviceIp> <deviceModel>H3C WX5002-128AP</deviceModel> <pollInterval>1440</pollInterval> <lastPoll>2011-08-59 20:59:11</lastPoll> <pollResult>1</pollResult> <acl>http://imc_host:8080/imcrs/acl/res/acl/74</acl> <aclResUse>http://imc_host:8080/imcrs/acl/res/aclUse/74</aclResUse> <aclResTimerange>http://imc_host:8080/imcrs/acl/res/aclTimeRange/74</aclResTimerange> </aclDevice> ... <link href="http://imc_host:8080/imcrs/acl/res/aclDevice?start=0&size=4&deviceIp=10"/> <link href="http://imc_host:8080/imcrs/acl/res/aclDevice?start=6&size=4&deviceIp=10"/></list>
Query the Device List of ACL Configuration 407
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 200 OKTotal: 7
Query the ACL Definitions of a Device 409
Message body
<list> <acl> <aclId>1371</aclId> <parentId>68</parentId> <parentType>1</parentType> <aclName>2345</aclName> <aclNameType>1</aclNameType> <aclType>2</aclType> <aclMatchorder>1</aclMatchorder> <aclDesc>dd</aclDesc> <tmpName>1371</tmpName> <tmpName/> <updateFlag>0</updateFlag> <aclRules>http://imc_host:8080/imcrs/acl/res/acl/68,1371</aclRules> </acl> ...</list>
Elements
ACL sub-elements
ACL ID, which uniquely identifies an ACL.aclIdLong integer type.
ID of the parent device or task.parentIdLong integer type.
Parent type, which can be device or task.parentTypeLong integer type.
ACL name.aclNameString type.
ACL name type.aclNameTypeLong integer type.
ACL type.aclTypeLong integer type.
ACL match order.aclMatchorderInteger type.
ACL description.aclDescString type.
Template name.tmpNameString type.
Template description.tmpDescString type.
Specify the action of adding, deleting, or modifying.useFlagLong integer type.
410 ACL Management
ExampleQuery basic ACL information entries 2 through ACL 4 on device whose device ID is 25.
Request
GET http://imc_host:8080/imcrs/acl/res/acl/25?start=2&size=2accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <acl> <aclId>1391</aclId> <parentId>25</parentId> <parentType>1</parentType> <aclName>2222</aclName> <aclNameType>1</aclNameType> <aclType>2</aclType> <aclMatchorder>1</aclMatchorder> <aclDesc>zxm</aclDesc> <tmpName>1391</tmpName> <tmpName/> <updateFlag>0</updateFlag> <aclRules>http://imc_host:8080/imcrs/acl/res/acl/25,1391</aclRules> </acl> ... <link href="http://imc_host:8080/imcrs/acl/res/acl/25?start=0&size=2" op="GET" rel="previous"/> <link href="http://imc_host:8080/imcrs/acl/res/acl/25?start=4&size=2" op="GET" rel="next"/></list>
Query the ACL Definitions of a Device 411
Add ACL on a DeviceAdd an ACL on a device.
Interface URI/acl/res/acl
Access Method
HTTPPOST
Message body
POST http://imc_host:8080/imcrs/acl/res/aclaccept: application/xml...
<acl> <parentId>68</parentId> <aclName>2222</aclName> <aclNameType>1</aclNameType> <aclType>2</aclType> <aclDesc>acl_2222</aclDesc> <aclRuleList> <aclRule> <trName/> <action>1</action> <sourceAddr>192.168.10.0/255.255.10.10</sourceAddr> <fragment>1</fragment> <logging>1</logging> <vpnIntance/> ... </aclRule> </aclRuleList></acl>
Elements
ACL sub-elements
ID of the parent device or task.parentIdLong integer type.
Parent type, which can be device or task.parentTypeLong integer type.
ACL name.aclNameString type.
ACL name type.aclNameTypeLong integer type.
ACL type.aclTypeLong integer type.
ACL match order.aclMatchorderInteger type.
ACL description.aclDesc
412 ACL Management
ACL sub-elements
String type.
Template name.tmpNameString type.
Template description.tmpDescString type.
Specify the action of adding, deleting, or modifying.useFlagLong integer type.
ACL rule sub-elements
Time range name.trNameString type.
Action of the rule.actionInteger type.
Rule description.ruleDescString type.
Rule number.ruleSeqLong integer type.
Match rule.ruleMatchCountLong integer type.
Fragment.fragmentInteger type.
Logging.loggingInteger type.
Protocol.protocolLong integer type.
VPN instance.vpnIntanceString type.
Source address.sourceAddrString type.
Source address mask.sourceWildcardString type.
Source address mask.destAddrString type
Destination address mask.destMaskString type.
Destination port operator.sourcePortOperLong integer type.
Source port 1.sourcePort1
Add ACL on a Device 413
ACL rule sub-elements
Long integer type.
Source port 2.sourcePort2Long integer type.
Destination port operator.destPortOperLong integer type.
Destination port 1.destPort1Long integer type.
Destination port 2.destPort2Long integer type.
ICMP type.icmpTypeLong integer type.
ICMP value.icmpCodeLong integer type.
HP Ack.hpAckInteger type.
HP Fin.hpFinInteger type.
HP Rst.hpRstInteger type.
HP Syn.hpSynInteger type.
HP IGMP type.hpIgmpTypeInteger type.
IP precedence.precedenceLong integer type.
ToS.tosLong integer type.
DSCP.dscpLong integer type.
802.3 precedence.priorityLong integer type.
Encapsulation type.formatTypeLong integer type.
Source VLAN ID.srcVlanIdLong integer type.
Layer 2 protocol code.l2ProtocolCodeString type.
Layer 2 protocol mask.l2ProtocolMask
414 ACL Management
ACL rule sub-elements
String type.
Layer 2 protocol type.l2ProtocolTypeLong integer type.
Source MAC address mask.sourceMacAddrString type.
Source MAC address mask.sourceMacWildcardString type.
Destination MAC address.destMacAddrString type.
Destination MAC address mask.destMacMaskString type.
Interface description.ifdescString type.
Rule string.ruleStringString type.
Returned Result
Status codes
• 201 (Created): Success.
ExampleAdd a standard ACL on the device whose device ID is 68.
Request
POST http://imc_host:8080/imcrs/acl/res/aclaccept: application/xml...
<acl> <parentId>68</parentId> <aclName>2222</aclName> <aclNameType>1</aclNameType> <aclType>2</aclType> <aclDesc>acl_2222</aclDesc> <aclRuleList> <aclRule> <trName/> <action>1</action> <sourceAddr>192.168.10.0/255.255.10.10</sourceAddr> <fragment>1</fragment> <logging>1</logging> <vpnIntance/> </aclRule> </aclRuleList></acl>
Add ACL on a Device 415
Response
HTTP/1.1 201 CreatedContent-Type: application/xml...No message body is included.
2. Add an extended ACL with the protocol type being ICMP on the device whose device ID is 68.
Request
POST http://imc_host:8080/imcrs/acl/res/aclaccept: application/xml...
<acl> <parentId>68</parentId> <aclName>3001</aclName> <aclNameType>1</aclNameType> <aclType>3</aclType> <aclDesc>acl_3001</aclDesc> <aclRuleList> <aclRule> <trName/> <action>1</action> <protocol>1</protocol> <destAddr/> <sourceAddr>192.168.10.0/255.255.10.10</sourceAddr> <icmpType>21</icmpType> <icmpCode>254</icmpCode> <precedence>5</precedence> <tos>10</tos> <dscp>34</dscp> <fragment>1</fragment> <logging>1</logging> <vpnIntance/> </aclRule> </aclRuleList></acl>
Response
HTTP/1.1 201 CreatedContent-Type: application/xml...No message body is included.
3. Add an extended ACL with the protocol type being IGMP on the device whose device ID is 68.
Request
POST http://imc_host:8080/imcrs/acl/res/aclaccept: application/xml...
<acl> <parentId>68</parentId> <aclName>3002</aclName> <aclType>3</aclType> <aclDesc>acl_3002</aclDesc> <aclRuleList> <aclRule> <trName/> <action>1</action>
416 ACL Management
<protocol>2</protocol> <destAddr/> <sourceAddr>192.168.10.0/255.255.10.10</sourceAddr> <precedence>5</precedence> <tos>10</tos> <dscp>34</dscp> <hpIgmpType>18</hpIgmpType> <fragment>1</fragment> <logging>1</logging> <vpnIntance/> </aclRule> </aclRuleList></acl>
Response
HTTP/1.1 201 CreatedContent-Type: application/xml...No message body is included.
4. Add an extended ACL with the protocol type being TCP or UDP on the device whose device IDis 68.
Request
POST http://imc_host:8080/imcrs/acl/res/aclaccept: application/xml...
<acl> <parentId>68</parentId> <aclName>3003</aclName> <aclType>3</aclType> <aclDesc>acl_3003</aclDesc> <aclRuleList> <aclRule> <trName/> <action>1</action> <protocol>6</protocol> <destAddr/> <sourceAddr>192.168.10.0/255.255.10.10</sourceAddr> <sourcePortOper>1</sourcePortOper> <sourcePort1>55</sourcePort1> <destPortOper>5</destPortOper> <destPort1>554</destPort1> <destPort2>555</destPort2> <precedence>5</precedence> <tos>10</tos> <dscp>34</dscp> <hpAck>1</hpAck> <hpFin>0</hpFin> <hpRst>1</hpRst> <hpSyn>0</hpSyn> <fragment>1</fragment> <logging>1</logging> <vpnIntance/> </aclRule> </aclRuleList></acl>
Add ACL on a Device 417
Response
HTTP/1.1 201 CreatedContent-Type: application/xml...No message body is included.
5. Add a Layer 2 ACL on the device whose device ID is 68.
Request
POST http://imc_host:8080/imcrs/acl/res/aclaccept: application/xml...
<acl> <parentId>68</parentId> <aclName>4001</aclName> <aclType>4</aclType> <aclDesc>acl_4001</aclDesc> <aclRuleList> <aclRule> <trName/> <action>1</action> <sourceMacAddr/> <destMacAddr/> <priority>-1</priority> <formatType>-1</formatType> <srcVlanId>25</srcVlanId> <l2ProtocolType>2</l2ProtocolType> <l2ProtocolCode>12</l2ProtocolCode> <l2ProtocolMask>12</l2ProtocolMask> </aclRule> </aclRuleList></acl>
Response
HTTP/1.1 201 CreatedContent-Type: application/xml...No message body is included.
6. Add a user-defined ACL without rule strings on the device whose device ID is 68.
Request
POST http://imc_host:8080/imcrs/acl/res/aclaccept: application/xml...
<acl> <parentId>68</parentId> <aclName>5001</aclName> <aclType>5</aclType> <aclDesc>acl_5001</aclDesc> <aclRuleList> <aclRule> <trName/> <action>0</action> <ruleString/> </aclRule> </aclRuleList></acl>
418 ACL Management
Response
HTTP/1.1 201 CreatedContent-Type: application/xml...No message body is included.
7. Add a user-defined ACL with rule strings on the device whose device ID is 68.
Request
POST http://imc_host:8080/imcrs/acl/res/aclaccept: application/xml...
<acl> <parentId>68</parentId> <aclName>5002</aclName> <aclType>5</aclType> <aclDesc>acl_5002</aclDesc> <aclRuleList> <aclRule> <trName/> <action>1</action> <ruleString>12:12:12#12:12:13#</ruleString> </aclRule> </aclRuleList></acl>
Response
HTTP/1.1 201 CreatedContent-Type: application/xml...No message body is included.
Add ACL on a Device 419
Delete ACL from a DeviceDelete an ACL from a device.
Interface URI/acl/res/acl/{id}
Access Method
HTTPDELETE
Parameters
Path parameters
ACL ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 204(No Content): Success.
• 409(Conflict): Failure.
• 410(Gone): Failure. For more information, see “Conventions and Constraints.”
ExampleDelete ACL 1389 from a device.
Request
DELETE http://imc_host:8080/imcrs/acl/res/acl/1389accept: application/xml...
Response
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 200 OKTotal: 7
Query ACL Applications of a Device 421
Message body
<list> <aclUse> <useId>10</useId> <parentId>25</parentId> <parentType>1</parentType> <useType>1</useType> <aclName>2222</aclName> <useContext>Ethernet0/0</useContext> <useCommand>firewall packet-filter 2222 inbound</useCommand> <useDesc/> <useFlag>0</useFlag> </aclUse> ...</list>
Elements
ACL application sub-elements
ACL application ID, which uniquely identifies an ACL application.useIdLong integer type.
ID of the parent device or task.parentIdLong integer type.
Parent type, which can be device or task.parentTypeLong integer type.
ACL application type.useTypeLong integer type.
ACL name.aclNameLong integer type.
ACL application context.useContextLong integer type.
ACL application command.useCommandLong integer type.
ACL application description.useDescLong integer type.
Specify the action of adding, deleting, or modifying.useFlagLong integer type.
422 ACL Management
ExampleQuery basic ACL application information entries 3 through 6 on device whose device ID is 25.
Request
GET http://imc_host:8080/imcrs/acl/res/aclUse/25?start=3&size=3accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <aclUse> <useId>10</useId> <parentId>25</parentId> <parentType>1</parentType> <useType>1</useType> <aclName>2222</aclName> <useContext>Ethernet0/0</useContext> <useCommand>firewall packet-filter 2222 inbound</useCommand> <useDesc/> <useFlag>0</useFlag> </aclUse> ... <link href="http://imc_host:port/imcrs/acl/res/aclUse/25?start=0&size=3" op="GET" rel="previous"/> <link href="http://imc_host:port/imcrs/acl/res/aclUse/25?start=6&size=3" op="GET" rel="next"/></list>
Query ACL Applications of a Device 423
Add ACL Application on a DeviceAdd an ACL application on a device.
Interface URI/acl/res/aclUse
Access Method
HTTPPOST
Message body
POST http://imc_host:8080/imcrs/acl/res/aclUseaccept: application/xml...<aclUse> <parentId>68</parentId> <useType>1</useType> <aclName>2001</aclName> <useContext>Ethernet1/0/4</useContext> <useDesc/> <direct>0</direct></aclUse>
Elements
ACL application sub-elements
ACL application ID, which uniquely identifies an ACL application.useIdLong integer type.
ID of the parent device or task.parentIdLong integer type.
Parent type, which can be device or task.parentTypeLong integer type.
ACL application type.useTypeLong integer type.
ACL name.aclNameLong integer type.
ACL application context.useContextLong integer type.
ACL application command.useCommandLong integer type.
ACL application description.useDescLong integer type.
Specify the action of adding, deleting, or modifying.useFlagLong integer type.
424 ACL Management
Returned Result
Status codes
• 201 (Created): Success.
ExampleAdd an ACL application on the device whose device ID is 68.
Request
POST http://imc_host:8080/imcrs/acl/res/aclUseaccept: application/xml...<aclUse> <parentId>68</parentId> <useType>1</useType> <aclName>2001</aclName> <useContext>Ethernet1/0/4</useContext> <useDesc/> <direct>0</direct></aclUse>
Response
HTTP/1.1 201 CreatedContent-Type: application/xml...No message body is included.
Add ACL Application on a Device 425
Delete ACL Application from a DeviceDelete an ACL application specified by its ID from a device.
Interface URI/acl/res/aclUse/{id}
Access Method
HTTPDELETE
Parameters
Path parameters
ACL application ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 204(No Content): Success.
• 409(Conflict): Failure.
• 410(Gone): Failure. For more information, see “Conventions and Constraints.”
Message header
ExampleDelete ACL application 15 from a device.
Request
DELETE http://imc_host:8080/imcrs/acl/res/aclUse/15accept: application/xml...
Response
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.
HTTP/1.1 200 OKTotal: 7
Message body
<list> <aclResTimeRange> <trId>1371</trId> <parentId>68</parentId> <parentType>1</parentType> <trName>1</trName> <useFlag>0</updateFlag> <aclChildTimeRanges>http://imc_host:8080/imcrs/acl/res/aclTimeRange/68,1371</aclChildTimeRanges> </aclResTimeRange> ...</list>
Query ACL Time Ranges of a Device 427
Elements
ACL time range sub-elements
ACL time range ID, which uniquely identifies an ACL time range.trIdLong integer type.
ID of the parent device or task.parentIdLong integer type.
Parent type, which can be device or task.parentTypeLong integer type.
Time range name.trNameString type.
Specify the action of adding, deleting, or modifying.useFlagLong integer type.
Child Time Range Set URI.aclChildTimeRangeString type.
ExampleQuery the basic time range information entries 2 through 4 on device whose device ID is 25.
Request
GET http://imc_host:8080/imcrs/acl/res/aclTimeRange/25?start=2&size=2accept: application/xml...
Response
HTTP/1.1 200 OKContent-Type: application/xml...
<list> <aclResTimeRange> <trId>51</trId> <parentId>25</parentId> <parentType>1</parentType> <trName>1</trName> <useFlag>0</useFlag> <aclChildTimeRanges>http://imc_host:8080/imcrs/acl/res/aclTimeRange/25,51</aclChildTimeRanges> </aclResTimeRange> ... <link href="http://imc_host:8080/imcrs/acl/res/aclTimeRange/25?start=0&size=2" op="GET" rel="previous"/> <link href="http://imc_host:8080/imcrs/acl/res/aclTimeRange/25?start=4&size=2" op="GET" rel="next"/></list>
428 ACL Management
Add ACL Time Range on a DeviceAdd an ACL time range on a device.
Interface URI/acl/res/aclTimeRange
Access Method
HTTPPOST
Message body
POST http://imc_host:8080/imcrs/acl/res/aclTimeRangeaccept: application/xml...<aclResTimeRange> <parentId>68</parentId> <parentType>1</parentType> <trName>a</trName> <useFlag>0</useFlag> <aclResChildTimeRangeList> <aclResChildTimeRange> <trChildType>0</trChildType> <trPerDayofweek/> <trStartTime>2010-04-06 15:12</trStartTime> <trEndTime>2010-04-30 15:12</trEndTime> </aclResChildTimeRange> </aclResChildTimeRangeList></aclResTimeRange>
Elements
ACL time range sub-elements
ACL time range ID, which uniquely identifies an ACL time range.trIdLong integer type.
ID of the parent device or task.parentIdLong integer type.
Parent type, which can be device or task.parentTypeLong integer type.
Time range name.trNameString type.
Specify the action of adding, deleting, or modifying.useFlagLong integer type.
Child Time Range Set URI.aclChildTimeRangeString type.
Add ACL Time Range on a Device 429
Returned Result
Status codes
• 201 (Created): Success.
ExampleAdd an ACL time range on the device whose device ID is 68.
Request
POST http://imc_host:8080/imcrs/acl/res/aclTimeRangeaccept: application/xml...<aclResTimeRange> <parentId>68</parentId> <parentType>1</parentType> <trName>a</trName> <useFlag>0</useFlag> <aclResChildTimeRangeList> <aclResChildTimeRange> <trChildType>0</trChildType> <trPerDayofweek/> <trStartTime>2010-04-06 15:12</trStartTime> <trEndTime>2010-04-30 15:12</trEndTime> </aclResChildTimeRange> </aclResChildTimeRangeList></aclResTimeRange>
Response
HTTP/1.1 201 CreatedContent-Type: application/xml...No message body is included.
430 ACL Management
Delete ACL Time Range from a DeviceDelete an ACL time range specified by its ID from a device.
Interface URI/acl/res/aclTimeRange/{id}
Access Method
HTTPDELETE
Parameters
Path parameters
ACL time ranges ID.idLong integer type. Required. No default value.
Returned Result
Status codes
• 204(No Content): Success.
• 409(Conflict): Failure.
• 410(Gone): Failure. For more information, see “Conventions and Constraints.”
Message header
ExampleDelete ACL time range 15 from a device.
Request
DELETE http://imc_host:8080/imcrs/acl/res/aclTimeRange/15accept: application/xml...
Response
HTTP/1.1 204 No ContentContent-Type: application/xml...No message body is included.
Delete ACL Time Range from a Device 431
Query Child TimeQuery the child time ranges of an ACL time range on a device according to the specified deviceID and ACL time range ID.
Interface URI/acl/res/aclTimeRange/{deviceId},{trId}
Access Method
HTTPGET
Parameters
Path parameters
Device ID.deviceIdLong integer type. Required. No default value.
ACL time range ID.trIdLong integer type. Required. No default value.
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.
HTTP/1.1 200 OKTotal: 7
Message body
<list> <aclResChildTimeRange> <trChildId>244</trChildId> <aclTimeRangeId>80</aclTimeRangeId> <trChildType>0</trChildType> <trPerDayofweek/> <trStartTime>2010-04-06 15:12</trStartTime> <trEndTime>2010-04-30 15:12</trEndTime> </aclResChildTimeRange> ...</list>
432 ACL Management
Elements
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...
Response
HTTP/1.1 200 OKContent-Type: application/xml... <list> <aclResChildTimeRange> <trChildId>244</trChildId> <aclTimeRangeId>80</aclTimeRangeId> <trChildType>0</trChildType> <trStartTime>2010-04-06 15:12</trStartTime> <trEndTime>2010-04-30 15:12</trEndTime> </aclResChildTimeRange> ...</list>
434 ACL Management
15 Support and other resourcesContacting HP
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.
Contacting HP 435
PrerequisitesPrerequisites for installing this product include:
• IMC v5.1 or higher installed and deployed on your enterprise network or lab environment.
Typographic conventionsTable 2 Document conventions
ElementConvention
Cross-reference links and email addressesBlue text: Table 2 (page 436)
Website addressesBlue, underlined text: http://www.hp.com
Bold text • Keys that are pressed
• Text typed into a GUI element, such as a box
• GUI elements that are clicked or selected, such as menuand list items, buttons, tabs, and check boxes
Text emphasisItalic text
Monospace text • File and directory names
• System output
• Code
• Commands, their arguments, and argument values
Monospace, italic text • Code variables
• Command variables
Emphasized monospace textMonospace, bold text
IMPORTANT: Provides clarifying information or specific instructions.
CAUTION: Indicates that failure to follow directions could result in damage to equipment or data.
NOTE: Provides additional information.
TIP: Provides helpful hints and shortcuts.
About the HP IMC documentation setThe HP IMC documentation set includes:
Table 3 About the HP IMC documentation set
PurposesDocumentsCategory
Describe product specifications and benefits.Marketing brochuresProduct descriptionand specifications
Quickly guides you through the IMC main features andtroubleshooting common problems.
HP IMC Getting Started Guide
Hardwarespecifications andinstallation
Provides a complete guide to IMC platform and componentinstallation and deployment.
HP IMC Installation Guide
Provides a complete guide to IMP Probe installation anddeployment.
HP IMC Probe Installation Guide
436 Support and other resources
Table 3 About the HP IMC documentation set (continued)
PurposesDocumentsCategory
Guides you through installing SQL Server 2005 for IMC.SQL Server 2005 Installationand Configuration Guide
Guides you through installing SQL Server 2008 for IMC.SQL Server 2008 Installationand Configuration Guide
Guides you through installing SQL Server 2008 R2 for IMC.SQL Server 2008 R2 Installationand Configuration Guide
Guides you through installing Oracle 11g on Linux for IMC.Oracle 11g Installation andConfiguration Guide (for Linux)
Guides you through installing MySQL 5.1 on Linux for IMC.MySQL 5.1 Installation andConfiguration Guide (Linux)
Guides you through installing MySQL 5.1 on Windows for IMC.MySQL 5.1 Installation andConfiguration Guide (Windows)
Describes operation procedures on the IMC base platform.HP IMC Base PlatformAdministrator Guide
Softwareconfiguration
Describes operation procedures on the IMC Network TrafficAnalyzer.
HP IMC Network TrafficAnalyzer Administrator Guide
Describes operation procedures on using QoSM to control yournetwork resources.
HP IMC Quality of ServiceManager Administrator Guide
Describes operation procedures on using UBA to audit userbehavior.
HP IMC User Behavior AuditorAdministrator Guide
Helps you properly use IMC.Online Help
Provides latest IMC release information.Read meOperations andmaintenance
About the HP IMC documentation set 437
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.
438 Documentation feedback