Download as pdf or txt
Download as pdf or txt
You are on page 1of 438

HP Intelligent Management Center

Extended API Guide

Abstract
This manual provides detailed information about the HP Intelligent Management Center Extended API (eAPI), which enables
users to customize their installation of IMC. It is designed for network administrators and programmers experienced with Java
development environments and XML. The information presented in this manual was up-to-date at publication time. The most
current collection of IMC eAPI help and support files is available at http://www.hp.com/networking/IMC-eAPI.

HP Part Number: 5998-3320


Published: June 2012
Edition: 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, Commercial
Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under
vendor'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 express
warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall
not 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
Revision 1
First publication

June 2012

Contents
1 Quick Start..............................................................................................22
Welcome to iMC RESTful Web Services ....................................................................................22
The First iMC-RS Client............................................................................................................22
Preparations......................................................................................................................22
Verify iMC-RS availability....................................................................................................22
Create project...................................................................................................................23
Compile iMC-RS client codes...............................................................................................23
Run codes and view result...................................................................................................23
iMC-RS Security Mechanism.....................................................................................................24
Identification authentication.................................................................................................24
Verify iMC-RS availability....................................................................................................25

2 Client Access...........................................................................................26
Access
Access
Access
Access
Access

iMC-RS Resources with Apache Commons HTTP Client 3.x................................................26


iMC-RS Resources with Apache HTTP Client 4.x...............................................................26
iMC-RS Resources with RestTemplate of SpringFramework 3.0............................................26
iMC-RS Resources with Jersey Client................................................................................26
iMC-RS Resources with Android SDK..............................................................................26

3 R&D References........................................................................................27
Interface Categories................................................................................................................27
Interfaces for accessing resources.........................................................................................27
Interfaces for registering and receiving real-time events...........................................................27
Real-Time Event Registration and Receipt....................................................................................27
Event registration...............................................................................................................27
Event receipt.....................................................................................................................28
Java client.........................................................................................................................29
Security control..................................................................................................................29
Conventions and Constraints....................................................................................................29
HTTP methods...................................................................................................................30
Content types and character encoding..................................................................................30
Status codes......................................................................................................................30
Wildcard characters supported in queries.............................................................................31
Data types and ranges.......................................................................................................31
Result set of multi-criteria batch queries..................................................................................31
Error Codes...........................................................................................................................31
FAQ......................................................................................................................................32

4 System Management.................................................................................33
Query All Operators...............................................................................................................34
Interface URI.....................................................................................................................34
Access Method..................................................................................................................34
Returned Result..................................................................................................................34
Example...........................................................................................................................35
Query Individual Operators.....................................................................................................36
Interface URI.....................................................................................................................36
Access Method..................................................................................................................36
Returned Result..................................................................................................................36
Example...........................................................................................................................38
Add Operator........................................................................................................................39
Interface URI.....................................................................................................................39
Access Method..................................................................................................................39
Returned Result..................................................................................................................39
Contents

Example...........................................................................................................................40
Modify Operators...................................................................................................................41
Interface URI.....................................................................................................................41
Access Method..................................................................................................................41
Returned Result..................................................................................................................41
Example...........................................................................................................................42
Delete Operator.....................................................................................................................43
Interface URI.....................................................................................................................43
Access Method..................................................................................................................43
Returned Result..................................................................................................................43
Example...........................................................................................................................43
Query Operator Groups..........................................................................................................44
Interface URI.....................................................................................................................44
Access Method..................................................................................................................44
Returned Result..................................................................................................................44
Example...........................................................................................................................45
Query Operator Group Details.................................................................................................46
Interface URI.....................................................................................................................46
Access Method..................................................................................................................46
Returned Result..................................................................................................................46
Example...........................................................................................................................47
Add Operator Group..............................................................................................................48
Interface URI.....................................................................................................................48
Access Method..................................................................................................................48
Returned Result..................................................................................................................48
Example...........................................................................................................................49
Modify Operator Group..........................................................................................................50
Interface URI.....................................................................................................................50
Access Method..................................................................................................................50
Returned Result..................................................................................................................50
Example...........................................................................................................................51
Delete Operator Group...........................................................................................................52
Interface URI.....................................................................................................................52
Access Method..................................................................................................................52
Returned Result..................................................................................................................52
Example...........................................................................................................................52

5 Network Resource Management.................................................................53


Query Device Information List...................................................................................................55
Interface URI.....................................................................................................................55
Access Method..................................................................................................................55
Returned Result..................................................................................................................56
Example...........................................................................................................................56
Query Device Information........................................................................................................57
Interface URI.....................................................................................................................57
Access Method..................................................................................................................57
Returned Result..................................................................................................................57
Example...........................................................................................................................61
Query Device Types................................................................................................................63
Interface URI.....................................................................................................................63
Access Method..................................................................................................................63
Returned Result..................................................................................................................63
Example...........................................................................................................................64
Query Device Type.................................................................................................................65
Interface URI.....................................................................................................................65
4

Contents

Access Method..................................................................................................................65
Returned Result..................................................................................................................65
Example...........................................................................................................................66
Query Vendor Information List..................................................................................................67
Interface URI.....................................................................................................................67
Access Method..................................................................................................................67
Returned Result..................................................................................................................67
Example...........................................................................................................................68
Query Vendor Information.......................................................................................................69
Interface URI.....................................................................................................................69
Access Method..................................................................................................................69
Example...........................................................................................................................70
Query Device Series Information List..........................................................................................71
Interface URI.....................................................................................................................71
Access Method..................................................................................................................71
Returned Result..................................................................................................................72
Example...........................................................................................................................73
Query Device Series Information...............................................................................................74
Interface URI.....................................................................................................................74
Access Method..................................................................................................................74
Returned Result..................................................................................................................74
Example...........................................................................................................................75
Query Device Model Information List.........................................................................................76
Interface URI.....................................................................................................................76
Access Method..................................................................................................................76
Returned Result..................................................................................................................77
Example...........................................................................................................................78
Query Device Model Information..............................................................................................79
Interface URI.....................................................................................................................79
Access Method..................................................................................................................79
Returned Result..................................................................................................................79
Example...........................................................................................................................80
Add Device............................................................................................................................81
Interface URI.....................................................................................................................81
Access Method..................................................................................................................81
Returned Result..................................................................................................................82
Example...........................................................................................................................83
Synchronize Device.................................................................................................................84
Interface URI.....................................................................................................................84
Access Method..................................................................................................................84
Returned Result..................................................................................................................84
Example...........................................................................................................................84
Manage Device......................................................................................................................85
Interface URI.....................................................................................................................85
Access Method..................................................................................................................85
Returned Result..................................................................................................................85
Example...........................................................................................................................85
Unmanage Device..................................................................................................................86
Interface URI.....................................................................................................................86
Access Method..................................................................................................................86
Returned Result..................................................................................................................86
Example...........................................................................................................................86
Delete Device.........................................................................................................................87
Interface URI.....................................................................................................................87
Access Method..................................................................................................................87
Contents

Returned Result..................................................................................................................87
Example...........................................................................................................................87
Modify Device Label...............................................................................................................88
Interface URI.....................................................................................................................88
Access Method..................................................................................................................88
Returned Result..................................................................................................................88
Example...........................................................................................................................89
Modify System Information.......................................................................................................90
Interface URI.....................................................................................................................90
Access Method..................................................................................................................90
Returned Result..................................................................................................................90
Example...........................................................................................................................91
Modify Login Method..............................................................................................................92
Interface URI.....................................................................................................................92
Access Method..................................................................................................................92
Returned Result..................................................................................................................92
Example...........................................................................................................................93
Modify Device Group..............................................................................................................94
Interface URI.....................................................................................................................94
Access Method..................................................................................................................94
Returned Result..................................................................................................................94
Example...........................................................................................................................95
Modify SNMP Settings............................................................................................................96
Interface URI.....................................................................................................................96
Access Method..................................................................................................................96
Returned Result..................................................................................................................97
Example...........................................................................................................................98
Modify Telnet Settings.............................................................................................................99
Interface URI.....................................................................................................................99
Access Method..................................................................................................................99
Returned Result................................................................................................................100
Example.........................................................................................................................100
Modify SSH Settings.............................................................................................................101
Interface URI...................................................................................................................101
Access Method................................................................................................................101
Returned Result................................................................................................................102
Example.........................................................................................................................103
Modify Polling Interval...........................................................................................................104
Interface URI...................................................................................................................104
Access Method................................................................................................................104
Returned Result................................................................................................................104
Example.........................................................................................................................105
Modify Ping Parameters.........................................................................................................106
Interface URI...................................................................................................................106
Access Method................................................................................................................106
Returned Result................................................................................................................106
Example.........................................................................................................................107
Modify Web Network Management Parameters.......................................................................108
Interface URI...................................................................................................................108
Access Method................................................................................................................108
Returned Result................................................................................................................108
Example.........................................................................................................................109
Query Service Monitoring Information List................................................................................110
Interface URI...................................................................................................................110
Access Method................................................................................................................110
6

Contents

Returned Result................................................................................................................110
Example.........................................................................................................................111
Modify Service Monitoring Information....................................................................................112
Interface URI...................................................................................................................112
Access Method................................................................................................................112
Returned Result................................................................................................................113
Example.........................................................................................................................113
Ping....................................................................................................................................114
Interface URI...................................................................................................................114
Access Method................................................................................................................114
Returned Result................................................................................................................114
Example.........................................................................................................................115
Tracert................................................................................................................................116
Interface URI...................................................................................................................116
Access Method................................................................................................................116
Returned Result................................................................................................................116
Example.........................................................................................................................117
Query Links.........................................................................................................................118
Interface URI...................................................................................................................118
Access Method................................................................................................................118
Returned Result................................................................................................................118
Example.........................................................................................................................119
Query Link Information..........................................................................................................120
Interface URI...................................................................................................................120
Access Method................................................................................................................120
Returned Result................................................................................................................120
Example.........................................................................................................................121
Start Automatic Discovery......................................................................................................122
Interface URI...................................................................................................................122
Access Method................................................................................................................122
Returned Result................................................................................................................123
Example 1......................................................................................................................123
Example 2......................................................................................................................124
Example 3......................................................................................................................124
Stop Automatic Discovery......................................................................................................125
Interface URI...................................................................................................................125
Access Method................................................................................................................125
Returned Result................................................................................................................125
Example.........................................................................................................................125
Query Automatic Discovery Status..........................................................................................126
Interface URI...................................................................................................................126
Access Method................................................................................................................126
Returned Result................................................................................................................126
Example.........................................................................................................................126
Query Automatic Device Discovery Results...............................................................................127
Interface URI...................................................................................................................127
Access Method................................................................................................................127
Returned Result................................................................................................................127
Example.........................................................................................................................128
Query Automatically Discovered Devices.................................................................................129
Interface URI...................................................................................................................129
Access Method................................................................................................................129
Returned Result................................................................................................................129
Example.........................................................................................................................130
Query Device Interface Information.........................................................................................131
Contents

Interface URI...................................................................................................................131
Access Method................................................................................................................131
Returned Result................................................................................................................131
Example.........................................................................................................................132
Query Interface Details..........................................................................................................133
Interface URI...................................................................................................................133
Access Method................................................................................................................133
Returned Result................................................................................................................133
Example.........................................................................................................................135
Bring Up an Interface............................................................................................................136
Interface URI...................................................................................................................136
Access Method................................................................................................................136
Returned Result................................................................................................................136
Example.........................................................................................................................136
Shut Down an Interface.........................................................................................................137
Interface URI...................................................................................................................137
Access Method................................................................................................................137
Returned Result................................................................................................................137
Example.........................................................................................................................137
Query Custom View List.........................................................................................................138
Interface URI...................................................................................................................138
Access Method................................................................................................................138
Returned Result................................................................................................................138
Example.........................................................................................................................139
Query Custom View Information.............................................................................................140
Interface URI...................................................................................................................140
Access Method................................................................................................................140
Returned Result................................................................................................................140
Example.........................................................................................................................141
Add Custom View.................................................................................................................142
Interface URI...................................................................................................................142
Access Method................................................................................................................142
Returned Result................................................................................................................142
Example.........................................................................................................................143
Modify Custom View.............................................................................................................144
Interface URI...................................................................................................................144
Access Method................................................................................................................144
Returned Result................................................................................................................145
Example.........................................................................................................................145
Delete Custom View..............................................................................................................146
Interface URI...................................................................................................................146
Access Method................................................................................................................146
Returned Result................................................................................................................146
Example.........................................................................................................................146
Query Interface Views...........................................................................................................147
Interface URI...................................................................................................................147
Access Method................................................................................................................147
Returned Result................................................................................................................147
Example.........................................................................................................................148
Query Interface View Information...........................................................................................149
Interface URI...................................................................................................................149
Access Method................................................................................................................149
Returned Result................................................................................................................149
Example.........................................................................................................................150
Add Interface View...............................................................................................................151
8

Contents

Interface URI...................................................................................................................151
Access Method................................................................................................................151
Returned Result................................................................................................................151
Example.........................................................................................................................152
Modify Interface View...........................................................................................................153
Interface URI...................................................................................................................153
Access Method................................................................................................................153
Returned Result................................................................................................................154
Example.........................................................................................................................154
Delete Interface View............................................................................................................155
Interface URI...................................................................................................................155
Access Method................................................................................................................155
Returned Result................................................................................................................155
Example.........................................................................................................................155
Query IP Views....................................................................................................................156
Interface URI...................................................................................................................156
Access Method................................................................................................................156
Returned Result................................................................................................................156
Example.........................................................................................................................157
Query IP View......................................................................................................................158
Interface URI...................................................................................................................158
Access Method................................................................................................................158
Returned Result................................................................................................................158
Example.........................................................................................................................159
Export Topology in Visio Format.............................................................................................160
Interface URI...................................................................................................................160
Access Method................................................................................................................160
Returned Result................................................................................................................160
Example.........................................................................................................................161
Query SNMP Template Information List....................................................................................162
Interface URI...................................................................................................................162
Access Method................................................................................................................162
Returned Result................................................................................................................162
Example.........................................................................................................................163
Query SNMP Template Information.........................................................................................164
Interface URI...................................................................................................................164
Access Method................................................................................................................164
Returned Result................................................................................................................164
Example.........................................................................................................................166
Query Telnet Template Information List.....................................................................................167
Interface URI...................................................................................................................167
Access Method................................................................................................................167
Returned Result................................................................................................................167
Example.........................................................................................................................168
Query Telnet Template Information..........................................................................................169
Interface URI...................................................................................................................169
Access Method................................................................................................................169
Returned Result................................................................................................................169
Example.........................................................................................................................170
Query SSH Template Information List.......................................................................................171
Interface URI...................................................................................................................171
Access Method................................................................................................................171
Returned Result................................................................................................................171
Example.........................................................................................................................172
Query SSH Template Information............................................................................................173
Contents

Interface URI...................................................................................................................173
Access Method................................................................................................................173
Returned Result................................................................................................................173
Example.........................................................................................................................174
Query SQL Statements..........................................................................................................175
Interface URI...................................................................................................................175
Access Method................................................................................................................175
Returned Result................................................................................................................175
Example.........................................................................................................................176

6 User Management..................................................................................177
Query Users........................................................................................................................178
Interface URI...................................................................................................................178
Access Method................................................................................................................178
Returned Result................................................................................................................179
Example.........................................................................................................................180
Query User Information.........................................................................................................181
Interface URI...................................................................................................................181
Access Method................................................................................................................181
Returned Result................................................................................................................181
Example.........................................................................................................................182
Add User.............................................................................................................................183
Interface URI...................................................................................................................183
Access Method................................................................................................................183
Returned Result................................................................................................................183
Example.........................................................................................................................184
Modify User.........................................................................................................................185
Interface URI...................................................................................................................185
Access Method................................................................................................................185
Returned Result................................................................................................................186
Example.........................................................................................................................186
Delete User..........................................................................................................................187
Interface URI...................................................................................................................187
Access Method................................................................................................................187
Returned Result................................................................................................................187
Example.........................................................................................................................187
Query User Additional Information Definitions..........................................................................188
Interface URI...................................................................................................................188
Access Method................................................................................................................188
Returned Result................................................................................................................188
Example.........................................................................................................................189
Query User Additional Information Definition...........................................................................190
Interface URI...................................................................................................................190
Access Method................................................................................................................190
Returned Result................................................................................................................190
Example.........................................................................................................................192
Add User Additional Information Definition..............................................................................193
Interface URI...................................................................................................................193
Access Method................................................................................................................193
Returned Result................................................................................................................194
Example 1......................................................................................................................194
Example 2......................................................................................................................195
Modify User Additional Information Definition..........................................................................196
Interface URI...................................................................................................................196
Access Method................................................................................................................196
10

Contents

Returned Result................................................................................................................197
Example.........................................................................................................................197
Delete User Additional Information Definition...........................................................................198
Interface URI...................................................................................................................198
Access Method................................................................................................................198
Returned Result................................................................................................................198
Example.........................................................................................................................198

7 Terminal Access Management..................................................................199


Query Unauthorized Access Attempts......................................................................................201
Interface URI...................................................................................................................201
Access Method................................................................................................................201
Returned Result................................................................................................................202
Example.........................................................................................................................203
Query Unauthorized Access Logs............................................................................................204
Interface URI...................................................................................................................204
Access Method................................................................................................................204
Returned Result................................................................................................................205
Example.........................................................................................................................206
Query Access Log Histories....................................................................................................207
Interface URI...................................................................................................................207
Access Method................................................................................................................207
Returned Result................................................................................................................208
Example.........................................................................................................................209
Query Current Accesses........................................................................................................210
Interface URI...................................................................................................................210
Access Method................................................................................................................210
Returned Result................................................................................................................211
Example.........................................................................................................................212
Query Real-Time Locations.....................................................................................................213
Interface URI...................................................................................................................213
Access Method................................................................................................................213
Returned Result................................................................................................................213
Example.........................................................................................................................214
Query All IP Segments..........................................................................................................215
Interface URI...................................................................................................................215
Access Method................................................................................................................215
Returned Result................................................................................................................215
Example.........................................................................................................................217
Query IP Segment................................................................................................................218
Interface URI...................................................................................................................218
Access Method................................................................................................................218
Returned Result................................................................................................................218
Example.........................................................................................................................220
Add IP Segment...................................................................................................................221
Interface URI...................................................................................................................221
Access Method................................................................................................................221
Returned Result................................................................................................................221
Example 1......................................................................................................................222
Example 2......................................................................................................................222
Add Child IP Segment...........................................................................................................223
Interface URI...................................................................................................................223
Access Method................................................................................................................223
Returned Result................................................................................................................223
Example.........................................................................................................................224
Contents

11

Modify IP Segment...............................................................................................................225
Interface URI...................................................................................................................225
Access Method................................................................................................................225
Returned Result................................................................................................................225
Example.........................................................................................................................226
Release IP Segment...............................................................................................................227
Interface URI...................................................................................................................227
Access Method................................................................................................................227
Returned Result................................................................................................................227
Example.........................................................................................................................227
Automatically Scan IP Segment...............................................................................................228
Interface URI...................................................................................................................228
Access Method................................................................................................................228
Returned Result................................................................................................................228
Example.........................................................................................................................230
Automatically Scan Assigned IP Segment.................................................................................231
Interface URI...................................................................................................................231
Access Method................................................................................................................231
Returned Result................................................................................................................231
Example.........................................................................................................................232
Query IP Addresses..............................................................................................................233
Interface URI...................................................................................................................233
Access Method................................................................................................................233
Returned Result................................................................................................................234
Example.........................................................................................................................235
Assign IP Address.................................................................................................................236
Interface URI...................................................................................................................236
Access Method................................................................................................................236
Returned Result................................................................................................................236
Example.........................................................................................................................237
Release Assigned IP Address..................................................................................................238
Interface URI...................................................................................................................238
Access Method................................................................................................................238
Returned Result................................................................................................................238
Example.........................................................................................................................238
Query Terminal Access Bindings.............................................................................................239
Interface URI...................................................................................................................239
Access Method................................................................................................................239
Returned Result................................................................................................................240
Example.........................................................................................................................240
Query Terminal Access Binding..............................................................................................241
Interface URI...................................................................................................................241
Access Method................................................................................................................241
Returned Result................................................................................................................241
Example.........................................................................................................................242
Automatically Scan Terminal Access Bindings...........................................................................243
Interface URI...................................................................................................................243
Access Method................................................................................................................243
Returned Result................................................................................................................243
Example.........................................................................................................................244
Add Terminal Access Binding.................................................................................................245
Interface URI...................................................................................................................245
Access Method................................................................................................................245
Returned Result................................................................................................................245
Example 1......................................................................................................................246
12

Contents

Example 2......................................................................................................................246
Modify Terminal Access Binding.............................................................................................247
Interface URI...................................................................................................................247
Access Method................................................................................................................247
Returned Result................................................................................................................247
Example.........................................................................................................................248
Delete Terminal Access Binding..............................................................................................249
Interface URI...................................................................................................................249
Access Method................................................................................................................249
Returned Result................................................................................................................249
Example.........................................................................................................................249
Query Switch Access Bindings...............................................................................................250
Interface URI...................................................................................................................250
Access Method................................................................................................................250
Returned Result................................................................................................................251
Example.........................................................................................................................252
Query Switch Access Binding.................................................................................................253
Interface URI...................................................................................................................253
Access Method................................................................................................................253
Returned Result................................................................................................................253
Example.........................................................................................................................254
Automatically Scan Switch Access Bindings..............................................................................255
Interface URI...................................................................................................................255
Access Method................................................................................................................255
Returned Result................................................................................................................255
Example.........................................................................................................................256
Add Switch Access Binding....................................................................................................257
Interface URI...................................................................................................................257
Access Method................................................................................................................257
Returned Result................................................................................................................257
Example 1......................................................................................................................258
Example 2......................................................................................................................258
Modify Switch Access Binding................................................................................................259
Interface URI...................................................................................................................259
Access Method................................................................................................................259
Returned Result................................................................................................................259
Example.........................................................................................................................260
Delete Switch Access Binding.................................................................................................261
Interface URI...................................................................................................................261
Access Method................................................................................................................261
Returned Result................................................................................................................261
Example.........................................................................................................................261
Query IP-to-MAC Address Bindings.........................................................................................262
Interface URI...................................................................................................................262
Access Method................................................................................................................262
Returned Result................................................................................................................262
Example.........................................................................................................................263
Query IP-to-MAC Address Binding..........................................................................................264
Interface URI...................................................................................................................264
Access Method................................................................................................................264
Returned Result................................................................................................................264
Example.........................................................................................................................265
Automatically Scan IP-to-MAC Address Bindings.......................................................................266
Interface URI...................................................................................................................266
Access Method................................................................................................................266
Contents

13

Returned Result................................................................................................................266
Example.........................................................................................................................267
Add IP-to-MAC Address Binding.............................................................................................268
Interface URI...................................................................................................................268
Access Method................................................................................................................268
Returned Result................................................................................................................268
Example.........................................................................................................................269
Delete IP-to-MAC Address Binding..........................................................................................270
Interface URI...................................................................................................................270
Access Method................................................................................................................270
Returned Result................................................................................................................270
Example.........................................................................................................................270
Query Conflict and Unauthorized Access Policy........................................................................271
Interface URI...................................................................................................................271
Access Method................................................................................................................271
Returned Result................................................................................................................271
Example.........................................................................................................................272
Query Unknown Access Policy...............................................................................................273
Interface URI...................................................................................................................273
Access Method................................................................................................................273
Returned Result................................................................................................................273
Example.........................................................................................................................274
Modify Conflict and Unauthorized Access Policy.......................................................................275
Interface URI...................................................................................................................275
Access Method................................................................................................................275
Returned Result................................................................................................................275
Example.........................................................................................................................276
Modify Unknown Access Policy..............................................................................................277
Interface URI...................................................................................................................277
Access Method................................................................................................................277
Returned Result................................................................................................................278
Example.........................................................................................................................278

8 Network Alarm Management...................................................................279


Query Alarms......................................................................................................................280
Interface URI...................................................................................................................280
Access Method................................................................................................................280
Returned Result................................................................................................................281
Example.........................................................................................................................282
Query Alarm Information.......................................................................................................283
Interface URI...................................................................................................................283
Access Method................................................................................................................283
Returned Result................................................................................................................283
Example.........................................................................................................................286
Query Root Alarm Information................................................................................................287
Interface URI...................................................................................................................287
Access Method................................................................................................................287
Returned Result................................................................................................................287
Example.........................................................................................................................288
Query Child Alarms..............................................................................................................289
Interface URI...................................................................................................................289
Access Method................................................................................................................289
Returned Result................................................................................................................289
Example.........................................................................................................................290
Query Top N Alarming Devices..............................................................................................291
14

Contents

Interface URI...................................................................................................................291
Access Method................................................................................................................291
Returned Result................................................................................................................291
Example.........................................................................................................................292
Query Alarming Enterprises...................................................................................................293
Interface URI...................................................................................................................293
Access Method................................................................................................................293
Returned Result................................................................................................................293
Example.........................................................................................................................294
Query Alarm Events..............................................................................................................295
Interface URI...................................................................................................................295
Access Method................................................................................................................295
Returned Result................................................................................................................295
Example.........................................................................................................................296
Query Alarm Categories.......................................................................................................297
Interface URI...................................................................................................................297
Access Method................................................................................................................297
Returned Result................................................................................................................297
Example.........................................................................................................................298
Query Alarm Levels...............................................................................................................299
Interface URI...................................................................................................................299
Access Method................................................................................................................299
Returned Result................................................................................................................299
Example.........................................................................................................................300
Query Alarm Source Types....................................................................................................301
Interface URI...................................................................................................................301
Access Method................................................................................................................301
Returned Result................................................................................................................301
Example.........................................................................................................................302
Query Alarm Recovery Status.................................................................................................303
Interface URI...................................................................................................................303
Access Method................................................................................................................303
Returned Result................................................................................................................303
Example.........................................................................................................................304
Query Alarm Acknowledgement Status....................................................................................305
Interface URI...................................................................................................................305
Access Method................................................................................................................305
Returned Result................................................................................................................305
Query Alarm Time Ranges.....................................................................................................306
Interface URI...................................................................................................................306
Access Method................................................................................................................306
Returned Result................................................................................................................306
Example.........................................................................................................................307
Recover Alarm......................................................................................................................308
Interface URI...................................................................................................................308
Access Method................................................................................................................308
Returned Result................................................................................................................308
Example.........................................................................................................................308
Acknowledge Alarm.............................................................................................................309
Interface URI...................................................................................................................309
Access Method................................................................................................................309
Returned Result................................................................................................................309
Example.........................................................................................................................309
Delete Alarm........................................................................................................................310
Interface URI...................................................................................................................310
Contents

15

Access Method................................................................................................................310
Returned Result................................................................................................................310
Example.........................................................................................................................310
Register Send-Alarm-to-Server Event.........................................................................................311
Interface URI...................................................................................................................311
Access Method................................................................................................................311
Returned Result................................................................................................................311
Example.........................................................................................................................312

9 Network Syslog Management..................................................................313


Query Syslog Information......................................................................................................314
Interface URI...................................................................................................................314
Access Method................................................................................................................314
Returned Result................................................................................................................314
Example.........................................................................................................................315
Query Syslog Information List.................................................................................................316
Interface URI...................................................................................................................316
Access Method................................................................................................................316
Returned Result................................................................................................................316
Example.........................................................................................................................317
Query Unmanaged Device Filtering Rule Status.........................................................................318
Interface URI...................................................................................................................318
Access Method................................................................................................................318
Returned Result................................................................................................................318
Example.........................................................................................................................319
Query Unmanaged Device Filtering Rule Status List...................................................................320
Interface URI...................................................................................................................320
Access Method................................................................................................................320
Returned Result................................................................................................................320
Example.........................................................................................................................321
Modify Unmanaged Device Filtering Rule Status.......................................................................322
Interface URI...................................................................................................................322
Access Method................................................................................................................322
Returned Result................................................................................................................322
Example.........................................................................................................................322

10 Network Performance Management........................................................323


Query Summaries.................................................................................................................324
Interface URI...................................................................................................................324
Access Method................................................................................................................324
Returned Result................................................................................................................324
Example.........................................................................................................................325
Query Index Groups.............................................................................................................326
Interface URI...................................................................................................................326
Access Method................................................................................................................326
Returned Result................................................................................................................326
Example.........................................................................................................................327
Query Performance Indexes...................................................................................................328
Interface URI...................................................................................................................328
Access Method................................................................................................................328
Returned Result................................................................................................................328
Example.........................................................................................................................329
Query Single-Device Single-Index Instances.............................................................................331
Interface URI...................................................................................................................331
Access Method................................................................................................................331
Returned Result................................................................................................................331
16

Contents

Example.........................................................................................................................332
Query Single-Index Multi-Device Performance Summary Data.....................................................333
Interface URI...................................................................................................................333
Access Method................................................................................................................333
Returned Result................................................................................................................333
Example.........................................................................................................................334
Query Single-Index Single-Interface Performance Summary Data................................................336
Interface URI...................................................................................................................336
Access Method................................................................................................................336
Returned Result................................................................................................................336
Example.........................................................................................................................338
Query Single Instance Performance Details..............................................................................339
Interface URI...................................................................................................................339
Access Method................................................................................................................339
Returned Result................................................................................................................339
Example.........................................................................................................................340
Query Single-Index TopN Data..............................................................................................341
Interface URI...................................................................................................................341
Access Method................................................................................................................341
Returned Result................................................................................................................341
Example.........................................................................................................................342
Add Custom Performance Index..............................................................................................344
Interface URI...................................................................................................................344
Access Method................................................................................................................344
Returned Result................................................................................................................344
Example.........................................................................................................................345
Delete Custom Performance Index...........................................................................................346
Interface URI...................................................................................................................346
Access Method................................................................................................................346
Returned Result................................................................................................................346
Example.........................................................................................................................346

11 Report Management..............................................................................347
Query Periodic Reports..........................................................................................................348
Interface URI...................................................................................................................348
Access Method................................................................................................................348
Returned Result................................................................................................................348
Example.........................................................................................................................349
Query Periodic Report Details.................................................................................................350
Interface URI...................................................................................................................350
Access Method................................................................................................................350
Returned Result................................................................................................................350
Example.........................................................................................................................351
Query Periodic Report Histories..............................................................................................352
Interface URI...................................................................................................................352
Access Method................................................................................................................352
Returned Result................................................................................................................352
Example.........................................................................................................................353
Get History File of a Periodic Report........................................................................................354
Interface URI...................................................................................................................354
Access Method................................................................................................................354
Returned Result................................................................................................................354
Example.........................................................................................................................354

12 Network Asset Management..................................................................355


Query Assets.......................................................................................................................356
Contents

17

Interface URI...................................................................................................................356
Access Method................................................................................................................356
Returned Result................................................................................................................357
Example.........................................................................................................................359
Query Asset Details..............................................................................................................360
Interface URI...................................................................................................................360
Access Method................................................................................................................360
Returned Result................................................................................................................360
Example.........................................................................................................................363

13 Network Service Management................................................................364


Query VLANs......................................................................................................................365
Interface URI...................................................................................................................365
Access Method................................................................................................................365
Returned Result................................................................................................................365
Example.........................................................................................................................367
Query VLAN Ports................................................................................................................368
Interface URI...................................................................................................................368
Access Method................................................................................................................368
Returned Result................................................................................................................368
Example.........................................................................................................................370
Add VLAN..........................................................................................................................371
Interface URI...................................................................................................................371
Access Method................................................................................................................371
Returned Result................................................................................................................371
Example.........................................................................................................................372
Delete VLAN........................................................................................................................373
Interface URI...................................................................................................................373
Access Method................................................................................................................373
Returned Result................................................................................................................373
Example.........................................................................................................................373
Change VLAN Name............................................................................................................374
Interface URI...................................................................................................................374
Access Method................................................................................................................374
Returned Result................................................................................................................374
Example.........................................................................................................................374
Add Port to VLAN.................................................................................................................375
Interface URI...................................................................................................................375
Access Method................................................................................................................375
Returned Result................................................................................................................375
Example.........................................................................................................................376
Remove Port from VLAN.........................................................................................................377
Interface URI...................................................................................................................377
Access Method................................................................................................................377
Returned Result................................................................................................................377
Example.........................................................................................................................377
Query Access Ports...............................................................................................................378
Interface URI...................................................................................................................378
Access Method................................................................................................................378
Returned Result................................................................................................................378
Example.........................................................................................................................379
Change PVID of Access Port...................................................................................................380
Interface URI...................................................................................................................380
Access Method................................................................................................................380
Returned Result................................................................................................................380
18

Contents

Example.........................................................................................................................380
Query Hybrid Ports...............................................................................................................381
Interface URI...................................................................................................................381
Access Method................................................................................................................381
Returned Result................................................................................................................381
Example.........................................................................................................................383
Add Hybrid Port...................................................................................................................384
Interface URI...................................................................................................................384
Access Method................................................................................................................384
Returned Result................................................................................................................384
Example.........................................................................................................................385
Delete Hybrid Port.................................................................................................................386
Interface URI...................................................................................................................386
Access Method................................................................................................................386
Returned Result................................................................................................................386
Example.........................................................................................................................386
Modify Hybrid Port...............................................................................................................387
Interface URI...................................................................................................................387
Access Method................................................................................................................387
Returned Result................................................................................................................387
Example.........................................................................................................................388
Query Trunk Ports.................................................................................................................389
Interface URI...................................................................................................................389
Access Method................................................................................................................389
Returned Result................................................................................................................389
Example.........................................................................................................................391
Add Trunk Port.....................................................................................................................392
Interface URI...................................................................................................................392
Access Method................................................................................................................392
Returned Result................................................................................................................392
Example.........................................................................................................................393
Delete Trunk Port...................................................................................................................394
Interface URI...................................................................................................................394
Access Method................................................................................................................394
Returned Result................................................................................................................394
Example.........................................................................................................................394
Modify Trunk Port.................................................................................................................395
Interface URI...................................................................................................................395
Access Method................................................................................................................395
Returned Result................................................................................................................395
Example.........................................................................................................................395
Query VLAN Interfaces.........................................................................................................396
Interface URI...................................................................................................................396
Access Method................................................................................................................396
Returned Result................................................................................................................396
Example.........................................................................................................................398
Query a Specific VLAN Interface ...........................................................................................399
Interface URI...................................................................................................................399
Access Method................................................................................................................399
Returned Result................................................................................................................399
Example.........................................................................................................................400
Add VLAN Interface..............................................................................................................401
Interface URI...................................................................................................................401
Access Method................................................................................................................401
Returned Result................................................................................................................401
Contents

19

Example.........................................................................................................................402
Delete VLAN Interface...........................................................................................................403
Interface URI...................................................................................................................403
Access Method................................................................................................................403
Returned Result................................................................................................................403
Example.........................................................................................................................403

14 ACL Management.................................................................................404
Query the Device List of ACL Configuration..............................................................................405
Interface URI...................................................................................................................405
Access Method................................................................................................................405
Returned Result................................................................................................................405
Example.........................................................................................................................407
Synchronize ACL Configuration Information for a Device............................................................408
Interface URI...................................................................................................................408
Access Method................................................................................................................408
Returned Result................................................................................................................408
Example.........................................................................................................................408
Query the ACL Definitions of a Device.....................................................................................409
Interface URI...................................................................................................................409
Access Method................................................................................................................409
Returned Result................................................................................................................409
Example.........................................................................................................................411
Add ACL on a Device...........................................................................................................412
Interface URI...................................................................................................................412
Access Method................................................................................................................412
Returned Result................................................................................................................415
Example.........................................................................................................................415
Delete ACL from a Device......................................................................................................420
Interface URI...................................................................................................................420
Access Method................................................................................................................420
Returned Result................................................................................................................420
Example.........................................................................................................................420
Query ACL Applications of a Device.......................................................................................421
Interface URI...................................................................................................................421
Access Method................................................................................................................421
Returned Result................................................................................................................421
Example.........................................................................................................................423
Add ACL Application on a Device..........................................................................................424
Interface URI...................................................................................................................424
Access Method................................................................................................................424
Returned Result................................................................................................................425
Example.........................................................................................................................425
Delete ACL Application from a Device.....................................................................................426
Interface URI...................................................................................................................426
Access Method................................................................................................................426
Returned Result................................................................................................................426
Example.........................................................................................................................426
Query ACL Time Ranges of a Device.......................................................................................427
Interface URI...................................................................................................................427
Access Method................................................................................................................427
Returned Result................................................................................................................427
Example.........................................................................................................................428
Add ACL Time Range on a Device..........................................................................................429
Interface URI...................................................................................................................429
20

Contents

Access Method................................................................................................................429
Returned Result................................................................................................................430
Example.........................................................................................................................430
Delete ACL Time Range from a Device.....................................................................................431
Interface URI...................................................................................................................431
Access Method................................................................................................................431
Returned Result................................................................................................................431
Example.........................................................................................................................431
Query Child Time.................................................................................................................432
Interface URI...................................................................................................................432
Access Method................................................................................................................432
Returned Result................................................................................................................432
Example.........................................................................................................................434

15 Support and other resources...................................................................435


Contacting HP......................................................................................................................435
Subscription service..............................................................................................................435
Warranty............................................................................................................................435
Documentation.....................................................................................................................435
Prerequisites.........................................................................................................................436
Typographic conventions.......................................................................................................436
About the HP IMC documentation set......................................................................................436

16 Documentation feedback.......................................................................438

Contents

21

1 Quick Start
This guide provides overview and reference information for the iMC extended API, a set of
commands and support files that enables you to customize your iMC experience.

Welcome to iMC RESTful Web Services


iMC provides web services based on open service-oriented architecture (SOA). Web services are
primarily implemented using these methods: REST, SOAP, and XML-RPC. Compared with the other
two methods, the REST-style web services feature clearness and simplicity.
Using the Hypermedia as the Engine of Application State (HATEOAS) feature of the REST application
architecture, together with the systematic and extendable web services, iMC becomes very flexible
to offer various and customized services. Almost all iMC services can be integrated into target
software as RESTful web services, meeting various service integration requirements at present and
in future.
The user guide is intended for RESTful web services users, and comprises the following contents:
Quick Start
Describes the basic structure and access method of iMC RESTful web services, helping you quickly
establish the client environment for accessing the basic service interfaces.
Client Access
Describes 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 SDK

This document covers the access method based on Java only, but not other languages or systems.
R & D References
Describes the iMC-RS design ideas, conventions, and development constraints.

The First iMC-RS Client


This section guides you to quickly access iMC-RS services and to create your first iMC-RS client
program.
The following shows you how to access iMC-RS with Java. Ensure that you are familiar with Java
and the Eclipse environment.

Preparations
Make 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 availability


Follow these steps to verify the availability of iMC-RS:

22

Quick Start

1.

2.
3.

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).
In the identity authentication dialog box that appears, enter "admin" as the username and
password, and click OK.
If the browser displays an XML document with "<application>" as the root node, iMC-RS is
ready for you to use. If you encounter an error (such as a 404 error) in step 2 or 3, check
your iMC version and service.

Create project
Launch 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.jar
to the project.
4. Click Finish.

Compile iMC-RS client codes


Right-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
import
import
import
import
import

org.apache.http.HttpResponse;
org.apache.http.auth.AuthScope;
org.apache.http.auth.UsernamePasswordCredentials;
org.apache.http.client.methods.HttpGet;
org.apache.http.impl.client.DefaultHttpClient;
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 result


Select 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 the
first ten device entries in XML format.

iMC-RS Security Mechanism


The iMC-RS framework allows you to access iMC resources and services in secure mode. It features
in the following:

Identity authentication: iMC-RS offers a simple and effective identify authentication mode
called HTTP digest authentication (see RFC 2617). It does not transfer passwords on the
network and thus effectively protects the REST user passwords. This authentication process is
required, 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 can
be accessed through HTTPS when necessary.

Password protection: With this feature, iMC-RS denies access from a client for a minute by
giving a 403 Forbidden error message if the client continuously enters an incorrect username
or password five times.

Identification authentication
An iMC operator is used for iMC-RS identity authentication, if the operator is a member of the
default administrator group, or a group with administrator rights and with the RESTful Web Services
Call 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 the
iMC system in the following ways:

24

iMC-RS identity authentication does not check the ACLs and password control policy of the
operator.

iMC operators use the "simple password authentication" method to access iMC-RS. If an
operator uses RADIUS or LDAP authentication, the operator must successfully log in to iMC
first and then can pass iMC-RS authentication. If the authentication password is changed, the

Quick Start

operator must successfully log in to iMC with the new password, and then can pass iMC-RS
authentication.

By default, an operator can use all RESTful services offered by iMC-RS, regardless of the
operation 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 device
and 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 availability


Follow 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 and
password, and click OK.
3. If the browser displays an XML document with "<application>" as the root node, iMC-RS is
ready for you to use. If you encounter an error (such as a 404 error) in step 2 or 3, check
your iMC version and service.

iMC-RS Security Mechanism

25

2 Client Access
The IMC Extended API (eAPI) provides a number of Java test code examples based on common
web services:

Apache Commons HTTP Client 3.x

Apache HTTP Client 4.x

SpringFramework 3.0

Jersey Client

Android SDK

These Java test code examples are located in the rest_en\manual\client folder in your eAPI
package.

Access iMC-RS Resources with Apache Commons HTTP Client 3.x


For more information, see the Test Code Example: CommonsClientTest.java.

Access iMC-RS Resources with Apache HTTP Client 4.x


For more information, see the Test Code Example: HttpClientTest.java.

Access iMC-RS Resources with RestTemplate of SpringFramework 3.0


For more information, see the Test Code Example: RestTemplateTest.java.

Access iMC-RS Resources with Jersey Client


For more information, see the Test Code Example: JerseyClientTest.java.

Access iMC-RS Resources with Android SDK


For more information, see the Test Code Example: AndroidTest.java.

26

Client Access

3 R&D References
This 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 Categories
The interfaces of the iMC-RS framework can be classified into two categories, one for accessing
iMC resources, and the other for registering and receiving real-time events.

Interfaces for accessing resources


This category of interface works in the synchronous request/response mode to response the request
from 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 category
of interface, see Client Access.

Interfaces for registering and receiving real-time events


This category of interface processes registration of particular types of event from the client, and
informs the client of the latest events in real time with asynchronous notification. The interface
implements HTTP server push to register events such as real-time alarms and real-time device status
changes, and informs the client of the event immediately after it occurs.
For more information about this category of interface, see Real-Time Event Registration and
Receipt.

Real-Time Event Registration and Receipt


The iMC-RS framework can receive and accept the registration requests of real-time events. After
receiving 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 the
HTTP 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 to
the client every minute to verify network connections.
This section describes real-time event registration and receipt by using the java.net.URL access
method.

Event registration
iMC-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 about
message types, see the related API references.
2. The "accept" message header defines the format of notification messages. The valid message
formats include XML (application/xml) and JSON (application/json).
3. The query criteria must include the "type" parameter, which defines the type of the message
to be registered. You can set other parameters (see related API references) to narrow down
the query results.
4. If the registration succeeds, the server returns the 202 (Accepted) status code, and maintains
the HTTP connection for transmitting subsequent notifications. If the registration fails, the server
returns 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 for
transmitting subsequent messages.

400 (Bad Request): Invalid query parameters. The server returns this status code if the registration
request message does not include the "type" parameter, or the event type specified by the
parameter is not supported.

403 (Forbidden): The client denied registration of the message. For more information, see the
Security Control section.

405 (Method Not Allowed): The HTTP method of the registration request is not GET. The iMC-RS
framework supports only the GET type message in event registration and notification.

406 (Not Acceptable): Unsupported content type (which is the "accept" message header in
the registration request). The iMC-RS framework supports only the following content types in
event registration and notification: application/xml and application/json.

Event receipt
When the server generates a registration event, it pushes the event in real time to the corresponding
client 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.

2.
3.

Event messages are separated with a blank line. Once the server reads a blank line, it decides
that it has read a complete event and should process the event. After complete processing the
event, the server continues to read subsequent events.
The server sends a heartbeat message "#HEART_BEAT" every minute, which can be ignored
by the client
The received events are represented in strings, which can be converted into class entities with
JAXB or other libraries as needed.

Java client
If you use Java to access iMC-RS real-time events, integrate file EventClient.java into your
source 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 control
The iMC-RS event notification framework maintains a long connection with the client for receiving
events 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 the
identity of the operator that uses the client. Instead, the framework implements iMC-RS event access
control 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 client
to access iMC-RS events, open file web\apps\imcrs\WEB-INF\web.xml in the iMC installation
path, 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 Constraints


This section describes the conventions and constraints in iMC-RS interfaces.

Conventions and Constraints

29

HTTP methods
The iMC-RS interfaces use GET, POST, PUT, and DELETE to query (or read), add, modify (or
configure), and delete iMC resources. These HTTP methods comply with the recommendations in
RESTful 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 the
status code and message header only, but does not return a message body in the response.

Content types and character encoding


By 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 API
documents.
All message bodies in the packets exchanged by iMC-RS are encoded in UTF-8.

Status codes
The HTTP status codes returned by iMC-RS interfaces comply with the recommendations in RESTful
web 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 caused
by non-existent object.

Add (POST method): 201 (Created) for success and returning link to the object, 204 (No
Content) for success without returning any content.

Modify (PUT method): 204 (No Content) for success without returning any content, 404 (Not
Found) 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), the
Error-Code attribute, and the Error-Message attribute. For more information about the error codes
and their descriptions, see Error Codes.
In addition, you may encounter errors that are caused by error encoding or iMC server errors. The
following describes these errors, their status codes, and solutions:

30

Non-existent service specified by the URI: 404 (Not Found). Check the URI against the API
documentation and correct the URI. Note that when this error occurs, the returned packet
contains the message body in HTML format. When the object of the GET or PUT method does
not exist, the returned packet does not contain any message body, though its status code is
404 (Not Found).

Unsupported method: 405 (Method Not Allowed). Check the API documentation or use the
OPTIONS method to get the supported methods.

Unsupported content type: 406 (Not Acceptable). Set a valid content type (accept message
header) 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 to


the Identity Authentication and Privilege Control section and test code example.

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 works
normally (for example, whether or not the web page can be normally accessed), or contact
the technical support.

Wildcard characters supported in queries


In multi-criteria queries, some string-type criteria support wildcard characters asterisk (*) and
question mark (?), the former matching zero or more characters and the latter matching a single
character. A query without any wildcard character specified returns an exact match.

Data types and ranges


iMC-RS supports the following data types:

Integer (int): Ranges from -2147483648 to 2147483647 (0x80000000 to 0x7fffffff in


hexadecimal 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 queries


Multi-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 current
operation, 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 of
the message header returns the number of records that meet the requirements.

Error Codes
If an HTTP response message gives the 409 (Conflict) status code, the Error-Code and Error Message
attributes in the message header show the iMC error code and error description. For example:
HTTP/1.1 409 Conflict
Error-Code: 4
Error-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
3 Operation timeout.
The server performance may be insufficient. Please check the data later to see if the operation succeeds.
4 Database error.
Please check the database status.
2003 Database error.
2013 Failed to access the device.

Error Codes

31

Table 1 Error codes and descriptions (continued)


Query Parameters
2014 The device already exists.
2015 Unknown device.
2024 The device cannot be pinged.
2032 The number of devices exceeds the limit set in the license.
2033 Failed to obtain the limit of the device number from the license.
2038 Domain name resolution or reverse domain name resolution failure.
2041 The parent symbol has been deleted.
2046 The SNMP template has been deleted.
2047 The Telnet template has been deleted.
2054 The device IP address is invalid when the device is added.
2078 The SNMP parameters on the device are invalid.
2094 Failed to operate the SSH key file.
50311 The operator already exists.
50334 The operator group already exists.
50339 The operator group is in use.
50340 The default operator group cannot be deleted.

FAQ
This section describes the problems you may encounter when developing iMC-RS, and provides
solutions 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 can
view 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 (*) and
question mark (?). The former matches zero or more characters, and the latter matches a single
character. A query without any wildcard character specified returns an exact match. When
performing 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, you
may obtain undesired results. To prevent such problems, escape special characters with the method
described in the corresponding database document
How 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 disabled
by default. You can enable this feature with the following method:
Open file client\conf\log4j.properties in the iMC installation path, locate the
log4j.appender.IMCRS.Threshold string, and change its value from INFO to DEBUG or
TRACE. In the DEBUG level, iMC-RS records the header of each request or response message that
is called. In the TRACE level, iMC-RS records both the header and the message body. iMC-RS
saves the call logs in file client\log\imcrs.log in the iMC installation path.

32

R&D References

4 System Management
This section provides eAPI commands that enable you to manage the users who can operate your
IMC 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 Operators


Query and list all operators.

Interface URI
/plat/operator

Access Method
HTTP
GET

Parameters
Query parameters
start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value is uploaded, the default value is
used.

size

The total number of returned records.


Integer type. Optional. The default value is 10. If a negative value is uploaded, the default value is
used.

orderBy

The sequencing field of the returned result set.


String type. Optional. The default value is id. Valid values include ip, mac, name and type.

desc

Whether or not the result is sequenced in reverse order.


Boolean type. Optional. The default value is false. The parameter is valid only when the orderBy
parameter is specified.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Total attribute of the message header
returns the number of records that meet the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total 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>

Elements
For meanings of the fields in the message body, see Query All Operators (page 34).

Example
Query and list all operators.

Request
GET http://imc_host:8080/imcrs/plat/operator
accept: application/xml
. . .

Response
HTTP/q.q 200 OK
Content-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 Operators


Query an operator with certain ID.

Interface URI
/plat/operator/{id}

Access Method
HTTP
GET

Parameters
Path parameters
id

Operator ID.
Long 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
id

Operator ID.
Long integer type. It is not required when you add an operator and is required when you
modify an operator.

name

Operator logon name.


String type. It is required when you add an operator and cannot be modified when you modify
an operator.

fullName

Operator full name.


String type. It is optional when you add or modify an operator.

desc

Operator description.
String type. It is optional when you add or modify an operator.

36

System Management

Operator elements
authType

Authentication type.
Integer type. 0: simple password authentication. 1: RADUIS authentication. 2:LDAP
authentication. It is required when you add or modify an operator.

password

Operator password.
String type. It is required when you add or modify an operator if the authentication type is
0.

sessionTimeout

Idle timeout.
Integer type, in the range of 1 to 9999999. When you add or modify an operator without
setting this parameter, the system parameter will take affect.

operatorGroup

OperatorGroup ID.
Long integer type. It is required when you add or modify an operator.

default Acl

Default value of operator ACL control.


Integer type, 0 refers to permission and 1 refers to disable. It is required when you add or
modify an operator.

operatorAclList

Operator ACL List.


Operator ACL information list. It is optional when you add or modify an operator.

operatorAcl

Operator ACL information.


Suboption 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 and
1 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.

operatorGroup

Operator Group information.


Function link. It is not required when you add or modify a group and it is contained in the
response message when you query a group.

Query Individual Operators

37

Example
Query the operator whose ID is 1.

Request
GET http://imc_host:8080/imcrs/plat/operator/1
accept: application/xml
. . .

Response
HTTP/1.1 200 OK
Content-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 Operator
Add an operator with specified information.

Interface URI
/plat/operator

Access Method
HTTP
POST

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.110.153.89.2</desc>
<aclOrder>1</aclOrder>
</operatorAcl>
</operatorAclList>
</operator>

Element description
For 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 header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/plat/operator/4

Add Operator

39

Example
Add an operator.

Request
POST http://imic_host:8080/imcrs/plat/operator
accept: application/xml
Content-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.110.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.310.153.89.4</desc>
<aclOrder>2</aclOrder
</operatorAcl>
</operatorAclList>
</operator>

Response
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/plat/operator/4

40

System Management

Modify Operators
Modify an operator with certain ID.

Interface URI
/plat/operator/{id}

Access Method
HTTP
PUT

Parameters
Path parameters
id

Operator ID.
Long 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.510.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.710.153.89.8</desc>
<aclOrder>2</aclOrder>
</operatorAcl>
</operatorAclList>
</operator>

Element remarks
For 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

Example
Modify the operator whose ID is 2.

Request
PUT http://imc_host:8080/imcrs/plat/operator/2
accept: 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.510.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.710.153.89.8</desc>
<aclOrder>2</aclOrder>
</operatorAcl>
</operatorAclList>
</operator>

Response
HTTP/1.1 204 No Content
. . .

42

System Management

Delete Operator
Delete 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
HTTP
DELETE

Parameters
Path parameters
id

Operator ID.
Long 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
. . .

Example
Delete the operator with ID 4.

Request
DELETE http://imc_host:8080/imcrs/plat/operator/4
accept: application/xml
. . .

Response
HTTP/1.1 204 No Content

Delete Operator

43

Query Operator Groups


Query and list operator groups.

Interface URI
/plat/operatorGroup

Access Method
HTTP
GET

Parameters
Query parameters
start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value is uploaded, the default value is
used.

size

The total number of returned records.


Integer type. Optional. The default value is 10. If a negative value is uploaded, the default value is
used.

orderBy

The sequencing field of the returned result set.


String type. Optional. The default value is id. Valid values include ip, groupName, and groupDesc.

desc

Whether or not the result is sequenced in reverse order.


Boolean type. Optional. The default value is false. The parameter is valid only when the orderBy
parameter is specified.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Total attribute of the message header
returns the number of records that meet the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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>

Elements
For meanings of the fields in the message body, see Query All Operators (page 34).

Example
Query and list operator groups.

Request
GET http://imc+host:8080/imcrs/plat/operatorGroup
accept: application/xml
. . .

Response
HTTP/1.1 200 OK
Content-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 Details


Query detailed information about an operator group with the specified ID.

Interface URI
/plat/operatorGroup/{id}

Access Method
HTTP
GET
Path parameters
id

Operator ID.
Long 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
id

Operator ID.
Long integer type. This element is not needed when you add an operator group and it is required
when you modify an operator group.

groupName

Operator group name.


String type.This element is required when you add an operator group and cannot be changed when
you modify an operator group.

groupDesc

Operator group description.


String type. This element is optional when you add or modify an operator group.

roleDesc

Role description.
String type. This element is optional when you add or modify an operator group and is returned in
the response message for queries.

roleId
46

System Management

Role ID.

operatorGroup sub-elements
Long integer type. This element is required when you add or modify an operator group.
operatePrivilegeList List of operator privileges. This element is optional when you add or modify an operator group.
operatePrivilege

Operator privilege.
The 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 level
and is 1 for the component privilege level (privilege named by the component ID). Integer type.
Required.

role

Role link.
Function link. This element is not needed when you add or modify an operator group and is returned
in the response message for queries.

privileges

Operator privilege link.


Function link. This element is not needed when you add or modify an operator group and is returned
in the response message for queries.

Example
Query information about the operator group with ID 1.

Request
GET http://imc_host:8080/imcrs/plat/operatorGroup/1
accept: application/xml
. . .

Response
HTTP/1.1 200 OK
Content-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 Group


Add an operator group with specified information.

Interface URI
/plat/opertorGroup

Access Method
HTTP
POST

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 description
For 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 header
If the operator succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/plat/operatorGroup/4

48

System Management

Example
Add an operator group.

Request
POST http://imc_host:8080/imcrs/plat/operatorGroup
accept: application/xml
Content-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 Created
Location: http://localhost:8080/imcrs/plat/operatorGroup/4

Add Operator Group

49

Modify Operator Group


Modify an operator group with the specified ID.

Interface URI
/plat/operatorGroup/{id}

Access Method
HTTP
PUT

Parameters
Path parameters
id

Operator ID.
Long 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 description
For meanings of the fields in the message body, see Query All Operators (page 34).

Returned Result
Status codes

50

204 (No Content): Success.

404 (Not Found): No data is found with the ID.

409 (Conflict): Failure. See Error Codes.

System Management

Example
Modify the operator group with ID 4.

Request
PUT http://imc_host:8080/imcrs/plat/operatorGroup/4
accept: 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 Group


Delete an operator group with the specified ID.

Interface URI
/plat/operatorGroup/{id}

Access Method
HTTP
DELETE

Parameters
Path parameters
id

Operator ID.
Long 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
. . .

Example
Delete the operator group with ID 4.

Request
Delete http://imc_host:8080/imcrs/plat/operatorGroup/4
accept: application/xml
. . .

Response
HTTP/1.1 204 No Content

52

System Management

5 Network Resource Management


This section provides eAPI commands that enable you to control your devices and other network
resources. 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

54

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

Network Resource Management

Query Device Information List


Query device information based on predefined criteria.

Interface URI
/plat/res/device

Access Method
HTTP
GET

Parameters
Query parameter
resPrivilegeFilter

Filter resources by access right.


Boolean type. Optional. The default value is false.

category

Device type.
Integer type. Optional. No default value. Valid values can be obtained through SNMP Template
Query Interfaces.

label

Device label.
String type. Wildcards are supported. Optional. No default value.

ip

Device IP address.
String type. Wildcards are supported. Optional. No default value.

mac

MAC address.
String type. Wildcards are supported. Optional. No default value.

status

Device status.
Integer type. Optional. No default value. For valid values, see Device status description.

series

Device status.
Integer type. Optional. No default value. Valid values can be obtained through Device Series
Query Interfaces.

contact

Contact.
String type. Wildcards are supported. Optional. No default value.

location

Device location.
String type. Wildcards are supported. Optional. No default value.

start

Location of the first returned record in the query result.


Integer type. Optional. The default value is 0. If the input value is smaller than 0, the default
value is used.

size

Total returned records.


Integer type. Optional. The default value is 10. If the input value is smaller than 0, the default
value is used.

orderBy

Sort field of the returned result.


String type. Optional. The default value is id. Valid values include id, label, ip, mask, status,
contact, location, sysoid, and sysName.

desc

Sort records in descending order.

Query Device Information List

55

Query parameter
Boolean type. Optional. The default value is false. It is valid only when the orderBy parameter
is specified.
total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size
attributes are invalid, the returned message body is empty, and the Message Header field
gives the records that match the sort criteria.

Returned Result
Status codes

200 (OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. No
message body is included.
HTTP/1.1 200 OK
Total: 150

Message body
HTTP/1.1 200 OK
Total: 150

For the description on each field of the returned value, see the API document for Query Device
Information.

Example
Query the 10th to the 20th pieces of information about devices whose IP address starts from
192.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 OK
Content-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 Information


Query device basic information based on device ID. Besides device basic information, the method
for accessing device extended information and access interface for device-related operations are
also returned.

Interface URI
/plat/res/device/{id}

Access Method
HTTP
GET
Path parameter
id

Device ID.
Long integer type. Required. No default value.

Returned Result
Status codes

200 (OK): Success.

Message header
The following links are provided through the Link field:
synchronize

Synchronize Device

manage

Manage Devices

unmanage

Unmanage Device

delete

Delete Device

ping

Ping

tracert

Track Device by Routing

updateLabel

Modify Device Label

updateSysGrpAttr

Modify System Information (System Name, Contact, and Location

updateLoginType

Modify Login Method

updateCategory

Modify Device Type

updateSnmp

Modify SNMP Configuration

updateTelenet

Modify Telnet Configuration

updateSsh

Modify SSH Configuration

updatePollInterval

Modify Poll Interval

updatePingParam

Modify Ping Parameters

updateWebMrgParam

Modify Web Network Management Parameters

latest10UnrecoveryFault

Last 10 Unacknowledged Alarms

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>20110831 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-520r6605.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>20110818 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
id

Device ID which uniquely identifies a device.


Long integer type.

label

Device label.
String type.

ip

Device IP address.
String type.

mask
58

Mask.

Network Resource Management

device sub-elements
String type.
status

Device status.
Integer type. See Device status description.

sysName

System name.
String type.

contact

Contact.
String type.

location

Location.
String type.

sysOid

sysOID.
String type.

runtime

Running time.
String type.

lastPoll

Last poll.
String type, in the format of yyyy-MM-dd HH:mm:ss.

loginType

Login method. 0: None. 1: Telnet. 2: SSH.


Integer type.

sysDescription

System description.
String type.

categoryId

Device type ID.


Integer type.

supportPing

Support ping operation.


Boolean type.

snmpTmplId

SNMP template ID.


Boolean type.

telnetTmplId

Telnet template ID.


Integer type.

sshTmplId

SSH Template ID.


Integer type.

webMgrPort

Login port for a lower-level network management.


Long integer type.

configPollTime

Set polling interval.


Integer type, in minutes.

statePollTime

Status poll interval.


Integer type, in seconds.

device Service

Device services.
Element type. Multiple elements can be used. See the API document for Query Service Monitoring
Information.

Query Device Information

59

device sub-elements
symbolId

Device symbol ID.


Integer type.

symbolName

Device symbol name.


String type.

symbolType

Device symbol type.


Integer type.

symbolDesc

Device symbol description.


String type.

symbolLevel

Device symbol level.


Integer type.

parentId

Device parent symbol ID.


Integer type.

typeName

Device type name.


String type.

parentId

Device parent symbol ID.


Integer type.

viewType

View type.
Integer type.

iconFileName

Icon corresponding to the symbol.


String type.

positionX

X location.
Integer type.

positionY

Y location.
Integer type.

visibleFlag

Display symbol.
Integer type.

statusImg

Device status icon file.


String type.

version

Device bin file.


String type.

mac

MAC address.
String type.

categoryImg

Device type icon file.


String type.

vendorImg

Device vendor icon file.


String type.

childrenNum

Number of sub-symbols for a device symbol.


Integer type.

60

Network Resource Management

device sub-elements
vergeNet

Edge subnet identifier.


Integer type.

phyName

Physical name.
String type.

phyCreateTime

Created at.
String type.

phyCreator

Creator.
String type.

appendUnicode Attached unicode.


String type.
snmpTmpl

SNMP template URI.


String type.

telnetTmpl

Telnet template URI.


String type.

sshTmpl

SSH template URI.


String type.

series

Device Series URI.


String type.

model

Device Model URI.


String type.

interfaces

Device Interfaces URI.


String type.

category

Device Type URI.


String type.

Device status description


The following describes the device status:
1 Unmanaged (Gray)
0 Unknown (Blue)
1 Normal (Green)
2 Alarm (Cyan)
3 Minor (Yellow)
4 Important (Orange)
5 Warning (Red)

Example
Query information about the device with the ID 2.

Request
GET http://localhost:8080/imcrs/plat/res/device/2
accept: application/xml
. . .

Query Device Information

61

Response
HTTP/1.1. 200 OK
Content-Type: application/xml
Link: <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>20110831 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-520r6605.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>20110818 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 Types


Query device types based on predefined criteria.

Interface URI
/plat/res/category

Access Method
HTTP
GET

Parameters
Query parameter
name

Type name.
String type. Wildcards are supported. Optional. No default value.

start

Location of the first returned record in the query result.


Integer type. Optional. The default value is 0. If the input parameter is smaller than 0, the parameter
is automatically changed to 0.

size

Total returned records.


Integer type. Optional. The default value is 10. If the input parameter is smaller than 0, the parameter
is automatically changed to 0. If the input parameter is greater than 1000, the parameter is
automatically changed to 1000.

orderBy

Sort field of the returned result.


String type. Optional. The default value is id. Valid values include id, name, and preDefined.

desc

Sort field of the returned result.


Boolean type. Optional. The default value is false. It is valid only when the orderby parameter is
specified.

total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

Returned Result
Status codes

200 (OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. No
message body is included.
HTTP/1.1 200 OK
Total: 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 Device
Type.

Example
Query all device types.

Request
Get http://imc_host:8080/imcrs/plat/res/category?start=0&size=1000
accept: application/xml
. . .

Response
HTTP/1.1 200 OK
Content-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 Type


Query device type based on device ID.

Interface URI
/plat/res/category/{id}

Access Method
HTTP
GET

Parameters
Path parameter
id

Device type ID.


Integer 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
id

Device type Id, which uniquely identifies a device type.


Integer type.

name

Device type name.


String type.

preDefined

System defined.
Boolean type.

Query Device Type

65

Example
Query device type with the ID 0.

Request
Get http://imc_host:8080/imcrs/plat/res/category/0
accept: application/xml
. . .

Response
HTTP/1.1 200 OK
Content-Type: application/xml
. . .
<deviceCategory>
<id>0</id>
<name>Router</name>
<preDefined>true</preDefined>
</deviceCategory>

66

Network Resource Management

Query Vendor Information List


Query device vendor information list.

Interface URI
/plat/res/vendor

Access Method
HTTP
GET

Parameters
Query parameter
name

Vendor name.
String type. Wildcards are supported. Optional. No default value.

start

Location of the first returned record in the query result.


Integer type. Optional. The default value is 0. If the input parameter is smaller than 0, the parameter
is automatically changed to 0.

size

Total returned records.


Integer type. Optional. The default value is 10. If the input parameter is smaller than 0, the parameter
is automatically changed to 0. If the input parameter is greater than 1000, the parameter is
automatically changed to 1000.

orderBy

Sort field of the returned result.


String type. Optional. The default value is id. Values include id, name, description, phone, contact,
and preDefined.

desc

Sort records in descending order.


Boolean type.
Optional.
The default value is false. It is valid only when the orderBy parameter is specified.

total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

Returned Result
Status codes

200 (OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. No
message body is included.
HTTP/1.1 200 OK
Total: 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 Device
Vendor Information.

Example
Query device vendor starting with H.

Request
GET http://imc_host:8080/imcrs/plat/res/vendor?name=H*&start=0&size=1000
accept: application/xml
. .

Response
HTTP/1.1 200 OK
Content-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 Information


Query vendor information based on vendor ID.

Interface URI
/plat/res/vendor/{id}

Access Method
HTTP
GET

Parameters
Query parameter
id

Device vendor ID.


Integer 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
id

Device vendor ID, which uniquely identifies a device vendor.


Integer type.

name

Device vendor name.


String type.

description

Device vendor description.


String type.

phone

Vendor contact information.


String type.

contact

Vendor address.
String type.

preDefined

System defined.
Boolean type.

Query Vendor Information

69

Example
Query device vendor with the ID 1.

Request
GET http://imc_host:8080/imcrs/plat/res/vendor/1
accept: application/xml
. . .

Response
HTTP/1.1 200 OK
Content-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 List


Query device series information list based on predefined criteria.

Interface URI
/plat/res/series

Access Method
HTTP
GET

Parameters
Query parameter
seriesName

Device series name.


String type. Wildcards are supported. Optional. No default value.

vendorName

Vendor name.
String type. Wildcard is supported. Optional. No default value.

managedOnly

Only devices managed by iMC can be found.


Boolean type. Optional. The default value is false. If the value is true, only device series managed
by iMC is listed in the query result.

start

Location of the first returned record in the query result.


Integer type. Optional. The default value is 0. If the input parameter is smaller than 0, the parameter
is automatically changed to 0.

size

Total returned records.


Integer type. Optional. The default value is 10. If the input parameter is smaller than 0, the parameter
is automatically changed to 0. If the input parameter is greater than 1000, the parameter is
automatically changed to 1000.

orderBy

Sort field of the returned result.


String type. Optional. The default value is id. Values include id, name, description, and preDefined.

desc

Sort records in descending order.


Boolean type. Optional. The default value is false. It is valid only when the orderBy parameter is
specified.

total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

Query Device Series Information List

71

Returned Result
Status codes

200 (OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. No
message body is included.
HTTP/1.1 200 OK
Total: 41

Message body
<list>
<deviceSeries>
<id>1</id>
<name>H3C AR182x</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 Device
Series Information.

72

Network Resource Management

Example
Query the first 100 device series of H3C.

Request
GET http://imc_host:8080/imcrs/palt/res/series?vendorName=H3C&start=0&size=100
accept: application/xml
. . .

Response
HTTP/1.1 200 OK
Content-Type: application/xml
. . .
<list>
<deviceSeries>
<id>1</id>
<name>H3C AR182x</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 AR183x</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 Information


Query device series information based on device ID. >

Interface URI
/plat/res/series/{id}

Access Method
HTTP
GET

Parameters
Path parameter
id

Device series ID.


Integer 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
id

Device series ID, which uniquely identifies a device series.


Integer type.

name

Device series name.


String type.

description

Device series description.


String type.

preDefined

System defined.
Boolean type.

vendor

Vendor information URI.


String type.

74

Network Resource Management

Example
Query device series with the ID 1.

Request
GET http://imc_host:8080/imcrs/plat/res/series/1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 List


Query device information based on predefined criteria.

Interface URI
/plat/res/model

Access Method
HTTP
GET

Parameters
Query parameter
name

Model name.
String type. Wildcards are supported. Optional. No default value.

sysOid

Model sysOID.
String type. Wildcards are supported. Optional. No default value.

vendor

Vendor.
Integer type. Optional. No default value. Valid values can be obtained through Vendor Query
Interface.

series

Device series.
Integer type. Optional. No default value. Valid values can be obtained through Device Series Query
Interface.

category

Device type.
Integer type. Optional. No default value. Valid values can be obtained through Device Type Query
Interface.

start

Location of the first returned record in the query result.


Integer type. Optional. The default value is 0. If the input parameter is smaller than 0, the default
value 0 is used.

size

Total returned records.


Integer type. Optional. The default value is 10. If the input parameter is smaller than 0, the parameter
is automatically changed to 0. If the input parameter is greater than 1000, the parameter is
automatically changed to 1000.

orderBy

Sort field of the returned result.


String type. Optional. The default value is id. Valid values include id, name, and predefined.

desc

Sort records in descending order.


Boolean type. Optional. The default value is false. It is valid only when the orderBy parameter is
specified.

total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

76

Network Resource Management

Returned Result
Status codes

200 (OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. No
message body is included.
HTTP/1.1 200 OK
Total: 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 Device
Model Information.

Query Device Model Information List

77

Example
Query device model information about all routers.

Request
GET http://imc_host:8080/imcrs/plat/res/model?category=0&start=0&size=1000
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Information


Query device model based on device ID.

Interface URI
/plat/res/model/{id}

Access Method
HTTP
GET

Parameters
Path parameter
id

Device model ID.


Integer 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
id

Device model ID, which uniquely identifies a device model.


Integer type.

name

Device model name.


String type.

description

Device model description.


String type.

sysOid

Device model sysOID.


String type.

preDefined

System defined.
Boolean type.

vendor

Vendor information URI.


Query Device Model Information

79

deviceModel sub-elements
String type.
series

Vendor information URI.


Boolean type.

category

Device Type URI.


String type.

Example
Query device model with the ID 1.

Request
GET http://imc_host:8080/imcrs/plat/res/model/1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Device
Add a device to iMC.

Interface URI
/plat/res/device

Access Method
HTTP
POST

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
nameOrIp

Host or IP address.
String type. Required. No default value.

label

Device label.
String type. Optional. The default value is empty.

mask

Mask.
String type. Optional. The default value is empty.

loginType

Login method. 0: None. 1: Telnet. 2: SSH.


Integer type.

registerTrap

Send traps to the network management system.


Boolean type. Optional. The default value is true. It is valid only when the alarm component
is installed.

supportPing

Support for the ping operation.


Boolean type. Optional. The default value is true.

forceAdd

Add the device even if the device cannot be pinged successfully.


Add Device

81

device sub-elements
Boolean type. Optional. The default value is false.
loopbackAsMgrIp

Use the loopback address as the management IP address.


Boolean type. Optional. The default value is false.

snmpTmplId

SNMP template ID.


Integer type. Required. No default value. Valid values can be obtained through SNMP
Template Query Interfaces. If both snmpTmplId and snmpParameter exist, snmpTmplId is
preferred, and snmpParameter is omitted.

telnetTmplId

Telnet template ID.


Integer type. Required. No default value. Valid values can be obtained through Telnet
Template Query Interfaces. If both telnetTmplId and telnetParameter exist, telnetTmplId is
preferred, and telnetParameter is omitted.

sshTmplId

SSH template ID.


Integer type. Required. No default value. Valid values can be obtained through SSH
Template Query Interfaces. If both sshTmplId and sshParameter exist, sshTmplId is preferred,
and sshParameter is omitted.

snmpParameter

SNMP parameters.
For SNMP parameters, see SNMP Parameter Description. Required. No default value. If
both snmpTmplId and snmpParameter exist, snmpTmplId is preferred, and snmpParameter
is omitted.

telnetParameter

Telnet parameters.
For Telnet parameters, see Telnet Parameter Description. Required. No default value. If
both telnetTmplId and telnetParameter exist, telnetTmplId is preferred, and telnetParameter
is omitted.

sshParameter

SSH parameters.
For SSH parameters, see SSH Parameter Description. Required. No default value. If both
sshTmplId and sshParameter exist, sshTmplId is preferred, and sshParameter is omitted.

Returned Result
Status codes

201 (Created): Success.

409 (Conflict): Failure. See Error Codes.

Message header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://imc_host:port/imcrs/res/device/1

82

Network Resource Management

Example
Add a device with the IP address 192.168.1.100.

Request
POST http://imc_host:8080/imcrs/plat/res/device
accept: application/xml
Content-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 Created
Location: http://imc_host:port/imcrs/res/device/1

Add Device

83

Synchronize Device
Synchronize a device based on device ID.

Interface URI
/plat/res/device/{id}/synchronize

Access Method
HTTP
PUT

Parameters
Path parameter
id

Device ID.
Long 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
...

Example
Synchronize the device with the ID 2.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/synchronize
accept: application/xml
...

Response
HTTP/1.1 204 No Content

84

Network Resource Management

Manage Device
Manage a device based on device ID.

Interface URI
/plat/res/device/{id}/manage

Access Method
HTTP
PUT

Parameters
Path parameter
id

Device ID.
Long 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
...

Example
Manage the device with the ID 2.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/manage
accept: application/xml
...

Response
HTTP/1.1 204 No Content

Manage Device

85

Unmanage Device
Unmanage a device based on device ID.

Interface URI
/plat/res/device/{id}/unmanage

Access Method
HTTP
PUT

Parameters
Path parameter
id

Device ID.
Long 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
...

Example
Unmanage a device with the ID 2.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/unmanage
accept: application/xml
...

Response
HTTP/1.1 204 No Content

86

Network Resource Management

Delete Device
Delete a device based on device ID.

Interface URI
/plat/res/device/{id}/delete

Access Method
HTTP
DELETE

Parameters
Path parameter
id

Device ID.
Long 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
...

Example
Delete a device with the ID 2.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/delete
accept: application/xml
...

Response
HTTP/1.1 204 No Content

Delete Device

87

Modify Device Label


Modify device label based on device ID.

Interface URI
/plat/res/device/{id}/updateLabel

Access Method
HTTP
PUT

Parameters
Path parameter
id

Device ID.
Long integer type. Required. No default value.

Message body
<device>
<label>Dev Label1</label>
</device>

Element description
device sub-elements
label

Device label.
String 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

Example
Change the device label for the device with the ID 2 to Dev Label2.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/updateLabel
accept: application/xml
...
<device>
<label>Dev Label2</label>
</device>

Response
HTTP/1.1 204 No Content
...

Modify Device Label

89

Modify System Information


Modify the system information for a device based on device ID.

Interface URI
/plat/res/device/{id}/updateSysGrpAttr

Access Method
HTTP
PUT

Parameters
Path parameter
id

Device ID.
Long 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
sysName

System name.
String type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

contact

Contact.
String type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

location

Location.
String 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

Example
Change the system information for the device with the ID 10.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updateSysGrpAttr
accept: 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 Method


Modify login method for a device based on device ID.

Interface URI
/plat/res/device/{id}/updateLoginType

Access Method
HTTP
PUT

Parameters
Path parameter
id

Device ID.
Long integer type. Required. No default value.

Message body
<device>
<loginType>2</loginType>
</device>

Element description
device sub-elements
loginType

Login method. 0: None. 1: Telnet. 2: SSH.


Integer 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

Example
Change the login method for the device with the ID 10 to 2.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updateLoginType
accept: application/xml
...
<device>
<loginType>2</loginType>
</device>

Response
HTTP/1.1 204 No Content
...

Modify Login Method

93

Modify Device Group


Modify a device group based on device ID and device group.

Interface URI
/plat/res/device/{id}/updateCategory

Access Method
HTTP
PUT

Parameters
Path parameter
id

Device ID.
Long integer type. Required. No default value.

Message body
<device>
<categoryId>1</categoryId>
</device>

Element description
device sub-elements
categoryId

Device type ID.


Integer 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

Example
Change the device group for the device with the ID 1 to 1.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/updateCategory
accept: application/xml
...
<device>
<categoryId>1</categoryId>
</device>

Response
HTTP/1.1 204 No Content
...

Modify Device Group

95

Modify SNMP Settings


Modify SNMP settings for a device based on device ID.

Interface URI
/plat/res/device/{id}/updateSnmp

Access Method
HTTP
PUT

Parameters
Path parameter
id

Device ID.
Long 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
snmpParameter

SNMP parameters.
Element type. See the following description.

snmpTmplId

SNMP template ID.


Integer type. If both snmpTmplId and snmpParameter exist, snmpParameter is preferred, and
snmpTmplId is omitted.

snmpParameter sub-elements
paraType

Parameter type. Valid values: SNMPv1, SNMPv2c, SNMPv3 No-Priv No-Auth, SNMPv3 No-Priv
Auth-Md5, SNMPv3 No-Priv Auth-Sha, SNMPv3 Priv-Des Auth-Md5, SNMPv3 Priv-Des Auth-Sha,
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.

roCommunity

Read-only community name.


String 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
rwCommunity

Read-write community string.


String type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

timeout

Timeout time.
Long integer type. Optional. If the element does not exist, the value is not changed. If the element
exists, the value cannot be null.

retries

Number of retries.
Long integer type. Optional. If the element does not exist, the value is not changed. If the element
exists, the value cannot be null.

securityName

Username.
String type. Optional. It is effective only for SNMPv3. If the element does not exist, the value is not
changed. If the element exists, the value cannot be null.

authPassword

Authentication password.
String type. Optional. It is effective only for SNMP authentication. If the element does not exist, the
value is not changed. If the element exists, the value cannot be null.

privPassword

Encryption password.
String type. Optional. It is effective only for SNMP encryption. 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
...

Modify SNMP Settings

97

Example
Change the SNMP settings for the device with the ID 10.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updateSnmp
accept: 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 Settings


Modify Telnet settings for a device based on device ID.

Interface URI
/plat/res/device/{id}/updateTelnet

Access Method
HTTP
PUT

Parameters
Path parameter
id

Device ID.
Long 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
telnetParameter

Telnet parameters.
Element type. See the following description.

telnetTmplId

Telnet template ID.


Integer type. If both telnetTmplId and telnetParameter exist, telnetParameter is preferred, and
telnetTmplId is omitted.

telnetParameter sub-elements
authType

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.
Integer type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

userName

Username.
String 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
userPassword

Password.
String type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

superPassword

Super password.
String type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

timeout

Timeout time.
Long integer 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
...

Example
Change the Telnet settings for the device with the ID 10.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updateTelnet
accept: 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 Settings


Modify SSH settings for a device based on device ID.

Interface URI
/plat/res/device/{id}/updateSsh

Access Method
HTTP
PUT

Parameters
Path parameter
id

Device ID.
Long 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
sshParameter

SSH settings.
Element type. See the following description.

sshTmplId

SSH template ID.


Integer type. If both sshTmplId and sshParameter exist, sshParameter is preferred, and sshTmplId is
omitted.

sshParameter sub-elements
authType

Authentication mode. 0: Password authentication. 3: Key authentication + super password. Integer


type. Optional. If the element does not exist, the value is not changed. If the element exists, the value
cannot be null.

userName

Username.
String 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

Port.
Integer type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

timeout

Timeout time.
Integer type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

retries

Number of retries.
Integer type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

superPassword

Super password.
String 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

Example
Change the SSH settings for the device with the ID 10.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updateSsh
accept: 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 Interval


Modify polling interval for a device based on device ID.

Interface URI
/plat/res/device/{id}/updatePollInterval

Access Method
HTTP
PUT

Parameters
Path parameter
id

Device ID.
Long integer type. Required. No default value.

Message body
<device>
<configPollTime>1800</configPollTime>
<statePollTime>100</statePollTime>
</device>

Element description
device sub-elements
configPollTime

Set polling interval.


Integer type, in minutes. Optional. If the element does not exist, the value is not changed. If the
element exists, the value cannot be null

statePollTime

Status polling interval.


Integer type, in seconds. 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
...

104 Network Resource Management

Example
Change the polling interval for the device with the ID 1 to 1.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updatePollInterval
accept: application/xml
...
<device>
<configPollTime>1800</configPollTime>
<statePollTime>100</statePollTime>
</device>

Response
HTTP/1.1 204 No Content
...

Modify Polling Interval 105

Modify Ping Parameters


Modify ping parameters for a device based on device ID.

Interface URI
/plat/res/device/{id}/updatePingParam

Access Method
HTTP
PUT

Parameters
Path parameter
id

Device ID.
Long integer type. Required. No default value.

Message body
<device>
<supportPing>false</supportPing>
</device>

Element description
device sub-elements
supportPing

Support for the ping operation.


Boolean 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

Example
Change the ping parameters for the device with the ID 10. The device does not support the ping
operation.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updatePingParam
accept: application/xml
...
<device>
<supportPing>false</supportPing>
</device>

Response
HTTP/1.1 204 No Content
...

Modify Ping Parameters 107

Modify Web Network Management Parameters


Modify web network management settings for a device based on device ID.

Interface URI
/plat/res/device/{id}/updateWebMgrParam

Access Method
HTTP
PUT

Parameters
Path parameter
id

Device ID.
Long integer type. Required. No default value.

Message body
<device>
<webMgrProtocol>HTTP</webMgrProtocol>
<webMgrPort>80</webMgrPort>
</device>

Element description
device sub-elements
webMgrProtocol Protocol used by a lower-level network management
String type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.
webMgrPort

Login port for a lower-level network management.


Long integer 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
...

108 Network Resource Management

Example
Change the web network management parameters for the device with the ID 10.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/10/updateWebMgrParam
accept: 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 List


Query device service monitoring information based on predefined criteria.

Interface URI
/plat/res/device/service

Access Method
HTTP
GET

Parameters
Query parameter
deviceId

Device ID.
Long integer type. Required. No default value.

total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

Returned Result
Status codes

200 (OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. The
message body is empty.
HTTP/1.1 200 OK
Total: 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
deviceId

Device ID.
Long integer type.

serviceBit

Service bits.
Integer type.

name

Name.
String type.

port

Port.
Integer type.

type

Type. 0: No monitoring. 1: TCP. 2: UDP.


Integer type.

status

Service running status: 0: Not running. 1: Running.


Integer type.

Example
Query service monitoring about the device with the ID 10.

Request
GET http://imc_host:8080/imcrs/plat/res/device/service?deviceId=10
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Information


Modify service monitoring information for a device based on device ID.

Interface URI
/plat/res/device/service/{id}

Access Method
HTTP
PUT

Parameters
Path parameter
id

Device ID.
Long 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
deviceId

Device ID.
Long integer type. Optional. Obtained from the path parameter.

serviceBit

Service bits.
Integer type. Required. No default value.

name

Name.
String type. Required. No default value.

port

Port.
Integer type. Required. No default value.

type
112

Type. 0: No monitoring. 1: TCP. 2: UDP.

Network Resource Management

deviceService sub-elements
Integer type. Required. No default value.
monitor

Monitor services.
Boolean 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
...

Example
Change the service monitoring information for the device with the ID 10.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/service/10
accept: 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

Ping
Ping a device based on device ID.

Interface URI
/plat/res/device/{id}/ping

Access Method
HTTP
GET

Parameters
Path parameter
id

Device ID.
Long 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
result

Ping results.
String type.

114

Network Resource Management

Example
Ping the device with the ID 10.

Request
GET http://imc_host:8080/imcrs/plat/device/10/ping
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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

Tracert
Tracert a device based on device ID.

Interface URI
/plat/res/device/{id}/tracert

Access Method
HTTP
GET

Parameters
Path parameter
id

Device ID.
Long 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
result

Tracert results.
String type.

116

Network Resource Management

Example
Tracert the device with the ID 10.

Request
GET http://imc_host:8080/imcrs/plat/device/10/tracert
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Links
Query device links based on predefined criteria.

Interface URI
/plat/res/link

Access Method
HTTP
GET

Parameters
Query parameter
topoId

Topology ID, or custom view ID. See the API document in Query Custom Views.
Long integer type. Required. No default value.

total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

Returned Result
Status codes

200 (OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. The
message body is empty.
HTTP/1.1 200 OK
Total: 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

Example
Query device links with the topology ID 1027.

Request
GET http://imc_host:8080/imcrs/plat/res/link?topoId=1027
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Information


Query device link information based on topology and link ID.

Interface URI
/plat/res/link/{id}

Access Method
HTTP
GET

Path parameter
Path parameter
id

Link ID.
Long integer type. Required. No default value.

Query parameter
Query parameter
topoId

Topology ID, or view ID. To obtain it, query the view list.
Long integer type. Required. No default value.

Returned Result
Status codes

200 (OK): Success.

Message header
HTTP/1.1 200 OK
Content-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
id

Device link ID.

120 Network Resource Management

deviceLink sub-elements
Long integer type.
type

Link type.
Integer type.

leftSymbolId

Link left node ID.


Long integer type.

leftIfDesc

Link left interface description.


String type.

rightSymbolId

Link right node ID.


Long integer type.

rightIfDesc

Link right interface description.


String type

status

Link state. 0: Unknown. 1: Normal. 2: Down. 3: Urgent. 4: Important. 5: Minor. 6: Warning. 7:


Event. 8: Virtual.
Integer type.

bandWidth

Link bandwidth.
String type.

leftDevice

Link left node device link.


String type.

rightDevice

Link right node device link.


String type.

Example
Query link with the topology ID 1914 and link ID 556.

Request
GET http://imc_host:8080/imcrs/plat/res/link/556?topoId=1914
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Discovery


This function helps you discover manageable devices and add them to the network management
system. Automatic discovery can be in simple or advanced mode.

Interface URI
/plat/res/autodiscover/start

Access Method
HTTP
POST

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
mode

Automatic discovery modes. 0: Simple mode. 1: Advanced mode. Integer type. Required.
No default value.

ipSection

Subnet for automatic discovery. Required. No default value. Multiple subnets are supported.

begin

Start IP address of the subnet. String type. Required. No default value.

end

End IP address of the subnet. String type. Required. No default value.

sendTrap

Send traps to the network management system. Boolean type. Optional. The default value is
true.

discoverType

Advanced type. 1: Subnet. 2: Routing. 3: IPsec. 4: Reserved (invalid). 5: ARP. 6: PPP. Integer
type. Optional. The default value is routing.

loopBackAsManageIP

Use the loopback address as the management IP address. Boolean type. Optional. The default
value is false.

discoverNonSnmpDevice Discover non-SNMP devices. Boolean type. Optional. The default value is true.

122

pingAll

Scan devices on the subnet. Boolean type. Optional. The default value is false.

seedIp

Seed IP address. String type. Required. No default value. Multiple seed IP addresses are
supported.

filterSubNetIp

Filter subnet IP addresses. String type. Required. No default value. Multiple subnet IP addresses
are supported.

filterSubNet

Filter subnets. 1: No (discover devices in the filtered subnet). 2: Yes (not discover devices in
the filtered subnet). Long integer type. Optional. The default value is no.

level

Discover hops. Integer type. Optional. The default value is 3.

snmpParameter

SNMP parameters. For SNMP parameters, see SNMP Parameter Description. Required. No
default value. Multiple SNMP parameters are supported. If both snmpTmplId and
snmpParameter exist, snmpTmplId is preferred, and snmpParameter is omitted.

Network Resource Management

autoDiscoverConfig sub-elements
telnetParameter

Telnet parameters. For Telnet parameters, see Telnet Parameter Description. Optional. No
default value. If both telnetTmplId and telnetParameter exist, telnetTmplId is preferred, and
telnetParameter is omitted.

sshParameter

SSH parameters. For SSH parameters, see SSH Parameter Description. Optional. No default
value. If both sshTmplId and sshParameter exist, sshTmplId is preferred, and sshParameter is
omitted.

snmpTmplId

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 snmpTmplId
and snmpParameter exist, snmpTmplId is preferred, and snmpParameter is omitted.

telnetTmplId

Telnet template ID. Integer type. Optional. No default value. Valid values can be obtained
through Telnet Template Query Interfaces. If both telnetTmplId and telnetParameter exist,
telnetTmplId is preferred, and telnetParameter is omitted.

sshTmplId

SSH template ID. Integer type. Optional. No default value. Valid values can be obtained
through SSH Template Query Interfaces. If both sshTmplId and sshParameter exist, sshTmplId
is preferred, and sshParameter is omitted.

Returned Result
Status codes

200 (OK): Success.

Message body
If the operation succeeds, the message body is returned.
<autoDiscoverStatus>
<status>2</status>
</autoDiscoverStatus>

Element description
See Query Automatic Discovery Status.

Example 1
Use the simple mode to automatically discover devices.

Request
POST http://imc_host:8080/imcrs/plat/res/autodiscover/start
accept: application/xml
Content-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 OK
Content-Type: application/xml

Start Automatic Discovery

123

Example 2
Use the routing mode to automatically discover devices.

Request
POST http://imc_host:8080/imcrs/plat/res/autodiscover/start
accept: application/xml
Content-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 OK
Content-Type: application/xml

Example 3
Use the segment mode to automatically discover devices.

Request
POST http://imc_host:8080/imcrs/plat/res/autodiscover/start
accept: application/xml
Content-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 OK
Content-Type: application/xml

124

Network Resource Management

Stop Automatic Discovery


Stop automatic discovery.

Interface URI
/plat/res/autodiscover/stop

Access Method
HTTP
GET

Parameters
None

Returned Result
Status codes

200 (OK): Success.

Message body
If the operation succeeds, the message body is returned.
<autoDiscoverStatus>
<status>4</status>
</autoDiscoverStatus>

Element description
See Query Automatic Discovery Status.

Example
Stop the running automatic discovery.

Request
GET http://imc_host:8080/imcrs/plat/res/autodiscover/stop
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-Type: application/xml
...
<autoDiscoverStatus>
<status>4</status>
</autoDiscoverStatus>

Stop Automatic Discovery

125

Query Automatic Discovery Status


Query automatic discovery status.

Interface URI
/plat/res/autodiscover/status

Access Method
HTTP
GET

Parameters
None

Returned Result
Status codes

200 (OK): Success.

Message body
<autoDiscoverStatus>
<status>1</status>
</autoDiscoverStatus>

Element description
autoDiscoverStatus sub-elements
status

Automatic discovery status. 1: Stopped. 2: Running. 3: Periodic automatic discovery is running (not
supported). 4: Stopping.
Integer type.

Example
Query automatic discoveries that have stopped.

Request
GET http://imc_host:8080/imcrs/plat/res/autodiscover/status
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-Type: application/xml
...
<autoDiscoverStatus>
<status>1</status>
</autoDiscoverStatus>

126

Network Resource Management

Query Automatic Device Discovery Results


Query automatic device discovery results.

Interface URI
/plat/res/autodiscover/result

Access Method
HTTP
GET

Parameters
None

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
cmdCode

Command codes. 0: Start automatic discovery. 1: Common message. 2: Automatic discover alarm.
3: Automatic discovery has stopped.
Integer type.

type

Command type. 0: Error message common value. 1: Informational message common value. 2: Alarm
message common value. 4: Successful message common value.
Integer type.

time

Discovered at.
String type.

content

Content.
String type.

deviceIp

Device IP.
String type.

result

Result.
String type.

deviceProtocol

Protocol. String type.

Query Automatic Device Discovery Results

127

Example
Query automatic device discovery results.

Request
GET http://imc_host:8080/imcrs/plat/res/autodiscover/result
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Devices


Query automatically discovered devices.

Interface URI
/plat/res/autodiscover

Access Method
HTTP
GET

Parameters
None

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/techsupport
Copyright (c) 1986-2004 by cisco Systems, Inc.
Com</deviceSysDescription>
<discoverResult>2001</discoverResult>
</discoveredDevice>
...
</list>

Element description
discoveredDevice sub-elements
discoverTime

Discovered at.
String type.

deviceId

Device ID.
Long integer type.

deviceIP

Device IP.
String type.

deviceName

Device name.
String type.

deviceProtocol

Protocol.
String type.

deviceSysDescription System description.


String type.
discoverResult

Result. 2001: Success. Other error codes. See Error Codes. Integer type.
Query Automatically Discovered Devices

129

Example
Query automatically discovered devices.

Request
GET http://imc_host:8080/imcrs/plat/res/autodiscover
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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/techsupport
Copyright (c) 1986-2004 by cisco Systems, Inc.
Com</deviceSysDescription>
<discoverResult>2001</discoverResult>
</discoveredDevice>
...
</list>

130 Network Resource Management

Query Device Interface Information


Query device interface information based on predefined criteria.

Interface URI
/plat/res/device/{deviceId}/interface

Access Method
HTTP
GET

Path parameter
Path parameter
deviceId

Device ID.
Long integer type. Required. No default value.

Query parameters
Query parameter
start

Location of the first returned record in the query result.


Integer type. Optional. The default value is 0. If the input parameter is smaller than 0, the default
value 0 is used.

size

Total returned records.


Integer type. Optional. The default value is 10. If the input parameter is smaller than 0, the default
value 10 is used.

desc

Sort records in descending order.


Boolean type. Optional. The default value is false. Interface index is used to sort interfaces by default.

total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

Returned Result
Status codes

200 (OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. The
message body is empty.
HTTP/1.1 200 OK
Total: 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.

Example
Query information about the interface with the device ID 5.

Request
GET http://imc_host:8080/imcrs/plat/res/device/5/interface
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Details


Query interface details based on interface index and device ID.

Interface URI
/plat/res/device/{deviceId}/interface/{ifIndex}

Access Method
HTTP
GET

Parameters
Path parameter
deviceId

Device ID.
Long integer type. Required. No default value.

ifIndex

Interface index.
Long integer type. Required. No default value.

Returned Result
Status codes

200 (OK): Success.

Message header
HTTP/1.1 200 OK
Content-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
ifIndex

Interface index.
Long integer type.

ifType

Interface type.
Integer type.

ifTypeDesc

Interface type description.


String type.

ifDescription

Interface description.
String type.

adminStatus

Management status. 1: Up. 2: Down.


Integer type.

adminStatusDesc

Management status description.


String type.

operationStatus

Operation status. 1: Up. 2: Down. 3: Testing. 4: Unknown. 5: Dormant. 6: Not present. 7:


LowerLayerDown.
Integer type.

operationStatusDesc

Operation status description.


String type.

ifspeed

Interface speed.
Long integer type.

appointedSpeed

Specify speed.
Long integer type.

ifAlias

Interface alias.
String type.

phyAddress

MAC address.
String type.

mtu

MTU.
Integer type.

lastChange

Last change.
String type.

ipHash

The first item is IP. The second item is mask.


String type.

lastChangeTime

Last change.
Long integer type.

134

Network Resource Management

Example
Query information about the interface with the index 1 and device ID 2.

Request
GET http://imc_host:8080/imcrs/plat/res/device/2/interface/1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Interface
Bring up an interface on a device based on device ID and interface index.

Interface URI
/plat/res/device/{deviceId}/interface/{ifIndex}/up

Access Method
HTTP
PUT

Parameters
Path parameter
deviceId

Device ID.
Long integer type. Required. No default value.

ifIndex

Interface index.
Long 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
...

Example
Bring up the interface with index 2 and device ID 2.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/interface/2/up
accept: application/xml
...

Response
HTTP/1.1 204 No Content

136

Network Resource Management

Shut Down an Interface


Shut down an interface on a device based on device ID.

Interface URI
/plat/res/device/{deviceId}/interface/{ifIndex}/down

Access Method
HTTP
PUT

Parameters
Path parameter
deviceId

Device ID.
Long integer type. Required. No default value.

ifIndex

Interface index.
Long 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
...

Example
Shut down the interface with the index 2 and device ID 2.

Request
PUT http://imc_host:8080/imcrs/plat/res/device/2/interface/2/down
accept: application/xml
...

Response
HTTP/1.1 204 No Content

Shut Down an Interface

137

Query Custom View List


Query custom view list.

Interface URI
/plat/res/view/custom

Access Method
HTTP
GET

Parameters
Query parameter
resPrivilegeFilter Filter resources by access right.
Boolean type. Optional. The default value is false.
desc

Sort records in descending order.


Boolean type. Optional. The default value is false. Interface index is used to sort interfaces by default.

total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

name

View name.
String type. Optional. No default value.

Returned Result
Status codes

200 (OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. The
message body is empty.
HTTP/1.1 200 OK
Total: 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
symbolId

Custom view ID.


Long integer type.

name

Custom view name.


String type.

runStatus

Operation status.
Integer type.

statusImgSrc

Running picture.
String type.

statusDesc

Operation status description.


String type.

Example
Query custom view information list.

Request
GET http://imc_host:8080/imcrs/plat/res/view/custom
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Information


Query custom view information based on custom view ID.

Interface URI
/plat/res/view/custom/{id}

Access Method
HTTP
GET

Path parameter
Path parameter
id

Custom view ID. Long integer type. Required. No default value.

Query parameter
Query parameter
start

Location of the first returned record in the query result.


Integer type. Optional. The default value is 0. If the input value is smaller than 0, the default value
is used.

size

Total returned records.


Integer type. Optional. The default value is 10. If the input value is smaller than 0, the default value
is used.

desc

Sort records in descending order.


Boolean type. Optional. The default value is false. Interface index is used to sort interfaces by default.

total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

Returned Result
Status codes

200 (OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. The
message body is empty.
HTTP/1.1 200 OK
Total: 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 description
For description on each field, see the API document in Query Device Information.

Example
Query information about the custom view with the ID 11.

Request
GET http://imc_host:8080/imcrs/plat/res/view/custom/11
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 View


Add a custom view to iMC.

Interface URI
/plat/res/view/custom

Access Method
HTTP
POST

Message body
<customView>
<name>myView</name>
<device>
<id>1</id>
</device>
<device>
<id>2</id>
</device>
</customView>

Element description
customView sub-elements
name

Custom view name.


String type. Required. No default value.

device

Devices added to the custom view.


Element type. Optional. No default value. Multiple elements are supported.

device/id

IDs of the devices added to the custom view.


Long integer type. Required. No default value.

Returned Result
Status codes

201 (Created): Success.

409 (Conflict): Failure. See Error Codes.

Message header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/plat/res/view/custom/1179

142

Network Resource Management

Example
Add 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/custom
accept: application/xml
Content-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 Created
Location: http://localhost:8080/imcrs/plat/res/view/custom/1179

Add Custom View

143

Modify Custom View


Modify a custom view based on custom view ID.

Interface URI
/plat/res/view/custom/{id}

Access Method
HTTP
PUT

Parameters
Path parameter
id

Custom view ID.


Long 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
name

Custom view name.


String type. Optional.

autoAddDevType Automatically add device types. 0: Not add. 1: Add any new device. 2: Add devices in the specified
subnet. When the value is 2, inSection takes effect. ipSection
Integer type. Optional.
addAllDev

Add all devices in the system. When the value is false, devices takes effect.
Boolean type. Optional. The default value is false.

ipSection

Subnet for automatic discovery.


Optional. No default value.

begin

Start IP address of the subnet.


String type. Required. No default value.

end

End IP address of the subnet.


String type. Required. No default value.

144 Network Resource Management

customView sub-elements
device

Devices added to the custom view.


Element type. Optional. No default value.

device/id

IDs of the devices added to the custom view.


Long 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.

Example
Modify information about the custom view with the ID 1154.

Request
PUT http://imc_host:8080/imcrs/plat/res/view/custom/1154
accept: 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 View


Delete a custom view based on custom view ID.

Interface URI
/plat/res/view/custom/{id}

Access Method
HTTP
DELETE

Parameters
Path parameter
id

Custom view ID.


Long 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
...

Example
Delete a custom view with the ID 1154.

Request
DELETE http://imc_host:8080/imcrs/plat/res/view/custom/1154
accept: application/xml
...

Response
HTTP/1.1 204 No Content

146

Network Resource Management

Query Interface Views


Query interface view list based on predefined criteria.

Interface URI
/plat/res/view/interface

Access Method
HTTP
GET

Parameters
Query parameter
resPrivilegeFilter Filter resources by access right.
Boolean type. Optional. The default value is false.
desc

Sort records in descending order.


Boolean type. Optional. The default value is false. Interface view name is used to sort interface views
by default.

total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

name

View name.
String type. Optional.

createBy

View creator.
String type. Optional.

ifDesc

Interface description.
String type. Optional.

ifAlias

Interface alias.
String type. Optional.

status

Interface status.
Integer type. Optional.

Returned Result
Status codes

200 (OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. The
message body is empty.
HTTP/1.1 200 OK
Total: 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
id

Interface view ID.


Long integer type.

name

Interface view name.


String type.

desc

Interface view description.


String type.

createBy

Creator.
String type.

createDate

Created at.
Date type.

Example
Query interface view list.

Request
GET http://imc_host:8080/imcrs/plat/res/view/interface
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Information


Query an interface view based on interface view ID.

Interface URI
/plat/res/view/interface/{id}

Access Method
HTTP
GET

Path parameter
Path parameter
id

Interface view ID.


Long integer type. Required. No default value.

Query parameter
Query parameter
resPrivilegeFilter Filter resources by access right.
Boolean type. Optional. The default value is false.
total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

Returned Result
Status codes

200 (OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. The
message body is empty.
HTTP/1.1 200 OK
Total: 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 description
For the description on each field of the returned value, see Query Device Information.

Example
Query interface view with the ID 1.

Request
GET http://imc_host:8080/imcrs/plat/res/view/interface/1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 View


Add an interface view to iMC.

Interface URI
/plat/res/view/interface

Access Method
HTTP
POST

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
name

Interface view name.


String type. Required. No default value.

desc

Interface view description.


String type. Optional. No default value.

ifInfo

Interfaces to be added to an interface view.


String type. Optional. No default value.

ifInfo/deviceId

Device ID.
Long integer type. Required. No default value.

ifInfo/ifIndex

Interfaces to be added to an interface view.


Long integer type. Required. No default value.

Returned Result
Status codes

201 (Created): Success.

409 (Conflict): Failure. See Error Codes.

Add Interface View

151

Message header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/plat/res/view/interface/3

Example
Add an interface view named yourIfView. The device with ID 5 and interface indexes 1 and 3 is
added to the interface view.

Request
POST http://imc_host:8080/imcrs/plat/res/view/interface
accept: application/xml
Content-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 Created
Location: http://localhost:8080/imcrs/plat/res/view/interface/3

152

Network Resource Management

Modify Interface View


Modify interface view based on interface view ID.

Interface URI
/plat/res/view/interface/{id}

Access Method
HTTP
PUT

Parameters
Path parameter
id

Interface view ID.


Long 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
name

Interface view name.


String type. Required. No default value.

desc

Interface view description.


String type. Optional. No default value.

ifInfo

Interfaces to be added to an interface view.


String type. Optional. No default value.

ifInfo/deviceId

Device ID.
Long integer type. Optional. No default value.

ifInfo/ifIndex

Interfaces to be added to an interface view.


Long 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.

Example
Modify interface view with the ID 3.

Request
PUT http://imc_host:8080/imcrs/plat/res/view/interface/3
accept: 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 View


Delete an interface view based on interface view ID.

Interface URI
/plat/res/view/interface/{id}

Access Method
HTTP
DELETE

Parameters
Path parameter
id

Interface view ID.


Long 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
...

Example
Delete an interface view with the ID 2.

Request
DELETE http://imc_host:8080/imcrs/plat/res/view/interface/2
accept: application/xml
...

Response
HTTP/1.1 204 No Content

Delete Interface View

155

Query IP Views
Query IP views based on predefined criteria.

Interface URI
/plat/res/view/ip

Access Method
HTTP
GET

Parameters
Query parameter
resPrivilegeFilter Filter resources by access right.
Boolean type. Optional. The default value is false.
desc

Sort records in descending order.


Boolean type. Optional. The default value is false. IP view name is used to sort IP views by default.

total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

status

Operation status.
Integer type. Optional.

showVergeNet

Display edge subnets.


Boolean type. Optional. The default value is false.

showNullNet

Display empty subnets.


Boolean type. Optional. The default value is false.

Returned Result
Status codes

200 (OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. The
message body is empty.
HTTP/1.1 200 OK
Total: 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
symbolId

IP view symbol ID.


Long integer type.

name

IP view name.
String type.

runStatus

Operation status.
Integer type.

statusImgSrc

Running picture.
String type.

statusDesc

Operation status description.


String type.

Example
Query IP views.

Request
GET http://imc_host:8080/imcrs/plat/res/view/ip
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 View
Query IP views based on IP view ID.

Interface URI
/plat/res/view/ip/{id}

Access Method
HTTP
GET

Path parameter
Path parameter
id

IP view ID.
Long integer type. Required. No default value.

Query parameter
Query parameter
resPrivilegeFilter Filter resources by access right.
Boolean type. Optional. The default value is false.
desc

Sort records in descending order.


Boolean type. Optional. The default value is false. Interface index is used to sort interfaces by default.

total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

status

Operation status.
Integer type. Optional.

showVergeNet

Display edge subnets.


Boolean type. Optional. The default value is false.

showNullNet

Display empty subnets.


Boolean type. Optional. The default value is false.

Returned Result
Status codes

200 (OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. The
message body is empty.
HTTP/1.1 200 OK
Total: 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 description
For the description on each field of the returned value, see Query Device Information.

Example
Query IP view with the ID 1041.

Request
GET http://imc_host:8080/imcrs/plat/res/view/ip/1041
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Format


Export topology in visio format.

Interface URI
/plat/res/topo/export/visio

Access Method
HTTP
GET

Query parameter
Query parameter
topoId

Topology ID.
Long 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 description
For the description on the fields of the returned value, see the Visio help.

Description
Before you export topology in REST or Visio format, save the topology in iMC. Otherwise, all
devices will overlap in (0, 0).

160 Network Resource Management

Example
Export topology information with the topology ID 1027 in Visio format.

Request
GET http://imc_host:8080/imcrs/plat/res/topo/export/visio?topoId=1027
accept: application/x-visio
...

Response
HTTP/1.1 200 OK
Content-Type: application/x-visio
...
<VisioDocument xmlns="urn:schemas-microsoft-com:office:visio">
...
</VisioDocument>

Export Topology in Visio Format

161

Query SNMP Template Information List


Query SNMP template information list based on predefined criteria.

Interface URI
/plat/res/snmp

Access Method
HTTP
GET

Parameters
Query parameter
start

Location of the first returned record in the query result.


Integer type. Optional. The default value is 0. If the input parameter is smaller than 0, the parameter
is automatically changed to 0.

size

Total returned records. Integer type. Optional. The default value is 10. If the input parameter is
smaller than 0, the parameter is automatically changed to 0.

desc

Sort records in descending order. Boolean type. Optional. The default value is false. It is valid only
when the orderBy parameter is specified.

total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

Returned Result
Status codes

200(OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. The
message body is empty.
HTTP/1.1 200 OK
Total: 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.

Example
Query SNMP template information list.

Request
GET http://imc_host:8080/imcrs/plat/res/snmp
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Information


Query SNMP template information based on device ID.

Interface URI
/plat/res/snmp/{id}

Access Method
HTTP
GET

Parameters
Path parameter
id

SNMP template ID.


Integer 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
id

SNMP template ID.


Long integer type.

name

Template name.
String type.

version

Version.
Integer type.

164 Network Resource Management

snmpParamTemplate sub-elements
paraType

Parameter type.
String type

roCommunity

Read-only community name.


String type.

rwCommunity

Read-write community string.


String type.

timeout

Timeout time.
Long integer type.

retries

Number of retries.
Long integer type.

contextName

SNMPv3 context.
String type.

securityName

Security name.
String type.

authScheme

Authorization mode.
Integer type.

authPassword

Authorization password.
String type.

privScheme

Encryption mode.
Integer type.

privPassword

Encryption password.
String type.

snmpPort

Port.
Long integer type.

securityMode

Security mode.
Integer type.

Query SNMP Template Information

165

Example
Query SNMP template information with the template ID 1.

Request
GET http://imc_host:8080/imcrs/plat/res/snmp/1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 List


Query Telnet template information list based on predefined criteria.

Interface URI
/plat/res/telnet

Access Method
HTTP
GET

Parameters
Query parameter
start

Location of the first returned record in the query result.


Integer type. Optional. The default value is 0. If the input parameter is smaller than 0, the parameter
is automatically changed to 0.

size

Total returned records.


Integer type. Optional. The default value is 10. If the input parameter is smaller than 0, the parameter
is automatically changed to 0.

desc

Sort records in descending order.


Boolean type. Optional. The default value is false. It is valid only when the orderBy parameter is
specified.

total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

Returned Result
Status codes

200(OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. The
message body is empty.
HTTP/1.1 200 OK
Total: 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.

Example
Query Telnet template information list.

Request
GET http://imc_host:8080/imcrs/plat/res/telnet
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Information


Query Telnet template information based on device ID.

Interface URI
/plat/res/telnet/{id}

Access Method
HTTP
GET

Parameters
Path parameter
id

Telnet template ID.


Long 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
id

Telnet template ID.


Long integer type.

name

Template name.
String type.

version

Version.
Long integer type.

authType

Authentication type.
Integer type.

Query Telnet Template Information

169

telnetParamTemplate sub-elements
userName

Username.
String type.

userPassword

User password.
String type.

superPassword

Super password.
String type.

authTypeStr

Authentication mode.
String type.

timeout

Timeout time.
Long integer type.

retries

Number of retries.
Long integer type.

port

Port.
Long integer type.

type

Template type.
Integer type.

Example
Query Telnet template information with the template ID 1.

Request
GET http://imc_host:8080/imcrs/plat/res/telnet/1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 List


Query SSH template information list based on predefined criteria.

Interface URI
/plat/res/ssh

Access Method
HTTP
GET

Parameters
Query parameter
start

Location of the first returned record in the query result.


Integer type. Optional. The default value is 0. If the input parameter is smaller than 0, the parameter
is automatically changed to 0.

size

Total returned records.


Integer type. Optional. The default value is 10. If the input parameter is smaller than 0, the parameter
is automatically changed to 0.

desc

Sort records in descending order.


Boolean type. Optional. The default value is false. It is valid only when the orderBy parameter is
specified.

total

Only records that match the sort criteria are returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Message Header field gives the records
that match the sort criteria.

Returned Result
Status codes

200(OK): Success.

Message header
If the total parameter is true, the Total field gives all the records that match the sort criteria. The
message body is empty.
HTTP/1.1 200 OK
Total: 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.

Example
Query SSH template information list.

Request
GET http://imc_host:8080/imcrs/plat/res/ssh
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Information


Query SSH template information based on device ID.

Interface URI
/plat/res/ssh/{id}

Access Method
HTTP
GET

Parameters
Path parameter
id

SSH template ID.


Long 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
id

SSH template ID.


Long integer type.

name

Parameter name.
String type.

type

Parameter type.
Integer type.

authType

Authentication mode.
Integer type.

Query SSH Template Information

173

sshParamTemplate sub-elements
authTypeStr

Authentication mode description.


String type.

userName

Username.
String type.

timeout

Timeout time.
Integer type.

retries

Number of retries.
Integer type.

password

Password.
String type.

port

Port.
Integer type.

keyFileName

Key file name for key authentication.


String type.

keyPhrase

Key phrase for key authentication.


String type.

superPassword

Super password.
String type.

Example
Query SSH template information with the template ID 101.

Request
GET http://imc_host:8080/imcrs/plat/res/ssh/101
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Statements


Query database based on component ID and SQL statement.

Interface URI
/sql

Access Method
HTTP
GET

Parameters
Query parameter
componentId

Component ID.
String type. Required. No default value.

sql

Query SQL statements.


String type. Required. No default value.

Returned Result
Status codes

200 (OK): Success.

Message header
HTTP/1.1 200 OK
Total: 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

Total records.
Long integer type.

record

Result records.
Element type.

record/@type

Field type.
String type. The value can only be string.

record/value

Field value.
String type.

Example
Query the component iMC-NME-FAULT and SQL statement SELECT * FROM tbl_trap_conf in the
database.

Request
GET http://localhost:8080/imcrs/sql?componentId=iMC-NME-FAULT&sql=SELECT * FROM tbl_trap_conf
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Management
The User Management category provides multiple commands for managing, modifying, and
querying 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 Users
Query users with certain criteria.

Interface URI
/user

Access Method
HTTP
GET

Parameters
Query parameters
userName

userName
String type, supporting wildcard characters. Optional. No default value.

certification

Identity number.
String type, supporting wildcard characters. Optional. No default value.

address

Contact address.
String type, supporting wildcard characters. Optional. No default value.

phone

Telephone number.
String type, supporting wildcard characters. Optional. No default value.

email

Email address
String type, supporting wildcard characters. Optional. No default value.

userGroupId

User group ID.


Long integer type. Optional. No default value.

ssName

Self-service account name.


String type. Optional. No default value.

ssType

Activate self-service account or not. 1 for active. 2 for inactive.


Integer type. Optional. No default value.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value, the default value is used.

size

The total number of returned records.


Integer type. Optional. The default value is 10. If a negative value, the default value is used.

orderBy

The sequencing field of the returned result set.


String type. Optional. The default value is userName. Valid values include userName and id.

desc

Whether or not the result is sequenced in reverse order.


Boolean type. Optional. The default value is false. Only valid when the orderBy parameter is specified.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Total attribute of the message header
returns the number of records that meet the requirements.

178

User Management

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 2

Message body
<list>
<user>
<id>2</id>
<userName>lisi</userName>
<certification>lisi002</certification>
<address>Tianjin</address>
<phone>13810561010</phone>
<email>lisi@h3c.com</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 description
For meanings of the fields in the message body, see Query User Information.

Query Users

179

Example
Query and list users.

Request
GET http://imc_host:8080/imcrs/user
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-Type: application/xml
...
<list>
<user>
<id>2</id>
<userName>lisi</userName>
<certification>lisi002</certification>
<address>Tianjin</address>
<phone>13810561010</phone>
<email>lisi@h3c.com</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 Information


Query information about a user with the specified ID.

Interface URI
/user/{id}

Access Method
HTTP
GET

Parameters
Path parameters
id

User ID.
Long 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>zhangsan@h3c.com</email>
<ssType>2</ssType>
</user>

Element description
user sub-elements
id

User ID.
Long integer type. Required. No default value.

userName

User name.
String type.

certification

Identity number.
String type.

address

Contact address.
String type.

Query User Information

181

user sub-elements
phone

Telephone number.
String type.

email

Email address.
String type.

ssType

Activate self-service account or not. 1 for active. 2 for inactive.


Integer type.

Example
Query information about the user with ID 1.

Request
GET http://imc_host:8080/imcrs/user/1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-Type: application/xml
...
<user>
<id>1</id>
<userName>zhangsan</userName>
<certification>zhangsan001</certification>
<address>Bejing</address>
<phone>01088101023</phone>
<email>zhangsan@h3c.com</email>
<ssType>2</ssType>
</user>

182

User Management

Add User
Add a user with specified information.

Interface URI
/user

Access Method
HTTP
POST

Message body
<user>
<userName>wanger</userName>
<certification>wanger001</certification>
<address>Shanghai</address>
<phone>02088784567</phone>
<email>wanger@h3c.com</email>
<ssType>1</ssType>
<groupId>1</groupId>
</user>

Element description
user sub-elements
userName

User name.
String type. Required. No default value.

certification

Identity number.
String type. Required. No default value.

address

Contact address.
String type. Optional. The default value is empty.

phone

Telephone number.
String type. Optional. The default value is empty.

email

Email address.
String type. Optional. The default value is empty.

Returned Result
Status codes

201 (Created): Success.

409 (Conflict): Failure. See Error Codes.

Message header
If the operation succeeds, the Location field gives the URI of the new resource. No message body
is included.
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/user/4

Add User 183

Example
Add a user.

Request
POST http://imc_host:8080/imcrs/user
accept: application/xml
Content-Type: application/xml; charset=UTF-8
...
<user>
<userName>wanger</userName>
<certification>wanger001</certification>
<address>Shanghai</address>
<phone>02088784567</phone>
<email>wanger@h3c.com</email>
</user>

Response
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/user/4

184 User Management

Modify User
Modify information about a user with the specified ID.

Interface URI
/user/{id}

Access Method
HTTP
PUT

Parameters
Path parameters
id

User ID.
Long integer type. Required. No default value.

Message body
<user>
<userName>wanger</userName>
<certification>wanger001</certification>
<address>Shanghai</address>
<phone>02088784567</phone>
<email>wanger@h3c.com</email>
</user>

Element description
Path parameters
userName

User name.
Optional. If the element does not exist, the value is not changed. If the element exists, the value
cannot be null.

certification

Identity number.
Optional. If the element does not exist, the value is not changed. If the element exists, the value
cannot be null.

address

Contact address.
Optional. If the element does not exist, the value is not changed. If the element exists, the value
cannot be null.

phone

Telephone number.
Optional. If the element does not exist, the value is not changed. If the element exists, the value
cannot be null.

email

Email address.
Optional. If the element does not exist, the value is not changed. If the element exists, the value
cannot 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.

Example
Modify information about the user with ID 2.

Request
PUT http://imc_host:8080/imcrs/user/2
accept: application/xml
...
<user>
<userName>wanger</userName>
<certification>wanger001</certification>
<address>Shanghai</address>
<phone>02088784567</phone>
<email>wanger@h3c.com</email>
<ssType>1</ssType>
<groupId>1</groupId>
</user>

Response
HTTP/1.1 204 No Content
...

186 User Management

Delete User
Delete a user with the specified ID.

Interface URI
/user{id}

Access Method
HTTP
DELETE

Parameters
Path parameters
id

User ID.
Long 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
...

Example
Delete the user with ID 4.

Request
DELETE http://imc_host:8080/imcrs/user/4
accept: application/xml
...

Response
HTTP/1.1 204 No Content

Delete User

187

Query User Additional Information Definitions


Query user additional information definitions with certain criteria.

Interface URI
/user/additionalInfo

Access Method
HTTP
GET

Parameters
Query parameters
total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the returned message
body is empty, and the Total attribute of the message header returns the number of records that meet
the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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 description
For meanings of the fields in the message body, see Query User Additional Information Definition.

188 User Management

Example
Query and list user additional information definitions.

Request
GET http://imc_host:8080/imcrs/user/additionalInfo
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Definition


Query the user additional information definition of a specified ID.

Interface URI
/user/additionalInfo/{id}

Access Method
HTTP
GET

Parameters
Path parameters
id

ID of a user additional information definition.


Long 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

ID of a user additional information definition.


Long integer type.

columnId

Column name of the user additional information definition.


String type.

fieldName

Field name.
String type.

required
190 User Management

Required or not.

userAdditionalInfo sub-elements
Boolean type.
fieldType

Field type. 1 for integer. 2 for decimal. 3 for alphanumeric character. 4 for any character. 5
for option.
Integer type.

fieldLen

Maximum field length.


Integer type.

fieldMax

Maximum field value.


String type.

fieldMin

Minimum field value.


String type.

defaultValue

Default value.
String type.

priority

The display priority of a field.


Integer type.

showForPreRegisterUser Display pre-registered users or not.


Boolean type.
options

Option elements.
Element type.

options/id

Option ID.
Long integer type.

options/optionsValue Option value.


String type.

Query User Additional Information Definition

191

Example
Query the user additional information definition with ID 2.

Request
GET http://imc_host:8080/imcrs/user/additionalInfo/2
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Definition


Add a user additional information definition with specified information.

Interface URI
/user/additionalInfo

Access Method
HTTP
POST

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
fieldName

Field name.
String type. Required. No default value.

required

Required or not.
Boolean type. Optional. The default value is true.

fieldType

Field type. 1 for integer. 2 for decimal. 3 for alphanumeric character. 4 for any character. 5
for option.
Integer type. Required. No default value.

fieldLen

Maximum field length.


Integer type. Required when fieldType is 3 or 4. No default value.

fieldMax

Maximum field value.


String type. Required when fieldType is 1 or 2. No default value.

fieldMin

Minimum field value.


String type. Required when fieldType is 1 or 2. No default value.

defaultValue

Display pre-registered users or not.


String type. Required. No default value.

showForPreRegisterUser Display pre-registered users or not.


Boolean type. Optional. The default value is false.

Add User Additional Information Definition

193

Query parameters
options

Option elements.
Element type. Required when fieldType is 5. No default value.

options/id

Option ID.
Long integer type. Required. No default value.

options/optionsValue Option value.


String type. Required. No default value.

Returned Result
Status codes

201 (Created): Success.

409 (Conflict): Failure. See Error Codes.

Message header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/user/additionalInfo/3

Example 1
Add a user additional information definition of the option type.

Request
POST http://localhost:8080/imcrs/user/additionalInfo
accept: application/xml
Content-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 Created
Location: http://localhost:8080/imcrs/user/additionalInfo/1

194

User Management

Example 2
Add a user additional information definition of the integer type.

Request
POST http://localhost:8080/imcrs/user/additionalInfo
accept: application/xml
Content-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 Created
Location: http://localhost:8080/imcrs/user/additionalInfo/2

Add User Additional Information Definition 195

Modify User Additional Information Definition


Modify a user additional information definition with the specified ID.

Interface URI
/user/additionalInfo/{id}

Access Method
HTTP
PUT

Parameters
Path parameters
id

ID of a user additional information definition.


Long 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
fieldName

Field name.
String type. Optional. If the element does not exist, the value is not changed. If the element
exists, the value cannot be null.

required

Required or not.
Boolean type. Optional. If the element does not exist, the value is not changed. If the element
exists, the value cannot be null.

fieldType

Field type. 1 for integer. 2 for decimal. 3 for alphanumeric character. 4 for any character. 5
for option.
Integer type. Optional. If the element does not exist, the value is not changed. If the element
exists, the value cannot be null.

fieldLen

Maximum field length.


Integer type. Required when fieldType is 3 or 4. No default value.

fieldMax

Maximum field value.


String type. Required when fieldType is 1 or 2. No default value.

fieldMin

Minimum field value.


String type. Required when fieldType is 1 or 2. No default value.

defaultValue
196

User Management

Default value.

userAdditionalInfo 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.
showForPreRegisterUser Display pre-registered users or not.
Boolean type. Optional. If the element does not exist, the value is not changed. If the element
exists, the value cannot be null.
options

Option elements.
Element type. Required when fieldType is 5. No default value.

options/id

Option ID.
Long integer type. Required. No default value.

options/optionsValue Option value.


String 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.

Example
Modify the user additional information definition with ID 1.

Request
PUT http://imc_host:8080/imcrs/user/additionalInfo/1
accept: 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 Definition


Delete the user additional information definition of a specified ID.

Interface URI
/user/additionalInfo/{id}

Access Method
HTTP
DELETE

Parameters
Path parameters
id

ID of a user additional information definition.


Long 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
...

Example
Delete the user additional information definition with ID 1.

Request
DELETE http://imc_host:8080/imcrs/user/additionalInfo/1
accept: application/xml
...

Response
HTTP/1.1 204 No Content

198 User Management

7 Terminal Access Management


These 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 Attempts


Query unauthorized access attempts with certain criteria.

Interface URI
/res/access/unauthorizedAccess

Access Method
HTTP
GET

Parameters
Query Parameters
resPrivilegeFilter

Whether or not to filter the rights for resources.


Boolean type. Optional. The default value is false.

terminalIp

Terminal IP address.
String type, supporting wildcard characters. Optional. No default value.

terminalMac

Terminal MAC address.


String type, supporting wildcard characters. Optional. No default value.

terminalName

Terminal name.
String type, supporting wildcard characters. Optional. No default value.

deviceLabel

Device label.
String type. Optional. No default value.

deviceIp

Device IP address.
String type. Optional. No default value.

ifDesc

Interface description.
String type. Optional. No default value.

processStatus

Processing status.
Integer type. Optional. No default value.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value, the default value is used.

size

The total number of returned records.


Integer type. Optional. The default value is 10. If a negative value, the default value is used.

orderBy

The sequencing field of the returned result set.


String type. Optional. The default value is deviceIp. Valid values include deviceIp, deviceLabel,
ifDesc, terminalIp, terminalMac, terminalName, and processStatus.

desc

Whether or not the result is sequenced in reverse order.


Boolean type. Optional. Default value is false. Valid only when the orderBy parameter is
specified.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. Default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Total attribute of the message header
returns the number of records that meet the requirements.
Query Unauthorized Access Attempts 201

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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
terminalIp

Terminal IP address.
String type.

terminalMac

Terminal MAC address.


String type.

terminalName

Terminal name.
String type.

deviceId

Device ID.
Long integer type.

deviceLabel

Device label.
String type.

deviceIp

Device IP address.
String type.

ifDesc

Interface description.
String type.

processStatus

Processing status. 0 for unprocessed. 1 for processed.


Integer type.

202 Terminal Access Management

Example
Query and list information about unauthorized access attempts.

Request
GET http://localhost:8080/imcrs/res/access/unauthorizedAccess
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Logs


Query unauthorized access logs with certain criteria.

Interface URI
/res/access/unauthorizedAccessLog

Access Method
HTTP
GET

Parameters
Query Parameters
resPrivilegeFilter

Whether or not to filter the rights for resources.


Boolean type. Optional. The default value is false.

terminalIp

Terminal IP address.
String type, supporting wildcard characters. Optional. No default value.

terminalMac

Terminal MAC address.


String type, supporting wildcard characters. Optional. No default value.

terminalName

Terminal name.
String type, supporting wildcard characters. Optional. No default value.

deviceLabel

Device label.
String type. Optional. No default value.

deviceIp

Device IP address.
String type. Optional. No default value.

ifDesc

Interface description.
String type. Optional. No default value.

actionStatus

Action status.
Integer type. Optional. No default value.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value is uploaded, the default value
is used.

size

The total number of returned records.


Integer type. Optional. The default value is 10. If a negative value is uploaded, the default value
is used.

orderBy

The sequencing field of the returned result set.


String type. Optional. The default value is deviceIp. Valid values include deviceIp, deviceLabel,
ifDesc, terminalIp, terminalMac, terminalName, actionStatus, and conflictType.

desc

Whether or not the result is sequenced in reverse order.


Boolean type. Optional. The default value is false. The parameter is valid only when the orderBy
parameter is specified.

total

Only the number of records that meet the requirements is returned.

204 Terminal Access Management

Query Parameters
Boolean type. Optional. The default value is false. When the value is true, the start and size
attributes are invalid, the returned message body is empty, and the Total attribute of the message
header returns the number of records that meet the requirements.
conflictType

Conflict type.
Integer type. Optional.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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
actionStatus

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.
Integer type.

terminalIp

Terminal IP address.
String type.

terminalMac

Terminal MAC address.


String type.

terminalName

Terminal name.
String type.

deviceId

Device ID.
Long integer type.
Query Unauthorized Access Logs 205

unauthorizedAccessLog sub-elements
deviceLabel

Device label.
String type.

deviceIp

Device IP address.
String type.

ifDesc

Interface description.
String type.

conflictType

Conflict type. 1 for terminal access conflict. 2 for switch access conflict. 3 for switch and terminal
access conflict. 4 for access binding not configured.
Integer type.

conflictFindTime

Time when the conflict was detected.


Long integer type.

conflictFindTimeDesc Conflict type.


String type.
conflictDesc

Conflict description.
String type.

Example
Query and list unauthorized access logs.

Request
GET http://localhost:8080/imcrs/res/access/unauthorizedAccessLog
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Histories


Query access log histories with certain criteria.

Interface URI
/res/access/historyAccessLog

Access Method
HTTP
GET

Parameters
Query Parameters
resPrivilegeFilter

Whether or not to filter the rights for resources.


Boolean type. Optional. The default value is false.

terminalIp

Terminal IP address.
String type, supporting wildcard characters. Optional. No default value.

terminalMac

Terminal MAC address.


String type, supporting wildcard characters. Optional. No default value.

terminalName

Terminal name.
String type, supporting wildcard characters. Optional. No default value.

deviceLabel

Device label.
String type. Optional. No default value.

deviceIp

Device IP address.
String type. Optional. No default value.

ifDesc

Interface description.
String type. Optional. No default value.

vlanId

VLAN ID.
Integer type. Optional. No default value.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value is uploaded, the default value
is used.

size

The total number of returned records.


Integer type. Optional. The default value is 10. If a negative value is uploaded, the default value
is used

orderBy

The sequencing field of the returned result set.


String type. Optional. The default value is deviceIp. Valid values include deviceIp, deviceLabel,
ifDesc, terminalIp, terminalMac, terminalName, actionStatus, and conflictType.

desc

Whether or not the result is sequenced in reverse order.


Boolean type. Optional. The default value is false. The parameter is valid only when the orderBy
parameter is specified.

total

Only the number of records that meet the requirements is returned.

Query Access Log Histories 207

Query Parameters
Boolean type. Optional. The default value is false. When the value is true, the start and size
attributes are invalid, the returned message body is empty, and the Total attribute of the message
header returns the number of records that meet the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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
terminalIp

Terminal IP address.
String type.

terminalMac

Terminal MAC address.


String type.

terminalName

Terminal name.
String type.

deviceId

Device ID.
Long integer type.

deviceLabel

Device label.
String type.

deviceIp

Device IP address.
String type.

208 Terminal Access Management

unauthorizedAccessLog sub-elements
ifDesc

Interface description.
String type.

vlanId

VLAN ID.
Integer type.

upLineTime

Time when the user logged on.


Long integer type.

downLineTime

Time when the user logged off.


Long integer type.

Example
Query and list access log histories.

Request
GET http://localhost:8080/imcrs/res/access/historyAccessLog
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Accesses


Query current accesses on a device with certain criteria.

Interface URI
/res/access/ipMacLearn/{deviceId}

Access Method
HTTP
GET

Path parameters
Path parameters
deviceId

Device ID.
Long integer type. Required. No default value.

Query parameters
Query parameters
deviceId

Device ID.
Long integer type. Required. No default value.

mac

Learned MAC address.


String type. Optional.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. Default value is false. When true, the returned message body is empty, and
the Total attribute of the message header returns the required number of records.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value, the default value is used.

size

The total number of returned records.


Integer type. Optional. The default value is 10. If a negative value, the default value is used.

orderBy

The sequencing field of the returned result set.


String type. Optional. The default value is ifDesc. Valid values include ifDesc, vlanId, ip, and mac.

desc

Whether or not the result is sequenced in reverse order.


Boolean type. Optional. The default value is false. The parameter is valid only when the orderBy
parameter is specified.

210

Terminal Access Management

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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
deviceId

Location address.
String type.

deviceIp

Device IP address.
String type.

ifDesc

Interface description.
String type.

ifIndex

Interface index.
Long integer type.

vlanId

VLAN ID.
Integer type.

learnIp

Learned IP address.
String type.

learnMac

Learned MAC address.


String type.

device

URI of the device link.


String type.

iface

URI of the interface link.


Query Current Accesses

211

ipMacLearnResult sub-elements
String type.

Example
Query and list current accesses on the device whose ID is 10.

Request
GET http://localhost:8080/imcrs/res/access/ipMacLearn/10
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Locations


Query real-time locations with certain criteria.

Interface URI
/res/access/realtimeLocate

Access Method
HTTP
GET

Parameters
Query parameters
type

Location type. 1 for MAC address. 2 for IP address.


Integer type. Required. The default value is 2.

value

Location address.
String type. Required. The default value is an empty string.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the returned message
body is empty, and the Total attribute of the message header returns the number of records that meet
the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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
locateIp

Location address.
String type.

deviceIp

Device IP address.
String type.

ifDesc

Interface description.
String type.

Example
Query and list real-time locations.

Request
GET http://imc_host:8080/imcrs/asset/access/realtimeLocate
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Segments


Query information about all IP segments.

Interface URI
/res/access/assignedIpScope

Access Method
HTTP
GET

Path parameters
None

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
id

IP segment ID.
Long integer type.

ip

IP segment.
String type.

startIp

Start IP address.
String type.

endIp

End IP address.
String type.

name

Owner.
String type.

description

Description.
String type.

parentId

Parent IP segment ID.


Long integer type.

percent

Ratio of the assigned IP address number to the total number of IP addresses in the IP segment,
expressed in a percentage value.
Double-precision floating-point type.

rightIpId

ID of the parent IP segment that the child IP segment inherit rights from.
Long integer type.

operatorGroup

URI of the operator group.


String type.

216

Terminal Access Management

Example
Query information about all IP segments.

Request
GET http://localhost:8080/imcrs/asset/access/assignedIpScope
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Segment
Query information about an IP segment with the specified ID.

Interface URI
/res/access/assignedIpScope/{id}

Access Method
HTTP
GET

Path parameters
Path parameters
id

IP segment ID.
Long 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
id

IP segment ID.
Long integer type.

ip

IP segment.
String type.

startIp

Start IP address.
String type.

endIp

End IP address.
String type.

name

Owner.
String type.

description

Description.
String type.

parentId

Parent IP segment ID.


Long integer type.

percent

Ratio of the assigned IP address number to the total number of IP addresses in the IP segment,
expressed in a percentage value.
Double-precision floating-point type.

rightIpId

ID of the parent IP segment that the child IP segment inherit rights from.
Long integer type.

operatorGroupId

Operator group ID.


Long integer type.

Query IP Segment

219

Example
Query information about the IP segment with ID 1.

Request
GET http://localhost:8080/imcrs/res/access/assignedIpScope/1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Segment
Add an IP segment.

Interface URI
/res/access/assignedIpScope

Access Method
HTTP
POST

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
startIp

Start IP address.
String type. Required. No default value.

endIp

End IP address.
String type. Required. No default value.

name

Owner.
String type. Required. No default value.

description

Description.
String type. Optional. The default value is empty.

operatorGroupId

Operator group ID.


Long integer type. Optional, supporting multiple elements. If there is zero elements, the default
value contains 1, 2, and 3. If there is at least one element, the default value contains 1. For the
valid values, see Query Operator Groups.

Returned Result
Status codes

201 (Created): Success.

409 (Conflict): Failure. See Error Codes.

Message header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/res/access/assignedIpScope/7

Add IP Segment 221

Example 1
Add an IP segment ranging from 10.153.89.21 to 10.153.89.30 and grant rights to the IP segment
to the default operator groups.

Request
POST http://localhost:8080/imcrs/res/access/assignedIpScope
accept: application/xml
Content-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 Created
Location: http://localhost:8080/imcrs/res/access/assignedIpScope/7

Example 2
Add an IP segment ranging from 10.153.89.60 to 10.153.89.80, and grant rights to the IP
segment to operator groups with IDs 1, 2, and 4.

Request
POST http://localhost:8080/imcrs/res/access/assignedIpScope
accept: application/xml
Content-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 Created
Location: http://localhost:8080/imcrs/res/access/assignedIpScope/12

222 Terminal Access Management

Add Child IP Segment


Add a child IP segment.

Interface URI
/res/access/assignedIpScope/{id}

Access Method
HTTP
POST

Parameters
Path parameters
id

IP segment ID.
Long 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
startIp

Start IP address.
String type. Required. No default value.

endIp

End IP address.
String type. Required. No default value.

name

Owner.
String type. Required. No default value.

description

Description.
String type. Optional. No default value.

Returned Result
Status codes

201 (Created): Success.

409 (Conflict): Failure. See Error Codes.

Add Child IP Segment 223

Message header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/res/access/assignedIpScope/8

Example
Add a child IP segment ranging from 10.153.89.21 to 10.153.89.25 for the IP segment with ID
7.

Request
POST http://localhost:8080/imcrs/res/access/assignedIpScope/7
accept: application/xml
Content-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 Created
Location: http://localhost:8080/imcrs/res/access/assignedIpScope/8

224 Terminal Access Management

Modify IP Segment
Modify an IP segment with the specified ID.

Interface URI
/res/access/assignedIpScope/{id}

Access Method
HTTP
PUT

Parameters
Path parameters
id

IP segment ID.
Long 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
name

Owner.
String type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

description

Description.
String type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

operatorGroupId

Operator group ID.


Long integer type. Optional, supporting multiple elements. If the element does not exist, the value
is not changed. If the element exists, the value cannot be null. If there is at least one element, the
default 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

Example
Modify the IP segment with ID 13.

Request
PUT http://imc_host:8080/imcrs/asset/access/assignedIpScope/13
accept: 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 Segment
Release an IP segment with the specified ID.

Interface URI
/res/access/assignedIpScope/{id}

Access Method
HTTP
DELETE

Parameters
Path parameters
id

IP segment ID.
Long 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
...

Example
Release the IP segment with ID 13.

Request
DELETE http://localhost:8080/imcrs/res/access/assignedIpScope/13
accept: application/xml
...

Response
HTTP/1.1 204 No Content

Release IP Segment 227

Automatically Scan IP Segment


Automatically scan an IP segment with the specified start and end IP addresses.

Interface URI
/res/access/assignedIpScope/autoScan

Access Method
HTTP
GET

Query parameters
Query parameters
startIp

Start IP address.
String type. Required. No default value.

endIp

End IP address.
String type. Required. No default value.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the returned message
body is empty, and the Total attribute of the message header returns the number of records that meet
the requirements.

orderBy

The sequencing field of the returned result set.


String type. Optional. The default value is ip. Valid values include ip and name.

desc

Whether or not the result is sequenced in reverse order.


Boolean type. Optional. The default value is false. The parameter is valid only when the orderlBy
parameter is specified.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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

ID of the IP address.
Long integer type.

ip

IP address.
String type.

name

Owner.
String type.

description

Description.
String type.

Automatically Scan IP Segment 229

Example
Automatically scan the IP segment with start IP address 10.153.89.1 and end IP address
10.153.89.20.

Request
GET http://localhost:8080/imcrs/res/access/assignedIpScope/autoScan?startIp=10.153.89.1&endIP=10.153.89.20
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Segment


Automatically scan an IP segment with the specified ID.

Interface URI
/res/access/assignedIpScope/autoScan/{id}

Access Method
HTTP
GET

Parameters
Path parameters
id

IP segment ID.
Long integer type. Required. No default value.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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

ID of the IP address.
Long integer type.

ip

IP address.
String type.

name

Owner.

Automatically Scan Assigned IP Segment

231

assignedIpInfo sub-elements
String type.
description

Description.
String type.

Example
Automatically scan the IP segment with ID 2.

Request
GET http://localhost:8080/imcrs/res/access/assignedIpScope/autoScan/2
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Addresses
Query the assigned IP addresses with the specified IP segment ID.

Interface URI
/res/access/assignedIpScope/ip

Access Method
HTTP
GET

Query parameters
Query parameters
ipScopeId

ID of the IP address segment.


Long integer type. Required. No default value.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the returned message
body is empty, and the Total attribute of the message header returns the number of records that meet
the requirements.

orderBy

The sequencing field of the returned result set.


String type. Optional. The default value is ip. Valid values include ip and name.

desc

Whether or not the result is sequenced in reverse order.


Boolean type. Optional. The default value is false. The parameter is valid only when the orderBy
parameter is specified.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value is uploaded, the default value is
used.

size

The total number of returned records.


Integer type. Optional. The default value is 10. If a negative value is uploaded, the default value is
used.

ip

IP address
String type. Optional. No default value.

name

Owner.
String type. Optional. No default value.

description

Description.
String type. Optional. No default value.

Query IP Addresses 233

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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

ID of the IP address.
Long integer type.

ip

IP address.
String type.

name

Owner.
String type.

description

Description.
String type.

parentId

ID of the IP address segment.


Long integer type.

234 Terminal Access Management

Example
Query 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=1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Address
Assign an IP address.

Interface URI
/res/access/assignedIpScope/ip

Access Method
HTTP
POST

Query parameters
Query parameters
ipScopeId

IP segment ID.
Long 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

IP address.
String type. Required. No default value.

name

Owner.
String type. Required. No default value.

description

Description.
String type. Optional. No default value.

Returned Result
Status codes

201 (Created): Success.

409 (Conflict): Failure. See Error Codes.

Message header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/res/access/assignedIpScope/ip/15

236 Terminal Access Management

Example
Assign 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=1
accept: application/xml
Content-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 Created
Location: http://localhost:8080/imcrs/res/access/assignedIpScope/ip/15

Assign IP Address 237

Release Assigned IP Address


Release an assigned IP address with specific ID.

Interface URI
/res/access/assignedIpScope/ip/{id}

Access Method
HTTP
DELETE

Parameters
Path parameters
id

ID of the IP address.
Long 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
...

Example
Release the IP segment with ID 13.

Request
DELETE http://imc_host:8080/imcrs/asset/access/assignedIpScope/ip/15
accept: application/xml
...

Response
HTTP/1.1 204 No Content

238 Terminal Access Management

Query Terminal Access Bindings


Query terminal access bindings with certain criteria.

Interface URI
/res/access/macAccessBind

Access Method
HTTP
GET

Parameters
Query parameters
resPrivilegeFilter

Whether or not to filter the rights for resources.


Boolean type. Optional. The default value is false.

terminalIp

Terminal IP address.
String type, supporting wildcard characters. Optional. No default value.

terminalMac

Terminal MAC address.


String type, supporting wildcard characters. Optional. No default value.

terminalName

Terminal name.
String type, supporting wildcard characters. Optional. No default value.

deviceLabel

Device label.
String type. Optional. No default value.

deviceIp

Device IP address.
String type. Optional. No default value.

ifDesc

Interface description.
String type. Optional. No default value.

bindType

Binding type. 1 for no authentication. 2 for MAC-to-interface binding.


Integer type. Optional. No default value.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value, the default value is used.

size

The total number of returned records.


Integer type. Optional. The default value is 10. If a negative value, the default value is used.

orderBy

The sequencing field of the returned result set.


String type. Optional. The default value is terminalMac. Valid values include deviceIp, deviceLabel,
ifDesc, terminalIp, terminalMac, terminalName, and bindType.

desc

Whether or not the result is sequenced in reverse order.


Boolean type. Optional. Default value is false. Valid only when the orderBy parameter is specified.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false.When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Total attribute of the message header
returns the number of records that meet the requirements.

Query Terminal Access Bindings 239

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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>

Elements
For meanings of the fields in the message body, see Query Terminal Access Binding.

Example
Query and list terminal access bindings.

Request
GET http://localhost:8080/imcrs/res/access/macAccessBind
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Binding


Query information about a terminal access binding with the specified ID.

Interface URI
/res/access/macAccessBind/{id}

Access Method
HTTP
GET

Parameters
Path parameters
id

Terminal access binding


ID. 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
id

Terminal access binding


ID. Long integer type.

terminalIp

Terminal IP address.
String type.

terminalMac

Terminal MAC address.


String type.

Query Terminal Access Binding

241

macAccessBind sub-elements
terminalName

Terminal name.
String type.

deviceId

Device ID.
Long integer type.

deviceLabel

Device label.
String type.

deviceIp

Device IP address.
String type.

ifDesc

Interface description.
String type.

bindType

Binding type. 1 for no authentication. 2 for MAC-to-interface binding.


Integer type.

device

URI of the device link.


String type.

Example
Query information about the terminal access binding with ID 1.

Request
GET http://localhost:8080/imcrs/res/access/macAccessBind/1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Bindings


Automatically scan the terminal access bindings with certain criteria.

Interface URI
/res/access/macAccessBind/autoScan

Access Method
HTTP
GET

Parameters
Query parameters
deviceId

Device ID.
Long integer type. Required, supporting multiple query elements. No default value.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the returned message
body is empty, and the Total attribute of the message header returns the number of records that meet
the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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>

Elements
For meanings of the fields in the message body, see Query Terminal Access Binding.

Automatically Scan Terminal Access Bindings 243

Example
Automatically scan the terminal access bindings on the device whose ID is 2.

Request
GET http://localhost:8080/imcrs/res/access/macAccessBind/autoScan?deviceId=2
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Binding


Add a terminal access binding.

Interface URI
/res/access/macAccessBind

Access Method
HTTP
POST

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
terminalMac

Terminal MAC address.


String type. Required. No default value.

terminalName

Terminal name.
String type. Optional. No default value.

bindType

Binding type. 1 for no authentication. 2 for MAC-to-interface binding.


Integer type. Required. No default value.

maintainer

Maintainer.
String type. Optional. No default value.

ifInfo

Interface information.
Element type. Required when bindType takes 2. Multiple elements are supported.

ifInfo/deviceId

Device ID.
Long integer type.

ifInfo/ifIndex

Interface index.
Long integer type.

Returned Result
Status codes

201 (Created): Success.

409 (Conflict): Failure. See Error Codes.

Add Terminal Access Binding 245

Message header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/res/access/macAccessBind/4

Example 1
Add a terminal access binding, which maps MAC address 1a:2a:3a:4c:1c:2c to the interface
whose index is 1 on device whose ID is 2.

Request
POST http://localhost:8080/imcrs/res/access/macAccessBind
accept: application/xml
Content-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 Created
Location: http://localhost:8080/imcrs/res/access/macAccessBind/4

Example 2
Exclude MAC address 1a:2a:3a:4a:1a:2a from authentication.

Request
POST http://localhost:8080/imcrs/res/access/macAccessBind
accept: application/xml
Content-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 Created
Location: http://localhost:8080/imcrs/res/access/macAccessBind/1

246 Terminal Access Management

Modify Terminal Access Binding


Modify a terminal access binding with the specified ID.

Interface URI
/res/access/macAccessBind/{id}

Access Method
HTTP
PUT

Parameters
Path parameters
id

Terminal access binding ID.


ID. 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>

Elements
For meanings of the fields in the message body, see Query Terminal Access Binding. 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 Terminal Access Binding 247

Example
Modify the terminal access binding with ID 2.

Request
PUT http://localhost:8080/imcrs/res/access/macAccessBind/2
accept: 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 Binding


Delete a terminal access binding with the specified ID.

Interface URI
/res/access/macAccessBind/{id}

Access Method
HTTP
DELETE

Parameters
Path parameters
id

Terminal access binding ID.


Long 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
...

Example
Delete the terminal access binding with ID 1.

Request
DELETE http://localhost:8080/imcrs/res/access/macAccessBind/1
accept: application/xml
...

Response
HTTP/1.1 204 No Content

Delete Terminal Access Binding 249

Query Switch Access Bindings


Query switch access bindings with certain criteria.

Interface URI
/res/access/ifAccessBind

Access Method
HTTP
GET

Parameters
Query parameters
resPrivilegeFilter

Whether or not to filter the rights for resources.


Boolean type. Optional. The default value is false.

terminalIp

Terminal IP address.
String type, supporting wildcard characters. Optional. No default value.

terminalMac

Terminal MAC address.


String type, supporting wildcard characters. Optional. No default value.

terminalName

Terminal name.
String type, supporting wildcard characters. Optional. No default value.

deviceLabel

Device label.
String type. Optional. No default value.

deviceIp

Device IP address.
String type. Optional. No default value.

ifDesc

Interface description.
String type. Optional. No default value.

bindType

Binding type. 1 for MAC-to-interface binding. 2 for no authentication.


Integer type. Optional. No default value.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. Default value is 0. If a negative value, the default value is used.

size

The total number of returned records.


Integer type. Optional. The default value is 10. If a negative value, the default value is used.

orderBy

The sequencing field of the returned result set.


String type. Optional. The default value is terminalMac. Valid values include deviceIp, deviceLabel,
ifDesc, terminalIp, terminalMac, terminalName, and bindType.

desc

Whether or not the result is sequenced in reverse order.


Boolean type. Optional. Default value is false. Valid only when the orderBy parameter is specified.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size
attributes are invalid, the returned message body is empty, and the Total attribute of the message
header returns the number of records that meet the requirements.

250 Terminal Access Management

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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>

Elements
For meanings of the fields in the message body, see Query Switch Access Binding.

Query Switch Access Bindings

251

Example
Query switch access bindings.

Request
GET http://localhost:8080/imcrs/res/access/ifAccessBind
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Binding


Query information about a switch access binding with the specified ID.

Interface URI
/res/access/ifAccessBind/{id}

Access Method
HTTP
GET

Parameters
Path parameters
id

Switch access binding ID.


Long 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
id

Terminal access binding ID.


Long integer type.

terminalIp

Terminal IP address.
String type.

terminalMac

Terminal MAC address.


String type.

Query Switch Access Binding 253

ifAccessBind sub-elements
terminalName

Terminal name.
String type.

deviceId

Device ID.
Long integer type.

deviceName

Device label.
String type.

deviceIp

Device IP address.
String type.

ifDesc

Interface description.
String type.

bindType

Binding type. 1 for MAC-to-interface binding. 2 for no authentication.


Integer type.

terminalMaintainer

Maintainer.
String type

device

URI of the device link.


String type.

Example
Query information about the switch access binding with ID 1.

Request
GET http://localhost:8080/imcrs/res/access/ifAccessBind/1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Bindings


Automatically scan the terminal access bindings with certain criteria.

Interface URI
/res/access/macAccessBind/autoScan

Access Method
HTTP
GET

Parameters
Query parameters
deviceId

Device ID.
Long integer type. Required, supporting multiple elements. No default value.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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>

Elements
For meanings of the fields in the message body, see Query Terminal Access Binding.

Automatically Scan Switch Access Bindings 255

Example
Automatically scan the terminal access bindings on the device whose ID is 2.

Request
GET http://localhost:8080/imcrs/res/access/macAccessBind/autoScan?deviceId=2
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Binding


Add a switch access binding.

Interface URI
/res/access/ifAccessBind

Access Method
HTTP
POST

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
terminalMac

Terminal MAC address.


String type. Required when bindType takes 1.

terminalName

Terminal name.
String type.

bindType

Binding type. 1 for MAC-to-interface binding. 2 for no authentication.


Integer type.

terminalMaintainer

Maintainer.
String type.

ifInfo

Interface information.
Element type. Required. No default value.

deviceId

Device ID.
Long integer type.

ifIndex

Interface index.
Long integer type.

Returned Result
Status codes

201 (Created): Success.

409 (Conflict): Failure. See Error Codes.

Add Switch Access Binding 257

Message header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/res/access/ifAccessBind/4

Example 1
Add a switch access binding, which maps the interface (index 29) of the device (ID 5) to MAC
address 8:28:38:47:17:26.

Request
POST http://imc_host:8080/imcrs/asset/access/ifAccessBind
accept: application/xml
Content-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 Created
Location: http://localhost:8080/imcrs/asset/access/ifAccessBind/4

Example 2
Exclude the interface whose index is 32 of the device whose ID is 5 from authentication.

Request
POST http://imc_host:8080/imcrs/asset/access/ifAccessBind
accept: application/xml
Content-Type: application/xml; charset=UTF-8
...
<ifAccessBind>
<bindType>2</bindType>
<ifInfo>
<deviceId>5</deviceId>
<ifIndex>32</ifIndex>
</ifInfo>
</ifAccessBind>

Response
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/asset/access/ifAccessBind/6

258 Terminal Access Management

Modify Switch Access Binding


Modify a switch access binding with the specified ID.

Interface URI
/res/access/ifAccessBind/{id}

Access Method
HTTP
PUT

Parameters
Path parameters
id

Switch access binding ID.


Long 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>

Elements
For meanings of the fields in the message body, see Add Switch Access Binding. 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 Switch Access Binding 259

Example
Modify the switch access binding with ID 5.

Request
PUT http://localhost:8080/imcrs/res/access/ifAccessBind/5
accept: 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 Binding


Delete a switch access binding with the specified ID.

Interface URI
/res/access/ifAccessBind/{id}

Access Method
HTTP
DELETE

Parameters
Path parameters
id

Switch access binding ID.


Long 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
...

Example
Delete the switch access binding with ID 3.

Request
DELETE http://localhost:8080/imcrs/res/access/ifAccessBind/3
accept: application/xml
...

Response
HTTP/1.1 204 No Content

Delete Switch Access Binding

261

Query IP-to-MAC Address Bindings


Query the IP-to-MAC address bindings with certain criteria.

Interface URI
/res/access/ipMacBind

Access Method
HTTP
GET

Parameters
Query parameters
resPrivilegeFilter Whether or not to filter the rights for resources.
Boolean type. Optional. The default value is false.
ip

IP address.
String type, supporting wildcard characters. Optional. No default value.

mac

MAC address.
String type, supporting wildcard characters. Optional. No default value.

name

Owner.
String type, supporting wildcard characters. Optional. No default value.

type

Type.
Long integer type. Optional. No default value.

orderBy

The sequencing field of the returned result set.


String type. Optional. The default value is ip. Valid values include ip, mac, name and type.

desc

Whether or not the result is sequenced in reverse order.


Boolean type. Optional. The default value is false. The parameter is valid only when the orderBy
parameter is specified.

total

Only the number of records that meet the requirements is returned. Boolean type. Optional. The
default value is false. When the value is true, the start and size attributes are invalid, the returned
message body is empty, and the Total attribute of the message header returns the number of records
that meet the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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>

Elements
For meanings of the fields in the message body, see Query IP-to-MAC Address Binding.

Example
Query and list IP-to-MAC address bindings.

Request
GET http://imc_host:8080/imcrs/res/access/ipMacBind
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Binding


Query information about an IP-to-MAC address binding with the specified ID.

Interface URI
/res/access/ipMacBind/{id}

Access Method
HTTP
GET

Parameters
Path parameters
id

IP-to-MAC address binding ID.


Long 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
id

IP-to-MAC address binding ID.


Long integer type.

ip

IP address.
String type.

mac

MAC address.
String type.

name

Owner.
String type.

264 Terminal Access Management

Example
Query information about the IP-to-MAC address binding with ID 1.

Request
GET http://localhost:8080/imcrs/res/access/ipMacBind/1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Bindings


Automatically scan the IP-to-MAC address bindings with certain criteria.

Interface URI
/res/access/ipMacBind/autoScan

Access Method
HTTP
GET

Parameters
Query parameters
startIp

Start IP address.
String type. Required. No default value.

endIp

End IP address.
String type. Required. No default value.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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>

Elements
For meanings of the fields in the message body, see Query IP-to-MAC Address Binding.

266 Terminal Access Management

Example
Automatically scan the IP-to-MAC address bindings on the IP segment with start IP address
10.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.2
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Binding


Add an IP-to-MAC address binding.

Interface URI
/res/access/ipMacBind

Access Method
HTTP
POST

Message body
<ipMacBind>
<ip>10.153.89.1</ip>
<mac>00:0f:e2:e1:ca:be</mac>
</ipMacBind>

Elements
ipMacBind sub-elements
ip

IP address.
String type. Required. No default value.

mac

MAC address.
String type. Required. No default value.

Returned Result
Status codes

201 (Created): Success.

409 (Conflict): Failure. See Error Codes.

Message header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/res/access/ipMacBind/3

268 Terminal Access Management

Example
Add an IP-to-MAC address binding, which maps the IP address 10.153.89.1 to the MAC address
00:0f:e2:e1:ca:be

Request
POST http://localhost:8080/imcrs/res/access/ipMacBind
accept: application/xml
Content-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 Created
Location: http://localhost:8080/imcrs/res/access/ipMacBind/4

Add IP-to-MAC Address Binding 269

Delete IP-to-MAC Address Binding


Delete an IP-to-MAC address binding with the specified ID.

Interface URI
/res/access/ipMacBind/{id}

Access Method
HTTP
DELETE

Parameters
Path parameters
id

IP-to-MAC address binding ID.


Long 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
...

Example
Delete the IP-to-MAC address binding with ID 3.

Request
DELETE http://localhost:8080/imcrs/res/access/ipMacBind/3
accept: application/xml
...

Response
HTTP/1.1 204 No Content

270 Terminal Access Management

Query Conflict and Unauthorized Access Policy


Query information about the conflict and unauthorized access policy.

Interface URI
/res/access/strategy/conflict

Access Method
HTTP
GET

Parameters
None

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
sendFaultType

Whether or not to send alarms. 0 for no. 1 for yes.


Integer type.

closeIfType

Interface shutdown type. 0 for no shutdown. 1 for immediate shutdown. 2 for delayed shutdown.
Integer type.

openIfType

Whether or not to bring up the interface after it is shut down. 0 for no. 1 for yes.
Integer type.

closeIfDelay

Time delay before shutting down the interface, in seconds.


Integer type.

openIfDelay

Time delay before bringing up the interface, in seconds.


Integer type.

Query Conflict and Unauthorized Access Policy

271

Example
Query information about the conflict and unauthorized access policy.

Request
GET http://localhost:8080/imcrs/res/access/strategy/conflict
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Policy


Query information about the unknown access policy.

Interface URI
/res/access/strategy/unknown

Access Method
HTTP
GET

Parameters
None

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
sendFaultType

Whether or not to send alarms. 0 for no. 1 for yes.


Integer type.

closeIfType

Interface shutdown type. 0 for no shutdown. 1 for immediate shutdown. 2 for delayed shutdown.
Integer type.

openIfType

Whether or not to bring up the interface after it is shut down. 0 for no. 1 for yes.
Integer type.

closeIfDelay

Time delay before shutting down the interface, in seconds.


Integer type.

openIfDelay

Time delay before bringing up the interface, in seconds.


Integer type.

accessType

Whether or not the policy is valid when an unknown access is detected. 0 for yes. 1 for no.
Integer type.
Query Unknown Access Policy 273

Example
Query information about the unknown access policy.

Request
GET http://localhost:8080/imcrs/res/access/strategy/unknown
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Policy


Modify the conflict and unauthorized access policy.

Interface URI
/res/access/strategy/conflict

Access Method
HTTP
PUT

Parameters
None

Message body
<accessStrategy>
<sendFaultType>1</sendFaultType>
<closeIfType>2</closeIfType>
<openIfType>1</openIfType>
<closeIfDelay>180</closeIfDelay>
<openIfDelay>180</openIfDelay>
</accessStrategy>

Elements
accessStrategy sub-elements
sendFaultType

Whether or not to send alarms. 0 for no. 1 for yes.


Integer type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

closeIfType

Interface shutdown type. 0 for no shutdown. 1 for immediate shutdown. 2 for delayed shutdown.
Integer type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

openIfType

Whether or not to bring up the interface after it is shut down. 0 for no. 1 for yes.
Integer type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

closeIfDelay

Time delay before shutting down the interface, in seconds.


Integer type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

openIfDelay

Time delay before bringing up the interface, in seconds.


Integer 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

Example
Modify the conflict and unauthorized access policy.

Request
PUT http://imc_host:8080/imcrs/asset/access/strategy/conflict
accept: 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 Policy


Modify the unknown access policy.

Interface URI
/res/access/strategy/unknown

Access Method
HTTP
PUT

Parameters
None

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
sendFaultType

Whether or not to send alarms. 0 for no. 1 for yes.


Integer type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

closeIfType

Interface shutdown type. 0 for no shutdown. 1 for immediate shutdown. 2 for delayed shutdown.
Integer type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

openIfType

Whether or not to bring up the interface after it is shut down. 0 for no. 1 for yes.
Integer type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

closeIfDelay

Time delay before shutting down the interface, in seconds.


Integer type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

openIfDelay

Time delay before bringing up the interface, in seconds.


Integer type. Optional. If the element does not exist, the value is not changed. If the element exists,
the value cannot be null.

accessType

Whether or not the policy is valid when an unknown access is detected.0 for yes. 1 for no.
Integer 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.

Example
Modify the unknown access policy.

Request
PUT http://localhost:8080/imcrs/res/access/strategy/unknown
accept: 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 Management


This set of API commands provides tools for managing alarm conditions on your network. Network
alarm 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 Alarms
Query alarms with certain criteria.

Interface URI
/fault/alarm

Access Method
HTTP
GET

Parameters
Query parameters
alarmLevel

Alarm level.
Integer type, supporting multiple elements. Optional. No default value. For the valid values, see
Query Alarm Levels.

recStatus

Alarm recovery status.


Integer type. Optional. No default. For valid values, see Query Alarm Recovery Status.

ackStatus

Alarm acknowledgement status.


Integer type. Optional. No default. For valid values, see Query Alarm Acknowledgement Status.

timeRange

Time range for the alarm query.


Integer type. Optional. No default. For valid values, see Query Alarm Time Ranges.

startAlarmTime

Start time for the alarm query.


Long integer type. Optional. No default value.

endAlarmTime

End time for the alarm query.


Long integer type. Optional. No default value.

alarmDesc

Alarm description.
String type, supporting wildcard characters. Optional. No default value.

acker

User who recovered the alarm.


String type, supporting wildcard characters. Optional. No default value.

paras

Alarm parameters.
String type, supporting wildcard characters. Optional. No default value.

customView

Custom view ID.


Long integer type. Optional. No default value.

deviceIp

Device IP address.
String type, supporting wildcard characters and multiple elements. Optional. No default value.

deviceId

Device ID.
String type, supporting wildcard characters and multiple elements. Optional. No default value.

id

Alarm ID
Long integer type, supporting multiple elements. Optional. No default value.

alarmCategory

Alarm category.
Integer type. Optional. No default value.For the valid values, see Query Alarm Categories.

280 Network Alarm Management

Query parameters
faultOid

Alarm event OID.


String type, supporting multiple elements. Optional. No default value.

originalType

Alarm source type.


Integer type. Optional. No default value. For the valid values, see Query Alarm Sources.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value is uploaded, the default value is
used.

size

The total number of returned records.


Integer type. Optional. The default value is 10. If a negative value is uploaded, the default value is
used.

orderBy

The sequencing field of the returned result set.


String type. Optional. The default value is id. Valid values include id, label, ip, mask, status, contact,
location, sysOid, and sysName.

desc

Whether or not the result is sequenced in reverse order.


Boolean type. Optional. The default value is false. The parameter is valid only when the orderBy
parameter is specified.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Total attribute of the message header
returns the number of records that meet the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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

Example
Query 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=10
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Information


Query basic information about an alarm with the specified ID.
In addition to basic alarm information, the result also includes the method for accessing alarm
details and performing related operations.

Interface URI
/fault/alarm/{id}

Access Method
HTTP
GET

Parameters
Path parameters
id

Alarm ID.
Long integer type. Required. No default value.

Returned Result
Status codes

200 (OK): Success.

Message header
The message header offers the following resource links with the Link attribute:
recover

Recover alarm

acknowledge

Acknowledge alarm

delete

Delete alarm

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
id

Alarm ID, which uniquely identifies an alarm.


Long integer type.

OID

Alarm event OID.


String type.
Query Alarm Information 283

alarmDetail sub-elements
originalType

Alarm source type.


Integer type.

originalTypeDesc

Description of the alarm source type.


String type.

deviceId

Device ID.
Long integer type.

deviceIp

Device IP address.
String type.

deviceName

Device name.
String type.

alarmLevel

Alarm level.
Integer type.

alarmLevelDesc

Alarm level description.


String type.

alarmCategory

Alarm category.
Integer type.

alarmCategoryDesc

Alarm category description.


String type.

faultTime

Time when the alarm occurred.


Long integer type.

faultTimeDesc

Detailed information about the time when the alarm occurred.


String type, in the format of yyyy-MM-dd HH:mm:ss.

recTime

Time when the alarm was recovered.


Long integer type.

recTimeDesc

Detailed information about the time when the alarm was recovered.
String type, in the format of yyyy-MM-dd HH:mm:ss.

recStatus

Alarm recovery status.


Integer type.

recStatusDesc

Alarm recovery description.


String type.

recUserName

User who recovered the alarm.


String type.

ackTime

Time when the alarm was acknowledged.


Long integer type.

ackTimeDesc

Detailed information about the time when the alarm was acknowledged.
String type, in the format of yyyy-MM-dd HH:mm:ss.

ackStatus

Alarm acknowledgement status. Integer type.

ackStatusDesc

Alarm acknowledgement status description.

284 Network Alarm Management

alarmDetail sub-elements
String type.
ackUserName

User who acknowledged the alarm.


String type.

alarmDesc

Alarm description.
String type.

paras

Alarm parameters.
String type.

parentId

Parent ID of the alarm relation analysis.


Long integer type.

somState

Alarm distribution status.


Integer type.

remark

Alarm remarks.
String type.

genericId

Generic ID.
Integer type.

specificId

Specific ID.
Integer type.

eventName

Alarm event name.


String type.

reason

Alarm event reason.


String type.

suggestion

Restoration suggestion.
String type.

experience

Maintenance experience.
String type.

tipMessage

Alarm event location string.


String type

defineType

Alarm definition type. 0 for pre-defined. 1 for user-defined.


Integer type.

customAlarmLevel

Custom level.
Integer type

Query Alarm Information 285

Example
Query information about the alarm with ID 3665.

Request
GET http://imc_host:8080/imcrs/fault/alarm/3665
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-Type: application/xml
Link: <http://imc_host:port/imcrs/fault/alarm/recover/3665>; rel=recover
Link: <http://imc_host:port/imcrs/fault/alarm/acknowledge/3665>; rel=acknowledge
Link: <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 Information


Query the root alarm for an alarm with the specified ID.

Interface URI
/fault/alarm/rootAlarm/{id}

Access Method
HTTP
GET

Parameters
Path parameters
id

Alarm ID.
Long integer type. Required. No default value.

Returned Result
Status codes

200 (OK): Success.

Message header
The message header offers the following resource links with the Link attribute:
recover

Recover alarm

acknowledge

Acknowledge alarm

delete

Delete alarm

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

Example
Query information about the root alarm with ID 324.

Request
GET http://imc_host:8080/imcrs/fault/alarm/rootAlarm/324
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-Type: application/xml
Link: <http://imc_host:port/imcrs/fault/alarm/recover/51>; rel=recover
Link: <http://imc_host:port/imcrs/fault/alarm/acknowledge/51>; rel=acknowledge
Link: <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 Alarms


Query and list the child alarms of an alarm with the specified ID.

Interface URI
/fault/alarm/childAlarm/{id}

Access Method
HTTP
GET

Parameters
Path parameters
id

Alarm ID.
Long integer type. Required. No default value.

Query parameters
start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value is uploaded, the default value is
used.

size

The total number of returned records.


Integer type. Optional. The default value is 10. If a negative value is uploaded, the default value is
used.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Total attribute of the message header
returns the number of records that meet the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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.

Example
Query 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=8
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Devices


Query and list top N devices that include the specified alarm level.

Interface URI
/fault/alarmDevice

Access Method
HTTP
GET

Parameters
Query parameters
alarmLevel

Alarm level.
Integer type, supporting multiple elements. Optional. No default value. For the valid values, see
Query Alarm Levels.

size

The total number of returned records.


Integer type. Optional. The default value is 10. If a negative value is uploaded, the default value is
used.

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
deviceId

Device ID.
Long integer type.

alarmCount

The total number of alarms of the specified level.


Long integer type.

alarmLevel

Alarm level.
Integer type.

Query Top N Alarming Devices

291

Example
Query 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=10
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Enterprises


Query and list alarming enterprises.

Interface URI
/fault/trapEnterprise

Access Method
HTTP
GET

Parameters
Query parameters
total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the returned message
body is empty, and the Total attribute of the message header returns the number of records that meet
the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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
enterpriseId

Enterprise ID, which uniquely identifies an enterprise.


String type.

enterpriseName Enterprise name.


String type.
trapEvents

Link to the current alarm events.


URI type.

Query Alarming Enterprises 293

Example
Query and list all alarming enterprises.

Request
GET http://imc_host:8080/imcrs/fault/trapEnterprise
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Events


Query and list alarm events.

Interface URI
/fault/trapEvent

Access Method
HTTP
GET

Parameters
Query parameters
trapEnterpriseId Alarming enterprise ID.
String type. Required. No default value. For the valid values, see Query Alarming Enterprises.
total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the returned message
body is empty, and the Total attribute of the message header returns the number of records that meet
the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 133

Elements
trapEvent sub-elements
eventOID

Event OID, which uniquely identifies an event.


String type.

eventName

Event name.
String type.

specificID

Specific ID of the event.


Integer type.

Query Alarm Events 295

Example
Query 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.43
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Categories


Query and list the alarm categories.
The results include all alarm main categories, sub-categories, and their descriptions.

Interface URI
/fault/alarmCategory

Access Method
HTTP
GET

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
id

Alarm category ID, which uniquely identifies an alarm category.


Long integer type.

baseClass

Alarm main category.


Long integer type.

baseDesc

Main category description.


String type.

subClass

Alarm sub-category.
Long integer type.

subDesc

Sub-category description.
String type.

Example
Query and list all alarm categories.

Request
GET http://imc_host:8080/imcrs/fault/alarmCategory
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Levels


Query and list the alarm levels.
The results include all alarm levels and their descriptions.

Interface URI
/fault/alarmLevel

Access Method
HTTP
GET

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
id

Alarm level ID, which uniquely identifies an alarm level.


Integer type.

desc

Alarm level description.


String type.

Query Alarm Levels 299

Example
Query and list all alarm levels.

Request
GET http://imc_host:8080/imcrs/fault/alarmLevel
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-Type: application/xml
...
<list>
<alarmLevel>
<id>1</id>
<desc>Critical</desc>
</alarmLevel>
...
</list>

300 Network Alarm Management

Query Alarm Source Types


Query and list the alarm source types.
The results include all alarm source types and their descriptions. Interface URI

Interface URI
/fault/alarmOriginalType

Access Method
HTTP
GET

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
id

Alarm source ID, which uniquely identifies an alarm source type.


Integer type.

desc

Description of the alarm source type.


String type.

Query Alarm Source Types 301

Example
Query and list all alarm source types.

Request
GET http://imc_host:8080/imcrs/fault/alarmOriginalType
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-Type: application/xml
...
<list>
<alarmOriginalType>
<id>1</id>
<desc>Trap</desc>
</alarmOriginalType>
...
</list>

302 Network Alarm Management

Query Alarm Recovery Status


Query and list alarm recovery status.
The results include the recovery status of all alarms and their descriptions.

Interface URI
/fault/alarmRecStatus

Access Method
HTTP
GET

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
id

Alarm recovery status ID, which uniquely identifies an alarm recovery state.
Integer type.

desc

Alarm recovery status description.


String type.

Query Alarm Recovery Status 303

Example
Query and list all alarm recover status.

Request
GET http://imc_host:8080/imcrs/fault/alarmRecStatus
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-Type: application/xml
...
<list>
<alarmRecStatus>
<id>1</id>
<desc>Recovered</desc>
</alarmRecStatus>
...
</list>

304 Network Alarm Management

Query Alarm Acknowledgement Status


Query and list alarm acknowledgement status.
The results include the acknowledgement status of all alarms and their descriptions.

Interface URI
/fault/alarmAckStatus

Access Method
HTTP
GET

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
id

Alarm acknowledgement status ID, which uniquely identifies an alarm acknowledge state.
Integer type.

desc

Alarm acknowledgement status description.


String type.

Query Alarm Acknowledgement Status 305

Query Alarm Time Ranges


Query and list alarm time ranges.
The results include all alarm time ranges and their descriptions.

Interface URI
/fault/alarmTimeRange

Access Method
HTTP
GET

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
id

Alarm time range ID, which uniquely identifies an alarm time range.
Integer type.

desc

Alarm time range description.


String type.

306 Network Alarm Management

Example
Query and list all alarm time ranges.

Request
GET http://imc_host:8080/imcrs/fault/alarmTimeRange
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-Type: application/xml
...
<list>
<alarmTimeRange>
<id>0</id>
<desc>Last 1 hour</desc>
</alarmTimeRange>
...
</list>

Query Alarm Time Ranges 307

Recover Alarm
Recover an alarm with the specified ID.

Interface URI
/fault/alarm/recover/{id}

Access Method
HTTP
PUT

Parameters
Path parameters
id

Alarm ID.
Long integer type. Required. No default value.

Returned Result
Status codes

204 (No Content): Success.

Example
Recover the alarm with ID 3665.

Request
PUT http://imc_host:8080/imcrs/fault/alarm/recover/3665
accept: application/xml
...

Response
HTTP/1.1 204 No Content
...
The message body is empty.

308 Network Alarm Management

Acknowledge Alarm
Acknowledge an alarm with the specified ID.

Interface URI
/fault/alarm/acknowledge/{id}

Access Method
HTTP
PUT

Parameters
Path parameters
id

Alarm ID.
Long integer type. Required. No default value.

Returned Result
Status codes

204 (No Content): Success.

Example
Acknowledge the alarm with ID 3665.

Request
PUT http://imc_host:8080/imcrs/fault/alarm/acknowledge/3665
accept: application/xml
...

Response
HTTP/1.1 204 No Content
...
The message body is empty.

Acknowledge Alarm 309

Delete Alarm
Delete an alarm with the specified ID.

Interface URI
/fault/alarm/delete/{id}

Access Method
HTTP
DELETE

Parameters
Path parameters
id

Alarm ID.
Long integer type. Required. No default value.

Returned Result
Status codes

204 (No Content): Success.

Example
Delete the alarm with ID 3665.

Request
DELETE http://imc_host:8080/imcrs/fault/alarm/delete/3665
accept: application/xml
...

Response
HTTP/1.1 204 No Content
...
The message body is empty.

310

Network Alarm Management

Register Send-Alarm-to-Server Event


Register the send-alarm-to-server event and filter alarms to be sent with certain criteria.

Interface URI
/events

Access Method
HTTP
GET

Parameters
Query parameters
type

Event type.
Integer type. The value is 11, indicating the send-alarm-to-server event.

uuid

UUID.
String type. Uniquely identifies a client.

alarmLevel

Alarm level.
Integer 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.

customView

Custom view ID.


Long integer type. Optional. No default value.

deviceIp

Device IP address.
String type, supporting multiple elements. Optional. No default value.

ipSegment

IP segment.
String type, supporting multiple elements. Optional. No default value. The IP range is expressed with
a hyphen (-). For example, 192.168.0.1-192.168.0.254.

eventOid

Alarm event OID.


String type, supporting multiple elements. Optional. No default value.

Returned Result
Status codes

202 (Accepted): Successfully registered.

Message header
HTTP/1.1 202 Accepted
Content-Type: application/xml

Register Send-Alarm-to-Server Event

311

Example
Reregister 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=11
accept: application/xml
...

Response
HTTP/1.1 202 Accepted
Content-Type: application/xml
...

312

Network Alarm Management

9 Network Syslog Management


This set of eAPI commands enables you to query system log and unmanaged device filtering
information. 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 Information


Query syslog information with the specified ID.

Interface URI
/syslog/log/{id}

Access Method
HTTP
GET

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
id

Syslog source type ID, which uniquely identifies a syslog source type.
Integer type.

recvTime

Time when the syslog was received.


String type.

deviceId

Device ID.
Long integer type.

deviceName

Device name.
String type.

deviceIp

IP address.
String type.

sysName

System Name
String type.

module

Module name.
String type.

severity

Severity level.
Integer type.

314

Network Syslog Management

log sub-elements
digest

Log digest.
String type.

repeats

Repeat time.
Integer type.

content

Log content.
String type.

Example
Query the detailed information about the syslog with ID 1.

Request
GET http://imc_host:8080/imcrs/fault/syslog/log/1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 List


Query the syslog information list.

Interface URI
/syslog/log/

Access Method
HTTP
GET

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
id

Syslog source type ID, which uniquely identifies a syslog source type.
Integer type.

recvTime

Time when the syslog was received.


String type.

deviceId

Device ID.
Long integer type.

deviceName

Device name.
String type.

deviceIp

IP address.
String type.

sysName

System name.
String type.

module

Module name.
String type.

316

Network Syslog Management

log sub-elements
severity

Severity level.
Integer type.

digest

Log digest.
String type.

repeats

Repeat time.
Integer type.

content

Log content.
String type.

Example
Query 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 OK
Content-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 Status


Query the status of the filtering rule for unmanaged devices. The status can be Enabled or Disabled.

Interface URI
/syslog/filter/currentUnmanagedDeviceRuleState/

Access Method
HTTP
GET

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

Status of the filtering rule for unmanaged devices.


Integer type.

desc

Description of the status of the filtering rule for unmanaged devices.


String type.

318

Network Syslog Management

Example
Query 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 OK
Content-Type: application/xml
...
<unmanagedDeviceRuleStatus>
<status>0</status>
<desc>Disabled</desc>
</unmanagedDeviceRuleStatus>

Query Unmanaged Device Filtering Rule Status

319

Query Unmanaged Device Filtering Rule Status List


Query the unmanaged device filtering rule status list.

Interface URI
/syslog/filter/unmanagedDeviceRuleStates/

Access Method
HTTP
GET

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

Status of the filtering rule for unmanaged devices.


Integer type.

desc

Description of the status of the filtering rule for unmanaged devices.


String type.

320 Network Syslog Management

Example
Query 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 OK
Content-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 Status


Modify 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
HTTP
PUT

Parameters
Path parameters
id

Status ID.
Integer type. No default value. Valid values include 0 and 1.

Returned Result
Status codes

204 (No Content): Success.

Example
Change the status of the filtering rule for unmanaged devices to 1, which indicates the Enabled
state.

Request
PUT http://imc_host:8080/imcrs/syslog/filter/currentUnmanagedDeviceRuleState/1
accept: application/xml
...

Response
HTTP/1.1 204 No Content
...
The message body is empty.

322 Network Syslog Management

10 Network Performance Management


Network performance management commands enable you to query on network, server, and device
performance data and to maintain performance indexes. This category includes the following
commands:

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 Summaries
Query and list summaries.

Interface URI
/perf/summary

Access Method
HTTP
GET

Parameters
None

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
sumId

Summary ID.
Integer type.

sumName

Summary name.
String type.

groupList

URI of the index group list.


String type.

324 Network Performance Management

Example
Query and list all summaries.

Request
GET http://imc_host:8080/imcrs/perf/summary
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Groups


Query and list the performance index groups.

Interface URI
/perf/group

Access Method
HTTP
GET

Parameters
None

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
sumId

Summary ID.
Integer type.

groupId

Index group ID.


Integer type.

groupName

Index group name.


String type.

interfaceFlag

Interface flag.
Integer type.

summary

URI of the summary.

326 Network Performance Management

group sub-elements
String type
perfTask

URI of the index group list.


String type.

Example
Query and list all performance index groups.

Request
GET http://imc_host:8080/imcrs/perf/group
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Indexes


Query performance indexes with certain criteria.

Interface URI
/perf/task

Access Method
HTTP
GET

Parameters
Query parameters
name

Type name.
String type, supporting wildcard characters. Optional. No default value.

orderBy

The sequencing field of the returned result set.


String type. Optional. The default value is taskId. The valid value is taskId.

desc

Whether or not the result is sequenced in reverse order.


Boolean type. Optional. The default value is false. The parameter is valid only when the orderBy
parameter 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
taskId

Index ID.
Integer type.

taskName

Index name.
String type.

taskDescr

Index description.
String type.

tempId

Template ID.
String type.

alarmOneThresholdFirst

Threshold 1 of alarm 1.
Double-precision floating-point type.

alarmOneThresholdSecond Threshold 2 of alarm 1. The value is not equal to 0 when a range is specified, and is equal
to 0 in other cases.
Double-precision floating-point type.
alarmTwoTimes

Repeat time of alarm 2, which is counted when the alarm continuously falls in the alarm
range.
Integer type.

componentID

Component ID.
Integer type.

unitId

Unit ID. If there is no unit, the value is 0.


Integer type.

sumId

Summary ID.
Integer type.

groupId

Index group ID.


Integer type.

perfTemplate

Template URI.
String type.

tempUnitDependList

URI of the unit set.


String type.

tempUnit

Unit URI.
String type.

Example
1. Query all performance tasks.

Request
GET http://imc_host:8080/imcrs/perf/task
accept: application/xml
...

Query Performance Indexes 329

Response
HTTP/1.1 200 OK
Content-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/1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Instances


Query and list the instances for the specified index on the specified device.

Interface URI
/perf/monitor

Access Method
HTTP
GET

Parameters
Query parameters
devId

Device ID. Long integer type. Required. No default value. For the valid values, see Query Device
Information.

taskId

Index ID. Long integer type. Required. No default value. For the valid values, see Query Performance
Indexes.

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
deviceName

Device name.
String type.

taskId

Item ID
Integer type.

instanceId

Instance ID.

Query Single-Device Single-Index Instances

331

VLAN sub-elements
String type.
instanceName

Instance name.
String type.

ipAddress

IP address.
String type.

Example
Query the performance summary data with the original data for index ID 1 on the device whose
ID is 25.

Request
GET http://imc_host:port/imcrs/perf/monitor/25,1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Data


Query single-index multi-device performance summary data with certain criteria.

Interface URI
/perf/summaryData

Access Method
HTTP
GET

Parameters
Query parameters
taskId

Index ID.
Integer type. Required. No default value. For the valid values, see Query Performance Indexes.

devId

Device ID.
Long integer type. Required. No default value. For the valid values, see Query Device Information.

beginTime

Start time.
Long integer type. Optional. The value is the seconds counted from 00:00 on January 1, 1970 to
the specified time. An empty value indicates that the latest data is queried.

endTime

End time.
Long integer type. Optional. The value is the seconds counted from 00:00 on January 1, 1970 to
the specified time.

dataGranularity Data granularity.


Integer 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-Interface
Performance Summary Data (page 336).

Example
Query the performance summary data with the original data for index ID 1 on the device whose
ID is 25.

Request
GET http://imc_host:port/imcrs/perf/summaryData?taskId=1&devId=25&dataGranularity=1
accept: 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 Data


Query single-index single-interface performance summary data with certain criteria.

Interface URI
/perf/summaryData/interface

Access Method
HTTP
GET

Parameters
Query parameters
taskId

Index ID. Integer type. Required. No default value. For the valid values, see Query Performance
Indexes.

devId

Device ID. Integer type. Required. No default value. For the valid values, see Query Device
Information.

beginTime

Start time. Long integer type. Optional. The value is the seconds counted from 00:00 on January 1,
1970 to the specified time.

endTime

End time. Long integer type. Optional. The value is the seconds counted from 00:00 on January 1,
1970 to the specified time.

objIndex

Instance index. Integer type. Required. No default value.

dataGranularity Data granularity. Integer type. Optional. No default value. 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
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
taskId

Index ID, which uniquely identifies an index.


Integer type.

taskName

Index name.
String type.

devId

Device ID.
Long integer type.

devName

Device name.
String type.

instId

Instance ID.
Integer type

objIndex

Object index.
String type.

objIndexDesc

Object index description (or instance name).


String type.

taskNameWithUnit

Task name including the unit.


String type

devIP

Device IP address.
String type.

devDisplayName

Device name. String type.

averageValue

Average value of the detailed data set.


Double-precision floating-point type.

maximumValue

Maximum value of the detailed data set.


Double-precision floating-point type.

minimumValue

Minimum value of the detailed data set.


Double-precision floating-point type.

currentValue

Current value of the detailed data set.


Double-precision floating-point type.

summaryValue

Summary value of the detailed data set.


Double-precision floating-point type.

Query Single-Index Single-Interface Performance Summary Data 337

Example
Query the performance detailed data, the parameters are as follows: the index ID is 1, the device
ID 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=2
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Details


Query single-instance performance details with certain criteria.

Interface URI
/perf/summaryData/detail

Access Method
HTTP
GET

Parameters
Query parameters
taskId

Index ID. Integer type. Required. No default value. For the valid values, see Query Performance
Indexes.

devId

Device ID. Integer type. Required. No default value. For the valid values, see Query Devices.

beginTime

Start time. Long integer type. Optional. The value is the seconds counted from 00:00 on January 1,
1970 to the specified time.

endTime

End time. Long integer type. Optional. The value is the seconds counted from 00:00 on January 1,
1970 to the specified time.

instId

Instance ID. Integer type. Required. No default value.

dataGranularity Data granularity. Integer type. Optional. No default value. 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
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
dataVal

Data value.
Double-precision floating-point type.

dataTime

Data time.
String type.

dataTimeStr

Data time displayed.


String type.

dataType

Data type.
Integer type.

minVal

Minimum value.
Double-precision floating-point type.

maxVal

Maximum value.
Double-precision floating-point type.

sumVal

Summarized value.
Double-precision floating-point type.

sumCount

Data summary count.


Integer type.

Example
Query performance details of the monitor instance with ID 1, which belongs to the index with ID
2 on the device whose ID is 2.

Request
GET http://imc_host:port/imcrs/perf/summaryData/detail?devId=2&taskId=2&instID=1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Data


Query single-index topN data with certain criteria.

Interface URI
/perf/topNData

Access Method
HTTP
GET

Parameters
Query parameters
taskId

Index ID.
Integer type. Required. No default value. For the valid values, see Query Performance Indexes.

beginTime

Start time.
Long integer type. Optional. The value is the seconds counted from 00:00 on January 1, 1970 to
the specified time.

endTime

End time.
Long integer type. Optional. The value is the seconds counted from 00:00 on January 1, 1970 to
the specified time.

topN

Number of entries.
Integer 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
taskId

Index ID, which uniquely identifies an index.


Integer type.

devId

Device ID.
Integer type.

instId

Instance ID.
Integer type.

objIndex

Object index.
String type.

objIndexDesc

Object index description(or instance name).


String type.

dataVal

Average data value.


Double-precision floating-point type.

thresholdQuadrant

Threshold range.
Integer type.

alarmLevel

Alarm level.
Integer type.

Example
Query and list the top 5 performance data for index with ID 1.

Request
GET http://imc_host:port/imcrs/perf/topNData?taskId=1&topN=5
accept: application/xml
...

342 Network Performance Management

Response
HTTP/1.1 200 OK
Content-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 Index


Add a custom performance index.

Interface URI
/perf/task

Access Method
HTTP
POST

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
itemName

Index name.
String type. Required. No default value.

unitType

Unit type.
Integer type. Optional. No default value.

selectDefaultUnit Pre-defined unit selected.


Integer type. Optional. No default value.
userAddUnit

User-defined unit.
String type. Optional. No default value.

unit

Index unit.
String type. Optional. No default value.

indexType

Index type.
String type. Required. No default value. Valid values can be successfully created.

indexDesc

OID of the index description.


String type. Required. No default value. Valid values can be successfully created.

itemFunction

Index formula.
String 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 header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://imc_host:port/imcrs/perf/task/1

Example
Add an index named test.

Request
POST http://imc_host:8080/imcrs/perf/task
accept: application/xml
Content-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 Created
Location: http://imc_host:port/imcrs/perf/task/1

Add Custom Performance Index 345

Delete Custom Performance Index


Delete a custom performance index with the specified ID.

Interface URI
/perf/task/delete/{taskId}

Access Method
HTTP
DELETE

Parameters
Path parameters
taskId

Index ID. Integer type. Required. No default value. For the valid values, see Query Performance
Indexes.

Returned Result
Status codes

204 (No Content): Success.

409 (Conflict): Failure. See Error Codes.

410 (Gone): No data is found with the specified ID.

Example
Delete the custom index with ID 234.

Request
DELETE http://imc_host:port/imcrs/perf/task/delete/800001
accept: application/xml
...

Response
HTTP/1.1 204 No Content
...
The message body is empty.

346 Network Performance Management

11 Report Management
The 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 Reports


Query periodic reports with certain criteria.

Interface URI
/report/task

Access Method
HTTP
GET

Parameters
Query parameters
TaskName

Periodic report name.


String type, supporting wildcard characters. Optional. No default value.

TemplateName

Report template name.


String type, supporting wildcard characters. Optional. No default value.

TaskType

Periodic report type.


Integer 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
id

Periodic report ID, which uniquely identifies a periodic report.


Long integer type.

name

Periodic report name.


String type.

nextExecuteTime Next execution time.


Date and time type.
templateId
348 Report Management

Template ID.

reportTask sub-elements
Long integer type.
templateName

Report template name.


String type.

files

URI of the report file list.


String type.

Example
Query and list all periodic reports.

Request
GET http:/imc_host:8080/imcrs//report/task
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Details


Query detailed information about a periodic report with the specified ID.

Interface URI
/report/task/detail/{id}

Access Method
HTTP
GET

Parameters
Path parameters
id

Periodic report ID.


Long 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
id

Periodic report ID, which uniquely identifies a periodic report.


Long integer type.

name

Periodic report name.


String type.

nextExecuteTime Next execution time.


Date and time type.
templateId

Template ID.
Long integer type.

templateName

Report template name.


String type.

350 Report Management

Example
Query information about the periodic report with ID 1.

Request
GET http://imc_host:8080/imcrs/report/task/detail/1
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Histories


Query the histories of a periodic report with the specified ID.

Interface URI
/report/task/file/{id}

Access Method
HTTP
GET

Parameters
Path parameters
id

Periodic report ID.


Long 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
taskId

Periodic report ID.


Long integer type.

fileName

History file name.


String type.

file

URI of the report file list.


String type.

352 Report Management

Example
Query 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=10
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Report


Get the history file of a periodic report with the specified file name and report ID.

Interface URI
/report/task/download

Access Method
HTTP
GET

Parameters
Query parameters
taskId

Periodic report ID.


Long integer type.

fileName

History file name.


String type.

Returned Result
Status codes

200 (OK): Success.

Message body
The browser displays the download file dialog box or directly opens the file.

Example
Get 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.pdf
accept: 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 Management


Network asset management commands enable you to query network assets with specified criteria
and to gain details on specific devices. Available commands in this category include:

Query Assets

Query Asset Details

355

Query Assets
Query network assets with certain criteria.

Interface URI
/netasset/asset

Access Method
HTTP
GET

Parameters
Query parameters
assetName

Asset name.
String type, supporting wildcard characters. Optional. No default value.

assetDesc

Asset description.
String type, supporting wildcard characters. Optional. No default value.

assetPhyClass

Asset type.
Long integer type. Optional. No default value. -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 stack device.

assetSerialNum

Asset serial number.


String type. Optional. No default value.

assetNum

Asset number.
String type. Optional. No default value.

assetIsFRU

Field replaceable or not.


Long integer type. Optional. No default value. 1 for field replaceable. 2 for not field replaceable.

assetPhysicalFlag

Physical asset or not.


Long integer type. Optional. No default value. 1 for no. 2 for yes.

assetVendorType

Asset OID.
String type. Optional. No default value.

assetDevice.name

Device name.
String type. Optional. No default value.

assetDevice.ip

Device IP address.
String 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&amp;phyIndex=1001</asset>
</netAsset>
</list>

Elements
netAsset sub-elements
devId

Device ID, which uniquely identifies a device.


Long integer type.

phyIndex

Asset physical index.


Long integer type.

deviceName

Device name.
String type.

deviceIp

Device IP address.
String type.

desc

Asset description.
String type.

vendorType

Asset OID.
String type.

containedIn

Physical index of the parent entity.


Long integer type.

phyClass

Asset type.

Query Assets 357

netAsset sub-elements
Long 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 stack device.
relPos

Position serial number of the asset in the parent entity.


Long integer type.

name

Asset name.
String type.

hardVersion

Hardware version.
String type.

firmwareVersion

Firmware version.
String type.

softVersion

Software version.
String type.

serialNum

Serial number.
String type.

mfgName

Manufacturer name.
String type.

model

Model.
String type.

alias

Alias.
String type.

isFRU

Field replaceable or not.


Integer type. 1 for field replaceable. 2 for not field replaceable.

cleiCode

cleiCode.
String type.

buildInfo

Build information.
String type.

bom

BOM number.
String type.

boardNum

Card number.
Integer type.

serverDate

Time in service.
Date/time type.

remark

Remark.
String type.

assetNumber

Asset number.
String type.

physicalFlag

Physical entity flag.


Long integer type. 0 or 1 for no. 2 or 3 for yes.

358 Network Asset Management

netAsset sub-elements
device

Link to device details .


String type.

asset

Link to device details .


String type.

Example
Query and list network assets.

Request
GET http://imc_host:8080/imcrs/netasset/asset
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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&amp;phyIndex=1001</asset>
</netAsset>
</list>

Query Assets 359

Query Asset Details


Query details about an asset with the specified device ID and asset physical index.

Interface URI
/netasset/asset/detail

Access Method
HTTP
GET

Parameters
Query parameters
devId

Device ID.
Long integer type. Required. No default value.

phyIndex

Asset physical index.


Long 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
devId

Device ID, which uniquely identifies a device.


Long integer type.

phyIndex

Asset physical index.


Long integer type.

deviceName

Device name.
String type.

deviceIp

Device IP address.
String type.

desc

Asset description.
String type.

vendorType

Asset OID.
String type.

containedIn

Physical index of the parent entity.


Long integer type.

phyClass

Asset type.
Long 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 stack
device.

relPos

Position serial number of the asset in the parent entity.


Long integer type.

name

Asset name.
String type.

hardVersion

Hardware version.
String type.

firmwareVersion Firmware version.


String type.
softVersion

Software version.
String type.

serialNum

Serial number.
String type.

mfgName

Manufacturer name.
String type.

model

Model.
String type.

alias

Alias.
String type.

isFRU

Field replaceable or not.


Integer type. 1 for field replaceable. 2 for not field replaceable.
Query Asset Details

361

netAsset sub-elements
cleiCode

cleiCode.
String type.

buildInfo

Build information.
String type.

bom

BOM number.
String type.

boardNum

Card number.
Integer type.

serverDate

Time in service.
Date/time type.

remark

Remark.
String type.

assetNumber

Asset number.
String type.

physicalFlag

Physical entity flag.


Long integer type. 0 or 1 for no. 2 or 3 for yes.

device

Link to device details .


String type.

362 Network Asset Management

Example
Query 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=1001
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Management


Network service management commands enable you to query on and manage VLANs, ports, and
interfaces. 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 VLANs
Query and list VLAN information on the device with certain criteria.

Interface URI
/vlan

Access Method
HTTP
GET

Parameters
Query parameters
devId

Device type ID.


Integer type. Required. No default value.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value is uploaded, the default value is
used.

size

The total number of returned records.


Integer 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.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Total attribute of the message header
returns the number of records that meet the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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
vlanId

VLAN ID, which uniquely identifies a VLAN.


Integer type.

vlanName

VLAN name.
String type.

vlanStatus

VLAN status. 1 for static. 2 for dynamic.


Integer type.

366 Network Service Management

Example
Query 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=10
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Ports


Query and list information about VLAN ports on the device with certain criteria.

Interface URI
/vlan/{vlanId}

Access Method
HTTP
GET

Parameters
Query parameters
vlanId

VLAN ID.
Integer type. Required. No default value.

devId

Device type ID.


Integer type. Required. No default value.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value is uploaded, the default value is
used.

size

The total number of returned records.


Integer 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.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Total attribute of the message header
returns the number of records that meet the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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
ifIndex

Port index, which uniquely identifies a port.


Integer type.

Query VLAN Ports 369

Example
Query and list the 11th to the 20th VLAN port entries for the VLAN with ID 1 on the device whose
ID is 8.

Request
GET http://localhost:8080/imcrs/vlan/1?devId=8&start=10&size=10
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 VLAN
Add a VLAN on the device.

Interface URI
/vlan

Access Method
HTTP
POST

Message body
<vlan>
<vlanId>1111</vlanId>
<vlanName>VLAN 1111</vlanName>
</vlan>

Parameters
VLAN sub-elements
devId

Device type ID.


Integer type. Required. No default value.

vlanId

VLAN ID.
Integer type. Required. No default value.

vlanName

VLAN name.
String type. Required. No default value.

Returned Result
Status codes

201 (Created): Success.

409 (Conflict): Failure. See Error Codes.

Message header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/vlan?devId=13

Add VLAN

371

Example
Add 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=13
accept: application/xml
...
<vlan>
<vlanId>1111</vlanId>
<vlanName>VLAN 1111</vlanName>
</vlan>

Response
HTTP/1.1 201 Created
Location: http://localhost:8080/imcrs/vlan?devId=13

372 Network Service Management

Delete VLAN
Delete a VLAN from the device.

Interface URI
/vlan

Access Method
HTTP
DELETE

Message body
DELETE http://imc_host:8080/imcrs/vlan?devId=33&vlanId=1111
accept: application/xml
...

Parameters
VLAN sub-elements
devId

Device type ID.


Integer type. Required. No default value.

vlanId

VLAN ID.
Integer type. Required. No default value.

Returned Result
Status codes

204 (No Content): Success.

409 (Conflict): Failure. See Error Codes.

Example
Delete the VLAN with ID 1111 from the device whose ID is 33.

Request
DELETE http://imc_host:8080/imcrs/vlan?devId=33&vlanId=1111
accept: application/xml
...

Response
None.

Delete VLAN 373

Change VLAN Name


Change the name of a VLAN.

Interface URI
/vlan

Access Method
HTTP
PUT

Message body
<vlan>
<vlanId>1111</vlanId>
<vlanName>VLAN 1111</vlanName>
</vlan>

Parameters
Query parameters
devId

Device type ID.


Integer type. Required. No default value.

vlanId

VLAN ID
Integer type. Required. No default value.

vlanName

VLAN name.
String type. Required. No default value.

Returned Result
Status codes

204 (No Content): Success.

409 (Conflict): Failure. See Error Codes.

Example
Change 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=13
accept: 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 VLAN


Add a port to a VLAN.

Interface URI
/vlan/{vlanId}

Access Method
HTTP
POST

Message body
POST http://imc_host:8080/imcrs/vlan/777?devId=33&ifIndex=1538
accept: application/xml
...

Parameters
VLAN port sub-elements
devId

Device type ID.


Integer type. Required. No default value.

vlanId

VLAN ID
Integer type. Required. No default value.

vlanName

VLAN name.
String 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 is
located. The message body is empty.
HTTP/1.1 201 Created
http://localhost:8080/imcrs/vlan/777?devId=33

Add Port to VLAN 375

Example
Add 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=1538
accept: application/xml
...

Response
HTTP/1.1 201 Created
http://localhost:8080/imcrs/vlan/777?devId=33

376 Network Service Management

Remove Port from VLAN


Remove a port from a VLAN.

Interface URI
/vlan/{vlanId}

Access Method
HTTP
DELETE

Message body
DELETE http://imc_host:8080/imcrs/vlan/777?devId=33&ifIndex=1538
accept: application/xml
...

Parameters
VLAN port sub-elements
devId

Device type ID.


Integer type. Required. No default value.

vlanId

VLAN ID
Integer type. Required. No default value.

vlanName

VLAN name.
String type. Required. No default value.

Returned Result
Status codes

204 (No Content): Success.

409 (Conflict): Failure. See Error Codes.

Example
Remove 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=1538
accept: application/xml
...

Response
None.

Remove Port from VLAN 377

Query Access Ports


Query and list access ports on the device with certain criteria.

Interface URI
/vlan/access

Access Method
HTTP
GET

Parameters
Query parameters
devId

Device type ID.


Integer type. Required. No default value.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value is uploaded, the default value is
used.

size

The total number of returned records.


Integer 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.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Total attribute of the message header
returns the number of records that meet the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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
ifIndex

Port index, which uniquely identifies a port.


Integer type.

pvid

PVID of the port.


Integer type.

Example
Query 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=5
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Port


Change the PVID of an access port.

Interface URI
/vlan/access

Access Method
HTTP
PUT

Message body
PUT http://imc_host:8080/imcrs/vlan/access?devId=33&destVlanId=4&ifIndex=1794
accept: application/xml
...

Parameters
Access port sub-elements
devId

Device type ID.


Integer type. Required. No default value.

destVlanId

Target VLAN ID.


Integer type. Required. No default value.

ifIndex

Port index, which uniquely identifies a port.


Integer type. Required. No default value.

Returned Result
Status codes

204 (No Content): Success.

409 (Conflict): Failure. See Error Codes.

Example
Change 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=1794
accept: application/xml
...

Response
None.

380 Network Service Management

Query Hybrid Ports


Query and list hybrid ports on the device with certain criteria.

Interface URI
/vlan/hybrid

Access Method
HTTP
GET

Parameters
Query parameters
devId

Device type ID.


Integer type. Required. No default value.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value is uploaded, the default value is
used.

size

The total number of returned records.


Integer 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.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Total attribute of the message header
returns the number of records that meet the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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
ifIndex

Port index, which uniquely identifies a port.


Integer type.

pvid

PVID of the port.


Integer type.

taggedVlans

Tagged VLANs.
String type.

untaggedVlans

Untagged VLANs.
String type.

forbiddenVlans

Forbidden VLANs.
String type.

382 Network Service Management

Example
Query 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=5
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Port


Add a hybrid port on the device.

Interface URI
/vlan/hybrid

Access Method
HTTP
POST

Message body
POST http://imc_host:8080/imcrs/vlan/hybrid?devId=33
accept: application/xml
...
<hybridIf forbidenVlanFlag="false" forbiddenVlans="" ifIndex="2423" pvid="1" taggedVlans="4,5" untagVlanFlag="true"
untaggedVlans="3,7"/>

Parameters
Hybrid port sub-elements
devId

Device type ID.


Integer type. Required. No default value.

ifIndex

Port index, which uniquely identifies a port.


Integer type. Required. No default value.

pvid

PVID of the hybrid port.


Integer type. Required. No default value.

tagVlan

Tagged VLAN.
String type. Optional. The tagVlan and untagVlan parameters cannot be empty at the same time.

untagVlanFlag

Untagged VLAN flag.


Boolean type. Required.

untagVlan

Untagged VLAN.
String type. Optional. The tagVlan and untagVlan parameters cannot be empty at the same time.

forbidenVlanFlag

Forbidden VLAN flag.


Boolean type. Required.

forbiddenVlans

Forbidden VLAN.
String 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 header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://imc_host:port/imcrs/vlan/hybrid?devId=33

Example
Add 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=33
accept: application/xml
...
<hybridIf forbidenVlanFlag="false" forbiddenVlans="" ifIndex="2423" pvid="1" taggedVlans="4,5" untagVlanFlag="true"
untaggedVlans="3,7"/>

Response
HTTP/1.1 201 Created
Location: http://imc_host:port/imcrs/vlan/hybrid?devId=33

Add Hybrid Port 385

Delete Hybrid Port


Delete a hybrid port from the device.

Interface URI
/vlan/hybrid

Access Method
HTTP
DELETE

Message body
DELETE http://imc_host:8080/imcrs/vlan/hybrid?devId=33&ifIndex=2434
accept: application/xml
...

Parameters
Hybrid port sub-elements
devId

Device type ID.


Integer type. Required. No default value.

ifIndex

Port index, which uniquely identifies a port.


Integer type. Required. No default value.

Returned Result
Status codes

204 (No Content): Success.

409 (Conflict): Failure. See Error Codes.

Example
Delete 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=2434
accept: application/xml
...

Response
None

386 Network Service Management

Modify Hybrid Port


Modify the parameters of a hybrid port on the device.

Interface URI
/vlan/hybrid

Access Method
HTTP
PUT

Message body
PUT http://imc_host:8080/imcrs/vlan/hybrid?devId=33
accept: application/xml
...
<hybridIf forbidenVlanFlag="false" forbiddenVlans="" ifIndex="2423" pvid="1" taggedVlans="4,5" untagVlanFlag="true"
untaggedVlans="3,7"/>

Elements
Hybrid port sub-elements
devId

Device type ID.


Integer type. Required. No default value.

ifIndex

Port index, which uniquely identifies a port.


Integer type. Required. No default value.

pvid

PVID of the hybrid port.


Integer type. Required. No default value.

tagVlan

Tagged VLAN.
String type. Optional. The tagVlan and untagVlan parameters cannot be empty at the same time.

untagVlanFlag

Untagged VLAN flag.


Boolean type. Required.

untagVlan

Untagged VLAN.
String type. Optional. The tagVlan and untagVlan parameters cannot be empty at the same time.

forbidenVlanFlag

Forbidden VLAN flag.


Boolean type. Required.

forbiddenVlans

Forbidden VLAN.
String 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

Example
Modify 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=33
accept: application/xml
...
<hybridIf forbidenVlanFlag="false" forbiddenVlans="" ifIndex="2423" pvid="1" taggedVlans="4,5" untagVlanFlag="true"
untaggedVlans="3,7"/>

Response
None

388 Network Service Management

Query Trunk Ports


Query and list trunk ports on the device with certain criteria.

Interface URI
/vlan/trunk

Access Method
HTTP
GET

Parameters
Query parameters
devId

Device type ID.


Integer type. Required. No default value.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value is uploaded, the default value is
used.

size

The total number of returned records.


Integer 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.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false.When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Total attribute of the message header
returns the number of records that meet the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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
ifIndex

Port index, which uniquely identifies a port.


Integer type.

pvid

PVID of the port.


Integer type.

allowedVlans

Allowed VLANs.
String type.

390 Network Service Management

Example
Query 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=5
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Port


Add a trunk port on the device.

Interface URI
/vlan/trunk

Access Method
HTTP
POST

Message body
POST http://imc_host:8080/imcrs/vlan/trunk?devId=33
accept: application/xml
...
<trunkIf allowedVlans="4,7" ifIndex="2423" pvid="1"/>

Parameters
Trunk port sub-elements
devId

Device type ID.


Integer type. Required. No default value.

ifIndex

Port index, which uniquely identifies a port.


Integer type. Required. No default value.

pvid

PVID of the trunk port.


Integer type. Required. No default value.

allowedVlans

Allowed VLAN.
String type. Optional. No default value.

Returned Result
Status codes

201 (Created): Success.

409 (Conflict): Failure. See Error Codes.

Message header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://imc_host:port/imcrs/vlan/trunk?devId=33

392 Network Service Management

Example
Add 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=33
accept: application/xml
...
<trunkIf allowedVlans="4,7" ifIndex="2423" pvid="1"/>

Response
HTTP/1.1 201 Created
Location: http://imc_host:port/imcrs/vlan/trunk?devId=33

Add Trunk Port 393

Delete Trunk Port


Delete a trunk port from the device.

Interface URI
/vlan/trunk

Access Method
HTTP
DELETE

Message body
DELETE http://imc_host:8080/imcrs/vlan/trunk?devId=33&ifIndex=2434
accept: application/xml
...

Parameters
Trunk port sub-elements
devId

Device type ID.


Integer type. Required. No default value.

ifIndex

Port index, which uniquely identifies a port.


Integer type. Required. No default value.

Returned Result
Status codes

204 (No Content): Success.

409 (Conflict): Failure. See Error Codes.

Example
Delete 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=2434
accept: application/xml
...

Response
None

394 Network Service Management

Modify Trunk Port


Modify the parameters of a trunk port on the device.

Interface URI
/vlan/trunk

Access Method
HTTP
PUT

Message body
PUT http://imc_host:8080/imcrs/vlan/trunk?devId=33
accept: application/xml
...
<trunkIf allowedVlans="3,7" ifIndex="2423" pvid="1"/>

Elements
Trunk port sub-elements
devId

Device type ID.


Integer type. Required. No default value.

ifIndex

Port index, which uniquely identifies a port.


Integer type. Required. No default value.

pvid

PVID of the trunk port.


Integer type. Required. No default value.

allowedVlans

Allowed VLAN.
String type. Optional. No default value.

Returned Result
Status codes

204 (No Content): Success.

409 (Conflict): Failure. See Error Codes.

Example
Modify 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=33
accept: application/xml
...
<trunkIf allowedVlans="3,7" ifIndex="2423" pvid="1"/>

Response
None
Modify Trunk Port 395

Query VLAN Interfaces


Query and list VLAN interfaces on the device with certain criteria.

Interface URI
/vlan/vlanif

Access Method
HTTP
GET

Parameters
Query parameters
devId

Device type ID.


Integer type. Required. No default value.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value is uploaded, the default value is
used.

size

The total number of returned records.


Integer 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.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Total attribute of the message header
returns the number of records that meet the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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
vlanId

VLAN ID, which uniquely identifies a VLAN.


Integer type.

isPrimary

Primary IP address or not.


Boolean type.

enableDHCP

Whether or not the IP address is assigned through DHCP. If the value takes true, then the ipAddress
and ipMask parameters are empty.
Boolean type.

ipAddress

IP address.
String type.

ipMask

Network mask of an IP address.


String type.

Query VLAN Interfaces 397

Example
Query 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=5
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Interface


Query and list information about VLAN interfaces for a VLAN on the device with certain criteria.

Interface URI
/vlan/vlanif/{vlanId}

Access Method
HTTP
GET

Parameters
Query parameters
vlanId

VLAN ID.
Integer type. Required. No default value.

devId

Device type ID.


Integer type. Required. No default value.

start

The position where the first returned record is located in the whole returned result.
Integer type. Optional. The default value is 0. If a negative value is uploaded, the default value is
used.

size

The total number of returned records.


Integer 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.

total

Only the number of records that meet the requirements is returned.


Boolean type. Optional. The default value is false. When the value is true, the start and size attributes
are invalid, the returned message body is empty, and the Total attribute of the message header
returns the number of records that meet the requirements.

Returned Result
Status codes

200 (OK): Success.

Message header
When the total parameter takes true, the Total attribute returns the total number of records that
meet the requirements. The message body is empty.
HTTP/1.1 200 OK
Total: 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
vlanId

VLAN ID, which uniquely identifies a VLAN.


Integer type.

isPrimary

Primary IP address or not.


Boolean type.

enableDHCP

Whether or not the IP address is assigned through DHCP. If the value takes true, then the ipAddress
and ipMask parameters are empty.
Boolean type.

ipAddress

IP address.
String type.

ipMask

Network mask of an IP address.


String type.

Example
Query 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=5
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Interface


Add a VLAN interface on the device.

Interface URI
/vlan/vlanif

Access Method
HTTP
POST

Message body
POST http://imc_host:8080/imcrs/vlan/vlanif?devId=3
accept: application/xml
...
<vlanIf enableDHCP="false" ipAddress="1.1.1.1" ipMask="255.0.0.0" isPrimary="true" vlanId="600"/>

Parameters
VLAN interface sub-elements
vlanId

VLAN ID, which uniquely identifies a VLAN.


Integer type. Required. No default value.

isPrimary

Primary IP address or not.


Boolean type. Optional. The default value is true.

enableDHCP

Whether or not the IP address is assigned through DHCP. If the value takes true, then the ipAddress
and ipMask parameters are empty.
Boolean type. Optional. The default value is false.

ipAddress

IP address.
String type. Optional. If the enableDHCP parameter is false then neither ipAddress or ipMask can
be empty.

ipMask

Network mask of an IP address.


String type. Optional. If the enableDHCP parameter is false, then neither ipAddress nor ipMask can
be empty.

Returned Result
Status codes

201 (Created): Success.

409 (Conflict): Failure. See Error Codes.

Message header
If the operation succeeds, the Location field gives the URI of the new resource. The message body
is empty.
HTTP/1.1 201 Created
Location: http://imc_host:port/imcrs/vlan/vlanif?devId=3

Add VLAN Interface 401

Example
Add 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=3
accept: application/xml
...
<vlanIf enableDHCP="false" ipAddress="1.1.1.1" ipMask="255.0.0.0" isPrimary="true" vlanId="600"/>

Response
HTTP/1.1 201 Created
Location: http://imc_host:port/imcrs/vlan/vlanif?devId=3

402 Network Service Management

Delete VLAN Interface


Delete a VLAN interface from the device.

Interface URI
/vlan/vlanif

Access Method
HTTP
DELETE

Message body
DELETE http://imc_host:8080/imcrs/vlan/vlanif?devId=3&vlanId=600&ipAddress=1.1.1.1&ipMask=255.0.0.0
accept: application/xml
...

Parameters
VLAN interface sub-elements
vlanId

VLAN ID, which uniquely identifies a VLAN. Integer type. Required. No default value.

isPrimary

Primary IP address or not. Boolean type. Optional. The default value is true.

enableDHCP

Whether or not the IP address is assigned through DHCP. If the value takes true, then the ipAddress
and ipMask parameters are empty. Boolean type. Optional. The default value is false.

ipAddress

IP address. String type. Optional. If the enableDHCP parameter is false then neither ipAddress or
ipMask can be empty.

ipMask

Network mask of an IP address. String type. Optional. If the enableDHCP parameter is false, then
neither ipAddress nor ipMask can be empty.

Returned Result
Status codes

204 (No Content): Success.

409 (Conflict): Failure. See Error Codes.

Example
Delete 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.0
accept: application/xml
...

Response
None

Delete VLAN Interface 403

14 ACL Management
The ACL Management category of commands enables you to query on and manage ACL devices
and 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 Configuration


Query the device list of the specified ACL configuration according to certain conditions.

Interface URI
/acl/res/aclDevice

Access Method
HTTP
GET

Parameters
Query parameters
deviceName

Device name.
String type. Optional. No default value.

deviceIp

Device IP address.
String type. Optional. No default value.

start

The position of the first returned record in the query result set.
Integer type. Optional. The default value is 0. If a value smaller than 0 is input, the default value 0
is used.

size

Total number of returned records.


Integer type. Optional. The default value is 10. If a value smaller than 0 is input, the default value
10 is used.

total

Specify that only the number of matched records is returned.


Boolean type. Optional. The default value is false. When this field is set to true, the start and size
fields are ineffective, the message body returned is empty, and the Total field in the message header
returns the number of matched records.

Returned Result
Status codes

200(OK): Success.

Message header
When 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 OK
Total: 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
deviceId

Device ID, which uniquely identifies a device.


Long integer type.

deviceName

Device name.
String type.

deviceIp

Device IP address.
String type.

deviceModel

Device type.
String type.

pollInterval

Polling interval (in hours), which ranges from 0 to 168 and can be -1. The value of -1 indicates
that polling is disabled.
Long integer type.

lastPoll

Last polling time.


String type.

pollResult

Last polling result: 0 for failure, 1 for success, and 2 for polling.
Integer type.

acl

ACL Definition URI.


String type.

aclResUse

ACL Application URI.


String type.

aclResTimerange

ACL Time Range URI.


String type.

406 ACL Management

Example
Query 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=4
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Device


Synchronize ACL configuration information for a device specified by its ID.

Interface URI
/acl/res/aclDevice/{id}/synchronize

Access Method
HTTP
PUT

Parameters
Path parameters
id

Device ID.
Long 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.

Example
Synchronize ACL configuration information for a device whose device ID is 68.

Request
PUT http://imc_host:8080/imcrs/acl/res/aclDevice/68/synchronize
accept: application/xml
...

Response
HTTP/1.1 204 No Content
Content-Type: application/xml
...
No message body is included.

408 ACL Management

Query the ACL Definitions of a Device


Query the ACL definitions of a device according to the specified device ID.

Interface URI
/acl/res/acl/{deviceId}

Access Method
HTTP
GET

Parameters
Path parameters
deviceId

Device ID.
Long integer type. Required. No default value.

Query parameters
start

The position of the first returned record in the query result set.
Integer type. Optional. The default value is 0. If a value smaller than 0 is input, the default value 0
is used.

size

Total number of returned records.


Integer type. Optional. The default value is 10. If a value smaller than 0 is input, the default value
10 is used.

total

Specify that only the number of matched records is returned.


Boolean type. Optional. The default value is false. When this field is set to true, the start and size
fields are ineffective, the message body returned is empty, and the Total field in the message header
returns the number of matched records.

Returned Result
Status codes

200(OK): Success.

Message header
When the total parameter is true, the Total field gives the total number of matched records. No
message body is included.
HTTP/1.1 200 OK
Total: 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
aclId

ACL ID, which uniquely identifies an ACL.


Long integer type.

parentId

ID of the parent device or task.


Long integer type.

parentType

Parent type, which can be device or task.


Long integer type.

aclName

ACL name.
String type.

aclNameType

ACL name type.


Long integer type.

aclType

ACL type.
Long integer type.

aclMatchorder

ACL match order.


Integer type.

aclDesc

ACL description.
String type.

tmpName

Template name.
String type.

tmpDesc

Template description.
String type.

useFlag

Specify the action of adding, deleting, or modifying.


Long integer type.

410

ACL Management

Example
Query 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=2
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Device


Add an ACL on a device.

Interface URI
/acl/res/acl

Access Method
HTTP
POST

Message body
POST http://imc_host:8080/imcrs/acl/res/acl
accept: 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
parentId

ID of the parent device or task.


Long integer type.

parentType

Parent type, which can be device or task.


Long integer type.

aclName

ACL name.
String type.

aclNameType

ACL name type.


Long integer type.

aclType

ACL type.
Long integer type.

aclMatchorder

ACL match order.


Integer type.

aclDesc

412

ACL Management

ACL description.

ACL sub-elements
String type.
tmpName

Template name.
String type.

tmpDesc

Template description.
String type.

useFlag

Specify the action of adding, deleting, or modifying.


Long integer type.

ACL rule sub-elements


trName

Time range name.


String type.

action

Action of the rule.


Integer type.

ruleDesc

Rule description.
String type.

ruleSeq

Rule number.
Long integer type.

ruleMatchCount

Match rule.
Long integer type.

fragment

Fragment.
Integer type.

logging

Logging.
Integer type.

protocol

Protocol.
Long integer type.

vpnIntance

VPN instance.
String type.

sourceAddr

Source address.
String type.

sourceWildcard

Source address mask.


String type.

destAddr

Source address mask.


String type

destMask

Destination address mask.


String type.

sourcePortOper

Destination port operator.


Long integer type.

sourcePort1

Source port 1.

Add ACL on a Device

413

ACL rule sub-elements


Long integer type.
sourcePort2

Source port 2.
Long integer type.

destPortOper

Destination port operator.


Long integer type.

destPort1

Destination port 1.
Long integer type.

destPort2

Destination port 2.
Long integer type.

icmpType

ICMP type.
Long integer type.

icmpCode

ICMP value.
Long integer type.

hpAck

HP Ack.
Integer type.

hpFin

HP Fin.
Integer type.

hpRst

HP Rst.
Integer type.

hpSyn

HP Syn.
Integer type.

hpIgmpType

HP IGMP type.
Integer type.

precedence

IP precedence.
Long integer type.

tos

ToS.
Long integer type.

dscp

DSCP.
Long integer type.

priority

802.3 precedence.
Long integer type.

formatType

Encapsulation type.
Long integer type.

srcVlanId

Source VLAN ID.


Long integer type.

l2ProtocolCode

Layer 2 protocol code.


String type.

l2ProtocolMask
414

ACL Management

Layer 2 protocol mask.

ACL rule sub-elements


String type.
l2ProtocolType

Layer 2 protocol type.


Long integer type.

sourceMacAddr

Source MAC address mask.


String type.

sourceMacWildcard

Source MAC address mask.


String type.

destMacAddr

Destination MAC address.


String type.

destMacMask

Destination MAC address mask.


String type.

ifdesc

Interface description.
String type.

ruleString

Rule string.
String type.

Returned Result
Status codes

201 (Created): Success.

Example
Add a standard ACL on the device whose device ID is 68.

Request
POST http://imc_host:8080/imcrs/acl/res/acl
accept: 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 Created
Content-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/acl
accept: 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 Created
Content-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/acl
accept: 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 Created
Content-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 ID
is 68.

Request
POST http://imc_host:8080/imcrs/acl/res/acl
accept: 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 Created
Content-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/acl
accept: 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 Created
Content-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/acl
accept: 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 Created
Content-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/acl
accept: 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 Created
Content-Type: application/xml
...
No message body is included.

Add ACL on a Device

419

Delete ACL from a Device


Delete an ACL from a device.

Interface URI
/acl/res/acl/{id}

Access Method
HTTP
DELETE

Parameters
Path parameters
id

ACL ID.
Long 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.

Example
Delete ACL 1389 from a device.

Request
DELETE http://imc_host:8080/imcrs/acl/res/acl/1389
accept: application/xml
...

Response
HTTP/1.1 204 No Content
Content-Type: application/xml
...
No message body is included.

420 ACL Management

Query ACL Applications of a Device


Query the ACL application list of a device specified by its device ID.

Interface URI
/acl/res/aclUse/{deviceId}

Access Method
HTTP
GET

Parameters
Path parameters
deviceId

Device ID.
Long integer type. Required. No default value.

Query parameters
start

The position of the first returned record in the query result set.
Integer type. Optional. The default value is 0. If a value smaller than 0 is input, the default value 0
is used.

size

Total number of returned records.


Integer type. Optional. The default value is 10. If a value smaller than 0 is input, the default value
10 is used.

total

Specify that only the number of matched records is returned.


Boolean type. Optional. The default value is false. When this field is set to true, the start and size
fields are ineffective, the message body returned is empty, and the Total field in the message header
returns the number of matched records.

Returned Result
Status codes

200(OK): Success.

Message header
When the total parameter is true, the Total field gives the total number of matched records. No
message body is included.
HTTP/1.1 200 OK
Total: 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
useId

ACL application ID, which uniquely identifies an ACL application.


Long integer type.

parentId

ID of the parent device or task.


Long integer type.

parentType

Parent type, which can be device or task.


Long integer type.

useType

ACL application type.


Long integer type.

aclName

ACL name.
Long integer type.

useContext

ACL application context.


Long integer type.

useCommand

ACL application command.


Long integer type.

useDesc

ACL application description.


Long integer type.

useFlag

Specify the action of adding, deleting, or modifying.


Long integer type.

422 ACL Management

Example
Query 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=3
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Device


Add an ACL application on a device.

Interface URI
/acl/res/aclUse

Access Method
HTTP
POST

Message body
POST http://imc_host:8080/imcrs/acl/res/aclUse
accept: 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
useId

ACL application ID, which uniquely identifies an ACL application.


Long integer type.

parentId

ID of the parent device or task.


Long integer type.

parentType

Parent type, which can be device or task.


Long integer type.

useType

ACL application type.


Long integer type.

aclName

ACL name.
Long integer type.

useContext

ACL application context.


Long integer type.

useCommand

ACL application command.


Long integer type.

useDesc

ACL application description.


Long integer type.

useFlag

Specify the action of adding, deleting, or modifying.


Long integer type.

424 ACL Management

Returned Result
Status codes

201 (Created): Success.

Example
Add an ACL application on the device whose device ID is 68.

Request
POST http://imc_host:8080/imcrs/acl/res/aclUse
accept: 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 Created
Content-Type: application/xml
...
No message body is included.

Add ACL Application on a Device 425

Delete ACL Application from a Device


Delete an ACL application specified by its ID from a device.

Interface URI
/acl/res/aclUse/{id}

Access Method
HTTP
DELETE

Parameters
Path parameters
id

ACL application ID.


Long 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

Example
Delete ACL application 15 from a device.

Request
DELETE http://imc_host:8080/imcrs/acl/res/aclUse/15
accept: application/xml
...

Response
HTTP/1.1 204 No Content
Content-Type: application/xml
...
No message body is included.

426 ACL Management

Query ACL Time Ranges of a Device


Query the ACL time ranges of a device specified by its device ID.

Interface URI
/acl/res/aclTimeRange/{deviceId}

Access Method
HTTP
GET

Parameters
Path parameters
deviceId

Device ID.
Long integer type. Required. No default value.

Query parameters
start

The position of the first returned record in the query result set.
Integer type. Optional. The default value is 0. If a value smaller than 0 is input, the default value 0
is used.
Total number of returned records.

size

Integer type. Optional. The default value is 10. If a value smaller than 0 is input, the default value
10 is used.

total

Specify that only the number of matched records is returned.


Boolean type. Optional. The default value is false. When this field is set to true, the start and size
fields are ineffective, the message body returned is empty, and the Total field in the message header
returns the number of matched records.

Returned Result
Status codes

200(OK): Success.

Message header
When the total parameter is true, the Total field gives the total number of matched records. No
message body is included.
HTTP/1.1 200 OK
Total: 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
trId

ACL time range ID, which uniquely identifies an ACL time range.
Long integer type.

parentId

ID of the parent device or task.


Long integer type.

parentType

Parent type, which can be device or task.


Long integer type.

trName

Time range name.


String type.

useFlag

Specify the action of adding, deleting, or modifying.


Long integer type.

aclChildTimeRange

Child Time Range Set URI.


String type.

Example
Query 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=2
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 Device


Add an ACL time range on a device.

Interface URI
/acl/res/aclTimeRange

Access Method
HTTP
POST

Message body
POST http://imc_host:8080/imcrs/acl/res/aclTimeRange
accept: 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
trId

ACL time range ID, which uniquely identifies an ACL time range.
Long integer type.

parentId

ID of the parent device or task.


Long integer type.

parentType

Parent type, which can be device or task.


Long integer type.

trName

Time range name.


String type.

useFlag

Specify the action of adding, deleting, or modifying.


Long integer type.

aclChildTimeRange

Child Time Range Set URI.


String type.

Add ACL Time Range on a Device 429

Returned Result
Status codes

201 (Created): Success.

Example
Add an ACL time range on the device whose device ID is 68.

Request
POST http://imc_host:8080/imcrs/acl/res/aclTimeRange
accept: 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 Created
Content-Type: application/xml
...
No message body is included.

430 ACL Management

Delete ACL Time Range from a Device


Delete an ACL time range specified by its ID from a device.

Interface URI
/acl/res/aclTimeRange/{id}

Access Method
HTTP
DELETE

Parameters
Path parameters
id

ACL time ranges ID.


Long 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

Example
Delete ACL time range 15 from a device.

Request
DELETE http://imc_host:8080/imcrs/acl/res/acl
TimeRange/15accept: application/xml
...

Response
HTTP/1.1 204 No Content
Content-Type: application/xml
...
No message body is included.

Delete ACL Time Range from a Device

431

Query Child Time


Query the child time ranges of an ACL time range on a device according to the specified device
ID and ACL time range ID.

Interface URI
/acl/res/aclTimeRange/{deviceId},{trId}

Access Method
HTTP
GET

Parameters
Path parameters
deviceId

Device ID.
Long integer type. Required. No default value.

trId

ACL time range ID.


Long integer type. Required. No default value.

Returned Result
Status codes

200(OK): Success.

Message header
When 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 OK
Total: 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
trChildId

Child time range ID of an ACL time range, which uniquely identifies a child time range of an
ACL time range.
Long integer type.

aclTimeRangeId

ACL time range ID.


Long integer type.

trChildType

Type.
Long integer type.

trPerDayofweek

Period.
String type.

trStartTime

Start time.
String type.

trEndTime

End time.
String 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-15
18: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, and
working 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 trPerDayofweek
to 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, and
trEndTime=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

Example
Query 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,80
accept: application/xml
...

Response
HTTP/1.1 200 OK
Content-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 resources


Contacting 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 service
HP recommends that you register your product at the Subscriber's Choice for Business website:
http://www.hp.com/go/e-updates
After registering, you receive email notification of product enhancements, new driver versions,
firmware updates, and other product resources.

Warranty
The Hewlett-Packard Limited Warranty Statement for this product and the HP Software License
Terms which apply to any software accompanying this product are available on the HP networking
Web site at www.hp.com/networking/warranty. The customer warranty support and services
information 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 with
services that they offer and with services offered by HP.

Documentation
For 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 OR


select a product category.

From the product page, choose the Manuals link to the documentation associated with your
product.

Contacting HP 435

Prerequisites
Prerequisites for installing this product include:

IMC v5.1 or higher installed and deployed on your enterprise network or lab environment.

Typographic conventions
Table 2 Document conventions
Convention

Element

Blue text: Table 2 (page 436)

Cross-reference links and email addresses

Blue, underlined text: http://www.hp.com

Website addresses

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 menu
and list items, buttons, tabs, and check boxes

Italic text

Text emphasis

Monospace text

File and directory names


System output
Code
Commands, their arguments, and argument values

Monospace, italic text

Code variables
Command variables

Monospace, bold text

IMPORTANT:
CAUTION:
NOTE:
TIP:

Emphasized monospace text

Provides clarifying information or specific instructions.


Indicates that failure to follow directions could result in damage to equipment or data.

Provides additional information.


Provides helpful hints and shortcuts.

About the HP IMC documentation set


The HP IMC documentation set includes:
Table 3 About the HP IMC documentation set
Category

Documents

Purposes

Product description
and specifications

Marketing brochures

Describe product specifications and benefits.

HP IMC Getting Started Guide

Quickly guides you through the IMC main features and


troubleshooting common problems.

HP IMC Installation Guide

Provides a complete guide to IMC platform and component


installation and deployment.

Hardware
specifications and
installation

HP IMC Probe Installation Guide Provides a complete guide to IMP Probe installation and
deployment.

436 Support and other resources

Table 3 About the HP IMC documentation set (continued)


Category

Documents

Purposes

SQL Server 2005 Installation


and Configuration Guide

Guides you through installing SQL Server 2005 for IMC.

SQL Server 2008 Installation


and Configuration Guide

Guides you through installing SQL Server 2008 for IMC.

SQL Server 2008 R2 Installation Guides you through installing SQL Server 2008 R2 for IMC.
and Configuration Guide
Oracle 11g Installation and
Configuration Guide (for Linux)

Guides you through installing Oracle 11g on Linux for IMC.

MySQL 5.1 Installation and


Configuration Guide (Linux)

Guides you through installing MySQL 5.1 on Linux for IMC.

MySQL 5.1 Installation and


Guides you through installing MySQL 5.1 on Windows for IMC.
Configuration Guide (Windows)

Software
configuration

Operations and
maintenance

HP IMC Base Platform


Administrator Guide

Describes operation procedures on the IMC base platform.

HP IMC Network Traffic


Analyzer Administrator Guide

Describes operation procedures on the IMC Network Traffic


Analyzer.

HP IMC Quality of Service


Manager Administrator Guide

Describes operation procedures on using QoSM to control your


network resources.

HP IMC User Behavior Auditor


Administrator Guide

Describes operation procedures on using UBA to audit user


behavior.

Online Help

Helps you properly use IMC.

Read me

Provides latest IMC release information.

About the HP IMC documentation set 437

16 Documentation feedback
HP is committed to providing documentation that meets your needs. To help us improve the
documentation, send any errors, suggestions, or comments to Documentation Feedback
(docsfeedback@hp.com). Include the document title and part number, version number, or the URL
when submitting your feedback.

438 Documentation feedback

You might also like