Vous êtes sur la page 1sur 473

iManager N2000 UMS Element Management System V200R013C05

iSStar
Issue Date 02 2010-10-10

HUAWEI TECHNOLOGIES CO., LTD.

Copyright Huawei Technologies Co., Ltd. 2010. All rights reserved. No part of this document may be reproduced or transmitted in any form or by any means without prior written consent of Huawei Technologies Co., Ltd.

Trademarks and Permissions


and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd. All other trademarks and trade names mentioned in this document are the property of their respective holders.

Notice
The purchased products, services and features are stipulated by the contract made between Huawei and the customer. All or part of the products, services and features described in this document may not be within the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements, information, and recommendations in this document are provided "AS IS" without warranties, guarantees or representations of any kind, either express or implied. The information in this document is subject to change without notice. Every effort has been made in the preparation of this document to ensure accuracy of the contents, but all statements, information, and recommendations in this document do not constitute the warranty of any kind, express or implied.

Huawei Technologies Co., Ltd.


Address: Huawei Industrial Base Bantian, Longgang Shenzhen 518129 People's Republic of China http://www.huawei.com support@huawei.com

Website: Email:

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

iManager N2000 UMS Element Management System iSStar

About This Document

About This Document


Purpose
Being an enhanced tool component of the N2000 UMS, Integration Script Star (iSStar) is a powerful platform for script enhancement maintenance. This describes the functions and application scenarios of iSStar. It also describes how to develop and use scripts through iSStar.

Related Versions
The following table lists the product versions related to this document. Product Name N2000 UMS Version V200R013C05

Intended Audience
The intended audiences of this document are: l l System engineers Network management engineers

Update History 02 (2010-10-10)


This is the second commercial release. The copyright declaration is updated.

01(2010-08-30)
This is the first commercial issue.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. iii

About This Document

iManager N2000 UMS Element Management System iSStar

Organization
1 iSStar Overview Being an enhanced tool component of the N2000 UMS, integrated Script Star (iSStar) is a powerful script secondary development platform. iSStar provides an easy-to-learn programmable script language - High level Script Language (HSL), powerful High-level Foundation Classes (HFC), and an integrated development environment for editing, debugging, and executing the HSL scripts. You can create an HSL script for the repetitive and effortconsuming daily maintenance. In this way, daily maintenance can be performed automatically through iSStar tool. This reduces workload and improves work efficiency. 2 iSStar Management This chapter describes iSStar file system, log information, process service information, and rights required for iSStar operations. 3 iSStar Operation This chapter describes the operation procedure of iSStar and how to use iSStar to develop, manage, or use scripts. 4 HSL Language Reference The High Level Script Language (HSL) is a simple but powerful script language provided by the iSStar. HSL reference contains the HSL syntax, data types and methods supported by HSL. 5 HFC Library Reference The iSStar provides various library functions, such as Type Conversion Function, Time Function, Input and Output Function, Network Operation Function, Directory and File Operation Function and so on. These functions are called HSL Foundation Class (HFC) functions. HFC functions help you to compile simple scripts and facilitate debugging and maintenance. 6 iSStar Interface Description This topic provides the reference information of the iSStar GUI.

Conventions
Symbol Conventions The symbols that may be found in this document are defined as follows. Symbol Description Indicates a hazard with a high level of risk, which if not avoided,will result in death or serious injury. Indicates a hazard with a medium or low level of risk, which if not avoided, could result in minor or moderate injury. Indicates a potentially hazardous situation, which if not avoided,could result in equipment damage, data loss, performance degradation, or unexpected results.
iv Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

About This Document

Symbol

Description Indicates a tip that may help you solve a problem or save time. Provides additional information to emphasize or supplement important points of the main text.

General Conventions The general conventions that may be found in this document are defined as follows. Convention Times New Roman Boldface Italic Courier New Description Normal paragraphs are in Times New Roman. Names of files, directories, folders, and users are in boldface. For example, log in as user root. Book titles are in italics. Examples of information displayed on the screen are in Courier New.

Command Conventions The command conventions that may be found in this document are defined as follows. Convention Boldface Italic [] { x | y | ... } [ x | y | ... ] { x | y | ... }* Description The keywords of a command line are in boldface. Command arguments are in italics. Items (keywords or arguments) in brackets [ ] are optional. Optional items are grouped in braces and separated by vertical bars. One item is selected. Optional items are grouped in brackets and separated by vertical bars. One item is selected or no item is selected. Optional items are grouped in braces and separated by vertical bars. A minimum of one item or a maximum of all items can be selected. Optional items are grouped in brackets and separated by vertical bars. Several items or no item can be selected.

[ x | y | ... ]*

GUI Conventions The GUI conventions that may be found in this document are defined as follows.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. v

About This Document

iManager N2000 UMS Element Management System iSStar

Convention Boldface >

Description Buttons, menus, parameters, tabs, window, and dialog titles are in boldface. For example, click OK. Multi-level menus are in boldface and separated by the ">" signs. For example, choose File > Create > Folder.

Keyboard Operations The keyboard operations that may be found in this document are defined as follows. Format Key Key 1+Key 2 Key 1, Key 2 Description Press the key. For example, press Enter and press Tab. Press the keys concurrently. For example, pressing Ctrl+Alt +A means the three keys should be pressed concurrently. Press the keys in turn. For example, pressing Alt, A means the two keys should be pressed in turn.

Mouse Operations The mouse operations that may be found in this document are defined as follows. Action Click Double-click Drag Description Select and release the primary mouse button without moving the pointer. Press the primary mouse button twice continuously and quickly without moving the pointer. Press and hold the primary mouse button and move the pointer to a certain position.

vi

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

Contents

Contents
About This Document...................................................................................................................iii 1 iSStar Overview..........................................................................................................................1-1
1.1 Product Features of iSStar...............................................................................................................................1-3 1.2 Basic Concepts of iSStar.................................................................................................................................1-3 1.3 iSStar Application Scenarios...........................................................................................................................1-5 1.4 iSStar Software Structure................................................................................................................................1-7 1.5 Basic Functions of iSStar................................................................................................................................1-8 1.6 iSStar Script Sample........................................................................................................................................1-8 1.7 iSStar Technical Specifications.....................................................................................................................1-12

2 iSStar Management....................................................................................................................2-1
2.1 iSStar File System...........................................................................................................................................2-2 2.2 iSStar Log Data...............................................................................................................................................2-3 2.3 iSStar Process and Service..............................................................................................................................2-3 2.4 iSStar User Authority Setting..........................................................................................................................2-6

3 iSStar Operation.........................................................................................................................3-1
3.1 iSStar Operation Procedure.............................................................................................................................3-2 3.2 Developing Scripts..........................................................................................................................................3-4 3.2.1 Creating a Script File..............................................................................................................................3-4 3.2.2 Debugging a Script File..........................................................................................................................3-7 3.2.3 Creating a Script Project......................................................................................................................3-11 3.2.4 Debugging a Script Project..................................................................................................................3-13 3.2.5 Creating a Script Application...............................................................................................................3-15 3.3 Using Scripts.................................................................................................................................................3-17 3.3.1 Types and Status of Script Tasks.........................................................................................................3-18 3.3.2 Running a Script File............................................................................................................................3-21 3.3.3 Running a Script Project......................................................................................................................3-23 3.3.4 Running a Script Application...............................................................................................................3-24 3.3.5 Viewing the Result of a Script.............................................................................................................3-26 3.3.6 Monitoring the Process of Running a Script........................................................................................3-27 3.3.6.1 Viewing the Script Task States.........................................................................................................3-28 3.3.6.2 Viewing Output Files of a Script Task..............................................................................................3-29 3.3.6.3 Pausing and Resuming a Script Task................................................................................................3-30 Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. vii

Contents

iManager N2000 UMS Element Management System iSStar 3.3.6.4 Stopping a Script Task......................................................................................................................3-30 3.3.6.5 Deleting a Script Task.......................................................................................................................3-31

3.4 Managing Scripts...........................................................................................................................................3-31 3.4.1 Viewing the Script Application Information........................................................................................3-32 3.4.2 Downloading a Script Application to the Local Terminal...................................................................3-33 3.4.3 Issuing a Script Application to the Server............................................................................................3-34 3.4.4 Deleting a Script Application...............................................................................................................3-35 3.4.5 Managing Script Application Bookmarks............................................................................................3-36

4 HSL Language Reference..........................................................................................................4-1


4.1 Introduction to the HSL Language..................................................................................................................4-2 4.2 HSL Language Syntax....................................................................................................................................4-2 4.2.1 Identifiers...............................................................................................................................................4-3 4.2.2 Keywords...............................................................................................................................................4-3 4.2.3 Statements..............................................................................................................................................4-4 4.2.4 Operators................................................................................................................................................4-5 4.2.5 String Format..........................................................................................................................................4-6 4.2.6 Comments...............................................................................................................................................4-7 4.2.7 Condition Statements.............................................................................................................................4-8 4.2.8 Loop Statements.....................................................................................................................................4-8 4.2.9 Function Definitions.............................................................................................................................4-10 4.3 Data Types and Methods in the HSL............................................................................................................4-11 4.3.1 Number.................................................................................................................................................4-12 4.3.2 Sequence...............................................................................................................................................4-13 4.3.3 String....................................................................................................................................................4-13 4.3.4 List........................................................................................................................................................4-19 4.3.5 Tuple.....................................................................................................................................................4-19 4.3.6 Dictionary.............................................................................................................................................4-20 4.3.7 File........................................................................................................................................................4-22 4.4 HSL Built-In Functions.................................................................................................................................4-26 4.4.1 Built-In Functions List.........................................................................................................................4-27 4.4.2 Example of the Data Operation Function.............................................................................................4-30 4.4.3 Example of the Type Conversion Function..........................................................................................4-31 4.4.4 Example of Other Functions................................................................................................................4-32

5 HFC Library Reference..............................................................................................................5-1


5.1 NE Operation Function...................................................................................................................................5-3 5.1.1 Overview of NE Operation Function.....................................................................................................5-4 5.1.2 Function: ConnectNE.............................................................................................................................5-7 5.1.3 Function: GetNELst...............................................................................................................................5-8 5.1.4 Function: GetNELstByType..................................................................................................................5-9 5.1.5 Function: GetNEName.........................................................................................................................5-10 5.1.6 Function: GetNEFDN..........................................................................................................................5-11 5.1.7 Function: GetNEIP...............................................................................................................................5-12 viii Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

Contents

5.1.8 Function: GetNEVer............................................................................................................................5-13 5.1.9 Function: GetNEType..........................................................................................................................5-14 5.1.10 Function: GetNETypeIDByName......................................................................................................5-15 5.1.11 Function: GetNETypeNameByID......................................................................................................5-16 5.1.12 Function: GetNEStatus.......................................................................................................................5-17 5.1.13 Function: SendMML..........................................................................................................................5-18 5.1.14 Function: GetMMLReport.................................................................................................................5-19 5.1.15 Function: GetAllMMLReport............................................................................................................5-22 5.1.16 Function: ClearMMLBuffer...............................................................................................................5-24 5.1.17 Function: SetMMLBufferSize............................................................................................................5-25 5.1.18 Example of NE Operation Function...................................................................................................5-26 5.2 CSV Parse Functions.....................................................................................................................................5-29 5.2.1 Overview of CSV Parse Functions.......................................................................................................5-29 5.2.2 Function: ReadCSVFile.......................................................................................................................5-29 5.2.3 Function: WriteCSVFile......................................................................................................................5-30 5.3 XML Parse Functions....................................................................................................................................5-31 5.3.1 Overview of XML Parse Functions.....................................................................................................5-32 5.3.2 Function: OpenXML............................................................................................................................5-33 5.3.3 Function: WriteBackXML...................................................................................................................5-34 5.3.4 Function: NewElement.........................................................................................................................5-35 5.3.5 Function: GetSubElement....................................................................................................................5-36 5.3.6 Function: GetSubElements...................................................................................................................5-37 5.3.7 Function: GetAttribute.........................................................................................................................5-38 5.3.8 Function: AddSubElement...................................................................................................................5-39 5.3.9 Function: SetElementContent..............................................................................................................5-40 5.3.10 Function: GetElementContent............................................................................................................5-41 5.3.11 Function: SetAttribute........................................................................................................................5-42 5.3.12 Function: RemoveAttribute................................................................................................................5-43 5.3.13 Function: RemoveSubElement...........................................................................................................5-43 5.3.14 Function: GetElementName...............................................................................................................5-44 5.3.15 Function: GetAttributes......................................................................................................................5-45 5.3.16 Example of XML Parse Function.......................................................................................................5-46 5.4 MML Message Parse Functions....................................................................................................................5-47 5.4.1 Overview of MML Message Parse Function.......................................................................................5-49 5.4.2 MML Message Format.........................................................................................................................5-52 5.4.3 Function: ParseMMLRpt......................................................................................................................5-56 5.4.4 Function: GetSourceName...................................................................................................................5-58 5.4.5 Function: GetReportDate.....................................................................................................................5-59 5.4.6 Function: GetReportTime....................................................................................................................5-60 5.4.7 Function: GetTimeAdjustFlag..............................................................................................................5-61 5.4.8 Function: GetServiceFlag.....................................................................................................................5-62 5.4.9 Function: GetReportIdx........................................................................................................................5-64 Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. ix

Contents

iManager N2000 UMS Element Management System iSStar 5.4.10 Function: GetMMLCmd....................................................................................................................5-65 5.4.11 Function: GetResultCode...................................................................................................................5-66 5.4.12 Function: GetResultCause..................................................................................................................5-68 5.4.13 Function: GetObjNum........................................................................................................................5-69 5.4.14 Function: GetObjTitle........................................................................................................................5-70 5.4.15 Function: GetRecordNum..................................................................................................................5-71 5.4.16 Function: GetTips...............................................................................................................................5-72 5.4.17 Function: GetAttrValueByName........................................................................................................5-73 5.4.18 Function: GetAttrValueByIdx............................................................................................................5-75 5.4.19 Function: GetAttrNameList................................................................................................................5-76 5.4.20 Function: GetAttrNum.......................................................................................................................5-77 5.4.21 Function: GetColumnByName...........................................................................................................5-78 5.4.22 Function: GetColumnByIndex...........................................................................................................5-80 5.4.23 Function: GetRowByIndex................................................................................................................5-82 5.4.24 Function: GetDataFrmMMLRpt........................................................................................................5-83 5.4.25 Function: GetUTCTimeOffSet...........................................................................................................5-86 5.4.26 Function: DestroyMMLParser...........................................................................................................5-87 5.4.27 Examples of MML Message Parse Functions....................................................................................5-88

5.5 Alarm Message Parsing Function.................................................................................................................5-90 5.5.1 Overview of Alarm Message Parsing Function...................................................................................5-93 5.5.2 Alarm Message Format........................................................................................................................5-97 5.5.3 Function: ParseAlmRpt......................................................................................................................5-100 5.5.4 Function: GetAlmSource....................................................................................................................5-102 5.5.5 Function: GetAlmRptDate.................................................................................................................5-103 5.5.6 Function: GetAlmRptTime................................................................................................................5-104 5.5.7 Function: GetAlmRptNum.................................................................................................................5-106 5.5.8 Function: GetAlmServiceTag............................................................................................................5-107 5.5.9 Function: GetAlmTimeAdjustFlag....................................................................................................5-108 5.5.10 Function: GetAlmServiceFlag..........................................................................................................5-109 5.5.11 Function: GetAlmRptIdx..................................................................................................................5-110 5.5.12 Function: GetAlmMMLCmd...........................................................................................................5-111 5.5.13 Function: GetAlmResultCode..........................................................................................................5-113 5.5.14 Function: GetAlmResultCause.........................................................................................................5-114 5.5.15 Function: GetAlmTips......................................................................................................................5-115 5.5.16 Function: GetAlmFlowNumber.......................................................................................................5-116 5.5.17 Function: GetAlmType....................................................................................................................5-117 5.5.18 Function: GetAlmLevel....................................................................................................................5-118 5.5.19 Function: GetAlmNEType...............................................................................................................5-120 5.5.20 Function: GetAlmID........................................................................................................................5-121 5.5.21 Function: GetAlmSort......................................................................................................................5-123 5.5.22 Function: GetAlmSyncSerialNo......................................................................................................5-124 5.5.23 Function: GetAlmName...................................................................................................................5-125 x Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

Contents

5.5.24 Function: GetAlmRaiseTime...........................................................................................................5-127 5.5.25 Function: GetAlmLocationInfo........................................................................................................5-128 5.5.26 Function: GetAlmAttrValueByName..............................................................................................5-130 5.5.27 Function: GetAlmAttrValueByIdx...................................................................................................5-131 5.5.28 Function: GetAlmNumByLevel.......................................................................................................5-133 5.5.29 Function: GetAlmNumByTimeDur.................................................................................................5-134 5.5.30 Function: GetAlmRptUTCTimeOffSet............................................................................................5-136 5.5.31 Examples of Alarm Message Parsing Function...............................................................................5-137 5.6 Database Operation Function......................................................................................................................5-139 5.6.1 Overview of Database Operation Functions......................................................................................5-141 5.6.2 Function: OpenDB.............................................................................................................................5-144 5.6.3 Function: CreateCond........................................................................................................................5-145 5.6.4 Function: QueryFmRcds....................................................................................................................5-146 5.6.5 Function: NextFmRcds......................................................................................................................5-153 5.6.6 Function: QueryPmRcds....................................................................................................................5-159 5.6.7 Function: NextPmRcds......................................................................................................................5-163 5.6.8 Function: QueryCmRcds....................................................................................................................5-165 5.6.9 Function: NextCmRcds......................................................................................................................5-165 5.6.10 Function: GetCmCom......................................................................................................................5-166 5.6.11 Function: GetChildMoc....................................................................................................................5-168 5.6.12 Function: GetIntegrityReportCond..................................................................................................5-169 5.6.13 Function: GetFunctionSubSetList....................................................................................................5-170 5.6.14 Function: QueryIntegrityResult........................................................................................................5-171 5.6.15 Function: GetOneNEInteLst............................................................................................................5-172 5.6.16 Function: GetOneFssInte..................................................................................................................5-173 5.6.17 Function: GetOneIntegrity...............................................................................................................5-174 5.6.18 Function: GetPmCond......................................................................................................................5-175 5.6.19 Function: GetFmCond......................................................................................................................5-178 5.6.20 Function: QueryRecord....................................................................................................................5-183 5.6.21 Function: RecordCount....................................................................................................................5-184 5.6.22 Function: NextRecord......................................................................................................................5-185 5.6.23 Function: GetMocAttrNameList......................................................................................................5-189 5.6.24 Function: GetMocList......................................................................................................................5-190 5.6.25 Function: GetNeObjInfo..................................................................................................................5-191 5.6.26 Function: GetCounterInfo................................................................................................................5-192 5.6.27 Function: GetFuncSetList................................................................................................................5-193 5.6.28 Function: GetFuncSubSetList..........................................................................................................5-194 5.6.29 Function: GetMoiAttrValueList.......................................................................................................5-195 5.6.30 Function: GetMoiListByFilter..........................................................................................................5-196 5.6.31 Function: GetPmNeType..................................................................................................................5-198 5.6.32 Function: GetNeInfo........................................................................................................................5-199 5.6.33 Function: CloseDB...........................................................................................................................5-200 Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. xi

Contents

iManager N2000 UMS Element Management System iSStar

5.7 Alarm Operation Function..........................................................................................................................5-201 5.7.1 Overview of Alarm Operation Function............................................................................................5-201 5.7.2 Function: SendAlarm.........................................................................................................................5-201 5.8 OM Operation Function..............................................................................................................................5-202 5.8.1 Overview of OM Operation Function................................................................................................5-203 5.8.2 Function: GetOMCVersion................................................................................................................5-204 5.8.3 Function: LOG_OP............................................................................................................................5-204 5.8.4 Function: GetAllSubareaInformation.................................................................................................5-205 5.8.5 Function: GetFdnListByHostname....................................................................................................5-206 5.8.6 Function: GetHostNameByNeFdn.....................................................................................................5-207 5.9 Type Conversion Functions........................................................................................................................5-208 5.9.1 Overview of the Type Conversion Functions....................................................................................5-208 5.9.2 Function: String2Int...........................................................................................................................5-209 5.9.3 Function: String2Float........................................................................................................................5-210 5.9.4 Function: String2Long.......................................................................................................................5-211 5.9.5 Function: Sequence2Tuple.................................................................................................................5-211 5.9.6 Function: Sequence2List....................................................................................................................5-212 5.9.7 Function: ToString.............................................................................................................................5-213 5.10 Time Functions..........................................................................................................................................5-214 5.10.1 Overview of the Time Functions......................................................................................................5-215 5.10.2 Time Format.....................................................................................................................................5-216 5.10.3 Time Tuple.......................................................................................................................................5-217 5.10.4 Function: GMTime...........................................................................................................................5-218 5.10.5 Function: LocalTime........................................................................................................................5-218 5.10.6 Function: MkTime............................................................................................................................5-219 5.10.7 Function: Sleep.................................................................................................................................5-220 5.10.8 Function: StrfTime...........................................................................................................................5-221 5.10.9 Function: StrpTime..........................................................................................................................5-222 5.10.10 Function: Time...............................................................................................................................5-223 5.10.11 Function: CTime............................................................................................................................5-224 5.10.12 Function: AscTime.........................................................................................................................5-224 5.11 Input and Output Functions.......................................................................................................................5-225 5.11.1 Overview of Input and Output Functions.........................................................................................5-226 5.11.2 Function: UserInput..........................................................................................................................5-227 5.11.3 Function: UserOutput.......................................................................................................................5-228 5.11.4 Function: SetOutMode.....................................................................................................................5-229 5.11.5 Function: SetOutFlag.......................................................................................................................5-229 5.11.6 Function: SetOutFileName...............................................................................................................5-231 5.11.7 Function: Print..................................................................................................................................5-231 5.11.8 Function: GetOutputPath..................................................................................................................5-232 5.11.9 Function: NotifyProgress.................................................................................................................5-233 5.12 GetError Function.....................................................................................................................................5-234 xii Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

Contents

5.12.1 Overview of GetError Function.......................................................................................................5-234 5.12.2 Function: GetLastError....................................................................................................................5-235 5.12.3 Function: GetErrorMsg....................................................................................................................5-235 5.13 Network Operation Function.....................................................................................................................5-237 5.13.1 Overview of Network Operation Function.......................................................................................5-238 5.13.2 Function: SetPassive........................................................................................................................5-239 5.13.3 Function: LoginFTP.........................................................................................................................5-240 5.13.4 Function: Upload..............................................................................................................................5-240 5.13.5 Function: Download.........................................................................................................................5-241 5.13.6 Function: GetFTPStatus...................................................................................................................5-242 5.13.7 Function: LogoutFTP.......................................................................................................................5-243 5.13.8 Function: OpenTelnet.......................................................................................................................5-243 5.13.9 Function: ExecuteCmd.....................................................................................................................5-245 5.13.10 Function: IsConnected....................................................................................................................5-247 5.13.11 Function: CloseTelnet....................................................................................................................5-248 5.13.12 Examples of Network Operation Function.....................................................................................5-250 5.14 Report Operation Function........................................................................................................................5-252 5.14.1 Overview of Report Operation Function..........................................................................................5-253 5.14.2 Report Management Function..........................................................................................................5-254 5.14.2.1 Function: LoadReport...................................................................................................................5-255 5.14.2.2 Function: NewReport....................................................................................................................5-255 5.14.2.3 Function: SaveReportAs...............................................................................................................5-256 5.14.2.4 Function: StoreReport...................................................................................................................5-257 5.14.3 Report Design Function...................................................................................................................5-258 5.14.3.1 Function: AddRange.....................................................................................................................5-259 5.14.3.2 Function: AddSheet.......................................................................................................................5-261 5.14.3.3 Function: AddTable.......................................................................................................................5-262 5.14.3.4 Function: GetRowCount...............................................................................................................5-263 5.14.3.5 Function: GetRowData..................................................................................................................5-264 5.14.3.6 Function: InsertRow......................................................................................................................5-265 5.14.3.7 Function: RemoveRow..................................................................................................................5-266 5.14.3.8 Function: Selector.........................................................................................................................5-267 5.14.3.9 Function: SetCellValue.................................................................................................................5-269 5.14.3.10 Function: SetRangeValue............................................................................................................5-270 5.14.3.11 Function: SetTableValueEx........................................................................................................5-271 5.14.3.12 Function: SetTableValue.............................................................................................................5-273 5.14.3.13 Function: UpdateRow.................................................................................................................5-274 5.14.4 Report Display Function..................................................................................................................5-275 5.14.4.1 Function: ReportStyle...................................................................................................................5-276 5.14.4.2 Function: SetCellAlign..................................................................................................................5-277 5.14.4.3 Function: SetCellBGColor............................................................................................................5-279 5.14.4.4 Function: SetCellFont...................................................................................................................5-280 Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. xiii

Contents

iManager N2000 UMS Element Management System iSStar 5.14.4.5 Function: SetColumnWidth...........................................................................................................5-281 5.14.4.6 Function: SetRangeAlign..............................................................................................................5-282 5.14.4.7 Function: SetRangeBGColor.........................................................................................................5-283 5.14.4.8 Function: SetRangeFont................................................................................................................5-284 5.14.4.9 Function: SetTableBGColor..........................................................................................................5-285 5.14.4.10 Function: SetTableFont...............................................................................................................5-286 5.14.4.11 Function: SetTableTitleFont.......................................................................................................5-287 5.14.5 Parameters for Operating Report......................................................................................................5-289 5.14.5.1 Parameter: Color...........................................................................................................................5-289 5.14.5.2 Parameter: FontType.....................................................................................................................5-291 5.14.5.3 Parameter: Type............................................................................................................................5-292 5.14.6 Examples of Report Operation Function..........................................................................................5-292

5.15 Directory and File Operation Function.....................................................................................................5-295 5.15.1 Overview of Directory and File Operation Function.......................................................................5-296 5.15.2 Function: Open.................................................................................................................................5-296 5.15.3 Function: read...................................................................................................................................5-298 5.15.4 Function: write.................................................................................................................................5-299 5.15.5 Function: close.................................................................................................................................5-299 5.15.6 Function: FindFiles..........................................................................................................................5-300 5.15.7 Function: MkDir...............................................................................................................................5-301 5.15.8 Function: RmDir..............................................................................................................................5-302 5.15.9 Function: GetCwd............................................................................................................................5-302 5.15.10 Function: Remove..........................................................................................................................5-303 5.15.11 Function: Rename..........................................................................................................................5-304 5.15.12 Function: ListDir............................................................................................................................5-304 5.15.13 Function: MakeDirs........................................................................................................................5-305 5.15.14 Function: RemoveDirs...................................................................................................................5-306 5.15.15 Examples of Directory Operation Function...................................................................................5-306 5.16 GUI Interactive Library Function.............................................................................................................5-307 5.16.1 Overview of GUI Interactive Library Function...............................................................................5-308 5.16.2 Introduction to GUI Interactive Library Controls............................................................................5-309 5.16.3 Function: CreateForm......................................................................................................................5-312 5.16.4 Function: Label................................................................................................................................5-313 5.16.5 Function: Edit...................................................................................................................................5-314 5.16.6 Function: CheckBox.........................................................................................................................5-315 5.16.7 Function: RadioBoxGroup...............................................................................................................5-316 5.16.8 Function: Enter.................................................................................................................................5-317 5.16.9 Function: Space................................................................................................................................5-318 5.16.10 Function: ShowForm......................................................................................................................5-319 5.16.11 Function: GetValue........................................................................................................................5-320 5.16.12 Function: DeleteForm....................................................................................................................5-321 5.16.13 Function: TextArea........................................................................................................................5-322 xiv Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

Contents

5.16.14 Examples of GUI Interactive Library Function.............................................................................5-323 5.17 Task Management Function......................................................................................................................5-324 5.17.1 Overview of Task Management Function........................................................................................5-324 5.17.2 Function: CreateTask.......................................................................................................................5-325 5.17.3 Function: Wait..................................................................................................................................5-326 5.17.4 Function: GetRegisterKey................................................................................................................5-326 5.17.5 Function: Exit...................................................................................................................................5-327 5.18 Assertion Function....................................................................................................................................5-328 5.18.1 Overview of Assertion Function......................................................................................................5-328 5.18.2 Function: Assert...............................................................................................................................5-329 5.18.3 Function: Assert_ON........................................................................................................................5-329 5.18.4 Function: Assert_OFF......................................................................................................................5-330 5.19 Function: ModifyProjParam......................................................................................................................5-330 5.20 Mail Sending Function..............................................................................................................................5-331 5.20.1 Overview of Mail Sending Functions..............................................................................................5-331 5.20.2 Function: CreateLoginInfo...............................................................................................................5-332 5.20.3 Function: CreateMailInfo.................................................................................................................5-334 5.20.4 Function: SendMail..........................................................................................................................5-335 5.21 Function: SendSMSMessage.....................................................................................................................5-337

6 iSStar Interface Description.....................................................................................................6-1


6.1 Interface Description: iSStar Main Window...................................................................................................6-3 6.2 Interface Description: Application Management Window.............................................................................6-6 6.3 Interface Description: Script Running Window..............................................................................................6-8 6.4 Interface Description: Script Debugging Window........................................................................................6-10 6.5 Interface Description: Task Management Window.......................................................................................6-13 6.6 Parameter Description: Project Attribute......................................................................................................6-15 6.7 Parameter Description: Configuring Virtual NEs.........................................................................................6-17 6.8 Parameter Description: Script Pack Setting..................................................................................................6-19 6.9 Parameter Description: Script Timing Task of the iSStar.............................................................................6-21

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

xv

iManager N2000 UMS Element Management System iSStar

Figures

Figures
Figure 1-1 iSStar system deployment..................................................................................................................1-7 Figure 3-1 Progress for developing scripts...........................................................................................................3-2 Figure 3-2 Script Application Operation Flow Chart...........................................................................................3-3 Figure 3-3 State transition of a running task......................................................................................................3-18 Figure 3-4 State transition of a debugging task..................................................................................................3-19 Figure 3-5 State transition of a scheduled task...................................................................................................3-20 Figure 5-1 Procedure for using NE operation functions......................................................................................5-6 Figure 5-2 Workflow of MML message parse functions...................................................................................5-52 Figure 5-3 MML message format 1...................................................................................................................5-53 Figure 5-4 MML message format 2...................................................................................................................5-53 Figure 5-5 Elements in the report.......................................................................................................................5-90 Figure 5-6 Workflow of alarm message parsing functions................................................................................5-96 Figure 5-7 Alarm Message Format....................................................................................................................5-97 Figure 5-8 Procedure for using database operation functions..........................................................................5-144 Figure 5-9 Procedure for modifying a report...................................................................................................5-257 Figure 5-10 Optional colors.............................................................................................................................5-289 Figure 6-1 iSStar Main Window........................................................................................................................6-3 Figure 6-2 Application Management window...................................................................................................6-6 Figure 6-3 iSStar Execute Window....................................................................................................................6-8 Figure 6-4 iSStar Execute Window....................................................................................................................6-9 Figure 6-5 iSStar Debug Window....................................................................................................................6-11 Figure 6-6 iSStar Debug Window....................................................................................................................6-11 Figure 6-7 iSStar Task Manage Window........................................................................................................6-14

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

xvii

iManager N2000 UMS Element Management System iSStar

Tables

Tables
Table 1-1 Basic concepts involved in iSStar........................................................................................................1-3 Table 1-2 List of self-defined functions of CPU load query script....................................................................1-11 Table 1-3 iSStar running environment specifications........................................................................................ 1-13 Table 1-4 Performance specifications of iSStar.................................................................................................1-13 Table 2-1 Directory structure of iSStar................................................................................................................2-2 Table 2-2 iSStar User Right List..........................................................................................................................2-6 Table 3-1 State transition of a running task........................................................................................................3-19 Table 3-2 State transition of a debugging task...................................................................................................3-19 Table 3-3 States of a scheduled task...................................................................................................................3-20 Table 4-1 Keywords.............................................................................................................................................4-4 Table 4-2 MML statements..................................................................................................................................4-5 Table 4-3 Basic operators.....................................................................................................................................4-5 Table 4-4 String format........................................................................................................................................4-7 Table 4-5 Formats for writing a comment............................................................................................................4-7 Table 4-6 Classification......................................................................................................................................4-12 Table 4-7 Numeric operations............................................................................................................................4-12 Table 4-8 String object methods.........................................................................................................................4-13 Table 4-9 Special Character............................................................................................................................... 4-17 Table 4-10 Rule of escape characters.................................................................................................................4-18 Table 4-11 List object methods..........................................................................................................................4-19 Table 4-12 Operations on dictionary objects......................................................................................................4-20 Table 4-13 Methods about dictionary objects.................................................................................................... 4-21 Table 4-14 Open function description................................................................................................................4-23 Table 4-15 File object methods..........................................................................................................................4-23 Table 5-1 List of NE operation functions.............................................................................................................5-4 Table 5-2 List of the CSV parse functions.........................................................................................................5-29 Table 5-3 List of the XML parse functions........................................................................................................5-32 Table 5-4 MML message parse functions.......................................................................................................... 5-49 Table 5-5 Description of MML message format................................................................................................5-54 Table 5-6 Alarm message parsing function list..................................................................................................5-93 Table 5-7 Description of the Alarm Message Format........................................................................................5-98 Table 5-8 Database operation function list.......................................................................................................5-141 Table 5-9 Description of items in Fmcond.......................................................................................................5-148 Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. xix

Tables

iManager N2000 UMS Element Management System iSStar Table 5-10 Attributes of alarm data records.....................................................................................................5-153 Table 5-11 Description of items of Pmcond.....................................................................................................5-160 Table 5-12 Description of conditions for querying performance data.............................................................5-176 Table 5-13 Description of conditions for querying alarm data.........................................................................5-178 Table 5-14 Items in the list of alarm records....................................................................................................5-186 Table 5-15 Items in the list of alarm records....................................................................................................5-187 Table 5-16 Alarm function list.........................................................................................................................5-201 Table 5-17 OM function list.............................................................................................................................5-203 Table 5-18 List of type conversion functions...................................................................................................5-208 Table 5-19 List of time functions.....................................................................................................................5-215 Table 5-20 List of input and output functions..................................................................................................5-226 Table 5-21 List of GetError functions..............................................................................................................5-235 Table 5-22 Description of error information....................................................................................................5-236 Table 5-23 Description of error level ..............................................................................................................5-236 Table 5-24 List of Network operation functions..............................................................................................5-238 Table 5-25 Report operation function list.........................................................................................................5-253 Table 5-26 Example of Using Conditional Expressions..................................................................................5-268 Table 5-27 Meanings of optional colors...........................................................................................................5-289 Table 5-28 Description of optional font values................................................................................................5-291 Table 5-29 Type Description............................................................................................................................5-292 Table 5-30 List of directory operation functions..............................................................................................5-296 Table 5-31 List of GUI interactive library functions........................................................................................5-308 Table 5-32 GUI interactive library controls.....................................................................................................5-309 Table 5-33 Layout of the controls....................................................................................................................5-310 Table 5-34 Return values..................................................................................................................................5-320 Table 5-35 List of task management functions................................................................................................5-324 Table 5-36 List of assertion functions..............................................................................................................5-328 Table 5-37 List of mail sending functions........................................................................................................5-331 Table 6-1 Description of iSStar Main Window..................................................................................................6-3 Table 6-2 Description of the Application Management window.......................................................................6-7 Table 6-3 Description of iSStar Execute Window.............................................................................................6-9 Table 6-4 Description of iSStar Debug Window..............................................................................................6-12 Table 6-5 Output area.........................................................................................................................................6-12 Table 6-6 Description of iSStar Task Manage Window.................................................................................6-14 Table 6-7 Shortcut buttons.................................................................................................................................6-15 Table 6-8 Basic Parameters................................................................................................................................6-16 Table 6-9 Preset parameters...............................................................................................................................6-17 Table 6-10 Basic Parameters..............................................................................................................................6-19 Table 6-11 Preset parameters.............................................................................................................................6-20

xx

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

1 iSStar Overview

1
About This Chapter

iSStar Overview

Being an enhanced tool component of the N2000 UMS, integrated Script Star (iSStar) is a powerful script secondary development platform. iSStar provides an easy-to-learn programmable script language - High level Script Language (HSL), powerful High-level Foundation Classes (HFC), and an integrated development environment for editing, debugging, and executing the HSL scripts. You can create an HSL script for the repetitive and effortconsuming daily maintenance. In this way, daily maintenance can be performed automatically through iSStar tool. This reduces workload and improves work efficiency. 1.1 Product Features of iSStar iSStar has all the features that a secondary development platform should have. After you understand these features, you will have a basic working knowledge of iSStar. 1.2 Basic Concepts of iSStar iSStar has unique concepts to help you better understand iSStar. The basic concepts of iSStar involve script, script development platform, script application platform, user, and script project. 1.3 iSStar Application Scenarios iSStar is a secondary development platform for users to extend the operation and maintenance of the service functions. Users can perform secondary development in iSStar secondary platform as required. This secondary platform is used where there is need for bulk operations or routine and automatic executions. iSStar is complementary to the N2000 UMS system. 1.4 iSStar Software Structure iSStar is a subsystem of the N2000 UMS. It compliments the architecture design of the N2000 UMS, and is classified into client system and server system. With regards to function modules, iSStar software system is composed of GUI subsystem, executor (descriptor) subsystem, HFC subsystem, ScriptServer subsystem, and service subsystem. 1.5 Basic Functions of iSStar iSStar provides the HSL, an integrated development environment for editing, debugging, and running HSL scripts, and functions of managing script applications and script tasks. 1.6 iSStar Script Sample This section describes an example of querying the CPU load. This sample is provided by iSStar. By studying this sample, you gain a preliminary understanding of the structure and framework of script files and their applications in the business.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 1-1

1 iSStar Overview

iManager N2000 UMS Element Management System iSStar

1.7 iSStar Technical Specifications The iSStar technical specifications are operational environment specifications and performance specifications. The running environment specifications include hardware configuration and software configuration. The performance specifications include number of local tasks simultaneously started, number of timed tasks simultaneously started, and size of the script files. These technical specifications must be met when you use iSStar.

1-2

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

1 iSStar Overview

1.1 Product Features of iSStar


iSStar has all the features that a secondary development platform should have. After you understand these features, you will have a basic working knowledge of iSStar. As a powerful secondary development platform, iSStar has the following features: l iSStar provides powerful script program development capability and can flexibly customize personalized service. iSStar provides an easy-to-learn programmable script language - HSL. The HSL can be used to write multiple kinds of programs because its syntax is based on Python. In addition, the HSL has its own data types and functions and has good control over the MML scripts through compiling. Thus iSStar can help you customize personalized services as required for fast service deployment. l iSStar provides abundant extendable service functions. iSStar provides abundant extendable HSL Foundation Class (HFC). The HFC encapsulates many complex and similar service implementations into functions. To compile a script program in iSStar, you only have to invoke these functions. You can flexibly extend HFC as required. l iSStar provides a comprehensive program debugging mechanism. You can set breakpoints and one-step debugging for the script programs. You can debug the program to check whether it operates properly and can quickly locate problems with the program. l You can compile MML scripts in batches through iSStar. By compiling the MML script program, you can conveniently deliver batch MML commands and can perform batch operations on multiple NEs. l Script tasks can be automatically executed. The script programs support manual immediate execution and timing automatic execution. Tasks that need to be executed in certain time point or periodically executed can be set as timing tasks. The script automatically executes these tasks. l iSStar provides an user-friendly interface. You can follow the wizard to edit, compile, and execute scripts. The result of the script execution is displayed in the monitoring window in real time.

1.2 Basic Concepts of iSStar


iSStar has unique concepts to help you better understand iSStar. The basic concepts of iSStar involve script, script development platform, script application platform, user, and script project. Table 1-1 describes the basic concepts involved in iSStar. Table 1-1 Basic concepts involved in iSStar Basic Concepts Script
Issue 02 (2010-10-10)

Description Programs written in the HSL are used to provide specific service functions.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 1-3

1 iSStar Overview

iManager N2000 UMS Element Management System iSStar

Basic Concepts Script file Script development platform Script application platform Users

Description Indicates the text file written by users in the HSL, saved with .hsl as the extension name. The script is used to implement a specific service function. Indicates the platform for developing service function scripts. The development platform provides the functions of managing projects and editing, debugging, and running scripts. Indicates the platform for applying service function scripts. This platform provides the function of managing applications. Indicates the person who uses iSStar. Users are classified into development users and service users. l Development users Users who compile script files and develop service functions. They often use the script development platform. l Service users Those who are concerned with only the execution of scripts and the implementation of a service function are called service users. Service users often use the application platform. Service users are also called application users.

Script project

Script projects are used by developers for centrally managing scripts with associated functions. A group of script files in the development platform are organized as a project. Each script project corresponds to a script project file. The extension name of a script project file is .dsl. A script project file records the information about scripts and the main file of a script project. The main file is the execution entry for executing and debugging a script project. A script project is the basis for packing. Script application indicates the script application package. A script application is a set of script files that meet specific service requirements, and is a .hsp package file generated from packing of a script project. Through script applications, if the script application does not support the unpacking function, development users can hide the implementation details of the service from service users. Service users need not care about the implementation details of the service, but only care about the service operation and related functions. Script applications are classified into local script applications and remote script applications. Local script application files are stored and run in the client. Remote script application files are stored and run in the server.

Script application

Packing

Packing is a process for combining all the files in a project into a script application package. When packing, if you choose not to support the unpacking function, the implementation details of the service are hidden from the service users. In iSStar, the tab page of the script application platform interface is called workspace. You can create workspaces and create script applications in the workspaces.

Workstation

1-4

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

1 iSStar Overview

Basic Concepts Script application bookmark Script task

Description A script application bookmark is related to a script application program and is the execution entry of the script application program. The bookmark is represented as an icon in iSStar platform. A script task is a process for executing related script files. A script task corresponds to an execution of a script file (or script application). Service functions are implemented through the execution of script tasks. Script tasks are classified into immediate tasks and timing tasks by the time of execution. Script tasks are classified into local tasks and remote tasks by the location of the execution. You can save and perform a local task on a local computer. You can save and perform a remote task on the server that is connected to the current client. iSStar has the feature of multiple tasks and a thread. iSStar supports the concurrent execution of multiple tasks. A task can have only one thread (that is, multiple threads are not supported). During the execution of a task, the task can only interact with one NE at one time.

1.3 iSStar Application Scenarios


iSStar is a secondary development platform for users to extend the operation and maintenance of the service functions. Users can perform secondary development in iSStar secondary platform as required. This secondary platform is used where there is need for bulk operations or routine and automatic executions. iSStar is complementary to the N2000 UMS system.

Background
Carrier's OM personnel often face the following problems and challenges during their work: l The functions provided by the network management system fail to meet the carrier's requirements for personalized operation and maintenance. The operation and maintenance service functions of the network management system provided by the equipment vendor are general functions that meet most carriers' requirements in most OM scenarios and are tailored to the customers' usage habits. When a carrier has a personalized and unique OM requirement, the equipment vendor fails to respond quickly to meet the customer's requirement due to the limits of software development period and version release period. l Expansion of the network scale leads to drastic increases in OM workload. With the business development, the network size expands quickly and the maintenance workload increases accordingly. Operations on NEs one-by-one cannot meet the challenge. You can deliver batch instructions to multiple NEs. Implementing a service function can help improve the OM efficiency. l Too many manual routine maintenance operations should be performed and some operations are duplicated. Some routine important work, such as routine check and data statistic analysis are repetitive manual operations. They are time-consuming and inefficient.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 1-5

1 iSStar Overview

iManager N2000 UMS Element Management System iSStar

To solve the preceding problems, Huawei provides iSStar as a secondary development platform for expanding the OM service function. Users can compile some OM-related script programs according to the actual situation, and process the work in batches according to the preset processing flow to substitute daily maintenance work and improve the maintenance efficiency.

Typical Application Scenarios


Script programs enable you to perform the operations on the NEs in batches. They can be executed manually or automatically through timing tasks. For example, you can use iSStar to perform the tasks such as routine check, real-time monitoring, office data creation, and bulk configuration data delivery.

Routine Check
l l Target users: Staff in the OM team and the monitoring team Scenario description Routine check is a common task in daily OM. You need to check the key operation state or network parameters of the devices on the existing network. Then, you can identify whether the device is operating properly and can detect the potential or existing faults. By compiling iSStar script program, you can send MML commands to the corresponding NEs to check the operational state of the devices. The generated check report summarizes and lists the exceptions. l Reference <Installation directory on the N2000 UMS client>\script\samples\***\***.hsl

Real-Time Monitoring
l l Target users: Staff in the monitoring team Scenario Description You can write an iSStar script about the network monitoring tasks that are required every day. By irregularly executing or periodically executing the script with a short interval, iSStar notifies the operators of the exceptions through alarms or exceptional files. Though not recommended, the scripts can also be executed circularly. In this way, OM engineers can obtain the information about the network in real time.
NOTE

The real-time network monitoring provided by iSStar supplements the alarm module on the N2000 UMS. Compared with the alarm module, the monitoring program written by iSStar is used for specific purposes.

Data Creation
l l Target users: Softswitch equipment maintenance personnel Scenario Description During the maintenance of softswitch devices, data is frequently modified and created. You can compile iSStar script programs to automatically generate the data about the analysis of prefixes, global titles (GTs), and international roaming on multiple NEs.
1-6 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

1 iSStar Overview

Batch Configuration Data Delivery


l l Target users: Staff in the configuration team Scenario Description If you need to modify the data of multiple NEs, you can compile a script based on the service logic. Multiple NEs can execute the script concurrently or sequentially, and then export the related information as required.

Analysis of Performance and Alarm Data


l l Target users: Staff in the professional maintenance team Scenario Description You can compile iSStar scripts to extract data from the performance and alarm databases. The extracted data can serve as the input data source for the analyzer of a third party. It can also be used for statistical analysis to generate a report.

1.4 iSStar Software Structure


iSStar is a subsystem of the N2000 UMS. It compliments the architecture design of the N2000 UMS, and is classified into client system and server system. With regards to function modules, iSStar software system is composed of GUI subsystem, executor (descriptor) subsystem, HFC subsystem, ScriptServer subsystem, and service subsystem. The client focuses on compiling and debugging scripts, while the server focuses on running and scheduling tasks. Figure 1-1 shows the system deployment of iSStar. Figure 1-1 iSStar system deployment

The functions of each subsystem are as follows: l GUI subsystem: consists of development platform and application platform. The development platform is used to compile and edit scripts and focuses on compiling and
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 1-7

Issue 02 (2010-10-10)

1 iSStar Overview

iManager N2000 UMS Element Management System iSStar

development. The application platform provides a function that uses the services through script application and focuses on management and interaction. l l l l Executor (descriptor) subsystem: parses scripts and executes and controls tasks. HFC subsystem: provides a group of encapsulated service functions for script developers. ScriptServer subsystem: schedules and executes remote tasks. Service subsystem: provides a group of service scripts and script project packages for users.

1.5 Basic Functions of iSStar


iSStar provides the HSL, an integrated development environment for editing, debugging, and running HSL scripts, and functions of managing script applications and script tasks. The functions of the iSStar are as follows. l HSL Language The High-level Script Language (HSL) is an easy-to-learn and powerful script language provided by iSStar. The features of the HSL are simple and efficient syntax, abundant data types, and efficient and extendable library functions. For details, see 4.1 Introduction to the HSL Language. l Script management iSStar provides script management function, such as, operating script files, editing and debugging scripts. For details, see 6.3 Interface Description: Script Running Window and 6.4 Interface Description: Script Debugging Window. l Script Task Management When you execute a script file, script project, or script application to implement a specific service function, iSStar creates a task. You can view the basic information and execution of all the local tasks and remote tasks of the system in iSStar Task Manage Window and can control the execution of the tasks. For details, see 6.5 Interface Description: Task Management Window. The task management of the iSStar is characteristic of single thread and multiple tasks, that is, the iSStar can run multiple tasks at one time but only one execution sequence exists in one task. l Script Application Management For users who are only concerned with executing scripts to provide a service function, they can directly use Application Management provided by iSStar. Users can manage the script application through Application Management without having to have special knowledge about implementation details of the script. For details, see 6.2 Interface Description: Application Management Window.

1.6 iSStar Script Sample


This section describes an example of querying the CPU load. This sample is provided by iSStar. By studying this sample, you gain a preliminary understanding of the structure and framework of script files and their applications in the business.

Script Content
iSStar provides a sample of querying CPU load. The path is <N2000 UMS client installation directory>\script\samples\en\DailyCheck\. The content is as follows:
1-8 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

1 iSStar Overview

####################################--Parameter Setting-begin-#################################### SampleMML1 = ''' +++ MTS-U 1.0 2008-01-16 10:15:13+08:00 O&M #131083 %%/*126769*/DSP CPUR: LT=MN;%% RETCODE = 0 Operation succeeded CPU Performance --------------- Module number Board Type FrameNo SlotNo CPU rate CPU status 2 WSMU 0 8 36% Normal 3 WSMU 1 8 25% Normal 4 WSMU 2 8 25% Normal 5 WSMU 3 8 15% Normal 22 WCSU 0 1 16% Normal 23 WCCU 0 3 6% Normal 24 WCCU 0 5 56% Normal 25 WCSU 1 0 26% Normal 26 WCCU 1 2 6% Normal 27 WCCU 1 5 6% Normal 28 WCSU 2 1 16% Normal 29 WCCU 2 2 17% Normal 30 WCCU 2 5 16% Normal 31 WCSU 3 0 26% Normal 32 WCCU 3 3 46% Normal 33 WCCU 3 5 36% Normal (Number of results = 16) --END ''' SampleMML2 = ''' DSP FAN: FN=0; CQSSA1 +++ MTS-U 1.0 2007-08-21 11:09:12 O&M #684194 %%/*1160460*/DSP FAN: FN=0;%% RETCODE = 0 Operation succeeded FAN Information --------------- Hardware PCB version = 0 Software version = 200 FAN temperature (in Celsius) = 29 FAN speed = Low speed Communication status = Normal Read Temperature Sensor status = Normal FAN Block status = Normal OverHeat status = Normal FAN Unsteadily status = Normal --END ''' # COLUMN_NAMES =['Module number','board type','frame number','slot number','CPU usage','CPU status'] # TITLE = 'Routine check sample' # Colwidths= [1,2,2,2,2,2] ####################################--Parameter Setting-end-#################################### ####################################--Function definition-begin-#################################### #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #^ Main function of the program, responsible for basic logic of the program. #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ def Main() # Variable initialized NEName = 'MSCServer1' Row = 0 ExpDataSet = [] # Send MML commands to NEs and parse messages to obtain the required data Print('Begin checking NEs. Please wait......') #In practice, invoke ConnectNE function to connect to NE #ConnectNE(NEName) ReportList,MMLCmd = ExecMMLCmd() # Determine the message result exception information for RowValue in ReportList Row = Row + 1 ExpColumns = CheckValue(RowValue) for Col in ExpColumns ExpInfoLst = [ NEName, MMLCmd, COLUMN_NAMES[Col]+': '+RowValue [Col], Row, Col ] ExpDataSet.append(ExpInfoLst) # Print exception information, FormatList function is used to convert List to character string Print("exception information: " +

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

1-9

1 iSStar Overview

iManager N2000 UMS Element Management System iSStar


FormatList(ExpInfoLst[:-2])) end end # Generate Excel report NewReport() SheetID = AddSheet(TITLE) TableID = writeReport(SheetID, TITLE, COLUMN_NAMES, ReportList, Colwidths) # Exception information is displayed in orange for i in range(len (ExpDataSet)) SetCellBGColor(TableID, ExpDataSet[i][-2], ExpDataSet[i] [-1], 17) end # Save Excel report. If the suffix xls is changed to html, HTML report is generated. RepOutputFile = "C:/Routine check report sample.xls" SaveReportAs(RepOutputFile) Print('Finish checking NE. Report outputted to : %s' %RepOutputFile) end #MML command execution and message parsing function def ExecMMLCmd() # Send MML command to NE to obtain messages. Being restricted by the running environment, we use constant instead. ''' @DSP CPUR:; mml = GetMMLReport () ''' mml = SampleMML1 p = ParseMMLRpt(mml) # If MML command does not execute successfully, the system prompts error and does not continue processing if not p or GetResultCode(p) != '0' Print('executing command %s fails. Reason: %s' %(GetMMLCmd(p), GetResultCause(p)) ) return [],'' end # If MML report has no corresponding entry information, the system prompts error and does not continue processing if GetObjNum(p) < 1 Print ('No proper entry information found') return [],'' end # Get some columns as required DataList = getColsByIdx(p,0, [0,1,2,3,4,5]) #Obtain the current MML command character string MMLCmd = GetMMLCmd (p) return DataList,MMLCmd end #Exception judging function def CheckValue(OneRow) RetLst = [] #Judge whether the value of a row in the report is exceptional , OneRow [4] means "CPU usage" OneRow[5] means "CPU status" if int(OneRow[4][:-1]) > 30 RetLst.append(4) end if OneRow[5] != 'normal' RetLst.append(5) end return RetLst end #~~~~~~~~~~~~~~~~~~~~~General function definition~~~~~~~~~~~~~~~~~~~~~ # Create a table in Excel and write data def writeTable (sheetID,tablename,row,col,header,datalst) if row < 0 or col < 0 return 0 end tableID= AddTable(sheetID,row+1,col,tablename) SetTableValue(tableID, header + datalst) SetTableTitleFont(tableID,8,10,0,1) SetTableFont(tableID,8,10,0,0) for i in range(col) SetCellBGColor(tableID,0,i,20) end return tableID end # Set column width def setColWidthList(sheetID,widths) for col in range (len(widths)) SetColumnWidth(sheetID,col,widths[col]) end end # Write data to Excel report def writeReport(sheetID, tablename, header, dataset, colwidths=[]) col = len(header) row = len(dataset) datalst = [] for item in dataset datalst.extend(item) end #row = len (datalst)/col tableID = writeTable(sheetID,tablename,row,col,header,datalst) if colwidths setColWidthList(sheetID,colwidths) end return tableID end # Get the values of some columns of the MML report def getColsByIdx(p,

1-10

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


obj=0, attridxs=[]) cols = []

1 iSStar Overview

#Get specified row of the MML report row = GetRecordNum(p,obj) col = GetAttrNum(p, obj) if attridxs==[] attridxs = range(col) end for i in range(row) onecol = [] for j in attridxs if j > col value = NULL_VALUE else value = GetAttrValueByIdx(p,obj,j,i) end onecol.append(value) end cols.append(onecol) end return cols end #Format list type and output the data. Convert to character string def FormatList(datalst, sep=',' ) content = '' for data in datalst if content content += sep + str(data) else content += str(data) end end return content end ####################################--Function definition-end-#################################### ####################################--Program execution-begin-#################################### Main()

Script Function and Basic Principle


The script is used to implement a specific service function. The basic function of CPU load query script is to obtain the CPU load information, generate check report, and help maintenance personnel to check some important running states or network parameters of the existing network equipment to determine whether the equipment is operating normally. The basic principle is that by sending MML command to NEs to obtain messages that include the CPU load information, you can analyze the returned messages for exception information and make a judgment depending on the actual exception.

Script File Structure


When a lot of complex functions must be implemented by the services, you can classify services into sub services and define these services as functions. The script organization is clear and you can read, write, modify, and conveniently maintain scripts. The CPU load query script is made up of eight Self-defined functions and multiple HFC library functions. For details of each function, see the script content. Table 1-2 lists the functions. Table 1-2 List of self-defined functions of CPU load query script Function Main function Description The main function of the script is the execution entry of the script and is responsible for organizing other functions and for controlling the execution flow of the script. This function is used to send MML messages and obtain CPU load information. Principle The main function invokes other self-defined functions and HFC library functions to provide control of the execution flow of the script.

ExecMMLCmd function

Analyzes the message by invoking section 5.4.3 Function: ParseMMLRpt, section 5.4.11 Function: GetResultCode, and section 5.4.12 Function: GetResultCause.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

1-11

1 iSStar Overview

iManager N2000 UMS Element Management System iSStar

Function CheckValue function

Description This function is used to analyze the exception and get CPU usage that is larger than 30 and the CPUs whose state is exceptional. This function is used to create a new table in the Excel table, write data, and set the display style of the table.

Principle This function analyzes the values the list items. For knowledge about list, see 4.3.4 List. The function invokes 5.14.3.3 Function: AddTable, 5.14.3.12 Function: SetTableValue, 5.14.4.11 Function: SetTableTitleFont, 5.14.4.10 Function: SetTableFont, and 5.14.4.3 Function: SetCellBGColor. The function invokes 5.14.4.5 Function: SetColumnWidth. This function invokes the writeTable function and setColWidthList function. This function invokes 5.4.15 Function: GetRecordNum, 5.4.20 Function: GetAttrNum, and 5.4.18 Function: GetAttrValueByIdx. The function invokes HSL built-in function str to implement data conversion.

writeTable function

setColWidthList function

This function is used to set the column width of the table file. Write data to Excel report file and set the display style of the report. This function is invoked by ExecMMLCmd function and is used to get the data of some columns.

writeReport function

getColsByIdx function

FormatList function

This function is used to convert List type to character string.

1.7 iSStar Technical Specifications


The iSStar technical specifications are operational environment specifications and performance specifications. The running environment specifications include hardware configuration and software configuration. The performance specifications include number of local tasks simultaneously started, number of timed tasks simultaneously started, and size of the script files. These technical specifications must be met when you use iSStar.

Operational Environment Specifications


Table 1-3 shows the running environment specifications needed by iSStar.

1-12

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

1 iSStar Overview

Table 1-3 iSStar running environment specifications Item Hardware Configuration Software configuration Configuration Requirement PCs working under the Windows operating system l Server: Solaris8 or Solaris10 l Client: Microsoft Windows 2000 Professional Service Pack 4 or higher versions and Microsoft Windows XP Professional Service Pack 1 or higher versions

Performance Specifications
Table 1-4 shows the performance specifications of iSStar. Table 1-4 Performance specifications of iSStar Item Number of local tasks simultaneously started in a GUI Number of debugging tasks included Number of timed tasks simultaneously started on N2000 UMS Server Number of script files simultaneously opened on the GUI Size of a single script file Number of workstations that can be created Number of bookmarks that can be created in a workstation Number of lines of a script file Range <= 50 <= 1 <= 500 <= 100 <= 1 MB <= 10 <= 70 <= 99999

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

1-13

iManager N2000 UMS Element Management System iSStar

2 iSStar Management

2
About This Chapter

iSStar Management

This chapter describes iSStar file system, log information, process service information, and rights required for iSStar operations. 2.1 iSStar File System This section describes the file system of the iSStar client. The file system stores the file information that is read and exported during iSStar execution. 2.2 iSStar Log Data iSStar log records all operations and iSStar running states to use to locate problems. 2.3 iSStar Process and Service When the N2000 UMS is operating properly, the server starts the scriptserver_agent process related to iSStar. The scriptserver_agent process provides ScriptServer service. The functions of iSStar are available only when scriptserver_agent is operating properly. You can view the service state of the N2000 UMS system to know the running state of the process. 2.4 iSStar User Authority Setting Because iSStar is an enhanced component of the N2000 UMS, it is under license control and security management of the N2000 UMS. To use the functions provided by iSStar, you need to set rights for the iSStar users on the N2000 UMS.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

2-1

2 iSStar Management

iManager N2000 UMS Element Management System iSStar

2.1 iSStar File System


This section describes the file system of the iSStar client. The file system stores the file information that is read and exported during iSStar execution. The iSStar client installation package is integrated into the N2000 UMS client installation package. The iSStar client is installed together with the N2000 UMS client. After being installed, two iSStar versions, that is, online and offline versions, are available in the system. Their differences are as follows: l Their start modes are different. The online iSStar is integrated into the N2000 UMS client software. To start the online iSStar, you need to start the N2000 UMS client software, and then choose Maintenance > iSStar > Development Platform on the N2000 UMS client. To start the offline iSStar, you need to choose Start > All Programs > iManager N2000 Client > iSStar Tool (Offline), or run <N2000 UMS client installation directory> \script\Run_iScript.bat. l Their dependences on the N2000 UMS client are different. You need to log in to the N2000 UMS client to use the online iSStar. You do not need to log in to the N2000 UMS to use the offline iSStar. l Their functions are different. The online iSStar provides all the functions of iSStar, including creating script application, interacting with NEs, and sending MML commands. The offline iSStar does not provide functions of creating script application, interacting with NEs, and sending MML commands. Table 2-1 shows the directory structure related to iSStar. Table 2-1 Directory structure of iSStar Directory N2000 UMS client installation directory Description Installation directory of the N2000 UMS client software, C:\iManager N2000 Client by default. Directory for storing executable files. The related files of the iSStar script descriptor, such as python24.dll are saved in the directory. Directory for storing the start program of the N2000 UMS client. Directory for storing script samples. Directory for storing configuration files.

N2000 UMS client installation directory \client

N2000 UMS client installation directory \client\bin N2000 UMS client installation directory \script\samples N2000 UMS client installation directory \script\config

2-2

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

2 iSStar Management

Directory N2000 UMS client installation directory \script\output N2000 UMS client installation directory \script\tracefile

Description Default directory for storing output information during the iSStar execution. Directory for storing trace files. Some information generated during iSStar execution is stored in this directory.

2.2 iSStar Log Data


iSStar log records all operations and iSStar running states to use to locate problems. Because iSStar is an enhanced component of the N2000 UMS, the N2000 UMS manages iSStar logs and monitors iSStar uniformly. iSStar log data is classified into two types: l Operation logs: All the operations during the use of iSStar are recorded in the operation log of the N2000 UMS network management system. You can view the operation log of the N2000 UMS network management to know your operations and other people's operations. For details about viewing the operation log, see Log Management. trace file: The running information of the N2000 UMS system, including iSStar, is stored in N2000 UMS client installation directory\script\tracefile. You can view this file to determine the running state of iSStar.

2.3 iSStar Process and Service


When the N2000 UMS is operating properly, the server starts the scriptserver_agent process related to iSStar. The scriptserver_agent process provides ScriptServer service. The functions of iSStar are available only when scriptserver_agent is operating properly. You can view the service state of the N2000 UMS system to know the running state of the process.

scriptserver_agent Process
When N2000 UMS is operating properly, the server starts related processes of N2000 UMS, each of which includes different services and provides different functions. The process that is related to iSStar is scriptserver_agent. The scriptserver_agent process provides the ScriptService service. ScriptService provide script timing and NEs access from script. The scheduled task management of iSStar and access to the NEs are normal only when the scriptserver_agent process and the ScriptServer service are normal.

Controlling the scriptserver_agent process


You can know the running state of the scriptserver_agent process through one of the following methods: l GUI 1. Choose Monitor > System Monitor > Monitor Browser. The System Monitor Browser window is displayed.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 2-3

Issue 02 (2010-10-10)

2 iSStar Management

iManager N2000 UMS Element Management System iSStar

2.

Click Service Monitor. If the scriptserver_agent process is listed on the tab page and its status is Running, you can infer that the scriptserver_agent process runs properly. Go to the installation directory of the N2000 UMS. The default installation directory is /opt/OMC. -bash-3.00$ cd /opt/OMC Run the following command: -bash-3.00$ . ./svc_profile.sh -bash-3.00$ svc_adm -cmd status
Host: DEFAULTSYSAGENT Service Agent: 3gpp_agent [1 service(s)] pid: 24278 3GPPAgent [running ] Service Agent: 3rdTool_agent [1 service(s)] pid: 24284 3rdToolService [running ] Service Agent: am_agent [1 service(s)] pid: 24280 AMServer [running Service Agent: chr_agent [1 service(s)] pid: 24286 CHRService [running Service Agent: cmdc_agent [1 service(s)] pid: 3113 CmDcService [running ] ] ]

Command line 1.

2.

Service Agent: cmserver_agent [1 service(s)] pid: 24282 CMServer [running ] Service Agent: devdoc_agent [1 service(s)] pid: 24290 DevDocService [running ] Service Agent: em_agent [1 service(s)] pid: 24292 EventService [running ]

Service Agent: fmexport_agent [1 service(s)] pid: 24296 FaultExportService [running ] Service Agent: fmnotify_agent [1 service(s)] pid: 24294 FMNotify [running ] Service Agent: ifms_agent [1 service(s)] pid: 24304 FaultService [running ] Service Agent: irp_agent [1 service(s)] pid: 24307 IRPService [running ]

Service Agent: itmserver_agent [1 service(s)] pid: 24309 ITMServer [running ] Service Agent: log_agent [1 service(s)] pid: 24329 LogService [running ]

Service Agent: maintain_agent [1 service(s)] pid: 24355 MaintenanceService [running ] Service Agent: manager_agent [1 service(s)] pid: 24556 SystemService [running ] Service Agent: mml_agent [1 service(s)] pid: 24339 MMLAgent [running ]

2-4

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

2 iSStar Management

Service Agent: mmlproxyserver_agent [1 service(s)] pid: 1334 MMLProxyServer [running ] Service Agent: monitor_agent [1 service(s)] pid: 24367 MonitorService [running ] Service Agent: neuser_agent [1 service(s)] pid: 24400 NeUserService [running ] Service Agent: nimserver_agent [1 service(s)] pid: 3485 NIMServer [running ] Service Agent: nms_mml_agent [1 service(s)] pid: 24392 NMSMMLServer [running ] Service Agent: notify_agent [1 service(s)] pid: 25379 RemoteNotifyService [running ] Service Agent: objgrp_agent [1 service(s)] pid: 24407 ObjGrpService [running ] Service Agent: omcne_agent [1 service(s)] pid: 24403 OMCNEService [running ] Service Agent: partition_agent [1 service(s)] pid: 24444 PartitionService [running ] Service Agent: pm_agent [1 service(s)] pid: 24432 PMService [running ]

Service Agent: pmexp_agent [1 service(s)] pid: 24424 PMExport [running ] Service Agent: pmmon_agent [1 service(s)] pid: 24427 PMMonService [running ] Service Agent: proxy_agent [1 service(s)] pid: 24447 ProxyServer [running ] Service Agent: sac_agent [1 service(s)] pid: 24314 LicenseService [running ]

Service Agent: scriptserver_agent [1 service(s)] pid: 24468 ScriptServer [running ] Service Agent: sm_agent [1 service(s)] pid: 24491 SecurityService [running ]

Service Agent: snmp_agent [1 service(s)] pid: 24513 SnmpAgent [running ] Service Agent: sumdata_agent [1 service(s)] pid: 6456 SumDataService [running ] Service Agent: sumreport_agent [1 service(s)] pid: 24544 SumReportService [running ] Service Agent: swm_agent [1 service(s)] pid: 24450 SWMService [running ]

Service Agent: threshold_agent [1 service(s)] pid: 24571 ThresholdService [running ] Service Agent: tm_agent [1 service(s)] pid: 24627 TopoService [running [All Services: 39 ] [Running: 39 ] [Not Running: 0 ] ]

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

2-5

2 iSStar Management

iManager N2000 UMS Element Management System iSStar

If the system displays the following information, then the scriptserver_agent process operates properly. Otherwise the process is not normal.
Service Agent: scriptserver_agent [1 service(s)] pid: 24468 CmeServer [running ]

If the scriptserver_agent process does not run normally, you can start scriptserver_agent using the following method: 1. Go to the installation directory of the N2000 UMS. The default installation directory is / opt/OMC. -bash-3.00$ cd /opt/OMC 2. Run the following command: # . ./svc_profile.sh # svc_adm -cmd start ScriptServer

2.4 iSStar User Authority Setting


Because iSStar is an enhanced component of the N2000 UMS, it is under license control and security management of the N2000 UMS. To use the functions provided by iSStar, you need to set rights for the iSStar users on the N2000 UMS.

iSStar User Right List


Table 2-2 shows the rights for iSStar operations. Table 2-2 iSStar User Right List Object Network Management Application Operation Local operations Description With this right, you can perform the following operations: l Running scripts l Debugging scripts l Running script projects l Debugging a script projects l Running script project packages l Packing script projects l Creating script applications l Running script applications l Releasing script applications Network Management Application Scheduled task operations With this right, you can perform the following operations: Creating scheduled tasks

2-6

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

2 iSStar Management

Setting iSStar User Rights


To set the iSStar user rights, perform the following operations: 1. 2. 3. 4. 5. Choose Security > Security Management. In the Security Management window, expand the User node in the Security Management navigation tree, and then select the user whose rights you want to set. In the right pane of the window, click the Operation Rights tab. On the Operation Rights tab page, click Select. In the Select Operation Rights dialog box, select the required Authorization Objects and Operation. l Authorization Objects: Network Management Application. l Operation: Choose Operation > System Operation > iSStar Tool, and then add all the operations under iSStar Tool to Selected Rights. 6. Click OK.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

2-7

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

3
About This Chapter

iSStar Operation

This chapter describes the operation procedure of iSStar and how to use iSStar to develop, manage, or use scripts. 3.1 iSStar Operation Procedure iSStar operation procedure consists of script development procedure and script application procedure. Understanding and complying with these procedures can improve the efficiencies of script development and service deployment. 3.2 Developing Scripts Script development is a process for developing scripts and implementing specific services on the iSStar development platform by using the HSL and HFC library functions. The development involves creating new script files, testing script files, creating script projects, and packing scripts into script applications. 3.3 Using Scripts iSStar provides script files, script projects, and script applications to implement multiple service functions, to meet different usage requirements, and to facilitate service deployment. 3.4 Managing Scripts This section describes how to view the script application information, release and download script application, delete unnecessary script application, and manage script application bookmark through iSStar.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

3-1

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

3.1 iSStar Operation Procedure


iSStar operation procedure consists of script development procedure and script application procedure. Understanding and complying with these procedures can improve the efficiencies of script development and service deployment.

Script Development Procedure


As a script developer, you must comply with the specified development procedure when developing scripts. In this way, your development efficiency is greatly improved. Figure 3-1 shows the recommended script development procedure. Figure 3-1 Progress for developing scripts

The progress is as follows: 1. Analyze services Analyze services, know the specific requirements of the services, determine the functions and performance to be provided by the service scripts, determine implementation principles and implementation methods. On this basis, determine the script structure and data structure and algorithms to be used. 2. Run the script development platform Choose Maintenance > iSStar > Development Platform from the main menu. iSStar Main Window is displayed. You can manage scripts on iSStar Main Window. 3. Create and edit script files You can edit script files by using the HSL, for example, copy, cut, paste, find, replace, print, undo, redo, locate line number, and set shortcuts.
3-2 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

4.

Debug script files For created script files, you can debug and verify the functions.

Script Application Procedure


As script application personnel, you should focus on the services provided by scripts instead of the service implementation details. You can use the scripts through the following methods: l Scripts If a service is implemented through scripts, you can run the scripts in iSStar Main Window. For details , see 3.3.2 Running a Script File. l Script projects If the service functions are complex and organized as projects, you can run the script projects in iSStar Main Window. For details, see 3.3.3 Running a Script Project. l Script applications If the services are packed into a script project package, see Figure 3-2 for the operation procedure. Figure 3-2 Script Application Operation Flow Chart

The progress is as follows: 1. Obtain the script application package. Multiple methods can be used for obtaining the project package, for example: Packing the existing script projects into a script project package. Downloading the data from the server. For details, see 3.4.2 Downloading a Script Application to the Local Terminal. 2.
Issue 02 (2010-10-10)

Create script applications.


Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 3-3

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

On the Application Management window, create a script application bookmark. For details, see 3.2.5 Creating a Script Application. 3. Running a Script Application On the Application Management window, run the application programs. For details, see 3.3.4 Running a Script Application.
NOTE

l For some applications, you need to select the NEs before running the applications. l You can view the script task states and terminate script tasks on iSStar Task Manage Window. For details, see 3.3.6.1 Viewing the Script Task States and 3.3.6.4 Stopping a Script Task.

4.

View the result You can view the results on iSStar Execute Window.

3.2 Developing Scripts


Script development is a process for developing scripts and implementing specific services on the iSStar development platform by using the HSL and HFC library functions. The development involves creating new script files, testing script files, creating script projects, and packing scripts into script applications. 3.2.1 Creating a Script File A script file is the carrier for service functions. You can create script files and compile scripts to provide specific service functions. 3.2.2 Debugging a Script File iSStar provides a powerful script debugging function and supports step over, step into, step out, and set breakpoints. In this way, you can quickly locate the faults in the script to greatly improve the script development efficiency and ensure the correctness of the script. 3.2.3 Creating a Script Project If a task involves multiple scripts, you can organize multiple script files into a project. You can create a script project and add scripts to the new project to manage multiple scripts. 3.2.4 Debugging a Script Project You can debug a script project to find errors of the scripts. 3.2.5 Creating a Script Application An application is an aggregation of scripts that meet the requirements of specific services. Through the application, you only need to be concerned with the operation results rather than the implementation details. The iSStar can create applications and use bookmarks as an entry to the applications. Script applications are categorized into local script applications and remote script applications.

3.2.1 Creating a Script File


A script file is the carrier for service functions. You can create script files and compile scripts to provide specific service functions.

Context
A maximum of 100 files are displayed in the iSStar Main Window. The new script file is named untitled-number.hsl, where the number increments from 1. For example, the first file name is untitled-1.hsl, and the second file name is untitled-2.hsl.
3-4 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

Procedure
Step 1 Choose Maintenance > iSStar > Development Platform from the main menu. The iSStar Main Window is displayed. Step 2 Click . Otherwise, right-click the tab bar of the script editing area, and then choose New.

Step 3 Compile a script in the script editing area. You can edit the script as required during the script compiling. Operation Name Cut Operation Method

Select the text to be cut, and then cut the selected text in one of the following three ways: l Click in the iSStar Main Window.

l Press Ctrl+X. l Right-click the text to be cut, and then choose Cut. Copy Select the text to be copied and copy the selected text in one of the following three ways: l Click in the iSStar Main Window.

l Press Ctrl+C. l Right-click the text to be copied, and then choose Copy. Paste Position the cursor at the place where you plan to paste. Paste the text in one of the following three ways: l Click in the iSStar Main Window.

l Press Ctrl+V. l Right-click and choose Paste.


CAUTION l You can perform the pasting operation only in the script editing area of iSStar Main Window. l If the pasted text exceeds 1 MB, the system displays the following message: After you insert the text, the size of the file exceeding 1 MB. Thus, text inserting fails. l If the pasted text exceeds 99999 lines, the system displays the following message: After you insert the text, the file contains more than 99999 lines. Thus, text inserting fails.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

3-5

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

Operation Name Find

Operation Method

Find a specific string in the current script files. You can choose either of the following two methods: l Right-click the script editing area, and then choose Find. l Press Ctrl+F.
NOTE l Cyclic find all is supported. l You cannot enter the new-line character. l The tool does not support inter-file search and wildcard search. l You can enter a maximum of 128 characters in the Find What text box of the Find dialog box.

Replace

Replace character strings. You can choose either of the following two methods: l Right-click the script editing area, and then choose Replace. l Press Ctrl+R.
NOTE l Cyclic replace all is supported. l You cannot enter the new-line character. l The tool does not support inter-file replace and wildcard find and replace. l You can enter a maximum of 128 characters in the Find What text box of the Replace dialog box.

Undo

Undo a previous operation in one of the following two ways: l Right-click the script editing area, and then choose Undo. l Press Ctrl+Z.
NOTE Only the last 100 operations can be undone.

Redo

Redo the undo operation in one of the following two ways: l Right-click the script editing area, and then choose Redo. l Press Ctrl+Y.
NOTE The number of redo operations is equal to that of undo operations.

Go to Line

Enter a line number to position the cursor at the specified line. You can choose either of the following two methods: l Right-click the gray area on the left part of the script editing area, and then choose Go to Line. l Press Ctrl+G.
NOTE The number that you can enter is from 1 to 99999.

3-6

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

Operation Name Add/Remove Bookmark

Operation Method

You can use a bookmark to implement the skipping inside a file; thus facilitating your positioning of the script file. You can choose either of the following two methods: l Right-click the gray area on the left part of the script editing area, and then choose Add/Remove Bookmark. l Press Ctrl+F2.
NOTE l If the current line is not marked, a bookmark is added. l If the current line is marked, the bookmark is deleted. l You can set a maximum of 32 bookmarks for one script file. l The bookmarks are not saved after the file is closed.

To Next Bookmark To Previous Bookmark Remove All Bookmarks

Right-click the gray area on the left part of the script editing area, and then choose To Next Bookmark. Otherwise, press Shift+F2. Right-click the gray area on the left part of the script editing area, and then choose To Previous Bookmark. Otherwise, press Alt+F2. Right-click the gray area on the left part of the script editing area, and then choose Remove All Bookmark.

Step 4 Click

. Otherwise, right-click the tab bar of the script editing area, and then choose Save.

Step 5 In the Save As dialog box, specify the path and file name (The file name can only consist of English letters, numbers and _ . ) . Click Save.
NOTE

To save a script file in other name or to other path, click script editing area, and then choose Save As.

. Otherwise, right-click the tab bar of the

----End

3.2.2 Debugging a Script File


iSStar provides a powerful script debugging function and supports step over, step into, step out, and set breakpoints. In this way, you can quickly locate the faults in the script to greatly improve the script development efficiency and ensure the correctness of the script.

Prerequisite
l l l You are authorized to operate scripts. A script file is already compiled. There is no debugging task.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

3-7

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

Context
When you start to debug a script, a corresponding debugging task is created in the iSStar Task Manage Window.

CAUTION
If a debugging task already exists, you cannot create a new debugging task. Only after the existing debugging task is deleted, a new debugging task can be created.

Procedure
Step 1 Choose Maintenance > iSStar > Development Platform from the main menu. The iSStar Main Window is displayed. Step 2 Click . Otherwise, right-click the tab bar in the edit area, and then choose Open.

Step 3 In the Open dialog box, select the script file to be debugged, and then click Open. Step 4 If the script file contains the MML commands used for interaction with the NE but the N2000 UMS has not accessed the NE, you can click the interaction. to configure a virtual NE that is used to simulate

l Enable or disable the virtual NE debugging mode: Select or deselect Use the virtual NE debugging mode as required. l Create a virtual NE. 1. 2. 3. Click .

On the right pane of this virtual NE, set NE name, NE state, NE IP address, NE type, NE version, and NE FDN. Configure an MML command as required. Create an MML command: Click New. In the dialog box titled the virtual NE name, set Virtual MML command and Return message of the virtual MML command. Click Confirm. Edit an MML command: In MML command configuration, select an MML command, and then click Edit. In the dialog box titled the virtual NE name, edit Virtual MML command and Return message of the virtual MML command. Click Confirm. Copy an MML command: In MML command configuration, select an MML command, and then click Copy. After copying the MML command, you can edit it. Delete an MML command: In MML command configuration, select one or more MML commands, and then click Delete. In the displayed Confirm dialog box, click Yes.

4.

Click Confirm.

l Copy a virtual NE. 1.


3-8

In the virtual NE list, select a virtual NE, and then click


Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

.
Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

2. 3. 4.

On the right pane of the copied virtual NE, set NE name, NE state, NE IP address, NE type, NE version, and NE FDN. Configure an MML command as required. Click Confirm.

l Delete a virtual NE. 1. 2. 3. Step 5 Click


NOTE

In the virtual NE list, select one or more virtual NEs, and then click In the Confirm dialog box, click Yes. Click Confirm.

. Otherwise, right-click the script editing area, and then choose Debug.

You can right-click the script editing area and choose Check to check grammatical errors in the script and to debug after grammatical errors are removed.

Step 6 In the iSStar Debug Window, you can perform the following operations as required. Operation Name Stop Operation Method Click
NOTE After the debugging is complete, the button is greyed out.

. Otherwise, press Shift+F5.

Step Over

Click
NOTE

. Otherwise, press F6.

l If the next step calls functions or script files, the indicating pointer finally points to the first line of the external function after the internal function is executed. l The button becomes gray if the command is being executed and no execution result is provided.

Step Into

Click
NOTE

. Otherwise, press F7.

l If the next step calls functions or script files, the indicating pointer finally points to the first line of the external function after the internal function is executed. l The button becomes gray if the command is being executed and no execution result is provided.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

3-9

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

Operation Name Step Out

Operation Method Click


NOTE l If the system is executing the internal function, the pointer skips to the next line of the external function. l If you are debugging at the outmost layer of the script file, perform step out and run to the next breakpoint. If there is no breakpoint in the forthcoming lines, proceed until the end of the file.

. Otherwise, press F8.

Add or Remove Breakpoint

You can choose any of the following methods: l Click l Press F9. l Right-click the left gray area of the iSStar Debug Window or iSStar Main Window, and then choose Add/Remove Breakpoint. For details about the iSStar Debug Window, see 6.4 Interface Description: Script Debugging Window. For details about the iSStar Main Window, see 6.1 Interface Description: iSStar Main Window.
CAUTION You can set a maximum of 32 breakpoints for one file. The breakpoints are not saved after the file is closed.

Run to Breakpoint

Click
NOTE

. Otherwise, press F5.

l If you set breakpoints in the script files that are debugged, the indicator jumps from the existing position to the breakpoint position. l If the script file calls functions or other scripts with breakpoints, then the skips to the breakpoint from the beginning of the function pointer or script. A breakpoint is a point indicating the interruption of a running task.

Remove All Breakpoints

You can select any of the following ways: l Click on the toolbar.

l Press Shift+F9. l Right-click in the grey area on the left of the iSStar Debug Window or iSStar Main Window, and choose Remove All Breakpoints on the shortcut menu. For details of the iSStar Debug Window, see 6.4 Interface Description: Script Debugging Window. For details of the iSStar Main Window, see 6.1 Interface Description: iSStar Main Window.

3-10

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

Operation Name Run to current line

Operation Method Right-click a line below the indicating pointer line, and then choose Run to Current Line. Otherwise, press F4.
NOTE l The indicating pointer executed. always point to the next statement to be

l If a breakpoint exists before the current line, the pointer stops at the breakpoint. l If a script has been executed and not reached the current line, the state of iSStar Task Manage Window is updated to Debug Finished. The information on the Watch tab page and Stack tab pages is cleared.

Close iSStar Debug Window,

Click
NOTE

l After the iSStar Debug Window is closed, the debugging task in the iSStar Task Manage Window is deleted. l If you delete the debugging task in the iSStar Task Manage Window, the corresponding iSStar Debug Window is closed.

Add to Watch

You can choose either of the following two methods: l Right-click a variable to be watched in the iSStar Debug Window display area, and then choose Add to Watch. l Right-click the Watch tab page in the iSStar Debug Window, and then choose Add to Watch.
NOTE l A maximum of 32 watch variables can be added. l On the Watch tab page of the iSStar Debug Window, right-click a watch variable to be deleted, and then choose Remove to delete a variable that need not be watched.

Activate the editing window

Click . The iSStar Main Window is displayed. You can modify the currently-debugging script file.
NOTE The modification of the debugging script takes effect at the next start.

Activate task management window

Click . The iSStar Task Manage Window is displayed. You can view the script task of the corresponding script.

----End

3.2.3 Creating a Script Project


If a task involves multiple scripts, you can organize multiple script files into a project. You can create a script project and add scripts to the new project to manage multiple scripts.

Procedure
Step 1 Choose Maintenance > iSStar > Development Platform from the main menu.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 3-11

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

Step 2 Right-click in the project management area of the iSStar Main Window and choose Create Project. Alternatively, click
NOTE

If a project is active in the current window, the Confirm dialog box is displayed. Click Yes to close the project.

Step 3 On the Basic Parameters tab and Preset Parameters tab of the Create Project dialog box, set parameters.
NOTE

l The parameters containing * are mandatory. l The project name can only consist of English letters, numbers and _ .

Step 4 Click Confirm. Step 5 In the navigation tree of the project management area, you can perform the following operation to create a script project. Operation Name Operation Method Create a file In the navigation tree of the project management area, right-click a script project name node, and then choose Create File. The system creates a new script file and adds it to the current project. You can compile a script in the script file to implement the functions that you require. Add files to a project 1. In the navigation tree of the project management area, right-click a script project name node, and then choose Add File to Project. 2. In the Open dialog box, select a script file that you plan to add to the project. Click Open. Set project attributes 1. In the navigation tree of the project management area, right-click a script project name node, and then choose Project Attributes. 2. In the Project Attributes window, set the parameters on the Basic Parameter tab page and Preset Parameter tab page. Click Confirm. Set the main file of In the navigation tree of the project management area, right-click the the script project script file name node which you plan to set as main file, and then choose Set Main File.
NOTE l Main files are the entries of the scripts for project running and debugging. One project has only one main file. l Then the corresponding node is marked with Main File. l The main file of the project must be set. Otherwise, you cannot debug, run, or zip the project.

3-12

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

Operation Name Operation Method 1. In the navigation tree in the project management area, right-click the Remove a script script file to be removed from a project and choose Remove File file from the script From Project. project 2. In the Confirm dialog box, click Yes.
NOTE l The script file node is removed from the navigation tree. l After a script file is removed, only the association between the script file and its project is removed. The script file in the project folder, however, is not removed.

Delete a file

1. In the navigation tree of the project management area, right-click the script file name node which you want to set as main file, and then choose Remove File. 2. In the Confirm dialog box, click Yes.
NOTE Deleting a file removes a script file from the script project and deletes the script file.

Pack a project

1. In the navigation tree in the project management area, choose the project name node that is opened, right-click it and choose Pack Project. Alternatively, click 2. In the Confirm dialog box, if you select Yes the project decompression is supported. If you select No the project decompression is not supported. 3. In the Save dialog box, set the save path and the file name, and then click Save. 4. When a message prompts to tell the packing succeeds, click OK.
NOTE If the script project has not set the main file, the system displays a message, indicating that the script project does not set the main file. Thus, you cannot pack the project. Set the main file of the script project first.

Close a project

In the navigation tree of the project management area, right-click a script project name node, and then choose Close Project. In the navigation tree of the project management area, right-click a script project name node, and then choose Delete Project.

Delete a project

----End

3.2.4 Debugging a Script Project


You can debug a script project to find errors of the scripts.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

3-13

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

Prerequisite
l l l You are authorized to operate scripts. A script project file is already compiled. There is no debugging task.

Context
When you plan to debug a script project, a corresponding debugging task is created in the iSStar Task Manage Window.

CAUTION
If a debugging task already exists, you cannot create a new debugging task. Only after the existing debugging task is deleted, a new debugging task can be created.

Procedure
Step 1 Choose Maintenance > iSStar > Development Platform from the main menu. Step 2 In the iSStar Main Window, click and then choose Open Project. . Otherwise, right-click the project management area,

Step 3 In the Open dialog box, set Project File(*.dsl) as File Type. Select the script project file or project package file to be opened, and then click Open. Step 4 If the script file contains the MML commands used for interaction with the NE but the N2000 UMS has not accessed the NE, you can click the interaction. to configure a virtual NE that is used to simulate

l Enable or disable the virtual NE debugging mode: Select or deselect Use the virtual NE debugging mode as required. l Create a virtual NE. 1. 2. 3. Click .

On the right pane of this virtual NE, set NE name, NE state, NE IP address, NE type, NE version, and NE FDN. Configure an MML command as required. Create an MML command: Click New. In the dialog box titled the virtual NE name, set Virtual MML command and Return message of the virtual MML command. Click Confirm. Edit an MML command: In MML command configuration, select an MML command, and then click Edit. In the dialog box titled the virtual NE name, edit Virtual MML command and Return message of the virtual MML command. Click Confirm. Copy an MML command: In MML command configuration, select an MML command, and then click Copy. After copying the MML command, you can edit it.

3-14

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

Delete an MML command: In MML command configuration, select one or more MML commands, and then click Delete. In the displayed Confirm dialog box, click Yes. 4. 1. 2. 3. 4. 1. 2. 3. Click Confirm. In the virtual NE list, select a virtual NE, and then click . l Copy a virtual NE. On the right pane of the copied virtual NE, set NE name, NE state, NE IP address, NE type, NE version, and NE FDN. Configure an MML command as required. Click Confirm. In the virtual NE list, select one or more virtual NEs, and then click In the Confirm dialog box, click Yes. Click Confirm. .

l Delete a virtual NE.

Step 5 In the navigation tree of the project management area, right-click the project name node, and then choose Debug Project from the shortcut menu. Otherwise, click ----End .

Result
During debugging, the debug information is displayed on the Message tab page, the MML Response tab page, the File List tab page, the Stack tab page, and the Watch tab page of iSStar Debug Window. l The Message tab page displays the system information during debugging of the script files. The system information includes script debugging output information, script running output information, error information, and syntax check results. The MML Response tab page contains the MML commands and displayed information during the running and debugging of the script file. File List tab page displays the full path of the called script files. The Stack tab page displays the complete path information invoked by the current function. The path is refreshed as the script file is being executed. The Watch tab page displays the change information of the variables during debugging of the script file.

l l l l

Postrequisite
During the debugging, you can click the current debug script file. to display the iSStar Main Window, and then edit

3.2.5 Creating a Script Application


An application is an aggregation of scripts that meet the requirements of specific services. Through the application, you only need to be concerned with the operation results rather than the implementation details. The iSStar can create applications and use bookmarks as an entry to the applications. Script applications are categorized into local script applications and remote script applications.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 3-15

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

Prerequisite
l l The connection between the N2000 UMS client and the server is normal. The project package file is ready.

Context
l The script project files of the local script applications are saved and executed on the local PC. The script project files of the remote script applications are saved and executed on the server. Remote applications can be shared among different clients. You can organize different script applications into different workspaces as required. You can create a maximum of 10 workspaces. In each workspace, you can create a maximum of 70 bookmarks. The extension of a script application file is .hsp.

l l l l

CAUTION
l You need to set up local script applications for the programs concerning GUI interaction. If you create a remote script application, the interaction interface is not displayed on the client so that the operation of the script application fails. l Remote applications can run on the N2000 UMS server (Solaris Version) only.

Procedure
Step 1 Choose Maintenance > iSStar > Application Management from the main menu. The Application Management window is displayed. Step 2 Perform operations according to whether to create a workspace. Whether to create a workspace Operation Use the existing workspaces. Create a workspace. Click the target workspace. 1. Click . The Workspace dialog box is displayed.

2. Enter a Workspace Name, and then click OK. Step 3 Click . Alternatively, right-click the blank area of the workspace and choose Add Bookmark from the shortcut menu. The Add Bookmark window is displayed. Step 4 Set relevant parameters in the Add Bookmark window. Choose Application Type, enter a Bookmark name, and then choose an Source File and Icon file. When you select a value in Source File, if the existing project package does not contain the required source file, you can click Cancel in the Add Bookmark dialog box to go back to the Application Management interface. Then make a .hsp file by using the script packing function on this interface. Do as follows:
3-16 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

1. 2. 3.

Click

Set the basic parameters. Please refer to 6.8 Parameter Description: Script Pack Setting. Set the preset parameters. Please refer to 6.8 Parameter Description: Script Pack Setting.

Step 5 Perform different operations according to the Application Type. Application Type Operation Local application 1. Click in the Source file. The Open dialog box is displayed.

2. Select a project file and click Open. Remote application 1. Click in the Source file.

2. Select a project file in the Remote file list dialog box, and then click OK. Step 6 Click OK. ----End

3.3 Using Scripts


iSStar provides script files, script projects, and script applications to implement multiple service functions, to meet different usage requirements, and to facilitate service deployment. 3.3.1 Types and Status of Script Tasks Script tasks can be classified into immediate tasks and scheduled tasks based on the execution time. Tasks can be classified into local tasks and remote tasks by location. A task has multiple states. Immediate tasks and scheduled tasks have different states. 3.3.2 Running a Script File iSStar provides the script running function. By running script files, you can perform the maintenance using the service function provided by the script. 3.3.3 Running a Script Project By running a script project, you can use the service functions provided by all the scripts of the script project. 3.3.4 Running a Script Application After creating a script application, you can run the script application to finish specific service function. 3.3.5 Viewing the Result of a Script When running a script, you can view the output information of the script execution. 3.3.6 Monitoring the Process of Running a Script This section describes how to control the execution of scripts through iSStar. The operations include viewing the state of script tasks, viewing the output files of script tasks, pausing, resuming, and terminating script tasks, and deleting unnecessary script tasks.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 3-17

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

3.3.1 Types and Status of Script Tasks


Script tasks can be classified into immediate tasks and scheduled tasks based on the execution time. Tasks can be classified into local tasks and remote tasks by location. A task has multiple states. Immediate tasks and scheduled tasks have different states.

Classification of Script Tasks


There are two ways to classify script tasks. l Based on the execution time, tasks can be classified into immediate tasks and scheduled tasks. An immediate task refers to a task that requires running immediately after it is started. A scheduled task refers to a task executed based on the specified start time, running period, and run times after it is started. l Based on the location where task are executed, tasks are classified into local tasks and remote tasks. Local tasks refer to the tasks whose files are saved and operated on the local computer. Remote tasks are the tasks whose files are saved and operated on the server. Through iSStar Task Manage Window, each client user can view the running state and results of the remote tasks created on its client.
NOTE

Scheduled tasks are saved and operated on the server.

States of an Immediate Task


An immediate task has eight states. Running tasks and debugging tasks have different states. A running task has the following states: suspended, running, finished, pausing, paused, and terminated exceptionally. For details, see Figure 3-3. Table 3-1 describes Figure 3-3. Figure 3-3 State transition of a running task
Terminated exceptionally Exceptions occur or the task exception is stopped. Waiting Initial status Pause the task Stopping Resume the task Paused
3-18 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

The script processing is complete. Finished

Start

Running

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

Table 3-1 State transition of a running task State Suspended Running Finished Terminated exceptionally Pausing Paused Description Indicates that the tasks are not scheduled by the system. After an immediate task is created or copied, it is in the suspended state. The task is running. After a waiting task is started, it is in the running state. The task has finished running. After a script file finishes running, it is in the finished state. If exceptions occur or the task is stopped during the running, the state of the task is terminated exceptionally. The system is pausing the task. The task is transitioning from the running state to the paused state. The task is paused.

A debugging task has the following states: suspended, debugging, debug finished, and terminated exceptionally. Figure 3-4 shows the states. Table 3-2 describes Figure 3-4. Figure 3-4 State transition of a debugging task
Terminated exceptionally Exception occur or the task debugging is stopped Start Debugging Waiting Debugging The script processing is completed Debug Finished

Initial Status

Table 3-2 State transition of a debugging task State Suspended Debugging Description The task is not ready to be scheduled. After an immediate task is created or copied, it is in the suspended state. The task is being debugged. After a waiting task is being debugged, it is in the debugging state.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

3-19

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

State Debug finished

Description Indicates that the script execution is complete and the debugging ends. After a script file finishes debugging, it is in the debug finished state. If exceptions occur or the task is stopped during the debugging, the state of the task is terminated exceptionally.

Terminated exceptionally

States of a Scheduled Task


A timing task has five states: idle, running, suspend, archived and finished. The states of a scheduled task change with different operations. Table 3-3 describes Figure 3-5. Figure 3-5 State transition of a scheduled task
Start Creating a timing task Idle

Suspend a timing task

Restore a timing task

Scheduling

Cancel Finish Yes

Running

Deleting a timing task

Suspend

Terminate a CME task

Terminate a CME task

Another Scheduling? Scheduling No

D tim ele in ting g ta sk

ete Del task E M aC

Archived

Ter a C minate ME task


Finished

Deleting a timing task End

Table 3-3 States of a scheduled task State Idle Running Description A scheduled task is in the idle state after it is initially created. After being dispatched, an idle task changes to the running state. If a running task is canceled, its state changes to idle.

3-20

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

State Finished

Description A task is in the complete state if it does not require to be dispatched. It requires to be dispatched, its state changes to idle.

Suspended

You can suspend an idle scheduled task. Then, the task is in the suspended state. The suspended task changes to the idle state if you resume it.

NOTE

When a timing task is in the idle, suspended, or finished state, you can delete the timing task.

3.3.2 Running a Script File


iSStar provides the script running function. By running script files, you can perform the maintenance using the service function provided by the script.

Prerequisite
l l l You are authorized to operate scripts. A script file is already compiled. The modes for executing a script file include instant execution and timing execution.

Context
l l To run a script file is a procedure that iSStar descriptor parses and executes the content of the script file to provide specific service functions. Each time you run a script file, a corresponding script task is created in the iSStar Task Manage Window.

Procedure
l Executed the script file instantly through the iSStar. 1. Choose Maintenance > iSStar > Development Platform. The iSStar Main Window is displayed. Click Open. . Otherwise, right-click the tab bar in the edit area, and then choose

2. 3. 4.

In the Open dialog box, select the script file to be executed, and then click Open. Click . Otherwise, right-click in the edit area, and then choose Run.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

3-21

3 iSStar Operation
NOTE

iManager N2000 UMS Element Management System iSStar

l You can run the script of an iSStar script file without opening it. To run a script without opening a script file, you can click , select Select Task and Run, and in the displayed Open dialog box select a script file. l You can run the specified continuous script of the opened script file. To do so, open the script file to be executed and select the continuous scripts to be executed. Then, click and then select Range Execution. ,

5.

In the iSStar Execute Window, you can perform the following operations as required. Operation Name Stop executing the script Operation Method Click
NOTE Only the running script can be stopped. In other situations, appears dimmed.

Re-execute the script

Click

NOTE Only a script that has finished running can be re-executed. In other situations, appears dimmed.

Pause executing the script

Click
NOTE

Only the running script can be paused. In other situations, appears dimmed.

View the output directory

Click , you can locate the directory of the system's output files.
NOTE After a script finishes running, you can view the output directory. In other situations, appears dimmed.

Close iSStar Execute Window

Click
NOTE

l After you close iSStar Execute Window, the corresponding tasks on the iSStar Task Manage Window are deleted. l If you delete a script file in iSStar Task Manage Window, the iSStar Execute Window corresponding to the script is closed.

Activate the editing window Activate task management window

Click

. The iSStar Main Windowis displayed.

Click . The iSStar Task Manage Window is displayed. You can view the script task of the corresponding script.
Issue 02 (2010-10-10)

3-22

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

Executed the script file periodically through centralized task management. 1. 2. 3. Choose Maintenance > Task Management from the main menu. In the Task Type navigation tree on the left of the Task Management window, select ScriptTimerTask, and then click New. In the New Task dialog box, set the task name and execution mode, and then click Next. For details, see 6.9 Parameter Description: Script Timing Task of the iSStar. In the New Task dialog box, set the time based on the execution mode selected in the previous step, and then click Next. For details, see 6.9 Parameter Description: Script Timing Task of the iSStar. In the New Task dialog box, select the main file and accessory file of the script timing task, and then select the required NE.
NOTE

4.

5.

You can select a HSL script file and a HSP script engineering file from Main File and Accessory File.

6. ----End

Click Finish.

3.3.3 Running a Script Project


By running a script project, you can use the service functions provided by all the scripts of the script project.

Prerequisite
l l You are authorized to operate scripts. A script project is already compiled.

Context
l A main file is the entrance file for the running of a script project. The running of a script project begins from the main file. The running of all scripts follow the preset logical sequence. Each time you run a script project, a corresponding script task is created in the iSStar Task Manage Window. If a script project is set to background running, during running of the project, you do not access iSStar Execute Window. Otherwise, you access iSStar Execute Window. For operations in the window, see 3.3.2 Running a Script File.

l l

Procedure
l To run a script project, perform the following operations. 1. Choose Maintenance > iSStar > Development Platform from the main menu. The iSStar Main Window is displayed. Click . Otherwise, right-click the project management area, and then choose Open Project.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 3-23

2.

Issue 02 (2010-10-10)

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

3.

In the Open dialog box, select the script project file or project package file to be opened, and then click Open. The file of which the File Type is *.dsl is a script project file. *.hsp is a script project package file.

CAUTION
If the script project package does not support the decompression operation, the system displays Decompressing the project package is not supported. Click . Choose Select Task and Run to run the script project package that cannot be decompressed. 4. In the navigation tree of the project management area, right-click the node of project name, and then choose Run Project from the shortcut menu. Otherwise, click l In the navigation tree of the project management area, right-click the script file name node of the project, and then choose Run Single File. In the navigation tree of the project management area, double-click the script file name node of the project to be executed, or right-click the node, and then choose Open. Then, click ----End . .

To run a script file of the already opened project, perform one of the following operations:

3.3.4 Running a Script Application


After creating a script application, you can run the script application to finish specific service function.

Prerequisite
l l The connection between the N2000 UMS and the server is normal. A script application is already created.

Procedure
Step 1 Choose Maintenance > iSStar > Application Management. The Application Management window is displayed. Step 2 Click the workstation where the script file to be executed is located. Step 3 Perform different operations according to whether the application requires to select the NEs. Whether to Select Procedure an NE No Go to Step 4.

3-24

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

Whether to Select Procedure an NE Yes

1. Click or displayed.
NOTE l The l

. The Please select an operation NE dialog box is

check box indicates that the NE is disconnected.

supports only one NE. supports multiple NEs and batch creation of local script tasks. Each task corresponds to a specific NE.

2. Select an NE and click Confirm. 3. Go to Step 4. Step 4 Run a script application Running Mode Execute immediately Procedure You can use one of the following methods to run an application: l Click .

l Double-click the script application bookmark. l Right-click the script application bookmark and choose Run. Scheduled execution 1. Right-click the application bookmark and select Timer Task. The New Task dialog box is displayed. 2. Set the basic information about the task. The basic information to be set is as follows: l Task Name: indicates the name of a scheduled task. l Task Type: Set it to Script Executor. l Run Type: Set it to Once or Period. 3. Click Next to set the time for the execution of a task. 4. Click . In the displayed Date/Time Selection dialog box, set the start time. 5. If the execution type is once, click Next. Otherwise, enter values in Period and Run Times, and then click Next. 6. Set the Accessory File and NEs to be operated as required. 7. Click Finish. ----End

Postrequisite
iSStar creates a script task for the running script application. In case of immediate tasks, you can view the states of the script tasks and terminate the script tasks in iSStar Task Manage
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 3-25

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

Window. For details, see 3.3.6.1 Viewing the Script Task States and 3.3.6.4 Stopping a Script Task. In case of scheduled tasks, you can manage the tasks in Task Management.

3.3.5 Viewing the Result of a Script


When running a script, you can view the output information of the script execution.

Prerequisite
The script is running.

Procedure
Step 1 After the script is executed, iSStar automatically goes into the iSStar Execute Window. For running a script file, see 3.3.2 Running a Script File. Step 2 View the output information between different interfaces of the iSStar. Area Print output area Description Displays the output information of the print function during the execution of a script

MML message output Displays the MML command and return information during the area execution of a script. MML command statistic bar Displays the number of commands sent, the number of commands successfully executed, and the number of failed commands.

Step 3 Views the output information. You can execute the following operations on the output information as required. Operation Copy Procedure 1. Copies the text you need in the print output area or MML message output area. 2. Right-click the text you select, and then choose Copy. Alternatively, you can use the shortcut keys Ctrl+C. Clear Right-click the print output area or MML message output area and select Clear.

3-26

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

Operation Find

Procedure Right-click the print output area or MML message output area, and then choose Find. Alternatively, you can the shortcut keys Ctrl+F.
NOTE l Cyclic find all is supported. l You cannot enter the new-line character. l Wildcard search is not supported. l You can enter up to 128 characters in the Find What text box of the Find dialog box.

Save as

1. Right-click the print output area or MML message output area and select Save as. 2. Set the path and file name of storage in the Save As dialog box. Click Save.

Re-direct

1. Right-click the MML message output area and select Redirect To. 2. Set the path and file name of storage in the Save As dialog box. Click Save.

----End

3.3.6 Monitoring the Process of Running a Script


This section describes how to control the execution of scripts through iSStar. The operations include viewing the state of script tasks, viewing the output files of script tasks, pausing, resuming, and terminating script tasks, and deleting unnecessary script tasks. 3.3.6.1 Viewing the Script Task States This section describes how to view the task status to familiarize yourself with the information about the operating tasks and the debugging tasks. The information consists of the main files of tasks, task types, selected NEs, and the status, progress, start time, and end time. 3.3.6.2 Viewing Output Files of a Script Task Output files save the output information during the execution of a script file. The output information includes print output information (output of the print function in the script file), and MML message output file. You can familiarize yourself with the detailed output information during the execution of a script file through viewing the output file. 3.3.6.3 Pausing and Resuming a Script Task This section describes how to pause a running script task according to your requirements. In this way, the script task is in the paused state. You can also resume a paused task. 3.3.6.4 Stopping a Script Task You can stop a local script task or remote script task that is running or being debugged. 3.3.6.5 Deleting a Script Task This section describes how to delete a task that is not required. In this way, you can save system resources. The script file or script project corresponding to the script task is not deleted.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 3-27

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

3.3.6.1 Viewing the Script Task States


This section describes how to view the task status to familiarize yourself with the information about the operating tasks and the debugging tasks. The information consists of the main files of tasks, task types, selected NEs, and the status, progress, start time, and end time.

Prerequisite
A running or debugging task exists.

Context
Running tasks and debugging tasks have different states. l l A running task has the following states: suspended, running, finished, pausing, paused, and exceptionally terminated. A debugging task has the following states: suspended, debugging, debug finished, and exceptionally terminated.

For more details, please see 3.3.1 Types and Status of Script Tasks.
NOTE

Because only one existing debugging task is allowed on the iSStar client, the debugging and debug finished cannot co-exist.

Procedure
Step 1 Choose Maintenance > iSStar > Development Platform from the main menu. iSStar Main Window is displayed. Step 2 Perform operations according to the task types. Task Type Immediate tasks Procedure ..

1. Click

2. Go to Step 3. Scheduled tasks

Click to start the Task Management window. You can view the task information of the task list in the right window.

Step 3 In iSStar Task Manage Window, select the Local Task or Remote Task tab according to the task type to be created.View the task state, including main file of the task, task type, selected NE, task state, progress, start time, and end time.
NOTE

l The Progress is described in scripts and fed back to the client. When the statement feeding back the progress is operated, the Progress exports the progress value in the scripts. If there is no statement feeding back the progress in the scripts, Progress is always displayed as 0%. l You can click to refresh iSStar Task Manage Window.

----End
3-28 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

3.3.6.2 Viewing Output Files of a Script Task


Output files save the output information during the execution of a script file. The output information includes print output information (output of the print function in the script file), and MML message output file. You can familiarize yourself with the detailed output information during the execution of a script file through viewing the output file.

Prerequisite
A script task is already created.

Procedure
l To view the output information of the print, perform the following steps: 1. Choose Maintenance > iSStar > Development Platform. The iSStar Main Window is displayed. Click on the toolbar.

2. 3. l

In the iSStar Task Manage Window window, right-click the task to be viewed, and then choose View Output. Choose Maintenance > iSStar > Development Platform. The iSStar Main Window is displayed. Click on the toolbar.

To view the MML message output information, perform the following steps: 1.

2. 3. l

In the iSStar Task Manage Window, right-click the task to be viewed, and then choose View MML Output. Choose Maintenance > Task Management. The Task Management window is displayed. In the navigation tree, choose Task Type > Other > Script Timer Task. In the right window, select a task that has already been executed. Click Save Log. In the displayed Select Folder window, set the file save path. Click OK.
NOTE

To view the remote task output, perform the following steps: 1. 2. 3. 4.

The system generates a folder for the log file generated each time and saves the folder to the specified path. The result log file is named in the format YYYY-MM-DD_HH-MM-SS, for example, 2008-04-18_10-27-53.

----End

Result
For tasks that are running in the foreground, the system displays iSStar Execute Window. For tasks that are running in the background, the system opens the task output file.
NOTE

For tasks that are running in the background, if the script file does not invoke the print function nor the MML commands, the task does not display files. If you want to view the task output file, the system displays a dialog box, prompting you that the file does not exist.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

3-29

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

3.3.6.3 Pausing and Resuming a Script Task


This section describes how to pause a running script task according to your requirements. In this way, the script task is in the paused state. You can also resume a paused task.

Procedure
Step 1 Choose Maintenance > iSStar > Development Platform. iSStar Main Window is displayed. Step 2 Click . iSStar Task Manage Window is displayed.

Step 3 In iSStar Task Manage Window, click the Local Task or Remote Task tab based on the target task type.
NOTE

The files of local tasks are saved and executed on the local PC. The files of remote tasks are saved and executed on the server.

Step 4 Right-click a script task to be operated, and then choose Pause or Resume. After you pause a running script task, the script task transfers its state from the pausing state to the paused state. After you resume a paused task, the task transfers its state from the pausing state to the running state. For details, please refer to 3.3.1 Types and Status of Script Tasks. ----End

3.3.6.4 Stopping a Script Task


You can stop a local script task or remote script task that is running or being debugged.

Prerequisite
A script task is in the running state.

Procedure
Step 1 Choose Maintenance > iSStar > Development Platform from the main menu. The iSStar Main Window is displayed. Step 2 Click . The iSStar Task Manage Window is displayed.

Step 3 In the iSStar Task Manage Window, click the Local Task or Remote Task tab based on the target task type.
NOTE

The files of local tasks are saved and executed on the local PC. The files of remote tasks are saved and executed on the server.

Step 4 Right-click the target task, and then choose Stop from the shortcut menu. After this operation, the system stops the running or debugging task. The task state changes toTerminated Exceptionally. ----End

Result
After a task is stopped, you cannot restart or resume the task.
3-30 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

3.3.6.5 Deleting a Script Task


This section describes how to delete a task that is not required. In this way, you can save system resources. The script file or script project corresponding to the script task is not deleted.

Prerequisite
If you need to delete a remote task, ensure that the connection between the client and the N2000 UMS is normal.

Context
l l l You can delete the local script task that you create on the client and the remote script task that you create. Deleting a script task does not involve the deletion of the script of the script task and of the script project. You can delete a task in any state.

Procedure
Step 1 Choose Maintenance > iSStar > Development Platform. The iSStar Main Window is displayed. Step 2 Click . The iSStar Task Manage Window is displayed.

Step 3 In the iSStar Task Manage Window, click the Local Task or Remote Task tab based on the target task type.
NOTE

The files of local tasks are saved and executed on the local PC. The files of remote tasks are saved and executed on the server.

Step 4 Right-click a script task to be deleted, and then choose Remove from the shortcut menu. The system deletes the script task and the corresponding information displayed in the iSStar Task Manage Window.
NOTE

If the script task is running, the Delete the task dialog box is displayed. Click Yes. The script task is terminated exceptionally.

----End

3.4 Managing Scripts


This section describes how to view the script application information, release and download script application, delete unnecessary script application, and manage script application bookmark through iSStar. 3.4.1 Viewing the Script Application Information This section describes how to view the information about local script applications and remote script applications. The information about script applications includes script application types and preset parameters. 3.4.2 Downloading a Script Application to the Local Terminal
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 3-31

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

This section describes how to download the remote script applications that are shared on the server to the local terminal. 3.4.3 Issuing a Script Application to the Server This section describes how to issue local script applications to the server so that the applications can be shared. The release operation involves uploading the script application to the server and registering it on the server. 3.4.4 Deleting a Script Application This section describes how to delete script applications. The script applications are categorized into local script applications and remote script applications. 3.4.5 Managing Script Application Bookmarks A bookmark is related to a specific script application and is the entry to script applications. A script application is displayed on an interface as a bookmark. You can create, modify, or delete bookmarks.

3.4.1 Viewing the Script Application Information


This section describes how to view the information about local script applications and remote script applications. The information about script applications includes script application types and preset parameters.

Prerequisite
l l If you want to view local script applications, ensure that the bookmark of the script application is created on the client. If you want to check remote script applications, ensure that the connection between the client and the N2000 UMS server is normal.

Procedure
l To view the information about the local script application, perform the following steps: 1. 2. 3. Choose Maintenance > iSStar > Application Management from the main menu. The Application Management window is displayed. Click the target workstation to use the existing workstation. Right-click the bookmark of a local script application, and then choose Bookmark Properties. The Bookmark Properties window is displayed. You can view or modify the bookmark properties. Click OK to save the modification and close the window. Choose Maintenance > iSStar > Application Management from the main menu. The Application Management window is displayed. You can perform the following operations according to the existence of the corresponding bookmark of the script application.

4. l 1. 2.

To view the information about the remote script application, perform the following steps:

3-32

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

Operation Name The corresponding shortcuts exist

Operation Method 1. Click the target workstation to use the existing workstation. 2. Right-click the bookmark of a remote script application, and then choose Bookmark Properties. The Bookmark Properties window is displayed. You can view or modify the bookmark properties. 3. Click OK to save the modification and close the window.

The corresponding shortcuts do not exist

1. Click . The Remote File Summary window is displayed. 2. Select a script application from Remote File Summary. 3. Click Details. The Remote File Details window is displayed. You can view Basic Parameters and Preset Parameters.
NOTE You can check and modify the remote applications created by yourself. You can only view but not modify the remote applications created by other users.

----End

3.4.2 Downloading a Script Application to the Local Terminal


This section describes how to download the remote script applications that are shared on the server to the local terminal.

Prerequisite
l l The connection between the N2000 UMS and the server is normal. The corresponding applications exist on the server.

Procedure
Step 1 Choose Maintenance > iSStar > Application Management from the main menu. The Application Management window is displayed. Step 2 Click the target workstation to use the existing workstation. Step 3 You can perform the following operations based on whether the Application Management window has the bookmark of the corresponding script application.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

3-33

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

If... The bookmark corresponding to the remote script application exists,

Then... 1. Right-click the bookmark of the remote script application, and then choose Download File from the shortcut menu. Otherwise, right-click the bookmark of the remote script application. Then, click displayed. . The Open window is

2. Set the file name and save path in the Open window, and then click Open. The remote script application does not have a bookmark, 1. Click . The Remote File Summary window is displayed. 2. Select a script application from Remote File Summary. 3. Click Download. The Open window is displayed. 4. Set the file name and save path in the Open window, and then click Open.
NOTE l Remote File Summary lists all the script applications of the server. The script applications include those created by the local client (bookmarks that you can view on the local client), and those that are created by other clients. l By using this method, you can download the created remote script applications to the local terminal.

----End

3.4.3 Issuing a Script Application to the Server


This section describes how to issue local script applications to the server so that the applications can be shared. The release operation involves uploading the script application to the server and registering it on the server.

Prerequisite
l l The connection between the N2000 UMS and the server is normal. Script applications already exist.

Procedure
Step 1 Choose Maintenance > iSStar > Application Management from the main menu. The Application Management window is displayed. . Otherwise, right-click the blank area of the workspace, and then choose Issue File Step 2 Click from the shortcut menu. The Open window is displayed.
NOTE

You can also right-click the bookmark of the local script application, and then choose Issue File from the shortcut menu. Then, the script application of the bookmark is issued to the server.

3-34

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

3 iSStar Operation

Step 3 Select a file to be uploaded, and then click Open. You can click Summary. ----End to check whether the file is uploaded to the server in Remote File

3.4.4 Deleting a Script Application


This section describes how to delete script applications. The script applications are categorized into local script applications and remote script applications.

Prerequisite
If you want to delete a remote application, ensure that the connection between the client and the N2000 UMS is normal.

Context
l l l l The local script applications are saved and executed on the local PC. The remote script applications are saved and executed on the server. You can delete the script applications on the server issued by yourself or by other users. The corresponding bookmarks are still available after the local or remote applications are deleted.

CAUTION
If a script application on the server is deleted, all the bookmarks created on the basis of this script application by users on the clients are unavailable.

Procedure
Step 1 Choose Maintenance > iSStar > Application Management from the main menu. The Application Management window is displayed. Step 2 You can delete a remote script application by using the remote file management function or using the remote application bookmark. Operation Entrance Remote file management Procedure

1. Click . The Remote File Summary window is displayed. 2. Select an application package from Remote File Summary. 3. Click Remove.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

3-35

3 iSStar Operation

iManager N2000 UMS Element Management System iSStar

Operation Entrance

Procedure

Remote application bookmark 1. Click the target workspace. 2. Right-click a remote application bookmark, and then choose Remove Remote File from the shortcut menu. The Confirm dialog box is displayed. 3. Click Yes.

NOTE

The local script applications are saved on the clients. To delete a local script application, you need to delete only the folder saving this application.

----End

3.4.5 Managing Script Application Bookmarks


A bookmark is related to a specific script application and is the entry to script applications. A script application is displayed on an interface as a bookmark. You can create, modify, or delete bookmarks.

Context
Deleting a bookmark does not involve the deletion of the script application of the bookmark but only the deletion of the icon of the bookmark on the script application platform.

Procedure
Step 1 Choose Maintenance > iSStar > Application Management from the main menu. The Application Management window is displayed. Step 2 You can create, modify, or delete bookmarks. l For details about how to create a bookmark, refer to 3.2.5 Creating a Script Application. l Modify the properties of a bookmark. After you click a bookmark, click . Otherwise, right-click a bookmark, and then choose Bookmark Properties. You can modify the properties of a bookmark in the Bookmark Properties window. l Delete a bookmark. Right-click a bookmark, and then choose Delete Bookmark. In the displayed Confirm prompt box, click Yes. ----End

3-36

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

4 HSL Language Reference

4
About This Chapter

HSL Language Reference

The High Level Script Language (HSL) is a simple but powerful script language provided by the iSStar. HSL reference contains the HSL syntax, data types and methods supported by HSL. 4.1 Introduction to the HSL Language The High-level Script Language (HSL) is an easy-to-learn and powerful script language provided by iSStar. The features of the HSL are simple and efficient syntax, abundant data types, and efficient and extendable library functions. 4.2 HSL Language Syntax The syntax of HSL contains identifiers, keywords, statements, operators, and so on. To use the HSL to write scripts better, you must understand the HSL syntax. 4.3 Data Types and Methods in the HSL This topic describes basic data types and their methods in the HSL. It helps you to use the HSL for development. The data types supported by the HSL are as follows: numeric, string, list, tuple, dictionary, and file. 4.4 HSL Built-In Functions This topic describes the HSL built-in function that provides a group of object-specific operation functions.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

4-1

4 HSL Language Reference

iManager N2000 UMS Element Management System iSStar

4.1 Introduction to the HSL Language


The High-level Script Language (HSL) is an easy-to-learn and powerful script language provided by iSStar. The features of the HSL are simple and efficient syntax, abundant data types, and efficient and extendable library functions.

Syntax Based on Python.


In terms of basic syntax, the HSL comes from Python. The HSL syntax is based on Python. You need not compile and link. The programs are compact and easy-to-read and have good expendability. The HSL supports the following common functions: l l l l l Supports simple statements, such as assignments, variables, arithmetic expressions, return statements, and continue statements. Supports complex conditional control statements, such as If statements, While statements, and For statements. Supports the self-definition of functions. Supports the import of library functions. Supports the invoking of file functions.

Supporting Batch MML Commands


You can compile MML script for batch operations. The details are as follows: l You can connect to NEs. You can connect to an NE through the HFC functions in the script, or manually select an NE in the GUI. l l You can send MML commands You can directly write batch MML commands in the script. You can parse MML messages and alarm messages. You can use the corresponding functions provided by the HSL to parse MML messages and alarm messages. In this way, you can obtain required information this way.

Providing Continuous Expandable Service Function Library HFC.


HFC is a series of functions for operating and maintaining service encapsulation. You can directly invoke these functions when compiling the HSL script. Using HFC can simplify the compiling of scripts, speed up development of scripts, and improve efficiency of script running. The HFC function library can be flexibly expanded. Regarding the HFC function library provided by iSStar, please refer to 5 HFC Library Reference.

4.2 HSL Language Syntax


The syntax of HSL contains identifiers, keywords, statements, operators, and so on. To use the HSL to write scripts better, you must understand the HSL syntax. 4.2.1 Identifiers An identifier is a string. It is a name that is used to identify a variable or a function in a program. 4.2.2 Keywords
4-2 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

4 HSL Language Reference

A keyword is also called a reserved word. It is an identifier pre-defined in HSL. 4.2.3 Statements As basic units of script programs, statements can be classified into simple statements, MML statements, and compound statements. 4.2.4 Operators Operators are divided into basic operators, bit operators, comparative operators, Boolean operators, sequence operators, and dictionary operators. 4.2.5 String Format This topic describes the string formats in HSL. You can view the information and perform operations. 4.2.6 Comments A comment gives the information on a program. It is not processed by the interpreter. HSL supports line comment and block comment in a script. 4.2.7 Condition Statements A condition is used to express the process for selecting the program branches. 4.2.8 Loop Statements A loop statement is used to express the repeated process for a program. The HSL supports two types of loop statements: for statement and while statement. 4.2.9 Function Definitions A function is the basic multiplex unit provided by the language.

4.2.1 Identifiers
An identifier is a string. It is a name that is used to identify a variable or a function in a program. The rules for naming an identifier are as follows: l l l l l l l Naming rule: An identifier can contain letters (a-z, A-Z), numbers (0-9), and underlines (_). Number cannot be the leading character. The length of an identifier is not restricted. An identifier is case sensitive. For example, FOO and foo are different objects. An identifier cannot be any keyword of HSL. For the keywords of HSL, see 4.2.2 Keywords. An identifier cannot contain special characters such as $, %, or @. When using an identifier, observe the principle of defining (assigning) first. Available scope: For an identifier defined in a compound statement, it is functional only in its attributive compound statement block. For an identifier defined in a non-compound statement, it is functional only in its attributive script. For details, see 4.2.3 Statements.

4.2.2 Keywords
A keyword is also called a reserved word. It is an identifier pre-defined in HSL.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

4-3

4 HSL Language Reference

iManager N2000 UMS Element Management System iSStar

CAUTION
l l The keywords in HSL are unique in the script. Keywords cannot be re-defined.

Table 4-1 lists the keywords used in HSL. The keywords global, assert, pass, try, except, raise, finally, exec, class, lambda, import, del, print, from, is, and yield are reserved keywords. They are used for the future syntax expansion. Table 4-1 Keywords Keywords and assert break class continue def del elif else except exec finally for from global if import in is lambda not or pass Print raise return try while yield end

4.2.3 Statements
As basic units of script programs, statements can be classified into simple statements, MML statements, and compound statements.

Simple Statement
l l l Generally, a statement line maps to a text line. A line feed character (\n) is the end mark. If you want to split a statement into multiple text lines, an extended line (\) must be used. A text line can include multiple simple statements which are separated by semicolons (;).
NOTE

l l

An extended line character cannot be used at the end of files, because semantic mistakes are caused. An extended line character is invalid to a comment line.

MML Statement
An MML statement ends with ;. Parameters are separated by ,, and parameter expressions are separated by =. The MML statement has two types: line mode and block mode. Table 4-2 lists the two types of MML statement.

4-4

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

4 HSL Language Reference

CAUTION
Do not write both MML command statements and simple statements in the same text line.

Table 4-2 MML statements MML Statement Line mode Block mode Format
@MMLCMD:MMLargs; @@@ MMLCMD:MMLargs; MMLCMD:MMLargs; MMLCMD:MMLargs; @@@

Compound Statement
The compound statement has the following three types: l Conditional statement: if...elif...else...end. The format is as follows:
if expr stmt [elif expr stmt] [else stmt] end

Loop statement: for...in...end. The format is as follows:


for atom in list stmt end

Loop statement: while...end. The format is as follows:


while expr stmt end

4.2.4 Operators
Operators are divided into basic operators, bit operators, comparative operators, Boolean operators, sequence operators, and dictionary operators. For details of the operators, see Table 4-3. Table 4-3 Basic operators Type Basic Operator x+y x-y
Issue 02 (2010-10-10)

Description Add Subtract


4-5

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

4 HSL Language Reference

iManager N2000 UMS Element Management System iSStar

Type

Operator x*y x/y x%y -x +x x ** y Multiply Divide

Description

Get magnitude (x mod y) Unary negation x x to the power of y Left shift Right shift Bitwise and Bitwise or Bitwise exclusive Less than Greater than Equal Not equal Greater than or equal Less than or equal If either x or y is True, return True. Otherwise, return False. If either x or y is False, return False. Otherwise, return True. If x is False, return True. Otherwise, return False. Sequence cascade Add s for n times, where n is an integer. Use key words as indexes.

Bit-wise

x << y x >> y x&y x|y ~x

Comparative

x<y x>y x == y x != y x >= y x <= y

Bool

x or y x and y not x

Sequence

s+ r s* n, n* s

Dictionary

d[k]

4.2.5 String Format


This topic describes the string formats in HSL. You can view the information and perform operations. Table 4-4 lists the detailed description of the string formats.

4-6

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

4 HSL Language Reference

Table 4-4 String format Method d,i u o x X f e E g,G s r and repr() c % Decimal integer or long integer Unsigned integer or long integer Octal integer or long integer Hexadecimal integer or long integer Hexadecimal integer (upper cased) Floating number, such as [-]m.dddddd Floating number, for example, [-]m.dddddde +/-xx Floating number, for example, [-]m.ddddddE +/-xx For index smaller than -4 or higher precision, use %e or %E. Otherwise, use %f. String or other objects. Call str() to produce a string. The returned strings are identical. Single character Indicates the flag conversion Description

4.2.6 Comments
A comment gives the information on a program. It is not processed by the interpreter. HSL supports line comment and block comment in a script. l l l The line comment starts with #, and it is used to comment the content contained in a line. The block comment uses """ or ''', and it is used to comment multiple lines of texts. The block comment is a special string. It can serve as a string.

CAUTION
Block comment can be used together with statements. A semicolon, however, is required to separate the block comment from the statements. Table 4-5 lists the formats for writing a comment. Table 4-5 Formats for writing a comment Comment Type Line comment
Issue 02 (2010-10-10)

Writing Format [stmt]#This is a one-line comment.

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

4-7

4 HSL Language Reference

iManager N2000 UMS Element Management System iSStar

Comment Type Block comment

Writing Format [stmt;]"""This is a multi-line comment. """[;stmt]

4.2.7 Condition Statements


A condition is used to express the process for selecting the program branches. The script language supports the if...elif...else...end statement. The writing format is as follows:
if expr if_stmt... [elif expr else_stmt...]... [else else_stmt...] end

Example
x = 100 if x > 0 Print("x is elif x == 0 Print("x is elif x < 0 Print("x is else Print("x is end x = 0 if x > 0 Print("x is elif x == 0 Print("x is elif x < 0 Print("x is else Print("x is end x = -100 if x > 0 Print("x is elif x == 0 Print("x is elif x < 0 Print("x is else Print("x is end positive") zero") negative") not a integer")

positive") zero") negative") not a integer")

positive") zero") negative") not a integer")

4.2.8 Loop Statements


A loop statement is used to express the repeated process for a program. The HSL supports two types of loop statements: for statement and while statement.

4-8

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

4 HSL Language Reference

For loop
The format of a for loop statement is as follows:
for atom in list stmt(for)... end

Example
for num in [1,2,3,4] Print('I can count to ' + str(num) ) end

Result
I I I I can can can can count count count count to to to to 1 2 3 4

While loop
The format of a while loop statement is as follows:
while expr stmt(while)... end

Example
x = 1 while(x < 5) Print(x) x = x + 1 end

Result
1 2 3 4

Cross Nesting
The HSL loop has an else clause, and the program codes after this clause are executed after the loop is finished. For a for loop, the completion of the programming refers to the completion of the list statements. For a while loop, the programming is complete when the condition changes to false. If a loop is terminated exceptionally, for example, break, the else clause is not executed. Example
for n in range(2,10) for x in range(2,n) if n%x == 0 Print(str(n) + ' equeals' + str(x) + ' *' + str(n/x)) break end else Print(str(n) + ' is a prime number') end end

Result
2 3 4 5 6 7 is a prime number is a prime number equeals2 * is a prime number equeals2 *3 is a prime number

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

4-9

4 HSL Language Reference


8 equeals2 *4 9 equeals3 *3

iManager N2000 UMS Element Management System iSStar

Loop Control Statement


HSL supports two types of loop control statements: continue and break. A break statement forces the processing loop to quit, ignores all the else statements, and proceeds with the line following the last line of the loop block. The continue statement forces the programming to switch to the next loop and ignores the other statements in the current block. It re-evaluates the loop expression. l Example: Using break to skip the loop
for num in [1,2,3,4] if(num == 3) break end Print('I can count to ' + str(num) ) end

Result
I can count to 1 I can count to 2

Example: Using continue to skip the current loop


for num in [1,2,3,4] if(num == 3) continue end Print('I can count to ' + str(num) ) end

Result
I can count to 1 I can count to 2 I can count to 4
NOTE

In a loop, an iteration range should be specified for a number. Two methods are provided in HSL, that is, while loop and value list of the range function (list also applies). l Example: Using the while loop
x = 1 while(x < 5) Print(x) x = x + 1 end

l Example: Using the range function to get value list


for x in range(1,10) Print(str(x)) end

4.2.9 Function Definitions


A function is the basic multiplex unit provided by the language.

4-10

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


NOTE

4 HSL Language Reference

l l l l

The HSL does not support function re-loading. A newly-defined function automatically overwrites the previous function with the duplicate name. The function definitions do not need to designate a return value. If you do not designate a return value, a default object None is returned after the function is invoked. The recursive invoking of a function has a maximum depth at 1,000. The function definitions can be nested.

The definition of a function is as follows:


def func(arglist...) statement... end

Example
def showHello() Print("Hello!") end showHello()

4.3 Data Types and Methods in the HSL


This topic describes basic data types and their methods in the HSL. It helps you to use the HSL for development. The data types supported by the HSL are as follows: numeric, string, list, tuple, dictionary, and file. 4.3.1 Number This topic describes the numeric types of the HSL and details of numeric operations. 4.3.2 Sequence The sequence objects are accessed by digital index. The sequence contains the following types: string, Unicode string, list, and tuple. 4.3.3 String A string is the form of sequence objects, its consists of single or double quotation marks. For example, 'hello' and "world" are of the string type. 4.3.4 List List is another form of sequence objects. The list inherits many operation functions of strings. Compared with the string, the list can include any objects. 4.3.5 Tuple Tuple is a constant list. This topic describes the tuple and provides some examples. You can refer to this topic to perform relevant operations. 4.3.6 Dictionary A dictionary has a random storage structure. Each element in the dictionary is called a pair. A pair contains two parts: key and value. Key can be an integer or a string, and value can be the data of random types. You can get value by D[key]. Duplicate keys are not available in the dictionary. 4.3.7 File This topic describes a file which provides basic operations for files, such as, opening, reading, and writing files.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

4-11

4 HSL Language Reference

iManager N2000 UMS Element Management System iSStar

4.3.1 Number
This topic describes the numeric types of the HSL and details of numeric operations.

Types
Table 4-6 lists numeric types and value example. Table 4-6 Classification Type Integer Long integer Floating Complex 1234,-24,0 99999999999999999999L 2.11,2.43e-10,5E12,6.0e+21 3+4j,3.0+4.0j,4j Value Example

Operation
Table 4-7 lists details of numeric operations. Table 4-7 Numeric operations Operation x or y x and y not x x < y, x <= y, x > y, x >= y x == y,x != y x|y x^y x&y x << y, x>> y x + y, x - y x * y,x % y,x / y -x,+x, ~x x ** y Logical OR Logical AND Logical NOT Compare Equal or not Bitwise or Bitwise exclusive or Bitwise and Shift x for y to the left or right Plus, subtract Multiple, get remainder (format), divide Negative, positive, inverse bit sequence x to the power of y Description

Example
4-12 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


#Get the result of x**y. x = 2 y = 3 Print(x**y)

4 HSL Language Reference

Result
8

4.3.2 Sequence
The sequence objects are accessed by digital index. The sequence contains the following types: string, Unicode string, list, and tuple.

4.3.3 String
A string is the form of sequence objects, its consists of single or double quotation marks. For example, 'hello' and "world" are of the string type.

String Object Methods


For details of the string object methods, see Table 4-8. Table 4-8 String object methods Method s.capitalize() Description Returns a copy of the string with only its first character capitalized. Returns a string whose initial part and end part are filled with fillchar. The middle part is the same as the original string . The width argument is an integer and indicates the length of the return string. The fillchar argument is a string and indicates the characters to be filled in the initial and end parts of the return string.
NOTE l When the length of width is not greater than that of the original string, s is returned and no padding is done. l When the length of width is greater than that of the original string, fill in fillchar in turn according to the order of filling in the tail first and then filling in the head. The padding number is the difference of the length of width and the original string.

s.center(width[,fillchar])

s.count(sub[,start[,end]])

Returns the number of occurrences of substring sub in string s[start:end]. The optional arguments start and end are interpreted as in slice notation. The default value of the start argument is 0, and the default value of the end is len (s). If the string s[start:end] ends with suffix, True is returned. If the string s[start:end] ends with suffix, False is returned. The default values of start and end are 0 and len(s) respectively.

s.endswith(suffix[,start [,end]])

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

4-13

4 HSL Language Reference

iManager N2000 UMS Element Management System iSStar

Method

Description Returns a copy of the string. If the returned string contains the escape character "\t" of tab, use the space to replace the character. The default value of the parameter tabsize is 8. The number of spaces to be replaced is the difference of tabsize and the length of the string before "\t". For example, if the string to be returned is aa\tbbbb\tc, the corresponding codes are as follows:

s.expandtabs([tabsize])

a='aa\tbbbb\tc' b=a.expandtabs() Print(b)

The returned result is as follows:


aa bbbb c

In the returned result, the number of spaces used by the first "\t" is the difference of the length of tabsize and "aa", that is, 8 - 2 = 6. The number of spaces used by the second "\t" is the difference of the length of tabsize and "bbbb", that is, 8 - 4 = 4. If the substring sub is contained in s[start:end), return the index that appears for the first time in the range s[start:end]. If the substring sub is not contained in s[start:end], -1 is returned. Be similar to find(). Raises ValueError when the substring is not found. If all characters in the string are digits or letters and at least one character exists in the string, True is returned. If any character in the string is not a digit or a letter or no character exists in the string, False is returned. If all characters in the string are letters and at least one character exists in the string, True is returned. If any character in the string is not a letter or no character exists in the string, False is returned. If all the characters in the string are digits and at least one character exists in the string, True is returned. If any character in the string is not a digit or no character exists in the string, False is returned. If all the letters in the string are lowercase and at least one letter exists in the string, True is returned. If any letter in the string is not lowercase or no letter exists in the string, False is returned. If all the characters in the string are blank spaces and at least a character exists in the string, True is returned. If any character in the string is not a blank space or no letter exists in the string, False is returned.

s.find(sub[,start[,end]])

s.index(sub[,start[,end]])

s.isalnum()

s.isalpha()

s.isdigit()

s.islower()

s.isspace()

4-14

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

4 HSL Language Reference

Method

Description Checks whether the string is a title string. If lowercase letters are not followed by uppercase letters and only uppercase letters are followed by lowercase letters, True is returned. If lowercase letters are followed by uppercase letters or any lowercase letter is followed by uppercase letters, False is returned. If all letters in the string are uppercase, True is returned. If any letter in the string is lowercase, False is returned. Returns the string that connects all strings in the sequence seq. If seq is a list or a tuple, the item in the list or the tuple must be a string. Returns a string whose length is equal to width. If the length of the string is smaller than the width, use fillchar whose default value is a space, to pad the right segment of the string. If the length of the string is equal to or greater than the width, the string is returned. Returns a copy of the string converted into lowercase. Removes the character at the beginning of the string, and then returns the s[n:] string. The letter n refers to the location index of the first character that is not located in chars. In addition, the first character belongs to the string. If you do not set the value of char or char to None, left blank characters in the string are removed by default. Returns a string where all the substrings old are replaced by the substrings new. If count is specified, then a maximum of count times can be replaced. The old and new arguments are of the string type. The count argument is an integer. Returns the highest index in the string where substring sub is found, so that sub is contained within s[start,end]. Optional arguments start and end are interpreted as in slice notation. -1 is returned in case of failure. Be similar to rfind(). Raises ValueError when the substring sub is not found. Returns a string whose length should be width. If the length of a string is smaller than the width, pad fillchar (a space by default) on the left of the string until the length of a string is equal to the width. If the length of a string is equal to or greater than the width, the string is returned.

s.istitle()

s.isupper()

s.join(seq)

s.ljust(width[,fillchar])

s.lower()

s.lstrip([char])

s.replace(old, new [, count])

s.rfind(sub [,start [, end]])

s.rindex(sub[,start[,end]])

s.rjust(width[,fillchar])

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

4-15

4 HSL Language Reference

iManager N2000 UMS Element Management System iSStar

Method

Description Uses sep as the delimiter string, and then splits a string into multiple substrings. Arranges the substrings in a list, and then returns the list. If maxsplit is specified, the string can be split for a maximum of maxsplit times from the right to the left. If you maintain the default value of maxsplit, then the string can be split for unlimited times. If sep is not specified, use a space as the delimiter string. The sep argument is a string, and the maxsplit argument is an integer. Removes the character at the end of the string and returns the s[:(n+1)] string. The letter n refers to the serial number of the first character that is not in chars. The first character is counted from the right of the string. The char argument is a string. If you do not set char or char to None, remove the blank character at the right side of the string by default. Returns a list of the words in the string and uses sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done. (Thus, the list will have at most maxsplit +1 elements). If maxsplit is not specified or is zero, then there is no limit on the number of splits (all possible splits are made). Consecutive delimiters are not grouped together and are deemed to delimit empty strings. For example, l " '1,,2'.split(',') "p_returns " ['1', '', '2'] "). l " '1, 2, 3'.split(', ') " returns " ['1', '2', '3'] "). l "''.split(',') " returns "[] "). Splits the string into multiple substrings by lines, arranges the substrings into a list, and then returns the list. If you set keepends to True, the line feed character is maintained for the substrings. If you do not set keepends to True, the line feed character is not maintained for the substrings. If the s[start:end] sunstring begins with prefix, True is returned. If the s[start:end] sunstring does not begin with prefix, False is returned. The prefix parameter is a string. The start parameter is an integer and the default value is 0. The end parameter is an integer and the default value is len(s). Removes the start and end characters of the string, and then returns the s[m:(n+1)] string. The letter m refers to the serial number of the first character that is not in chars. The first character related to m is counted from left of the string. The letter n refers to the number of the first character that is not in chars. The first character related to n is counted from right of the string. If you do not set the value of char or char to None, right and left blank characters in the string are removed by default.

s.rsplit([sep [,maxsplit]])

s.rstrip([char])

s.split([sep [,maxsplit]])

s.splitlines([keepends])

s.startswith(prefix [, start [, end]])

s.strip([char])

4-16

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

4 HSL Language Reference

Method

Description Returns a copy of the string. In addition, all the uppercase characters in the string are changed to lowercase characters, and all the lowercase characters are changed to uppercase characters. Returns title characters, that is, the initial letter of the copy string and all the letters immediately following characters other than letters should be changed to uppercase letters. Letters in other positions are changed to lowercase letters. Returns a converted string. All the characters occurring in delchars are removed from the copy string. Other characters are converted according to mapping relations in table. The augment table must be a string that contains 256 characters arranged in sequence. The mapping relation is as follows: The values of the ASCII codes mapping the string are used as indexes, and the characters mapping to the indexes in table are taken out.

s.swapcase()

s.title()

s.translate(table [,delchars])

s.upper()

Returns a copy of the string. In addition, all the lowercase letters in the copy string are changed to uppercase letters. Returns the string whose length is width. If the length of the string is smaller than the width, return the copy string and pad 0 at the left side of the copy string. If the length of the string is greater than the width, the string is returned.

s.zfill(width)

Special Character
Special characters and their descriptions are listed in Table 4-9. Table 4-9 Special Character Name \\ \' \" \a \b \e \0 \n \v
Issue 02 (2010-10-10)

Description Backslash Single quotation marks Double quotation marks Bell Space character Escape Null Newline character and equals to \x 0a and \cJ Perpendicular tab and equals to \x0b and \cK
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 4-17

4 HSL Language Reference

iManager N2000 UMS Element Management System iSStar

Name \t \r \f \OOO \xhh \un

Description Horizontal tab and equals to \x09 and \cJ Enter character and equals to \x0d and \cM Form feed character and equals to \x0c and \cJ octal(000-377) hex(x00-xff) Unicode character, n is a Unicode character shown by four hex numbers

Formatted String
The basic usage is s%<tuple>. The tuple indicates a parameter list, and it is similar to printf in the C language. Indicate each value in the tuple using the string. The representation format is determined by s. For example, Print("%s's height is %dcm"%("p_charles", 180)). %s and %d are similar to printf in the C language. In the iSStar system, they are called escape characters. Table 4-10 Rule of escape characters Character d i o u x X e E f g c r Description Signed decimal integer Signed decimal integer Unsigned octal numeral Unsigned integer Unsigned hexadecimal numeral Unsigned hexadecimal numeral Floating point number. It is represented in a scientific expression. Floating point number. It is represented in a scientific expression. Floating point number Floating point number. If the accuracy does not reach 0.0001, it is represented in a scientific expression. Represents an ASCII integer as single character Indicates a string format. It is the return value of the repr () function of the internal call object.

4-18

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

4 HSL Language Reference

Character s

Description Indicates a string format. It is the return value of the str() function of the internal call object.

4.3.4 List
List is another form of sequence objects. The list inherits many operation functions of strings. Compared with the string, the list can include any objects.

List Object Method


For details of the list object method, see Table 4-11. Table 4-11 List object methods Method L.append(x) L.extend(L1) Description Appends an item at the end of L. L[len(L):] = [x] is also applicable. Adds elements in the L1 list at the end of the L list. It can also be written as L[len(L):]. = L1, where L1 is a list. Inserts an element in a specified position. The i parameter is the index of the position of the element to be inserted. The parameter x is the element to be inserted. Removes the first item valued x. If no x exists in L, the script execution fails. Removes an item in a specified position from a list, and then returns the deleted item. If the default value is selected for i, L.pop() deletes the last item in the list and then returns the last item. Returns the index value of the item whose first value is equal to x. If x is not contained in L, then the execution of scripts may have errors. Returns the times of x in L. Sorts the items of L in ascending order. Reverses locations of the items in list.

L.insert(i,x)

L.remove(x)

L.pop([i])

L.index(x) L.count(x) L.sort() L.reverse()

4.3.5 Tuple
Tuple is a constant list. This topic describes the tuple and provides some examples. You can refer to this topic to perform relevant operations. l l
Issue 02 (2010-10-10)

Tuple is a constant list. Tuple has no such methods as pop, remove, and insert. Tuple is displayed by (), for example, a=(0,1,2,3). The round brackets can be omitted.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 4-19

4 HSL Language Reference

iManager N2000 UMS Element Management System iSStar

l l

Tuple can return elements or sub-tuples by using subscripts. Tuple can be used to assign values for multiple variables.

Example
t=(1,2) a,b = t Print("%d"%a) Print("%d"%b)

Result
1 2

4.3.6 Dictionary
A dictionary has a random storage structure. Each element in the dictionary is called a pair. A pair contains two parts: key and value. Key can be an integer or a string, and value can be the data of random types. You can get value by D[key]. Duplicate keys are not available in the dictionary.

Operations
For details of operations on dictionary objects, see Table 4-12. Table 4-12 Operations on dictionary objects Operation dic2["key"] dic3["key1"]["key2"] Index. Index. Checks whether the key is the key value of the dic. If the key is the key value of the dic, the result is True. If the key is not the key value of the dic, the result is False. (For details, see Example 2 in, not in.) Checks whether the key is the key value of the dic. If the key is not the key value of the dic, the result is True. If the key is the key value of the dic, the result is False. (For details, see Example 2 in, not in.) Gets the length of dic. (For details, see Example 3 Get the length of the dic by the function len()..) Description

key in dic

key not in dic

len(dic)

Example 1: Assigning Application


dic1 = {'sun':1,'moon':2} dic2 = {'food':{'ham':1,'egg':2}} #Output dic1 and dic2. Print(dic1) Print(dic2) Print("----------------------------") #Output the keys corresponding to dic1 and dic2.

4-20

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


Print("dic1['moon'] = " + str(dic1['moon']) ) Print("dic2['food']['ham'] = " + str(dic2['food']['ham']) ) Print("----------------------------") #Change the value correspond to "sun" in dic1. dic1['sun'] = 42 #Output the modified dic1. Print("dic1 = " + str(dic1) )

4 HSL Language Reference

Result
{'sun': 1, 'moon': 2} {'food': {'egg': 2, 'ham': 1}} ---------------------------dic1['moon'] = 2 dic2['food']['ham'] = 1 ---------------------------dic1 = {'sun': 42, 'moon': 2}

Example 2 in, not in


dic = {'sun':1,'moon':2} #Determine whether "moon" is a key in dic. If yes, return True. If no, return False. Print(("moon" in dic)) #Determine whether "moon"is a key in dic. If no, return True. If yes, return False. Print(("moon" not in dic))

Result
True False

Example 3 Get the length of the dic by the function len().


dic = {'sun':1,'moon':2} #Export the length of the dic. Print(len(dic))

Result
2

Dictionary Object Methods


For detailed methods about dictionary objects, see Table 4-13. Table 4-13 Methods about dictionary objects Method dic .clear() dic.values() dic.has_key(k) dic.copy() dic.items() dic.keys()
Issue 02 (2010-10-10)

Description Clears dic. Returns the value. Checks whether the key k exists in dic. Copies contents of the object. Are a copy of a's list of (key, value) pairs. Copies all the keys.

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

4-21

4 HSL Language Reference

iManager N2000 UMS Element Management System iSStar

Method dic.update([b])

Description Updates dic according to b. The letter b can refer to a dictionary type or a list, for example, [(key,value)]). Creates a dictionary and uses the elements in seq as acquisition keys. The values of all the elements are set to value. If the value of an element is not set to value, then set the value to None. If k is in dic, the return key k maps to the following value: dic [k]. Otherwise, return x and add (dic[k], x) in the dictionary. Returns the value of k. Removes and returns an arbitrary (key, value) pair. Returns the first key value pair (key, value) in dic, and then deletes the pair. Returns the iterator of the key value pair (key, value) in dic. Gets an iterator over the keys of the mapping. Gets an iterator over the values of the mapping.

dic.fromkeys(seq[,value])

dic.setdefault(k[,x]) dic.get(k[,x]) dic.pop(k[,x]) dic.popitem() dic.iteritems() dic.iterkeys() dic.itervalues()

4.3.7 File
This topic describes a file which provides basic operations for files, such as, opening, reading, and writing files.

File Object Methods


Before you operate a file object, obtain it by calling Open(filename[,mode[,bufsize]]). Table 4-14 lists the description of Open(filename[,mode[,bufsize]]).

4-22

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

4 HSL Language Reference

Table 4-14 Open function description Function Open(filename[,mode[,bufsize]]) Description Returns a new file object, where the filename indicates the name of the file to be opened. The default value of mode, which indicates the mode of opening a file, is r. The modes for opening files and the related meanings are as follows: l r: opens a file to read. l w: opens a file to write. l a: opens a file to append. The file is automatically moved to the end. l r: opens a file to read and write. l w+: truncates or clears a file, and then opens the file to read and write. l a+: opens a file to read and write. The file is automatically moved to the end. l t: opens a file in text mode. l b: opens a file in binary mode instead of text mode. The bufsize argument specifies the desired size of the file. The values and related meaning are as follows: l 0 means unbuffered. l 1 means line buffered. l Any other positive value means using a buffer of (approximately) that size. l A negative means using the default value. l If it is omitted, the default value is used.

Table 4-15 lists the description of file object methods. Table 4-15 File object methods Mame close() Description Closes a file. A closed file cannot be read or written any more. After the file is closed, any operations that need to read or write the file stop the program. Calling close() more than once is allowed. Clears the internal buffer. For some file objects, this function may have no operation effect.

flush()

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

4-23

4 HSL Language Reference

iManager N2000 UMS Element Management System iSStar

Mame read([size])

Description Reads most size bytes from the file (less if the read hits EOF before the size bytes are obtained). If the size argument is negative or omitted, read all the data until EOF is reached. The return value is a string. If the file is not empty, the read file contents are returned. If the file is empty, a null string is returned.

readline([size])

Reads the contents of a line. The content contains the line feed character at the end of the line. If the file ends with an incomplete line, no line feed character may exist. The return value is a string. If the size argument exists and is not negative, the maximum of the returned string is size, including the line feed character. If the file starts with EOF, a null string is returned.
NOTE The returned string contains null characters ('\0') if they occurred in the input information.

readlines()

Reads the contents at the end of a file. EOF is the end mark of a file. The return value is a list. The elements in the list are of the string type. The content of each line is used as an item. Sets the current location for the file. No return value is available. The value of the whence parameter can be one of the following: l 0: indicates the absolute location of the file. l 1: indicates the relative location of the current location. l 2: indicates the relative location of the end of the file. The default value for whence is 0. If a file is opened in an additional way, that is, 'a' or 'a+', then cancel all the seek() operations when you write contents into a file. If you open a file to only write contents into a file ('a'), this method actually has no operation effect. When you open a file to read contents ('a+'), you can still write contents into a file. If a file is opened in text mode ('t'), you can use only tell() to return the deviation value. Other values may incur unknown results. Not all the file objects can use this function.

seek(offset[, whence])

tell() truncate([size])

Returns the current position of the file. Truncates a file to a specified size. If there is the optional augment size, truncates the size of the file. By default, size means truncating a file to a current position.
NOTE l The current file position is not changed. l If a specified size exceeds the current size of the file, the result depends on the operating system. Possibilities include that the file may remain unchanged, increase to the specified size as if zero-filled, or increase to the specified size with undefined new content.

write(str)

Writes a string to the file. No return value is available. Because of buffering, the string may not actually show up in the file until the flush () or close() method is called.

4-24

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

4 HSL Language Reference

Mame writelines(sequence)

Description Writes the sequence into a file. No return value is available. A sequence can be any iteration object that generates a string. Generally, a sequence is a string list. Changes the state of a file object. The existing state of a file object can be represented by objects of the bool type. This is a read-only attribute and can be changed through close(). The function is not applicable for all file objects.

closed

Example
# Read the file by byte def readBytes ( filePath ) # Open the file in read-only mode f = Open( filePath, "r") c=f.read(1) buf = c while c #Print(c) c = f.read(100) buf = buf + c end f.close() return buf end # Read the file data by line def readLine ( filePath ) # Open the file in read-only mode f = Open( filePath, "r") line = f.readline() buf = line while line #Print(c) line = f.readline() buf = buf + line end f.close() return buf end # Read multiple lines of the file once def readLines( filePath ) f = Open( filePath, "r") lineList = f.readlines() f.close() return lineList end # Write the content in the file def writeString ( aString , filePath ) f = file(filePath,'a+') f.write(aString) f.close() end # Write multiple lines in the file def writeLines( strList , filePath ) f = file(filePath,'a+') f.writelines(strList) f.close()

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

4-25

4 HSL Language Reference


end filePath = "c:\\outfile.txt"

iManager N2000 UMS Element Management System iSStar

#Create a file fp = Open(filePath, "w+") fp.write("Hello World!\nNice to meet you.") fp.close() ret = readBytes( filePath ) Print("The result of reading the file by byte:" ) Print(ret) ret = readLine( filePath ) Print("The result of reading the file by line: " ) Print(ret) ret = readLines( filePath ) for line in ret Print("The result of reading multiple lines of the file: " ) Print(line) end # Write the content to the end of the file str = "test write" writeString( str , filePath) # Write multiple lines to the end of the file once strList = [ 'line1 \n','line2 \n'] writeLines( strList , filePath)

Result
The result of reading the file by byte: Hello World! Nice to meet you. The result of reading the file by line: Hello World! Nice to meet you. The result of reading multiple lines of the file: Hello World! The result of reading multiple lines of the file: Nice to meet you.

4.4 HSL Built-In Functions


This topic describes the HSL built-in function that provides a group of object-specific operation functions. 4.4.1 Built-In Functions List This topic lists built-in functions and describes their features. 4.4.2 Example of the Data Operation Function This topic describes the method of using the data operation function through the following example. 4.4.3 Example of the Type Conversion Function This topic describes the method of using the type conversion function through the following function. 4.4.4 Example of Other Functions This topic describes the method of using other functions through the following example.
4-26 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

4 HSL Language Reference

4.4.1 Built-In Functions List


This topic lists built-in functions and describes their features.

Data Operation Functions


Function abs(x) Description Returns the absolute value of x. x is of numeric type. If a complex number is given, the return value is the modulo of the complex number. Compares x and y. If x < y, return a negative number. If x == y, return zero. If x > y, return an integer. Types of x and y are not limited. The function can compare any two objects and return the result. Some insignificant comparison, for example, between file objects, may cause exception. coerce(x,y) complex(real [, imag]) Converts x and y into the same numeric type and returns as a tuple. Creates a complex number. The real part is real, and the imaginary part is imag. If imag is not available, the imaginary part is 0j. Returns a tuple containing quotient and remainder. For an integer, returns (a / b , a % b ). For a floating number, returns (math.floor(a / b ), a % b ). Returns a sequence (string, tuple, or list) or the number of entries in the dictionary (returns the length of the sequence of dictionary). For a single parameter, returns the largest value in sequence s. For several parameters, returns the parameter with the largest value. For a sequence invoking several parameters, parameters in each list are compared as a whole. For a single parameter, returns the smallest value in sequence s. For several parameters, returns the parameter with the smallest value. For a sequence invoking several parameters, parameters in each list are compared as a whole. Returns the power value of x ** y, where y is the index. If z is given, return the result of ((x ** y) % z). Returns the floating point value x rounded to n digits after the decimal point. If n is omitted, the default value is 0.

cmp(x,y)

divmod(a,b)

len(s)

max(s [, args, ...])

min(s [, args, ...])

pow(x, y [, z]) round(num)

Related Instances

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

4-27

4 HSL Language Reference

iManager N2000 UMS Element Management System iSStar

Type Conversion Functions


Function float(x) Description Converts a number of the string type or the numeric type to a number of the floating type. If x is a string, the string can contain only number characters, and the number of which should be no less than one. Converts an integer into a hexadecimal string. Converts a number or string into a decimal numeral. If x is a string, the string can contain only number characters, and the number of which should be not less than one. The optional parameter base represents the base or basis of the conversion and should be an integer ranging from 2 to 36. The default value for base is 10. If x is a digit, you do not need to present base. If you present base when x is a digit, errors occur. Returns a list whose items and ordering of the items are the same with that of the parameters. Converts a number or string into a long integer. If x is a string, the string can contain only number characters, and the number of which should be more than one. The optional parameter base represents the base or basis of the conversion and should be an integer ranging from 2 to 36. The default value for base is 10. If x is a digit, you do not need to present base. If you present base when x is a digit, errors occur. Converts an integer or a long integer into an octal string. Returns the ASCII or Unicode code value of a specified character. For a common character, a value from 0 to 255 is returned. For a Unicode character, a value from 0 to 65535 is returned. The c parameter is a string and contains only one character. Returns the character whose ASCII code is i. The i parameter is an integer and ranges from 0 to 255. Returns the object in string type. The result is the same with that using single counter quotation mark '. The return string generates an object whose value is consistent with that generated by transferring object to eval(). Returns the object in the printable string type. Returns a tuple. The items and the sequence of the items are the same with those of the parameters.

hex(x) int(x [, base])

list(s) long(x [, base])

oct(x) ord(c)

chr(i) repr(object)

str(object) tuple(s)

Related Instances
4-28 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

4 HSL Language Reference

String Conversion Functions


Function unichr(i) unicode(string[,encoding[,errors]]) Description Returns the character whose Unicode code is i. The i parameter is an integer and ranges from 0 to 65535. Converts a string to a Unicode string. The encoding parameter is a string and specifies the data coding of the string. The default coding type in the existing system is used if you do not select a coding type. The errors parameter defines the processing mode of the wrong coding. The mode can be 'stritct', 'replace' or 'ignore'. The default mode is 'strict'.
NOTE If the given data coding is unknown, errors occur.

4.4.2 Example of the Data Operation Function.

Other Common Functions


Function range([start,]stop[,step]) Description Creates a universal function of arithmetic progression list, which is often used in a loop. The argument must be an unformatted integer. When step is omitted, the default value is 1. When start is omitted, the default value is 0. When neither step nor start is omitted, an unformatted integer list [start, start+step,start +2*step,...] is returned. If step is positive, the last element is the maximum value of start+i*step which is smaller than stop; if step is negative, the last element is the maximum value of start + i*step which is greater than stop. Step cannot be zero; otherwise, ValueError is returned.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

4-29

4 HSL Language Reference

iManager N2000 UMS Element Management System iSStar

Function Call(FileName)

Description Runs the .hsl file with the name FileName. The running results are as follows: l FileName is a script file with no error. It indicates the call function runs normally and the function returns 0. l FileName is a script file but with errors. The call function throws an exception. l FileName does not exist. The call function returns error code 4. l FileName exists but is not a script file. The call function returns error code 6. l FileName is an Exit(errID) function. The errID is returned if the script can be performed normally.
CAUTION l For the files with no extension, process them as the script files. l The call function cannot be invoked in the same HSL script for many times. Use the import function first if the call function is invoked once.

Import(FileName)

Imports the script module and supports nesting (that is, importing from A to B, and B to C ). When the import is running properly, the return value is a module object. Otherwise, the return value is None.

Related Instances

4.4.2 Example of the Data Operation Function


This topic describes the method of using the data operation function through the following example.

Example
# common functions n1 = abs(-1) x = 10 y = 30 n2 = cmp(x,y) n3 = complex( 10, 20 ) n4 = divmod(5,3) l1 = [1,2,3,4,8,2,9,0] n5 = max(l1) n6 = min(l1) Print("n1 Print("n2 Print("n3 Print("n4 = = = = "+str(n1)) "+str(n2)) "+str(n3)) "+str(n4))

4-30

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


Print("n5 = "+str(n5)) Print("n6 = "+str(n6))

4 HSL Language Reference

Result
n1 n2 n3 n4 n5 n6 = = = = = = 1 -1 (10+20j) (1, 2) 9 0

4.4.3 Example of the Type Conversion Function


This topic describes the method of using the type conversion function through the following function.

Example
Print("ord function returns the ASCII value of a string of one character or a \ Unicode character ") t1 = ord('c') Print(t1) Print("p_chr function returns a string of one character whose ASCII code is \ the integer i") t2 = chr(99) Print(t2) Print("coerce function returns a string of one character whose ASCII code is \ the integer i") t3 = coerce(1,2) Print(t3) Print("long function convert a string or number to a long integer. ") t4 = long(1) Print(t4) Print("oct function convert an integer number (of any size) to an octal string.") t5 = oct(8) Print(t5) Print("hex function convert an integer number (of any size) to a hexadecimal \ string") t6 = hex(15) Print(t6) Print("int function convert an string to a integer") s = "11" t7 = int(s) t8 = int(s,2) t9 = int(s,16) Print(t7) Print(t8) Print(t9)

Result
ord function returns the ASCII value of a string of one character or a Unicode character 99 chr function returns a string of one character whose ASCII code is the integer i c coerce function returns a string of one character whose ASCII code is the integer i

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

4-31

4 HSL Language Reference


(1, 2) long function convert a 1 oct function convert an 010 hex function convert an 0xf int function convert an 11 3 17

iManager N2000 UMS Element Management System iSStar

string or number to a long integer. integer number (of any size) to an octal string. integer number (of any size) to a hexadecimal string string to a integer

4.4.4 Example of Other Functions


This topic describes the method of using other functions through the following example.

Example
#Take the range function as an example. The synopsis is as follows: #range([start,] stop [,step]). The range function generates a tuple. #The typical usage is represented in a for loop. #result: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] Print(range(10)) #result: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] Print( range(1, 11)) #result: [0, 5, 10, 15, 20, 25] Print( range(0, 30, 5)) #result: [0, 3, 6, 9] Print( range(0, 10, 3)) #result: [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] Print( range(0, -10, -1)) #result: [] Print(range(0)) #result: [] Print(range(1, 0))

Result
[0, [1, [0, [0, [0, [] [] 1, 2, 3, 4, 5, 6, 7, 8, 9] 2, 3, 4, 5, 6, 7, 8, 9, 10] 5, 10, 15, 20, 25] 3, 6, 9] -1, -2, -3, -4, -5, -6, -7, -8, -9]

4-32

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5
About This Chapter

HFC Library Reference

The iSStar provides various library functions, such as Type Conversion Function, Time Function, Input and Output Function, Network Operation Function, Directory and File Operation Function and so on. These functions are called HSL Foundation Class (HFC) functions. HFC functions help you to compile simple scripts and facilitate debugging and maintenance. 5.1 NE Operation Function The NE operation function enables you to easily maintain and manage large numbers of NEs of various types and different versions. You can obtain NE information, issue MML commands to NEs, obtain MML messages, and manage MML message buffers. 5.2 CSV Parse Functions The CSV parse functions are used to processing CSV files through a script. 5.3 XML Parse Functions A set of functions are provided for parsing XML files. 5.4 MML Message Parse Functions This topic describes the MML message parse functions. By using these functions, you can query a message for the information such as the parameters, entries, records, and attribute values. In addition, you can output the obtained information in the tuple format, thus knowing the execution of MML commands on the NEs. 5.5 Alarm Message Parsing Function This describes the alarm message parsing functions. Using these functions, you can obtain the information about the alarms in a message, such as alarm severity and alarm location information. This facilitates future maintenance. 5.6 Database Operation Function The database operation module provides the query operation interface for alarms, performances, and the configuration library. 5.7 Alarm Operation Function This describes the alarm operation function. This function enables you to send to the N2000 UMS the detected exceptions during the running of a script. In this way, you can monitor and manage the exceptions occurred on the network. The alarms that can be sent are fault alarms, clearance alarms, and event alarms.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-1

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.8 OM Operation Function This describes the OM operation function. This function enables you to obtain the version number of the NM software, record the operations of a script and generate logs, and obtain the information of the subareas of the NE. 5.9 Type Conversion Functions The iSStar uses the type conversion function to provide the exception protection mechanism for data type conversion. This prevents the script execution from being terminated by a conversion error. 5.10 Time Functions This topic describes the time functions which enable you to obtain the information related to time and provide the function for converting time formats. 5.11 Input and Output Functions This topic describes input and output functions and the function of setting the output mode. 5.12 GetError Function This functions provides the unified handling function for error codes. It enables you to obtain the last error information list and the error cause function. 5.13 Network Operation Function You can perform network communications operations through the network operation functions. For example, you can upload and download files, log in the system remotely, and run commands remotely. 5.14 Report Operation Function This topic describes the report operation functions. By using these functions, you can perform the related operations such as design, display, and manage reports. 5.15 Directory and File Operation Function This topic describes the operation functions related to the directories and files. 5.16 GUI Interactive Library Function GUI interactive library functions enable you to interact with the GUI through the controls during the execution of a task. 5.17 Task Management Function The task management functions are the operation functions related to the task. 5.18 Assertion Function Assertion functions are the operation functions related to assertion. 5.19 Function: ModifyProjParam This function allows you to refresh the service parameter (paramDic) to the HFC interface of the project package. 5.20 Mail Sending Function The functions of setting the mail server information, setting mail information, and sending mails are available. 5.21 Function: SendSMSMessage This function is used to send short messages on the N2000 UMS server.

5-2

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.1 NE Operation Function


The NE operation function enables you to easily maintain and manage large numbers of NEs of various types and different versions. You can obtain NE information, issue MML commands to NEs, obtain MML messages, and manage MML message buffers. 5.1.1 Overview of NE Operation Function This describes the basic functions and procedures of NE operation functions. 5.1.2 Function: ConnectNE This describes the Connect NE function. This function enables you to specify the NE for a task. 5.1.3 Function: GetNELst This describes the GetNELst function. This function enables you to obtain the name list of all the NEs managed by the N2000 UMS. The NEs refer to both connected and disconnected NEs. 5.1.4 Function: GetNELstByType This describes the GetNELstByType function. This function enables you to obtain the name list of all the NEs managed by the N2000 UMS by NE type. The NEs refer to both connected and disconnected NEs. 5.1.5 Function: GetNEName This describes the GetNEName function. This function enables you to obtain the name of the NE being operated. 5.1.6 Function: GetNEFDN This describes the GetNEFDN function. This function enables you to obtain the FDN of the specified NE. If NEName is default, the FDN of the current NE is obtained. FDN is a unique identification of an NE in the topology, such as .0.4.1. 5.1.7 Function: GetNEIP This describes the GetNEIP function. This function enables you to obtain the IP address of the specified NE. If NEName is default, the IP address of the current NE is obtained. 5.1.8 Function: GetNEVer This describes the GetNEVer function. This function enables you to obtain the version number of the specified NE. If NEName is default, the version number of the current NE is returned. 5.1.9 Function: GetNEType This describes the GetNEType function. This function enables you to obtain the type of the specified NE. If NEName is default, the type of the NE that is operated by the current task is returned. 5.1.10 Function: GetNETypeIDByName This describes the GetNETypeIDByName function. This function enables you to obtain the ID of an NE type according to the name of this NE type. 5.1.11 Function: GetNETypeNameByID This describes the GetNETypeNameByID function. This function enables you to obtain the name of an NE type according to the ID of this NE type. 5.1.12 Function: GetNEStatus This describes the GetNEStatus function. This function enables you to obtain the status of the specified NE. If NEName is default, the status of the NE currently operated is returned. 5.1.13 Function: SendMML
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-3

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

This describes the SendMML function, which enables you to issue MML commands to the NE that is operated currently. 5.1.14 Function: GetMMLReport This describes the GetMMLReport function. This function enables you to obtain and clear the messages in the buffer. 5.1.15 Function: GetAllMMLReport This describes the GetALLMMLReport function. This function enables you to obtain and clear all the MML messages in the locale buffer. 5.1.16 Function: ClearMMLBuffer This section describes the ClearMMLBuffer function. This function enables you to clear the MML messages in the local buffer to save system resources. 5.1.17 Function: SetMMLBufferSize This describes the SetMMLBufferSize function. This function enables you to set the size of a message buffer, that is, the maximum number of messages that are allowed in a buffer. 5.1.18 Example of NE Operation Function This gives an example of the NE operation function. You can better understand how to use NE operation functions to perform routine maintenance.

5.1.1 Overview of NE Operation Function


This describes the basic functions and procedures of NE operation functions.

Basic Functions
The NE operation function enables you to easily maintain and manage large numbers of NEs of various types and different versions. You can obtain NE information, issue MML commands to NEs, obtain MML messages, and manage MML message buffers. Table 5-1 lists the NE operation functions. Table 5-1 List of NE operation functions Function 5.1.2 Function: ConnectNE 5.1.3 Function: GetNELst Description Selects the NE that is operated by the current task. Returns the name list of all the NEs managed by the N2000 UMS. The NEs refer to both connected and disconnected NEs. Returns the name list of all the NEs managed by the N2000 UMS by NE type. The NEs refer to both connected and disconnected NEs. Returns the name of the NE that is operated by the current task. Returns the FDN of the specified NE, or the FDN of the connected NE if NEName is default. Returns the IP address of the specified NE, or the IP address of the connected NE if NEName is default.
Issue 02 (2010-10-10)

5.1.4 Function: GetNELstByType 5.1.5 Function: GetNEName 5.1.6 Function: GetNEFDN 5.1.7 Function: GetNEIP

5-4

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Function 5.1.8 Function: GetNEVer 5.1.9 Function: GetNEType 5.1.10 Function: GetNETypeIDByName 5.1.11 Function: GetNETypeNameByID 5.1.12 Function: GetNEStatus 5.1.13 Function: SendMML 5.1.14 Function: GetMMLReport 5.1.15 Function: GetAllMMLReport 5.1.16 Function: ClearMMLBuffer 5.1.17 Function: SetMMLBufferSize

Description Returns the version number of the specified NE. Returns the type of the specified NE. Obtains the ID of an NE type according to the name of this NE type. Obtains the name of an NE type according to the ID of this NE type. Returns the status of the NE that is operated by the current task. Issues MML commands to the NE that is operated by the current task. Returns and clears the message with the specified index number in the buffer. Returns and clears all MML messages in the buffer. Clears all messages in the buffer to release system resources. Sets the size of the MML message buffer.

Procedure
Figure 5-1 shows how to use NE operation functions to manage NEs.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-5

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Figure 5-1 Procedure for using NE operation functions

The procedure is as follows: 1. Select an NE. Select the required NE by referring to 5.1.2 Function: ConnectNE. After this function is called successfully, the corresponding task is created. 2. Issue MML commands. Issue MML commands by referring to 5.1.13 Function: SendMML. The returned message shows whether the commands are successfully issued.
NOTE

The return value of the function described in 5.1.13 Function: SendMML only shows whether the commands are successfully issued. To check the execution details, you need to obtain the message by calling the function described in 5.1.14 Function: GetMMLReport or 5.1.15 Function: GetAllMMLReport.

3. 4.

Run the commands on the NE. The NE returns messages which are then saved in the buffer. Each task has an individual buffer. After an MML command is issued to the NE, the returned MML message is saved in the buffer.

5.

Obtain the message. You can obtain the message by calling the function described in 5.1.14 Function: GetMMLReport or 5.1.15 Function: GetAllMMLReport.

5-6

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


NOTE

5 HFC Library Reference

After you obtain the message, it is removed from the buffer.

6.

Clear the buffer. To save system resources, you can delete all the messages in the buffer by referring to 5.1.16 Function: ClearMMLBuffer.
NOTE

After the task is complete, the buffer is cancelled.

5.1.18 Example of NE Operation Function shows the examples.

5.1.2 Function: ConnectNE


This describes the Connect NE function. This function enables you to specify the NE for a task.

Synopsis
ConnectNE(NEName)

Note
l l You must call this function to select the required NE. Then, after the operation is complete, you can issue commands to the NE. A task is created after the operation. All the operations related to this task apply to this NE. If you need to operate other NEs, you must call this function again to select other NEs and create new tasks. You can select only the NEs that are properly connected to the N2000 UMS.

Parameter Description
Parameter NEName Description NEName is a string. It indicates the name of an NE.

Return Value
The return value is an integer. If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
# Connect the NE. nename = 'rnc01' ret = ConnectNE(nename) # Exist if the connection failed. if ret == 0 Print(' Failed to connect to %s.'%nename)

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-7

5 HFC Library Reference


Exit(0) end

iManager N2000 UMS Element Management System iSStar

# The connection is successful. Send an MML command. @LST VER:;

MML Message Output


LST VER:; +++ O&M NE #41302 2007-06-21 19:38:43

%%/*415*/LST VER:;%% RETCODE = 0 Execution succeeded.

Version information ------------------Product version = BSC6800V100R008ENGC01B080

---

END

Related Example

5.1.3 Function: GetNELst


This describes the GetNELst function. This function enables you to obtain the name list of all the NEs managed by the N2000 UMS. The NEs refer to both connected and disconnected NEs.

Synopsis
GetNELst()

Note
None

Parameter Description
None

Return Value
l l The return value is a list. If the function is called successfully, the name list of all the NEs managed by the N2000 UMS is returned. Otherwise, an empty list is returned. Each element in the list is a string indicating the NE name.

Error Handling
None.
5-8 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Example
# Get the NE list. nelist = GetNELst() # Print the names of all NEs. Print('All NEs are:') for ne in nelist Print(ne) end

Result
All NEs are: rnc01 msc01 msc02 nodeb01

Related Example

5.1.4 Function: GetNELstByType


This describes the GetNELstByType function. This function enables you to obtain the name list of all the NEs managed by the N2000 UMS by NE type. The NEs refer to both connected and disconnected NEs.

Synopsis
GetNELstByType(NEType)

Note
None

Parameter Description
Parameter NEType Description NEType is a string. It indicates the NE type.

Return Value
l l The return value is a list. If the function is called successfully, the NE name list is returned. Otherwise, an empty string is returned. Each element in the list is a string indicating the NE name.

Error Handling
None.

Example
# Get the NE list based on NE type.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-9

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

rncLst = GetNELstByType("RNC") Print('GetNELstByType("RNC") return: ') Print(rncLst)

Result
GetNELstByType("RNC") return: ['rnc01', 'rnc02', 'rnc03', 'rnc111', 'rnc199', 'rncd1', 'rncme', 'rncreal']

Related Example

5.1.5 Function: GetNEName


This describes the GetNEName function. This function enables you to obtain the name of the NE being operated.

Synopsis
GetNEName()

Note
The iSStar allows you to create multiple tasks. You can click Select NE to select multiple NEs. Then, the system can create multiple tasks. Each task corresponds to an NE. If multiple tasks are involved, each task can obtain the name of its NE through the GetNEName function.

Parameter Description
None

Return Value
The return value is a string. If an NE is operated for the current task, the name of the NE is returned. Otherwise, return null strings.

Error Handling
None.

Example
#Connect the NE rnc001. ConnectNE("rnc001") #Get the name of the connected NE. name = GetNEName() Print("name: " + name)

Result
name: rnc001

Related Example
5-10 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.1.6 Function: GetNEFDN


This describes the GetNEFDN function. This function enables you to obtain the FDN of the specified NE. If NEName is default, the FDN of the current NE is obtained. FDN is a unique identification of an NE in the topology, such as .0.4.1.

Synopsis
GetNEFDN([NEName])

Note
None.

Parameter Description
Parameter NEName Description NEName is of string type. It indicates the name of an NE. The default value is the name of the NE that is currently connected.

Return Value
The return value is a string. l l l If you have specified the NE, its FDN is returned. If no NE is specified but an NE is operated, the FDN of this NE is returned. If no NE is specified, no NE is operated, or the specified NE does not exist, a null string is returned.
NOTE

If the specified NE is disconnected from the N2000 UMS, a null string is returned.

Error Handling
None.

Example 1
#Connect the NE rnc001. ConnectNE("rnc001") #Get the FDN of the connected NE. fdn = GetNEFDN() Print("FDN: " + fdn)

Result of Example 1
fdn: .0.1.177

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-11

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Example 2
#Get the FDN of the NE rnc001. fdn = GetNEFDN("rnc001") Print("FDN: " + fdn)

Result of Example 2
fdn: .0.1.177

Related Example

5.1.7 Function: GetNEIP


This describes the GetNEIP function. This function enables you to obtain the IP address of the specified NE. If NEName is default, the IP address of the current NE is obtained.

Synopsis
GetNEIP([NEName])

Note
None.

Parameter Description
Parameter NEName Description NEName is a string. It indicates the name of an NE. The default value is the name of the NE that is currently connected.

Return Value
The return value is a string. l l l If you have specified the NE, its IP address is returned. If no NE is specified but an NE is operated, the IP address of this NE is returned. If no NE is specified, no NE is operated, or the specified NE does not exist, a null string is returned.
NOTE

If the specified NE is disconnected from the N2000 UMS, a null string is returned.

Error Handling
None.

Example 1
#Connect the NE rnc001.

5-12

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


ConnectNE("rnc001") #Get the IP address of the connected NE. ip = GetNEIP() Print("IP: " + ip)

5 HFC Library Reference

Result of Example 1
ip: 200.200.200.200

Example 2
#Get the IP address of the connected NE. ip = GetNEIP("rnc001") Print("IP: " + ip)

Result of Example 2
ip: 200.200.200.200

Related Example

5.1.8 Function: GetNEVer


This describes the GetNEVer function. This function enables you to obtain the version number of the specified NE. If NEName is default, the version number of the current NE is returned.

Synopsis
GetNEVer([NEName])

Note
None

Parameter Description
Parameter NEName Description NEName is a string. It indicates the name of an NE. The default value is the name of the NE that is currently connected.

Return Value
The return value is a string. l l l If you have specified the NE, its version number is returned. If no NE is specified but an NE is operated, the version number of this NE is returned. If no NE is specified, no NE is operated, or the specified NE does not exist, a null string is returned.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-13

Issue 02 (2010-10-10)

5 HFC Library Reference


NOTE

iManager N2000 UMS Element Management System iSStar

If the specified NE is disconnected from the N2000 UMS, a null string is returned.

Error Handling
None.

Example 1
#Connect the NE ne1. ConnectNE("ne1") #Get the version number of the NE. neVer = GetNEVer() Print('GetNEVer() return: ') Print(neVer)

Result of Example 2
GetNEVer() return: BSCNEV100R006ENGC01B071

Related Example

5.1.9 Function: GetNEType


This describes the GetNEType function. This function enables you to obtain the type of the specified NE. If NEName is default, the type of the NE that is operated by the current task is returned.

Synopsis
GetNEType([NEName])

Note
None

Parameter Description
Parameter NEName Description NEName is a string. It indicates the name of an NE. The default value is the name of the NE that is currently connected.

Return Value
The return value is a string. l l
5-14

If you have specified the NE, its NE type is returned. If no NE is specified but an NE is operated, the type of this NE is returned.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

If no NE is specified, no NE is operated, or the specified NE does not exist, a null string is returned.
NOTE

If the specified NE is disconnected from the N2000 UMS, a null string is returned.

Error Handling
None.

Example 1
#Connect the NE ne1. ConnectNE("ne1") #Get the NE type. neType = GetNEType() Print('GetNEType() return: ') Print(neType)

Result of Example 2
GetNEType() return: RNC

Related Example

5.1.10 Function: GetNETypeIDByName


This describes the GetNETypeIDByName function. This function enables you to obtain the ID of an NE type according to the name of this NE type.

Synopsis
GetNETypeIDByName(typename, [isVirtual])

Note
None.

Parameter Description
Parameter typename isVirtual Description typenameis a string. It indicates the type name of an NE. isVirtualis a boolean. It indicates whether the NE is a virtual NE, by default, the NE is a real NE.

Return Value
The return value is a dictionary. The format is as follows: {NE type name: NE type ID}.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-15

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Error Handling
None.

Example
Print(GetNETypeIDByName('BSC6000'))

Result
{45}

Related Example

5.1.11 Function: GetNETypeNameByID


This describes the GetNETypeNameByID function. This function enables you to obtain the name of an NE type according to the ID of this NE type.

Synopsis
GetNETypeNameByID(typeId)

Note
None.

Parameter Description
Parameter typeId Description typeIdis an integer. It indicates the type ID of an NE.

Return Value
The return value is a dictionary. The format is as follows: {NE type ID:NE type name}.

Error Handling
None.

Example
Print(GetNETypeNameByID(45))

Result
{BSC6000}

Related Example
5-16 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.1.12 Function: GetNEStatus


This describes the GetNEStatus function. This function enables you to obtain the status of the specified NE. If NEName is default, the status of the NE currently operated is returned.

Synopsis
GetNEStatus([NEName])

Note
None

Parameter Description
Parameter NEName Description NEName is a string. It indicates an NE name. The default value is the name of the NE that is currently connected.

Return Value
The return value is an integer. If the NE is connected, 1 is returned. Otherwise, 0 is returned. l l l If you have specified an NE, the status of this NE is returned. If no NE is specified but an NE is operated, the status of this NE is returned. If no NE is specified, no NE is operated, or the specified NE does not exist, 0 is returned.

Error Handling
None.

Example 1
#Connect the NE rnc001. ConnectNE("rnc001") #Get the status of the connected NE. neStatus = GetNEStatus() Print("neStatus: "+ str(neStatus))

Result of Example 1
neStatus: 1

Example 2
#Get the status of the NE rnc001. neStatus = GetNEStatus("rnc001") Print("neStatus: "+ str(neStatus))

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-17

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Result of Example 2
neStatus: 1

Related Example

5.1.13 Function: SendMML


This describes the SendMML function, which enables you to issue MML commands to the NE that is operated currently.

Synopsis
SendMML(MMLCmd)

Note
l l l Call 5.1.2 Function: ConnectNE to select the NE to be operated before calling this function. You can only use SendMML to issue MML commands to the NE that supports MML. Issuing MML commands to the NE being upgraded might fail.

Parameter Description
Parameter MMLCmd Description MMLCmd is a string. It indicates the MML command string.

Return Value
The return value is a string. If the function is called successfully, 1 is returned. Otherwise, 0 is returned.
NOTE

You can use the 5.4 MML Message Parse Functions function to view the MML message. Thus, you can obtain the information about the execution of the MML commands on the NE.

Error Handling
None.

Example
#Connect the NE neName. ConnectNE("neName") #Sending MML command sendmml = SendMML("LST CELL:;") if sendmml==1 Print('SendMML("LST CELL:;") success.') else Print('SendMML("LST CELL:;") failure!') end

5-18

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Result
SendMML("LST CELL:;") success.

MML Message Output


LST CELL:; +++ NE 2007-06-21 11:34:08 O&M #21894 %%/*8221*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID No. 0 0 1 1 20 20 11 11 12 12 (Number of results = --END 300 300 301 302 302 5)

NodeB name 3812 3812 BBU 3812E 3812E

Local cell ID 0 1 0 1 2

Subrack No. 3 3 3 3 3

Subsystem 0 0 0 0 0

Related Example

5.1.14 Function: GetMMLReport


This describes the GetMMLReport function. This function enables you to obtain and clear the messages in the buffer.

Synopsis
GetMMLReport([Idx])

Note
l After an MML command is issued to the NE, the returned MML message is saved in the buffer. Each task has an individual buffer. You can set the buffer size by referring to 5.1.17 Function: SetMMLBufferSize. The messages accumulates in the buffer. When the number of stored messages exceeds the maximum, new messages are lost. You need to obtain and clear the messages in the buffer. After a task is complete, the corresponding buffer is cancelled and the messages are deleted. The messages in a buffer are identified by the location index. The location index starts from 0 and increases in sequence. After you extract a message with the position index as a, it is deleted from the buffer. Then, the location indexes that are greater than a are changed correspondingly. For example, four messages, 0, 1, 2, and 3 are available in the buffer. After you extract message 1, the location position of message 2 changes to 1 and the location position of message 3 changes to 2.

l l l

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-19

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Description
Parameter Idx Description Idx is the index of the delivering time of MML message and counts from 0. The default value is 0. When Idx is equal to -1, the obtained message is the return message of the latest delivered MML command.

Return Value
The return value is a string. If the function is called successfully, the message content is returned and the message is deleted from the buffer. Otherwise, a null string is returned.

Error Handling
None.

Example
#Connect the NE ne1. ConnectNE("ne1") #Send MML commands continuously. @LST OP:; @LST CELL:; @LST CELL:; #Get the third message. rpt1 = GetMMLReport(-1) Print("The third report : ") Print(rpt1) #Get the first message. rpt2 = GetMMLReport(0) Print("The first report : ") Print(rpt2)

Result
The third report : +++ NE 2006-12-19 20:48:50 O&M #8522 %%/*2116*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID 0 CELL1 1 1 CELL2 1 (Number of results = 2) --END

NodeB name NODEB1 NODEB1

Local cell ID 0 1

Subrack No. 3 3

The first report :

5-20

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


+++ NE 2008-01-10 15:01:31 O&M #1426 %%/*6718*/LST OP:;%% RETCODE = 0 Operation succeeded Operator info ------------Operator name

5 HFC Library Reference

Status

IP Address

Service 10.161.24.166 NULL

Login Time 2008-01-10 14:15:50 NULL

admin Online 10.161.24.166 GUEST Offline NULL (Number of results = 2) --END

MML Message Output


+++ NE 2008-01-10 15:01:31 O&M #1426 %%/*6718*/LST OP:;%% RETCODE = 0 Operation succeeded Operator info ------------Operator name

Status

IP Address

Service 10.161.24.166 NULL

Login Time 2008-01-10 14:15:50 NULL

admin Online 10.161.24.166 GUEST Offline NULL (Number of results = 2) --END

+++ NE 2006-12-19 20:48:50 O&M #8522 %%/*2116*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID 0 CELL1 1 1 CELL2 1 (Number of results = 2) --END

NodeB name NODEB1 NODEB1

Local cell ID 0 1

Subrack No. 3 3

+++ NE 2006-12-19 20:48:50 O&M #8522 %%/*2116*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID 0 CELL1 1 1 CELL2 1 (Number of results = 2) --END

NodeB name NODEB1 NODEB1

Local cell ID 0 1

Subrack No. 3 3

Related Example

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-21

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.1.15 Function: GetAllMMLReport


This describes the GetALLMMLReport function. This function enables you to obtain and clear all the MML messages in the locale buffer.

Synopsis
GetAllMMLReport()

Note
l l For the tasks that may generate MML messages, each one has an individual buffer. You can set the buffer size by referring to 5.1.17 Function: SetMMLBufferSize. The MML messages accumulates in the buffer. When the number of stored messages exceeds the maximum, new messages are lost. You need to obtain and clear the messages in the buffer. After a task is complete, the buffer is cancelled and the messages are deleted.

Parameter Description
None.

Return Value
l l l The return value is a list. The elements in the list are the obtained MML messages. If the message fails to be obtained, a null string is returned.

Error Handling
None.

Example
#Connect the NE ne1. ConnectNE('ne1') #Clear the MML messages in the buffer. ClearMMLBuffer() #Send MML commands continuously. @@@ LST OP:; LST CELL:; @@@ #Get and clear the MML messages in the buffer. allReport = GetAllMMLReport() #Output the messages in the buffer. Print("There are %d reports:"%(len(allReport))) for rpt in allReport Print("Report = %s"%rpt) end

5-22

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Result
There are 2 reports: Report = +++ NE 2008-01-10 15:01:31 O&M #1426 %%/*6718*/LST OP:;%% RETCODE = 0 Operation succeeded Operator info ------------Operator name

Status

IP Address

Service 10.161.24.166 NULL

Login Time 2008-01-10 14:15:50 NULL

admin Online 10.161.24.166 GUEST Offline NULL (Number of results = 2) --END

Report = +++ NE 2006-12-19 20:48:50 O&M #8522 %%/*2116*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID 0 CELL1 1 1 CELL2 1 (Number of results = 2) --END

NodeB name NODEB1 NODEB1

Local cell ID 0 1

Subrack No. 3 3

MML Message Output


There are 2 reports: Report = +++ NE 2008-01-10 15:01:31 O&M #1426 %%/*6718*/LST OP:;%% RETCODE = 0 Operation succeeded Operator info ------------Operator name

Status

IP Address

Service 10.161.24.166 NULL

Login Time 2008-01-10 14:15:50 NULL

admin Online 10.161.24.166 GUEST Offline NULL (Number of results = 2) --END

Report = +++ NE 2006-12-19 20:48:50 O&M #8522 %%/*2116*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID 0 CELL1 1 1 CELL2 1 (Number of results = 2)

NodeB name NODEB1 NODEB1

Local cell ID 0 1

Subrack No. 3 3

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-23

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

---

END

Related Example

5.1.16 Function: ClearMMLBuffer


This section describes the ClearMMLBuffer function. This function enables you to clear the MML messages in the local buffer to save system resources.

Synopsis
ClearMMLBuffer()

Note
l After an MML command is issued to the NE, the returned MML messages are saved in the buffer. Each task has an individual buffer. You can set the buffer size by referring to 5.1.17 Function: SetMMLBufferSize. If you do not invoke the 5.4.3 Function: ParseMMLRpt function to parse the MML messages or invoke the ClearMMLBuffer function to clear the buffer of MML messages after the MML command is issued, the MML messages accumulates in the buffer. When the number of stored messages exceeds the maximum that is set in 5.1.17 Function: SetMMLBufferSize, new messages are lost, and thus new MML commands fail to be issued. Therefore, you need to invoke the 5.4.3 Function: ParseMMLRpt function to parse the MML messages or invoke the ClearMMLBuffer function to clear the buffer of MML messages in time.

Parameter Description
None.

Return Value
The return value is an integer. If all the messages are cleared from the buffer, the value 1 is returned. Otherwise, the value 0 is returned.

Error Handling
None.

Example
#Connect the NE ne1. ConnectNE("ne1") #Send MML commands continuously.@LST VER:; @LST VER:; returncode = ClearMMLBuffer() Print('ClearMMLBuffer() return: ' + str(returncode))

Related Example
5-24 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.1.17 Function: SetMMLBufferSize


This describes the SetMMLBufferSize function. This function enables you to set the size of a message buffer, that is, the maximum number of messages that are allowed in a buffer.

Synopsis
SetMMLBufferSize([Len])

note
l l l After an MML command is issued to an NE, the returned MML message is saved in a buffer. Each task has an individual buffer. The messages accumulates in the buffer. When the number of stored messages exceeds the maximum, new messages are lost. The SetMMLBufferSize(len) function can initialize the buffer, that is, clear the existing messages in it.

Parameter Description
Parameter Description Len is an integer and >= -1, with the default value as 1000.The following different values for len have different meanings: Len l When len is equal to -1, you can infer that all messages are allowed in the buffer. l When len is equal to 0, messages are not buffered. l When len is greater than 0, the value of len is the maximum number of allowable messages in the buffer. After the value of len reaches the maximum, MML commands cannot be issued.

Return Value
The return value is a string. If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Example
ConnectNE('ne1') #Set the size of the MML buffer to 2. returncode = SetMMLBufferSize(1) @@@ LST VER:; LST VER:; LST VER:; @@@ mmllist = GetAllMMLReport() Print('The number of mml reports is : %s'%str(len(mmllist)))

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-25

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Result
The number of mml reports is : 1

MML Message Output


LST VER:; +++ O&M UMG8900 #5852 2008-01-08 12:07:34

%%/*117775*/LST VER:;%% RETCODE = 0 Execution succeeded.

Version information -----------------------Product version = UMG8900V200R007C02B019

---

END

Related Example

5.1.18 Example of NE Operation Function


This gives an example of the NE operation function. You can better understand how to use NE operation functions to perform routine maintenance.

Scenario
In daily OM work, you need to check whether NEs run normally and submit a check report. You can use the iSStar to check the operation of a certain type of NEs. For example, you are required to check the hard disk usages of the BAMs on all the NEs of the ABC type. If the remaining hard disk space is lower than 50%, you can infer that the NE does not run properly. Then, you need to provide the information about the NE name, disk drive, total space, remaining space, and rate of the remaining space. If the remaining space is higher than 50%, no output information is required.

Procedure
1. 2. 3. 4. By using the 5.1.4 Function: GetNELstByType function, check the names of the all the NEs of the ABC type. By using the 5.1.2 Function: ConnectNE function, specify the NEs that issue the MML commands. By using the 5.1.13 Function: SendMML function, issue the MML command for querying the hard disk usage of each NE. By using the 5.1.15 Function: GetAllMMLReport function, obtain the message returned by the MML command in the buffer.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

5-26

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5. 6.

By using the 5.4 MML Message Parse Functions function, parse the message and obtain the data of the remaining space of each disk. Use the Print function to print the obtained data on the output window.

Task Script
Print("Routine health check starts") # Get the ABC NE list. neList = GetNELstByType("ABC") Print("Print the obtained ABC NE list.") Print(neList) Print("") if not neList Print("The ABC NE does not exist.") Exit(0) end #Define a function. #Check the usage of the hard disks through parsing the returned message. def parseReport(report) mmlParser = CreateMMLParser(report) # Parse the message and isolate the messages in invalid format. objNum = GetObjNum(mmlParser) if objNum <> 2 Print("InvalidReport") return False end # Get the list of hard disks of the BAM. The message of hard disks corresponds # to the second entry of this message. The index of the entries counts from 0. objIndex = 1 hardDiscNum = GetRecordNum(mmlParser, objIndex) for hdIndex in range(hardDiscNum) freeSpaceValue = GetAttrValueByName(mmlParser, objIndex, "Free space(%)", hdIndex) # Convert the string of free space into an integer. Determine whether the #free space meets the requirement. freeSpace = int(freeSpaceValue[:-1]) # Check whether the free space is lower than 50%. if freeSpace < 50 # Get the driver of the hard disk that did no pass the check. hardDisc = GetAttrValueByName(mmlParser, objIndex, "Logical harddisk", hdIndex) Print("The free space of hard disk %s is %s. The free space is insufficient.\ Please handle it."%(hardDisc, freeSpaceValue)) return False end end return True end # Start performing the task. SUCCESS = 1 # "List of the NEs whose free space of hard disk is lower than 50%" resultNeList = [] for ne in neList Print("Checking the NE %s"%ne) if ( ConnectNE(ne) == SUCCESS)

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-27

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar


Print("Sending commands to query...") if( SendMML("DSP BAMSRV:;") == SUCCESS) report = GetMMLReport() Print("Check result") if not parseReport(report) # Record the NE that doesn't pass the check resultNeList.append(ne) end else Print("Command failed") end else Print("Connecting the NE %s failed"%ne) end

end # Print the list of the NEs whose free space of hard disk is lower than 50% if resultNeList Print("List of NEs whose free hard disk spaces are lower than 50%") Print(resultNeList) else Print("The free hard disk space of all checked NEs are greater than 50%") end Print("The routine health check ends.")

Result
Routine health check starts. Print the obtained ABC NE list. ['NE203', ' NE 96', ' NE 99'] Checking the NE NE203. Connecting NE NE203 failed. Checking the NE NE96 Sending commands for query... Check result The free space of disk D:\ is 31%. The free space is insufficient. Please handle it. Checking the NE NE99. Connecting the NE NE99 failed. List of NEs whose free space of hard disks are lower than 50%. ['NE96'] The routine health check ends.

MML Message Output


+++ NE 2007-01-20 15:06:53 O&M #656908 %%/*12218*/DSP BAMSRV:;%% RETCODE = 0 Execution succeeded. BAM server state(CPU&MEM) ------------------------CPU(%) = 3% MEM(%) = 75% (Number of results = 1) BAM server state(Logical harddisk) ----------------------------------

5-28

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


Logical Total Free Free Logical Total Free Free harddisk space(M) space(M) space(%) harddisk space(M) space(M) space(%) = = = = = = = = C:\ 9546 5622 58% D:\ 9537 2961 31%

5 HFC Library Reference

(Number of results = 2) --END

5.2 CSV Parse Functions


The CSV parse functions are used to processing CSV files through a script. 5.2.1 Overview of CSV Parse Functions The iSStar provides the CSV parse functions for processing CSV files. 5.2.2 Function: ReadCSVFile This function is used to read a CSV file and return the contents of the file in a 2-dimensional list. 5.2.3 Function: WriteCSVFile This function is used to write the specified contents to a CSV file.

5.2.1 Overview of CSV Parse Functions


The iSStar provides the CSV parse functions for processing CSV files. Table 5-2 lists the CSV parse functions provided by the iSStar. Table 5-2 List of the CSV parse functions Function 5.2.2 Function: ReadCSVFile 5.2.3 Function: WriteCSVFile Description To read a CSV file and return the contents of the file in a 2dimensional list. To write back a CSV file.

5.2.2 Function: ReadCSVFile


This function is used to read a CSV file and return the contents of the file in a 2-dimensional list.

Prototype
ReadCSVFile(File)
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-29

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Precautions
None.

Parameter Description
Parameter File Description File object. The File parameter is the return value of the Open Function. In addition, the invocation of the Open function must use the rb mode.

Return Values
If a file is successfully opened, the function returns a 2-dimensional string list; otherwise, the function returns None.

Error Handling
None.

Example
f = Open('test.csv') content = ReadCSVFile(f) for row in content for col in row Print(col) end end

Result
Contents of test.csv.

5.2.3 Function: WriteCSVFile


This function is used to write the specified contents to a CSV file.

Prototype
WriteCSVFile(File, Content)

Precautions
None.

5-30

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Description
Parameter Description File is a file object. It indicates the CSV file where contents are to be written back. If the File parameter is the return value of the Open function,the invocation of the Open function must use the wb mode. Content is a 2-dimensional string list. It indicates the contents that are to be written back to File.

File

Content

Return Values
If contents are written back successfully, the function returns True; otherwise, the function returns False.

Error Handling
None.

Example
f = Open('test1.csv' , "wb") lines = ['1,2,3', '4,5,6', '7,8,9'] content = [] for line in lines content.append(line.split(",")) end WriteCSVFile(f, content)

Result
The numbers from 1 to 9 are written in test1.csv.

5.3 XML Parse Functions


A set of functions are provided for parsing XML files. 5.3.1 Overview of XML Parse Functions The iSStar provides the XML parse functions for processing standard XML files. 5.3.2 Function: OpenXML This function is used to open an XML file. 5.3.3 Function: WriteBackXML This function is used to write back an XML file. 5.3.4 Function: NewElement This function is used to generate a node object. 5.3.5 Function: GetSubElement This function is used to obtain the first subelement object that is matched under the passed path.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-31

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.3.6 Function: GetSubElements This function is used to obtain all the subelement objects that are matched under the passed path. 5.3.7 Function: GetAttribute This function is used to obtain the specified property value of the specified element object. 5.3.8 Function: AddSubElement This function is used to add a subelement object. 5.3.9 Function: SetElementContent This function is used to set the contents of an element object. 5.3.10 Function: GetElementContent This function is use to obtain the contents of the specified element object. 5.3.11 Function: SetAttribute This function is used to modify the attributes of an element object. 5.3.12 Function: RemoveAttribute This function is used to delete the attributes of the specified element object. 5.3.13 Function: RemoveSubElement This function is used to delete a subelement object. 5.3.14 Function: GetElementName This function is used to obtain an element name. 5.3.15 Function: GetAttributes This function is used to obtain the attribute values of the specified element object. 5.3.16 Example of XML Parse Function This topic helps you to understand how to use XML parse functions during routine maintenance.

5.3.1 Overview of XML Parse Functions


The iSStar provides the XML parse functions for processing standard XML files.

CAUTION
The XML parse functions cannot parse the XML files that contain the data of the CDATA type. Table 5-3 lists the XML parse functions. Table 5-3 List of the XML parse functions Function 5.3.2 Function: OpenXML 5.3.3 Function: WriteBackXML 5.3.4 Function: NewElement
5-32

Description To open an XML file. To write back an XML file. To generate a node object.

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Function 5.3.5 Function: GetSubElement 5.3.6 Function: GetSubElements 5.3.7 Function: GetAttribute 5.3.8 Function: AddSubElement 5.3.9 Function: SetElementContent 5.3.10 Function: GetElementContent 5.3.11 Function: SetAttribute 5.3.12 Function: RemoveAttribute 5.3.13 Function: RemoveSubElement 5.3.14 Function: GetElementName 5.3.15 Function: GetAttributes

Description To obtain the first subelement object that is matched under the passed path. To obtain all the subelement objects that are matched under the passed path. To obtain the specified property value of the specified element object. To add a subelement object. To set the contents of an element object. To obtain the contents of the specified element object. To modify the properties of an element object. To delete the properties of the specified element object. To delete a subelement object. To obtain an element name. To obtain the dictionary of element attributes.

5.3.2 Function: OpenXML


This function is used to open an XML file.

Prototype
OpenXML(Path)

Precautions
None.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-33

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Description
Parameter Path Description Path of an XML file, which is of the string type.
CAUTION For a relative path, the path is relative to that where the script for interface invocation exists. For example, if a.hsl invokes b.hsl and b.hsl invokes OpenXML ("test.txt"), the relative path of test.txt is the path of b.hsl.

Return Values
If an XML file is opened successfully, the function returns the root node element object; otherwise, the function returns None.

Error Handling
None.

Example
#Generate an element. By default, the element has no contents. rootelement = NewElement("root", {"key1":"value",'key2':'value2'}) #Set the element contents to root contents. SetElementContent(rootelement,'root contents') #Write back the contents of the root element to the test.xml #file according to the UTF-8 encoding declaration. WriteBackXML('test.xml', rootelement, encoding='utf-8') #Parse test.xml to generate the element. root = OpenXML('test.xml') #Display the contents of the root element. Print(GetElementContent(root))

Result
root contents

5.3.3 Function: WriteBackXML


This function is used to write back an XML file.

Prototype
WriteBackXML(Path, Element[, Encoding[, XML_Declaration]])

Precautions
None.

Parameter Description
Parameter Path Description Path of an XML file, which is of the string type.

5-34

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Element Encoding XML_Declaratio n

Description Root node element of the file for writing back, which is of the string type. File code, which is of the string type. This parameter is optional. If it is not set, the operating system uses the current code by default. Whether an XML declaration is provided during writing back. The value is Boolean. This parameter is optional. If it is not set, an XML declaration is provided by default.

Return Values
If the operation is successful, the function returns True; otherwise, the function returns False.

Error Handling
None.

Example
#Generate an element. By default, the element has no contents. rootelement = NewElement("root", {"key1":"value",'key2':'value2'}) #Set the element contents to root contents. SetElementContent(rootelement,'root contents') #Write back the contents of the root element to the test.xml #file according to the UTF-8 encoding declaration. WriteBackXML('test.xml', rootelement, encoding='utf-8') #Parse test.xml to generate the element. root = OpenXML('test.xml') #Display the contents of the root element. Print(GetElementContent(root))

Result
root contents

5.3.4 Function: NewElement


This function is used to generate a node object.

Prototype
NewElement(Name[,Attribute[, Text]])

Precautions
None.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-35

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Description
Parameter Name Attribute Description Name of the created node object, which is of the string type and must not contain any Chinese characters. Attribute dictionary. Key values are all strings and must not contain any Chinese characters. This parameter is optional. If it is not set, the value is an empty dictionary by default. Text Element contents. This parameter is optional. If it is not set, the value is none by default.

Return Values
If the created node object has subelements, the function returns this object; otherwise, the function returns None.

Error Handling
None.

Example
#Generate an element. The element contents is test words. rootelement = NewElement("root", {"key1":"value",'key2':'value2'},"test words") #Display the contents of the root element. Print(GetElementContent(rootelement))

Result
test words

5.3.5 Function: GetSubElement


This function is used to obtain the first subelement object that is matched under the passed path.

Prototype
GetSubElement(Parent, Path)

Precautions
None.

Parameter Description
Parameter Parent
5-36

Description Parent element object.

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Path Path of an element node.

Description
CAUTION For a relative path, the path is relative to that where the script for interface invocation exists. For example, if a.hsl invokes b.hsl and b.hsl invokes OpenXML ("test.txt"), the relative path of test.txt is the path of b.hsl.

Return Values
If the subelement exists, the function returns this object; otherwise, the function returns None.

Error Handling
None.

Example
#Generate an element. By default, the element has no contents. rootelement = NewElement("root", {"key1":"value",'key2':'value2'},"test") #Set the element contents. SetElementContent(rootelement,'root contents') #Add the subelement under the root element. subelement = AddSubElement(rootelement,"sub", {"subkey":"subvalue"},"sub contents") #Display the contents of the obtained subelement. subobj = GetSubElement(rootelement, "./") #Display the contents of the obtained subelement. Print(GetElementContent(subobj))

Result
root contents

5.3.6 Function: GetSubElements


This function is used to obtain all the subelement objects that are matched under the passed path.

Prototype
GetSubElements(Parent[, Path])

Precautions
None.

Parameter Description
Parameter Parent Parent element object. Description

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-37

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Path

Description Path of an element node. This parameter is optional. If it is not set, the default value is None, indicating that all subelements of the current element are obtained.
CAUTION For a relative path, the path is relative to that where the script for interface invocation exists. For example, if a.hsl invokes b.hsl and b.hsl invokes OpenXML ("test.txt"), the relative path of test.txt is the path of b.hsl.

Return Values
If the elements exist, the function returns a list of all the element objects; if no element exists, the function returns an empty list.

Error Handling
None.

Example
#Generate an element. By default, the element has no contents. rootelement = NewElement("root", {"key1":"value",'key2':'value2'},"test") #Set the element contents. SetElementContent(rootelement,'root contents') #Add the subelement under the root element. subelement = AddSubElement(rootelement,"sub", {"subkey":"subvalue"},"sub contents") #Add the subelement subelement2 without any attributes. subelement2 = AddSubElement(rootelement,"sub2", {}) #Set the attributes of subelement2. SetAttribute(subelement2,'subk2','subvalue2') #Display the attributes of all subelements of the root element. sublist = GetSubElements(rootelement) for sub in sublist Print(GetAttributes(sub)) end

Result
{'subk2': 'subvalue2'} {'subkey': 'subvalue'}

5.3.7 Function: GetAttribute


This function is used to obtain the specified property value of the specified element object.

Prototype
GetAttribute(element, key)

Precautions
None.
5-38 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Description
Parameter Element Key Element object. Attribute key of an element object, which is of the string type. Description

Return Values
If the operation is successful, the function returns the attribute key; otherwise, the function returns None.

Error Handling
None.

Example
#Generate an element. By default, the element contents is test. rootelement = NewElement("root", {"key1":"value1",'key2':'value2'},"test") #Display the value of the attribute key1 of the root element. Print(GetAttribute(rootelement,'key1'))

Result
value1

5.3.8 Function: AddSubElement


This function is used to add a subelement object.

Prototype
AddSubElement(Parent, Name[, Attribute[, Text[,Index]]])

Precautions
None.

Parameter Description
Parameter Parent Name Attribute Parent element object. Element name, which is of the string type and must not contain any Chinese characters. Attribute dictionary. Key values are all strings and must not contain any Chinese characters. This parameter is optional. If it is not set, the value is an empty dictionary by default.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-39

Description

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Text Element contents.

Description This parameter is optional. If it is not set, the value is empty by default.

Index

Index of a subelement location, which is of the integer type. This parameter is optional. If it is not set, a subelement object is added to location 0 by default.

Return Values
If a subelement is added successfully, the function returns this subelement; otherwise, this function returns None.

Error Handling
None.

Example
#Generate an element. By default, the element contents is test. rootelement = NewElement("root", {"key1":"value1",'key2':'value2'},"test") #Add the subelement subelement1 without any attributes. subelement1 = AddSubElement(rootelement,"sub1", {},"test2") #Display the contents of subelement1. Print(GetElementContent(subelement1))

Result
test2

5.3.9 Function: SetElementContent


This function is used to set the contents of an element object.

Prototype
SetElementContent(Element, Text)

Precautions
None.

Parameter Description
Parameter Element Text Element object. Element contents, which is of the string type.
NOTE If the value is None, it indicates that the element has no contents.

Description

5-40

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Return Values
None.

Error Handling
None.

Example
#Generate an element. By default, the element has no contents. rootelement = NewElement("root", {"key1":"value",'key2':'value2'}) #Set the contents of the root element. SetElementContent(rootelement,'This is a test!!') #Obtain the contents of the root element. context1=GetElementContent(rootelement) #Display the contents of the root element. Print(context1)

Result
This is a test!!

5.3.10 Function: GetElementContent


This function is use to obtain the contents of the specified element object.

Prototype
GetElementContent(Element)

Precautions
None.

Parameter Description
Parameter Element Element object. Description

Return Values
If the operation is successful, the function returns the contents strings; if the element has no contents, the function returns None.

Error Handling
None.

Example
#Generate an element. By default, the element has no contents. rootelement = NewElement("root", {"key1":"value",'key2':'value2'}) #Set the contents of the root element.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-41

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

SetElementContent(rootelement,'This is a test!!') #Obtain the contents of the root element. context1=GetElementContent(rootelement) #Display the contents of the root element. Print(context1)

Result
This is a test!!

5.3.11 Function: SetAttribute


This function is used to modify the attributes of an element object.

Prototype
SetAttribute(Element, Key, Value)

Precautions
None.

Parameter Description
Parameter Element Key Value Element object. Attribute key of the specified element object, which is of the string type. Attribute value of the specified element object, which is of the string type. Description

Return Values
None.

Error Handling
None.

Example
#Generate an element. By default, the element has no contents. rootelement = NewElement("root", {"key1":"value",'key2':'value2'}) #Change the key1 value of the root element to test value. SetAttribute(rootelement,'key1','test value') #Obtain the attribute key value of the root element. If this operation is successful, #the attribute key value is returned in the dictionary format. attr1=GetAttributes(rootelement) #Display the attribute key value of the element. Print(attr1)

Result
{'key2': 'value2', 'key1': 'test value'}

5-42

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.3.12 Function: RemoveAttribute


This function is used to delete the attributes of the specified element object.

Prototype
RemoveAttribute(Element, Key)

Precautions
None.

Parameter Description
Parameter Element Key Element object. Attribute key of the element object to be deleted, which is of the string type. Description

Return Values
If the deletion is successful, the function returns True; otherwise, the function returns False.

Error Handling
None.

Example
#Generate an element. By default, the element has no contents. rootelement = NewElement("root", {"key1":"value",'key2':'value2'}) #Display the attribute key value of the root element. Print(GetAttributes(rootelement)) #Delete the attribute key value of key2 of the root element. RemoveAttribute(rootelement, 'key2') #Display the attribute key value of the root element. Print(GetAttributes(rootelement))

Result
{'key2': 'value2', 'key1': 'value'} {'key1': 'value'}

5.3.13 Function: RemoveSubElement


This function is used to delete a subelement object.

Prototype
RemoveSubElement (parent, child)
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-43

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Precautions
None.

Parameter Description
Parameter Parent Child Parent element object. Subelement object to be deleted. Description

Return Values
If the deletion is successful, the function returns True; otherwise, the function returns False.

Error Handling
None.

Example
#Generate a root element. rootelement = NewElement('root', {'key1': 'value1'}) #Add the sub1 element under the root element. subelement1= AddSubElement(rootelement, "sub1", {'key1': 'value1'}, \ text='sub1 contents') #Add the sub2 element under the root element. subelement2 = AddSubElement(rootelement, "sub2", {'key1': 'value1'}, \ text='sub2 contents') #Display the attributes of all subelements of the root element. sublist = GetSubElements(rootelement) Print("#Delete the contents of all the subelements before sub2") for sub in sublist Print(GetElementContent(sub)) end #Delete the subelement sub2 of the root element. RemoveSubElement(rootelement,GetSubElement(rootelement, 'sub2')) Print("#Delete the contents of all the subelements after sub2") #Display the attributes of all subelements of the root element. sublist = GetSubElements(rootelement) for sub in sublist Print(GetElementContent(sub)) end

Result
#Delete the contents of all the subelements before sub2. sub2 contents sub1 contents #Delete the contents of all the subelements after sub2. sub1 contents

5.3.14 Function: GetElementName


This function is used to obtain an element name.
5-44 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Prototype
GetElementName(Element)

Precautions
None.

Parameter Description
Parameter Element Element object. Description

Return Values
If the operation is successful, the function returns the element name, which is a string; otherwise, the function returns None.

Error Handling
None.

Example
#Generate a root element. By default, the element has no contents. rootelement = NewElement("root_name", {"key1":"value",'key2':'value2'},"test") #Display the name of the root element. Print(GetElementName(rootelement))

Result
root_name

5.3.15 Function: GetAttributes


This function is used to obtain the attribute values of the specified element object.

Prototype
GetAttributes(Element)

Precautions
None.

Parameter Description
Parameter Element Element object. Description

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-45

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Return Values
If the operation is successful, the function returns the attribute values (they are of the string type) of the element in the dictionary format; otherwise, the function returns an empty dictionary.

Error Handling
None.

Example
#Generate an element. By default, the element has no contents. rootelement = NewElement("root", {"key1":"value",'key2':'value2'}) #Change the key1 value of the root element to test value. SetAttribute(rootelement,'key1','test value') #Obtain the attribute key value of the root element. If this operation is successful, #the attribute key value is returned in the dictionary format. attr1=GetAttributes(rootelement) #Display the attribute key value of the element. Print(attr1)

Result
{'key2': 'value2', 'key1': 'test value'}

5.3.16 Example of XML Parse Function


This topic helps you to understand how to use XML parse functions during routine maintenance.

Example
#Generate an element. By default, the element has no contents. rootelement = NewElement("root", {"key1":"value",'key2':'value2'}) #Set the element contents. SetElementContent(rootelement,'rootcontent') #Add the subelement under the root element. subelement = AddSubElement(rootelement,"sub", {"subkey":"subvalue"},'subcontent') #Add a subelement without any attributes. subelement2 = AddSubElement(rootelement,"sub2", {}) #Set the element attributes. SetAttribute(subelement2,'subk2','subvalue2') #Generate the test.xml file according to the UTF-8 encoding declaration. WriteBackXML('test.xml', rootelement, encoding='utf-8') #Parse test.xml to generate the element. root = OpenXML('test.xml') #Display the contents of the root element. Print(GetElementContent(root)) #Display the value of the attribute key1 of the root element. Print(GetAttribute(root,'key1')) #Display the attribute dictionary of the root element. Print(GetAttributes(root)) #Obtain the subelement sub and display its contents. Print(GetElementContent(GetSubElement(root,'sub'))) #Display the attributes of all subelements of the root element. sublist = GetSubElements(root) for sub in sublist Print(GetAttributes(sub)) end #Delete the attribute key2 of the root element. RemoveAttribute(root,'key2') #Delete the subelement sub2 of the root element. RemoveSubElement(root,GetSubElement(root,'sub2'))

5-46

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Output
#Display the contents of the root element. rootcontent #Display the value of the attribute key1 of the root element. value #Display the attribute dictionary of the root element. {'key2': 'value2', 'key1': 'value'} #Obtain the subelement sub and display its contents. subcontent #Display the attributes of all subelements of the root element. {'subk2': 'subvalue2'} {'subkey': 'subvalue'}

5.4 MML Message Parse Functions


This topic describes the MML message parse functions. By using these functions, you can query a message for the information such as the parameters, entries, records, and attribute values. In addition, you can output the obtained information in the tuple format, thus knowing the execution of MML commands on the NEs. 5.4.1 Overview of MML Message Parse Function This topic describes the basic functions and procedures of MML message parse functions. 5.4.2 MML Message Format This topic describes the format of MML messages and the meaning of each part. 5.4.3 Function: ParseMMLRpt This topic describes the ParseMMLRpt function. This function enables you to convert the MML message into a format that can be recognized by other MML message parsing functions. You must call this function before calling other message parsing functions. 5.4.4 Function: GetSourceName This topic describes the GetSourceName function. This function enables you to obtain the source ID of an MML message, that is, equipment ID. A source ID indicates the physical area of an output message. 5.4.5 Function: GetReportDate This topic describes the GetReportDate function. This function enables you to obtain the creation date of an MML message. 5.4.6 Function: GetReportTime This topic describes the GetReportTime function. This function enables you to obtain the creation time of an MML message. 5.4.7 Function: GetTimeAdjustFlag This topic describes the GetTimeAdjustFlag function. This function enables you to get the time adjustment flag of an alarm message. A time adjustment flag indicates a periodic adjustment of time, for example, the DST. The N2000 UMS can precisely determine the time with the help of this flag. 5.4.8 Function: GetServiceFlag This topic describes the GetService Flag function. This function enables you to obtain the MML message service flag. A service flag is used for identifying the service types of a message, for example, alarm message or performance message. 5.4.9 Function: GetReportIdx
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-47

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

This topic describes the GetReportIdx function. This function enables you to obtain the serial number of an MML message. The message serial number maps a task. It uniquely identifies the output message of a task. 5.4.10 Function: GetMMLCmd This topic describes the GetMMLCmd function. This function enables you to obtain the echo of an MML command. The command echo shows the MML commands that is issued. 5.4.11 Function: GetResultCode This topic describes the GetResultCode function. This function enables you to obtain the return code of an MML message. A return code identifies whether the NE system has successfully processed the MML commands. 5.4.12 Function: GetResultCause This topic describes the GetResultCause function. This function enables you to obtain the remarks of the return code. If the command is successfully run, the remark shows success. If a command is not successfully run, the remark gives the cause, which helps locate the error. 5.4.13 Function: GetObjNum This topic describes the GetObjNum function. This function enables you to obtain the number of entries in an MML message. 5.4.14 Function: GetObjTitle This topic describes the GetObjTitle function. This function enables you to obtain the title of the specified entry in an MML message. A title summarizes the contents of a message entry. 5.4.15 Function: GetRecordNum This topic describes the GetRecordNum function. This function enables you to obtain the number of records in the specified entry in an MML message. 5.4.16 Function: GetTips This topic describes the GetTips function. This function enables you to obtain the tips of an MML message. For some commands, you need to provide detailed explanations in the form of tips for integrity purpose. 5.4.17 Function: GetAttrValueByName This topic describes the GetAttrValueByName function. This function enables you to obtain the specified attribute value from a parsed MML message according to the entry number, attribute name, and record number. 5.4.18 Function: GetAttrValueByIdx This topic describes the GetAttrValueByIdx function. This function enables you to obtain the specified attribute value from a parse MML message according to the entry number, attribute number, and record number. 5.4.19 Function: GetAttrNameList This topic describes the GetAttrNameList function. This function enables you to obtain the list of attribute names in the specified entry in an MML message. 5.4.20 Function: GetAttrNum This topic describes the GetAttrNum function. This function enables you to obtain the number of attributes in the specified entry in an MML message. 5.4.21 Function: GetColumnByName This topic describes the GetColumnByName function. This function enables you to obtain the data of a column in the specified entry according to the column name. 5.4.22 Function: GetColumnByIndex
5-48 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

This topic describes the GetColumnByIndex function. This function enables you to obtain the data of the specified column according to the column number. 5.4.23 Function: GetRowByIndex This topic describes the GetRowByIndex function. This function enables you to obtain the data of a record in the specified entry according to the entry number and row number. 5.4.24 Function: GetDataFrmMMLRpt This topic describes the GetDataFrmMMLRpt function. This function enables you to convert a specified entry into a tuple for report output. 5.4.25 Function: GetUTCTimeOffSet This describes the GetUTCTimeOffSet function. This function enables you to obtain the offset between the UTC time and the time when the MML message is generated. 5.4.26 Function: DestroyMMLParser This topic describes the DestroyMMLParser function. This function enables you to destroy an MM message parsing object so that you can release the system resources for parsing the MM message, and reduce system consumption. 5.4.27 Examples of MML Message Parse Functions This topic describes the examples of the MML message parse functions and the method of using some functions related to the MML message.

5.4.1 Overview of MML Message Parse Function


This topic describes the basic functions and procedures of MML message parse functions.

Basic Functions
An NE returns an MML message after it runs MML commands. An MML message contains two types of information. One is the information about MML commands, such as execution status and result data. The other is the information about MML messages, such as output time and serial number. By using the MML message parse functions, you can obtain and output the message information in the tuple format, which can be used for report output. Table 5-4 lists the MML message parse functions. Table 5-4 MML message parse functions Function 5.4.3 Function: ParseMMLRpt Description Parses MML message strings. Returns the source identifier of an MML message. 5.4.4 Function: GetSourceName A source identifier identifies the physical area of an message output. Generally, it is an equipment identifier. You can specify source identifiers when specifying the equipment, for example, office name. Returns the creation date of an MML message. Returns the creation time of an MML message.

5.4.5 Function: GetReportDate 5.4.6 Function: GetReportTime

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-49

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Function

Description Returns a time adjustment flag. A time adjustment flag indicates a periodic adjustment of time, for example, the DST. The N2000 UMS can precisely determine the time with the help of this flag. For example, when the DST starts, the time adjustment flag helps the N2000 UMS to solve the time overlaps before and after the DST. Returns the MML message service flag.

5.4.7 Function: GetTimeAdjustFlag

5.4.8 Function: GetServiceFlag

A service flag is used to identify the service types of a message, for example, alarm message or performance message. Returns the MML message serial number. The message serial number maps a task. It uniquely identifies the output message of a task.

5.4.9 Function: GetReportIdx

For a command that has large command results, the output needs to be divided into multiple messages which use the same message serial number. In this way, the serial number can identify the messages of the same task. Returns the echo of an MML command.

5.4.10 Function: GetMMLCmd

The echo of an MML command shows the issued MML command. The echo of a password is *****, that is, five asterisks. If an MML message is displayed as multiple sub-messages, the command echoes of all the sub-messages are the same. Returns the return codes of an MML message. Return codes are contained in a system report. The system report refers to the returned message which indicates whether the system has successfully processed the MML report. A return code is represented by a 32-bit decimal positive integer. The value 0 indicates that the system process is successful. Other return codes are defined by the NE applications. Returns the remarks for a return code of an MML message. The remarks of a return code is contained in a system report. The system report refers to the returned message which indicates whether the system has successfully processed the MML report. If the command is successfully run, the remark shows success. If a command is not successfully run, the remark gives the cause. This helps you to locate the error.

5.4.11 Function: GetResultCode

5.4.12 Function: GetResultCause

5-50

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Function 5.4.13 Function: GetObjNum 5.4.14 Function: GetObjTitle

Description Returns the number of entries in an MML message. An MML message can contain multiple entries. The serial numbers of the entries count from 0. Returns the title of an entry in an MML message. Returns the number of records in the specified entry in an MML message. An entry can contain multiple records. The serial number of the records start from 0. Returns the tips of an MML message. A tip gives further description of a command. For example, the command for querying the bill pool of the active server requires all modules to return the results. If a module link is disconnected, the related information cannot be queried. In an MML message, the information about which module has no response is shown in a tip. Returns the attribute value of a record in the specified entry according to the attribute name. Returns the attribute value of a record in the specified entry according to the attribute location. Returns the list of attribute names in the specified entry in an MML message. Returns the number of attributes in the specified entry in an MML message. Returns the data in a column in the specified entry according to the column name. Returns the data in a column in the specified entry according to the column number. Returns the data in the specified record in the specified entry according to the record number. Returns the contents of the specified entry and output the contents in the tuple format. Destroys an MML message parse object to release the system resources for parsing the MML message.

5.4.15 Function: GetRecordNum

5.4.16 Function: GetTips

5.4.17 Function: GetAttrValueByName 5.4.18 Function: GetAttrValueByIdx 5.4.19 Function: GetAttrNameList 5.4.20 Function: GetAttrNum 5.4.21 Function: GetColumnByName 5.4.22 Function: GetColumnByIndex 5.4.23 Function: GetRowByIndex 5.4.24 Function: GetDataFrmMMLRpt 5.4.26 Function: DestroyMMLParser

Procedure
Figure 5-2 shows how to use the MML message parse functions to obtain the message contents.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-51

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Figure 5-2 Workflow of MML message parse functions

The procedure is as follows: 1. Parse the MML message by calling 5.4.3 Function: ParseMMLRpt. The MML message to be parsed must comply with the related format specifications. Otherwise, the parse functions cannot parse it. For details about the MML message specifications, see 5.4.2 MML Message Format. Obtain the required data from the parsed message.

2.

5.4.27 Examples of MML Message Parse Functions shows the examples.

5.4.2 MML Message Format


This topic describes the format of MML messages and the meaning of each part. An MML message consists of the head, body, and end tag. l The head is the start of a message. It defines the start tag, message source identifier, service message tag, message serial number, message creation time, command echo display, return code, and explanation of the return code. The information defined by the head is the common features of all MML messages. These features are processed first to identify an MML message. The body contains the information that an MML message is to transfer. The end tag indicates the end of an MML message. The start and end tags together identifies a complete MML message.

l l

MML messages are in either of the following two formats, as shown in Figure 5-3 and Figure 5-4. For the descriptions of Figure 5-3 and Figure 5-4, see Table 5-5.

5-52

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Figure 5-3 MML message format 1

Figure 5-4 MML message format 2

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-53

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Table 5-5 Description of MML message format SN (1) (2) Field Meaning Start identifiers of an MML message. Source identity (equipment identification). Description An MML message must start with "+++" as its start identifiers. A source identity identifies the physical area where an output message is generated. You can specify the identity when installing the equipment. It can be obtained through 5.4.4 Function: GetSourceName. (3) Creation date of an MML message. The YYYY-MM-DD format is applied. It can be obtained through 5.4.5 Function: GetReportDate. The 24 hour clock mode is applied. The expression format is HH:MM:SS. It can be obtained through 5.4.6 Function: GetReportTime. (5) Service message flag of an MML message. A service message flag is used to identify the service type of a message. The meanings of the service report flags are as follows: l TRAFFIC Performance report. Only the performance reports that are actively reported are of the TRAFFIC type. The query reports of performance data are of the O&M type rather than TRAFFIC. l O&M Operation and maintenance report. All session outputs, for example, service configuration and alarm query, belong to the O&M type. l TEST Test report. Only the test reports that are actively reported are of the TEST type. The query reports of test data are of the O&M type rather than TEST. l ALARM Alarm report. Only the alarm reports that are actively reported are of the ALARM type. The query reports of test data are of the O&M type rather than ALARM. It can be obtained through 5.4.8 Function: GetServiceFlag.

(4)

Creation time of an MML message.

5-54

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

SN (6)

Field Meaning Serial number.

Description The message serial number maps a task. It uniquely identifies the output message of a task. For a command that has large command results, the output needs to be divided into multiple messages which use the same message serial number. In this way, the serial number can identify the messages of the same task. It can be obtained through 5.4.9 Function: GetReportIdx.

(7)

Command echo.

The echo of an MML command shows the issued MML command. The password echo is "*****", namely, five English star symbols. If an MML message is displayed as multiple sub-messages, the command echoes of all the sub-messages are the same. It can be obtained through 5.4.10 Function: GetMMLCmd.

(8)

Return code.

A return code identifies whether the NE system has successfully processed the MML commands. A return code is represented by a 32-bit decimal positive integer. The value 0 indicates that the system process is successful. Other return codes are defined by the NE applications. It can be obtained through 5.4.11 Function: GetResultCode.

(9)

Remarks of a return code.

If the command is successfully run, the remark shows success. If a command is not successfully run, the remark gives the cause, which helps locate the error. It can be obtained through 5.4.12 Function: GetResultCause.

(10)

Title of entry 0 of the MML message.

Specifies the topic of the body. It can be obtained through 5.4.14 Function: GetObjTitle. Obtain the attribute list of the entry through 5.4.19 Function: GetAttrNameList. It can be obtained through 5.4.17 Function: GetAttrValueByName and 5.4.18 Function: GetAttrValueByIdx. It is one part of the MML body. You can obtain the number of the entries by calling 5.4.13 Function: GetObjNum.

(11) (12)

Attribute of entry 0. Attribute value of entry 0.

(13)

Entry 0.

(14)

Record 1 of entry 0.

You can obtain the number of records of an entry by calling 5.4.15 Function: GetRecordNum.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-55

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

SN (15)

Field Meaning Sum information of entry 0.

Description The sum information shows the number of records in the body. You can obtain the number of records of an entry by calling 5.4.15 Function: GetRecordNum.

(16)

Entry 1.

It is one part of the MML body. You can obtain the number of the entries by calling 5.4.13 Function: GetObjNum.

(17) (18)

End identifier. MML message.

An MML message is ended with --- END. You can create a parsing object flag by using 5.4.3 Function: ParseMMLRpt.

For integrity purpose, the tips of the MML message of certain commands provide further explanation. Tips are displayed before the end mark, and before the additional information, if any. If an end mark does not follow the tip, a blank line separates the tip from the subsequent information. If the output MML message is divided into several sub-messages, the remark is displayed in the last sub-message only. It can be obtained through 5.4.16 Function: GetTips. Additional information is displayed before the end identifier of the message. If a command generates only one MML message, the additional information can be omitted. If the output of the command result is divided into several MML messages, the additional information is mandatory. The time offset value and time adjustment flag are available in English MML message only. You can obtain the time adjustment flag by using 5.4.7 Function: GetTimeAdjustFlag. If time adjustment is not required, the flag does not exist in the MML message.

CAUTION
The indexes of entries, attributes, and records of an MML message count from 0.

5.4.3 Function: ParseMMLRpt


This topic describes the ParseMMLRpt function. This function enables you to convert the MML message into a format that can be recognized by other MML message parsing functions. You must call this function before calling other message parsing functions.

Synopsis
ParseMMLRpt(MMLRpt)

5-56

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Note
The return value of the ParseMMLRpt function is the parsing object of the MML message. The parsing object of the MML message is necessary for other message parsing functions. Therefore, you need to call this function before calling other message parsing functions.

Parameter Description
Parameter MMLRpt Description MMLRpt is a string and is the MML message to be parsed. The iSStar can parse all the MML messages that conform to the MML format specification. For details of the message formats, refer to 5.4.2 MML Message Format.

Return Value
If the function is called successfully, the MML message parsing object is returned. Otherwise, None is returned.

Error Handling
None.

Example
mml = """ +++ NE 2007-11-29 17:08:04 DST O&M #1426 %%/*6718*/LST OP:;%% RETCODE = 0 Operation succeeded Operator info ------------Operator name

Status

IP Address

Service 10.161.24.166 NULL

Login Time 2008-01-10 14:15:50 NULL

admin Online 10.161.24.166 GUEST Offline NULL (Number of results = 2) --END

""" #Parse the MML message. p = ParseMMLRpt(mml) #Obtain the return code of the command from the parsed MML message. returnCode = GetResultCode(p) Print('The returncode of the MML command is %s'%returnCode)

Result
The returncode of the MML command is 0

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-57

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

MML Message Output


LST VER:; +++ NE 2007-03-26 20:32:25 O&M #31280 %%/*14263*/LST VER:;%% RETCODE = 0 Execution succeeded. --END

Related Example

5.4.4 Function: GetSourceName


This topic describes the GetSourceName function. This function enables you to obtain the source ID of an MML message, that is, equipment ID. A source ID indicates the physical area of an output message.

Synopsis
GetSourceName(mParser)

Note
None

Parameter Description
Parameter mParser Description mParser indicates a parsed MML message object.

Return Value
The return value is a string. If the function is called successfully, the source identity of the MML message is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
mml = ''' +++ NE 2008-01-15 12:04:00 O&M #286 %%/*8326*/LST OP:;%% RETCODE = 0 Execution succeeded. Operator info ------------Operator name admin

Status online

IP Address 10.161.37.211

Service 10.161.37.211---O&M System

Login Time 2006-09-06 16:46:36

5-58

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


guest online 10.161.37.211 ((Result number = 2 ))

5 HFC Library Reference


10.161.37.211---O&M System 2006-09-06 16:47:49

--END ''' p = ParseMMLRpt(mml) # Parse the MML message. sourceName = GetSourceName(p) # Get the source equipment identifier from the parsed MML message. Print('GetSourceName() return: %s'%sourceName)

Result
GetSourceName() return: NE

Related Example

5.4.5 Function: GetReportDate


This topic describes the GetReportDate function. This function enables you to obtain the creation date of an MML message.

Synopsis
GetReportDate(mParser)

Note
None

Parameter Description
Parameter mParser Description mParser indicates a parsed MML message object.

Return Value
The return value is of the string type. If the operation is successful, the function returns the creation date (YYYY-MM-DD) of the MML message; otherwise, the function returns an empty string.

Error Handling
None.

Example
mml = ''' +++ 2007-06-21 11:34:08 O&M #21894 %%/*8221*/LST CELL:;%% RETCODE = 0 Execution succeeded.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-59

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

List cell basic information --------------------------Cell ID Cell name NodeB ID 0 0 1 1 20 20 11 11 12 12 (Number of results = --''' END 300 300 301 302 302 5)

NodeB name 3812 3812 BBU 3812E 3812E

Local cell ID 0 1 0 1 2

Subrack No. 3 3 3 3 3

Subsystem No. 0 0 0 0 0

p = ParseMMLRpt(mml) reportDate = GetReportDate(p)

# Get the message date from the parsed MML message.

Print('GetReportDate() return: %s'%reportDate)

Result
GetReportDate() return: 2007-06-21

Related Example

5.4.6 Function: GetReportTime


This topic describes the GetReportTime function. This function enables you to obtain the creation time of an MML message.

Synopsis
GetReportTime(mParser)

Note
None

Parameter Description
Parameter mParser Description mParser indicates a parsed MML message object.

Return Value
The return value is a string. If the function is called successfully, the creation time (HH:MM:SS) of the MML message is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
mml = '''

5-60

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


+++ 2007-04-12 15:58:18 O&M; #812669 %%/*15343*/LST VER:;%% RETCODE = 0 Execution succeeded. Version information ------------------Product version = BSC6800V100R008ENGC01B060 --''' END

5 HFC Library Reference

p = ParseMMLRpt(mml) reportTime = GetReportTime(p)

# Parse the MML message. # Get the message time from the parsed MML message.

Print('GetReportTime() return: %s'%reportTime)

Result
GetReportTime() return: 15:58:18

Related Example

5.4.7 Function: GetTimeAdjustFlag


This topic describes the GetTimeAdjustFlag function. This function enables you to get the time adjustment flag of an alarm message. A time adjustment flag indicates a periodic adjustment of time, for example, the DST. The N2000 UMS can precisely determine the time with the help of this flag.

Synopsis
GetTimeAdjustFlag(mParser)

Note
The GetTimeAdjustFlag(mParser) function enables you to obtain the time adjustment flag. If there is no such record in the message, a null string is returned.

Parameter Description
Parameter mParser Description mParser indicates a parsed MML message object.

Return Value
The return value is a string. If the function is called successfully, the time adjustment flag is returned. Otherwise, a null string is returned. DST is an abbreviation for daylight saving time.

Error Handling
None.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-61

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Example
mml = """ +++ RNC 2006-12-19 20:48:50 +DST O&M #8522 %%/*2116*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID NodeB name Local cell ID DL primary scrambling code Location area code 0 1 2 3 4 5 6 10 CELL1 CELL2 CELL3 CELL4 CELL5 CELL6 CELL7 CELL10 1 1 1 1 2 2 2 1 NODEB1 H'2512(9490) NODEB1 H'2512(9490) NODEB1 H'2512(9490) NODEB1 H'2512(9490) NODEB2 H'2512(9490) NODEB2 H'2512(9490) NODEB2 H'2512(9490) NODEB1 H'2512(9490) 0 1 2 3 4 5 6 10 3 3 3 3 3 3 3

Subrack No. 3 0 0 0 0 0 0

Subsystem No. 0

\ 0\

128\ 127\ 126\ 125\ 124\ 123\ 0 1\

(Number of results = 8) --""" END

p = ParseMMLRpt(mml) adjust = GetTimeAdjustFlag(p) Print("GetTimeAdjustFlag(p) return: " + adjust)

Result
GetTimeAdjustFlag(p) return: DST

Related Example

5.4.8 Function: GetServiceFlag


This topic describes the GetService Flag function. This function enables you to obtain the MML message service flag. A service flag is used for identifying the service types of a message, for example, alarm message or performance message.

Synopsis
GetServiceFlag(mParser)

Note
None

5-62

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Description
Parameter mParser Description mParser indicates a parsed MML message object.

Return Value
The return value is a string. If the function is called successfully, the service flag of the MML message is returned. Otherwise, a null string is returned. The meanings of the service report flags are as follows: l TRAFFIC Performance report. Only the performance reports that are actively reported are of the TRAFFIC type. The query reports of performance data are of the O&M type rather than TRAFFIC. l O&M OM report. All session outputs, for example, service configuration and alarm query, belong to the O&M type. l TEST Test report. Only the test reports that are actively reported are of the TEST type. The query reports of test data are of the O&M type rather than TEST. l ALARM Alarm report. Only the alarm reports that are actively reported are of the ALARM type. The query reports of test data are of the O&M type rather than ALARM.

Error Handling
None.

Example
mml = """ +++ NE 2007-12-07 10:13:53 O&M #71476 %%/*570*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID NodeB name Local cell ID Subrack No. Subsystem No. 0 1 20 10 12 15 (Number --""" 0 300 1 300 20 301 10 302 12 302 3802 3802 of results = 6) END 3812 3812 BBU 3812E 3812E 3802 0 1 0 0 2 0 3 3 3 3 3 3 0 0 0 0 0 0

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-63

5 HFC Library Reference


p = ParseMMLRpt(mml)

iManager N2000 UMS Element Management System iSStar

#Get and output the service message flag. Print("GetServiceFlag() : "+ str(GetServiceFlag(p)))

Result
GetServiceFlag(): O&M

Related Example

5.4.9 Function: GetReportIdx


This topic describes the GetReportIdx function. This function enables you to obtain the serial number of an MML message. The message serial number maps a task. It uniquely identifies the output message of a task.

Synopsis
GetReportIdx(mParser)

Note
None

Parameter Description
Parameter mParser Description mParser indicates a parsed MML message object.

Return Value
The return value is a string. If the function is called successfully, the serial number of the message is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
mml = """ +++ NE 2007-12-07 10:13:53 O&M #71476 %%/*570*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID NodeB name Local cell ID Subrack No. Subsystem No. 0 1 20 0 1 20 300 300 301 3812 3812 BBU 0 1 0 3 3 3 0 0 0

5-64

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


10 12 15 (Number --""" 10 302 12 302 3802 3802 of results = 6) END 3812E 3812E 3802 0 2 0 3 3 3

5 HFC Library Reference


0 0 0

#Create an MML message parsing object. p = ParseMMLRpt(mml) #Get and output the message serial number. Print("GetReportIdx() : "+ str(GetReportIdx(p)))

Result
GetReportIdx() : 71476

Related Example

5.4.10 Function: GetMMLCmd


This topic describes the GetMMLCmd function. This function enables you to obtain the echo of an MML command. The command echo shows the MML commands that is issued.

Synopsis
GetMmlCmd(mParser)

Note
None

Parameter Description
Parameter mParser Description mParser indicates a parsed MML message object.

Return Value
The return value is a string. If the function is called successfully, the obtained command echo is returned. Otherwise, a null string is returned. The echo of an MML command shows the issued MML command. The password echo is *****, that is, five asterisks. If an MML message is displayed as multiple sub-messages, the command echoes of all the sub-messages are the same.

Error Handling
None.

Example
strAlarm = """

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-65

5 HFC Library Reference


+++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

iManager N2000 UMS Element Management System iSStar

Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8

211

Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

#Create an MML parsing object. p = ParseAlmRpt(strAlarm) #Get and output the command echo. fl = GetAlmMMLCmd(p) Print('The MML command output of an alarm message is: ' + fl)

Result
The MML command output of an alarm message is: LST ALMAF: CNT=0;

Related Example

5.4.11 Function: GetResultCode


This topic describes the GetResultCode function. This function enables you to obtain the return code of an MML message. A return code identifies whether the NE system has successfully processed the MML commands.

Synopsis
GetResultCode(mParser)

Note
None

5-66

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Description
Parameter mParser Description mParser indicates a parsed MML message object.

Return Value
The return value is a string. If the function is called successfully, the return code is returned. Otherwise, a null string is returned. If the return code is 0, you can infer that the commands have been successfully processed. Other return codes are defined by the related NEs.

Error Handling
None.

Example
mml = """ +++ NE 2007-12-07 10:13:53 O&M #71476 %%/*570*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID NodeB name Local cell ID Subrack No. Subsystem No. 0 1 20 10 12 15 (Number --""" 0 300 1 300 20 301 10 302 12 302 3802 3802 of results = 6) END 3812 3812 BBU 3812E 3812E 3802 0 1 0 0 2 0 3 3 3 3 3 3 0 0 0 0 0 0

#Create an MML message parsing object. p = ParseMMLRpt(mml) #Get and output the return code. Print("GetResultCode() return: "+ GetResultCode(p) )

Result
GetResultCode() return: 0

Related Example

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-67

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.4.12 Function: GetResultCause


This topic describes the GetResultCause function. This function enables you to obtain the remarks of the return code. If the command is successfully run, the remark shows success. If a command is not successfully run, the remark gives the cause, which helps locate the error.

Synopsis
GetResultCause(mParser)

Note
None

Parameter Description
Parameter mParser Description mParser indicates a parsed MML message object.

Return Value
The return value is a string. If the function is called successfully, the remarks of the return code is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
mml = """ +++ NE 2007-12-07 10:13:53 O&M #71476 %%/*570*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID NodeB name Local cell ID Subrack No. Subsystem No. 0 1 20 10 12 15 (Number --""" 0 300 1 300 20 301 10 302 12 302 3802 3802 of results = 6) END 3812 3812 BBU 3812E 3812E 3802 0 1 0 0 2 0 3 3 3 3 3 3 0 0 0 0 0 0

#Create an MML message parsing object. p = ParseMMLRpt(mml)

5-68

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


#Get and output the remarks of the return code. Print("GetResultCause() return: "+ GetResultCause(p) )

5 HFC Library Reference

Result
GetResultCause() return: Execution succeeded.

Related Example

5.4.13 Function: GetObjNum


This topic describes the GetObjNum function. This function enables you to obtain the number of entries in an MML message.

Synopsis
GetObjNum(mParser)

Note
None

Parameter Description
Parameter mParser Description mParser indicates a parsed MML message object.

Return Value
The return value is an integer. If the function is called successfully, the number of entries in the MML message is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
mml = """ +++ NE 2007-12-07 10:13:53 O&M #243 %%/*570*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID NodeB name Local cell ID Subrack No. Subsystem No. 0 1 12 15 (Number 0 300 1 300 12 302 3802 3802 of results = 4) 3812 3812 3812E 3802 0 1 2 0 3 3 3 3 0 0 0 0

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-69

5 HFC Library Reference


--""" END

iManager N2000 UMS Element Management System iSStar

#Create an MML message parsing object. p = ParseMMLRpt(mml) #Get and output the number of entries in the message. Print("GetObjNum() return: "+ str(GetObjNum(p) ) )

Result
GetObjNum() return: 1

Related Example

5.4.14 Function: GetObjTitle


This topic describes the GetObjTitle function. This function enables you to obtain the title of the specified entry in an MML message. A title summarizes the contents of a message entry.

Synopsis
GetObjTitle(mParser, ObjIndex)

Note
None

Parameter Description
Parameter mParser ObjIndex Description mParser indicates a parsed MML message object. ObjIndex is an integer. It indicates the entry number of the MML message. The serial numbers of the entries count from 0.

Return Value
The return value is a string. If the function is successfully called, the title of the specified entry is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
mml = """ +++ NE 2007-12-07 10:13:53 O&M #243 %%/*570*/LST CELL:;%% RETCODE = 0 Execution succeeded.

5-70

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

List cell basic information --------------------------Cell ID Cell name NodeB ID NodeB name Local cell ID Subrack No. Subsystem No. 0 1 20 10 12 15 (Number --""" 0 300 1 300 20 301 10 302 12 302 3802 3802 of results = 6) END 3812 3812 BBU 3812E 3812E 3802 0 1 0 0 2 0 3 3 3 3 3 3 0 0 0 0 0 0

#Create an MML message parsing object. p = ParseMMLRpt(mml) #Get and output the title of the specified entry. Print("GetObjTitle() return: "+ GetObjTitle(p, 0) )

Result
GetObjTitle() return: List cell basic information

Related Example

5.4.15 Function: GetRecordNum


This topic describes the GetRecordNum function. This function enables you to obtain the number of records in the specified entry in an MML message.

Synopsis
GetRecordNum(mParser, ObjIndex)

Note
None

Parameter Description
Parameter mParser ObjIndex Description mParser indicates a parsed MML message object. ObjIndex is an integer. It indicates the entry number of the MML message. The serial numbers of the entries count from 0.

Return Value
The return value is an integer. If the function is called successfully, the obtained number of records is returned. Otherwise, 0 is returned.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-71

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Error Handling
None.

Example
mml=''' +++ NE 2007-12-07 10:13:53 O&M #243 %%/*599*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID NodeB name Local cell ID Subrack No. Subsystem No. 0 0 300 1 1 300 20 20 301 10 10 302 12 12 302 15 3802 3802 (Number of results = 6) --''' END 3812 3812 BBU 3812E 3812E 3802 0 1 0 0 2 0 3 3 3 3 3 3 0 0 0 0 0 0

p = ParseMMLRpt(mml) Print("GetRecordNum = "+ str(GetRecordNum(p, 0))) #Get and output the number of records in entry 0.

Result
GetRecordNum()= 6

Related Example

5.4.16 Function: GetTips


This topic describes the GetTips function. This function enables you to obtain the tips of an MML message. For some commands, you need to provide detailed explanations in the form of tips for integrity purpose.

Synopsis
GetTips(mParser)

Note
This function enables you to obtain the alarm tips in an MML message. If no alarm tips are available in the MML message, a null string is returned.

Parameter Description
Parameter mParser Description mParser indicates a parsed MML message object.

5-72

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Return Value
The return value is a string. If the function is called successfully, the tip is returned. Otherwise, a null string is returned. A tip gives further description of a command. For example, the command for querying the bill pool of the active server requires all modules to return the results. If a module link is disconnected, the related information cannot be queried. In an MML message, the information about which module has no response is shown in a tip.

Error Handling
None.

Example
mml = ''' +++ NE 2007-12-07 10:13:53 O&M #71476 %%/*3745*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID NodeB name Local cell ID Subrack No. Subsystem No. 0 1 20 10 12 15 (Number 0 300 1 300 20 301 10 302 12 302 3802 3802 of results = 6) 3812 3812 BBU 3812E 3812E 3802 0 1 0 0 2 0 3 3 3 3 3 3 0 0 0 0 0 0

Hints ----some words --''' END

p = ParseMMLRpt(mml) Print("GetTips() return: "+ str(GetTips(p)))

#Get and output the tips.

Result
GetTips() return: some words

Related Example

5.4.17 Function: GetAttrValueByName


This topic describes the GetAttrValueByName function. This function enables you to obtain the specified attribute value from a parsed MML message according to the entry number, attribute name, and record number.

Synopsis
GetAttrValueByName(mParser, ObjIndex, PropName, RecordIdx,Case = 0)
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-73

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Note
None

Parameter Description
Parameter mParser ObjIndex Description mParser indicates a parsed MML message object. ObjIndex is an integer. It indicates the index of the entries of the MML message. The Nth object in the MML message refers to the Nth MML message. PropName is a string. It indicates the attribute name of an entry in the MML message. RecordIdx is an integer. It indicates the record number in the MML message. The numbers of the records count from 0. Case is an integer. It indicates whether the attribute name is case sensitive. The default value is 0. When Case uses the default value, the attribute name is case sensitive. When Case is valued other numbers, the attribute name is case insensitive.

PropName RecordIdx Case

Return Value
The return value is a string. If the function is called successfully, the obtained attribute value is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
mml = ''' +++ NE 2007-12-07 10:13:53 O&M #243 %%/*617*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID 0 0 300 1 1 300 20 20 301 10 10 302 12 12 302 15 3802 3802 (Number of results = 6) --''' END

NodeB name 3812 3812 BBU 3812E 3812E 3802

5-74

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

p = ParseMMLRpt(mml) #Get and output the attribute value of record 1 with #the attribute name "Cell ID" in entry 0. Print("GetAttrValueByName = "+ str(GetAttrValueByName(p,0,"Cell ID",1)))

Result
GetAttrValueByName() = 1

Related Example

5.4.18 Function: GetAttrValueByIdx


This topic describes the GetAttrValueByIdx function. This function enables you to obtain the specified attribute value from a parse MML message according to the entry number, attribute number, and record number.

Synopsis
GetAttrValueByIdx(mParser, ObjIndex, PropIndex, RecordIdx)

Note
None

Parameter Description
Parameter mParser ObjIndex Description mParser indicates a parsed MML message object. ObjIndex is an integer. It indicates the entry number in the MML message. The numbers of the entries count from 0. PropIdex is an integer. It indicates the attribute number in the MML message. The numbers of the attributes count from 0. RecordIdx is an integer. It indicates the record number in the MML message. The numbers of the records count from 0.

PropIndex

RecordIdx

Return Value
The return value is a string. If the function is called successfully, the obtained attribute value is returned. Otherwise, a null string is returned.

Error Handling
None.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-75

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Example
mml = ''' +++ NE 2007-12-07 10:13:53 O&M #243 %%/*617*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID NodeB name Local cell ID Subrack No. Subsystem No. 0 1 20 10 12 15 (Number --''' 0 300 1 300 20 301 10 302 12 302 3802 3802 of results = 6) END 3812 3812 BBU 3812E 3812E 3802 0 1 0 0 2 0 3 3 3 3 3 3 0 0 0 0 0 0

p = ParseMMLRpt(mml) #Get and output the attribute value of record 0 inf attribute 0 in entry 0. Print("GetAttrValueByIdx = "+ str(GetAttrValueByIdx(p,0,0,2)))

Result
GetAttrValueByIdx() = 20

Related Example

5.4.19 Function: GetAttrNameList


This topic describes the GetAttrNameList function. This function enables you to obtain the list of attribute names in the specified entry in an MML message.

Synopsis
GetAttrNameList(mParser, ObjIndex)

Note
None

Parameter Description
Parameter mParser ObjIndex Description mParser indicates a parsed MML message object. ObjIndex is an integer. It indicates the entry number in the MML message. The numbers of the entries count from 0.

5-76

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Return Value
The return value is a string list. If the function is called successfully, the list of the attribute names in the specified entry is returned. Otherwise, an empty list is returned.

Error Handling
None.

Example
mml = ''' +++ 2007-04-12 17:22:13 O&M; #813231 %%/*17449*/LST BAMIPRT:;%% RETCODE = 0 Execution succeeded. List BAM IP route ----------------Destination network address 10.20.0.0 10.21.0.0 (Number of results = 2) --''' END

Destination address mask 255.255.0.0 255.255.0.0

Forward route address 10.121.143.208 10.121.143.208

p = ParseMMLRpt(mml) attrNames = GetAttrNameList(p,0) #From the parsed MML message, get the name list of the attributes in entry 0. Print("GetAttrNameList() return: "+ str(attrNames))

Result
GetAttrNameList() return: ['Destination network address', 'Destination address mask', 'Forward route address']

Related Example

5.4.20 Function: GetAttrNum


This topic describes the GetAttrNum function. This function enables you to obtain the number of attributes in the specified entry in an MML message.

Synopsis
GetAttrNum(mParser, ObjIndex)

Note
None

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-77

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Description
Parameter mParser ObjIndex Description mParser indicates a parsed MML message object. ObjIndex is an integer. It indicates the entry number in the MML message. The numbers of the entries count from 0.

Return Value
The return value is an integer. If the function is called successfully, the number of attributes in the specified entry is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
mml = ''' +++ 2007-04-12 16:36:19 O&M; #813086 %%/*16553*/LST BRD: SRN=5;%% RETCODE = 0 Execution succeeded. List board type --------------Subrack No. = 5 Slot No. = 0 Board type = WOSE Subrack No. = 5 Slot No. = 1 Board type = WFMR (Number of results = 2) --''' END

p = ParseMMLRpt(mml) attrNum = GetAttrNum(p,0) #From the parsed MML message, get the number of attributes in entry 0. Print("GetAttrNum() return: %d"%attrNum)

Result
GetAttrNum() return: 3

Related Example

5.4.21 Function: GetColumnByName


This topic describes the GetColumnByName function. This function enables you to obtain the data of a column in the specified entry according to the column name.
5-78 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Synopsis
GetColumnByName(mParser, objIndex, columnName, ignoreCase)

Note
None.

Description
Parameter mParser objIndex Description mParser indicates the return object of parsing the MML message. ObjIndex is of integer type. It specifies the number of the entry to be extracted from the MML message. The number counts from 0. columnName is of string type. It refers to the name of the column to be extracted. ignoreCase is of integer type. It indicates whether the value in columnName is case sensitive. When ignoreCase is 0, you can infer that the value is case sensitive. When ignoreCase is not 0, you can infer that the value is case insensitive. The default setting is 0.

columnName ignoreCase

Return Value
The return value is of string sequence type. If the function is called successfully, the data of a column in the specified entry is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
mml = """ +++ RNC 2006-12-19 20:48:50 O&M #8522 %%/*2116*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID DL primary scrambling code 0 1 2 CELL1 CELL2 CELL3 1 1 1

NodeB name Local cell ID Location area code 3 3 3

Subrack No. 0 0 0

Subsystem No.\ 0\ 128\ 127\

NODEB1 0 H'2512(9490) NODEB1 1 H'2512(9490) NODEB1 2 H'2512(9490)

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-79

5 HFC Library Reference


3 4 5 6 10 CELL4 CELL5 CELL6 CELL7 CELL10 1 2 2 2 1

iManager N2000 UMS Element Management System iSStar


NODEB1 H'2512(9490) NODEB2 H'2512(9490) NODEB2 H'2512(9490) NODEB2 H'2512(9490) NODEB1 H'2512(9490) 3 4 5 6 10 3 3 3 3 3 0 0 0 0 0 126\ 125\ 124\ 123\ 1\

(Number of results = 8) --""" END

p = ParseMMLRpt(mml) col1 = GetColumnByName(p, 0, 'Cell name') for v in col1 Print(v) end

Result
CELL1 CELL2 CELL3 CELL4 CELL5 CELL6 CELL7 CELL10

5.4.22 Function: GetColumnByIndex


This topic describes the GetColumnByIndex function. This function enables you to obtain the data of the specified column according to the column number.

Synopsis
GetColumnByIndex(mParser, objIndex, columnIndex )

Note
None.

Description
Parameter mParser objIndex Description mParser indicates the MML message object that is parsed. ObjIndex is of integer type. It specifies the number of the entry to be extracted from the MML message. The number counts from 0. columnIndex is of integer type. It specifies the number of the column to be extracted. The number counts from 0.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

columnIndex

5-80

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Return Value
The return value is a string sequence. If the function is successfully called, the data of the specified column in the specified entry is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
mml = """ +++ RNC 2006-12-19 20:48:50 O&M #8522 %%/*2116*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID DL primary scrambling code 0 1 2 3 4 5 6 10 CELL1 CELL2 CELL3 CELL4 CELL5 CELL6 CELL7 CELL10 1 1 1 1 2 2 2 1

NodeB name Local cell ID Location area code 0 1 2 3 4 5 6 10 3 3 3 3 3 3 3 3

Subrack No. 0 0 0 0 0 0 0 0

Subsystem No.\ 0\ 128\ 127\ 126\ 125\ 124\ 123\ 1\

NODEB1 H'2512(9490) NODEB1 H'2512(9490) NODEB1 H'2512(9490) NODEB1 H'2512(9490) NODEB2 H'2512(9490) NODEB2 H'2512(9490) NODEB2 H'2512(9490) NODEB1 H'2512(9490)

(Number of results = 8) --""" END

p = ParseMMLRpt(mml) col3 = GetColumnByIndex(p, 0, 3) for v in col3 Print(v) end

Result
NODEB1 NODEB1 NODEB1 NODEB1 NODEB2 NODEB2 NODEB2 NODEB1

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-81

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.4.23 Function: GetRowByIndex


This topic describes the GetRowByIndex function. This function enables you to obtain the data of a record in the specified entry according to the entry number and row number.

Synopsis
GetRowByIndex(mParser, objIndex, rowIndex)

Note
None.

Description
Parameter mParser objIndex Description mParser indicates the return object of parsing the MML message. objIndex is of integer type. It specifies the number of the entry to be extracted from the MML message. The number counts from 0. rowIndex is of integer type. It specifies the number of the record to be abstracted. The number counts from 0.

rowIndex

Return Value
The return value is of string sequence type. If the function is called successfully, the data of a record in the specified entry is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
mml = """ +++ RNC 2006-12-19 20:48:50 O&M #8522 %%/*2116*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID DL primary scrambling code 0 1 2 CELL1 CELL2 CELL3 1 1 1

NodeB name Local cell ID Location area code 3 3 3

Subrack No. 0 0 0

Subsystem No.\ 0\ 128\ 127\

NODEB1 0 H'2512(9490) NODEB1 1 H'2512(9490) NODEB1 2 H'2512(9490)

5-82

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


3 4 5 6 10 CELL4 CELL5 CELL6 CELL7 CELL10 1 2 2 2 1 NODEB1 H'2512(9490) NODEB2 H'2512(9490) NODEB2 H'2512(9490) NODEB2 H'2512(9490) NODEB1 H'2512(9490) 3 4 5 6 10 3 3 3 3 3

5 HFC Library Reference


0 0 0 0 0 126\ 125\ 124\ 123\ 1\

(Number of results = 8) --""" END

p = ParseMMLRpt(mml) row = GetRowByIndex(p, 0, 0) for v in row Print(v) end

Result
0 CELL1 1 NODEB1 0 3 0 0 H'2512(9490)

5.4.24 Function: GetDataFrmMMLRpt


This topic describes the GetDataFrmMMLRpt function. This function enables you to convert a specified entry into a tuple for report output.

Synopsis
GetDataFrmMMLRpt(mParser, objIndex, columnIndexList)

Note
None

Parameter Description
Parameter mParser objIndex Description mParser indicates the return object of parsing the MML message. ObjIndex is an integer. It specifies which entry needs to be extracted from the MML message. The serial number of the entries start from 0.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-83

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter columnIndexList

Description columnIndexList is of integer type. It specifies the numbers of the columns to be extracted from the extracted entry. Ignoring this parameter or entering a null sequence list indicates that all the content in a table is extracted.

Return Value
The return value is a tuple (title, two-dimensional list). The title is a string. The two-dimensional is a common two-dimensional tuple, for example, [[...], [...], [...], ...]. For details of tuples, refer to 4.3.5 Tuple. For details of two-dimensional lists, refer to 4.3.4 List.

Error Handling
None.

Example
mml = """ +++ RNC 2006-12-19 20:48:50 O&M #8522 %%/*2116*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID DL primary scrambling code 0 1 2 3 4 5 6 10 CELL1 CELL2 CELL3 CELL4 CELL5 CELL6 CELL7 CELL10 1 1 1 1 2 2 2 1

NodeB name Local cell ID Location area code 0 1 2 3 4 5 6 10 3 3 3 3 3 3 3 3

Subrack No. 0 0 0 0 0 0 0 0

Subsystem No.\ 0\ 128\ 127\ 126\ 125\ 124\ 123\ 1\

NODEB1 H'2512(9490) NODEB1 H'2512(9490) NODEB1 H'2512(9490) NODEB1 H'2512(9490) NODEB2 H'2512(9490) NODEB2 H'2512(9490) NODEB2 H'2512(9490) NODEB1 H'2512(9490)

(Number of results = 8) --""" END

p = ParseMMLRpt(mml) title, data = GetDataFrmMMLRpt(p, 0) Print(title) for r in data for v in r

5-84

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


Print(v) end Print('-------------') end

5 HFC Library Reference

Result
List cell basic information Cell ID Cell name NodeB ID NodeB name Local cell ID Subrack No. Subsystem No. DL primary scrambling code Location area code ------------0 CELL1 1 NODEB1 0 3 0 0 H'2512(9490) ------------1 CELL2 1 NODEB1 1 3 0 128 H'2512(9490) ------------2 CELL3 1 NODEB1 2 3 0 127 H'2512(9490) ------------3 CELL4 1 NODEB1 3 3 0 126 H'2512(9490) ------------4 CELL5 2 NODEB2 4 3 0 125 H'2512(9490) -------------

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-85

5 HFC Library Reference


5 CELL6 2 NODEB2 5 3 0 124 H'2512(9490) ------------6 CELL7 2 NODEB2 6 3 0 123 H'2512(9490) ------------10 CELL10 1 NODEB1 10 3 0 1 H'2512(9490) -------------

iManager N2000 UMS Element Management System iSStar

5.4.25 Function: GetUTCTimeOffSet


This describes the GetUTCTimeOffSet function. This function enables you to obtain the offset between the UTC time and the time when the MML message is generated.

Synopsis
GetUTCTimeOffSet(pMMLRpt)

Note
None.

Parameter Description
Parameter pMMLRpt Description pMMLRpt is the return value of 5.4.3 Function: ParseMMLRpt.

Return Value
The return value is a string. If the function is called successfully, the return value is the offset between the UTC time and the time when the MML message is generated. Otherwise, null string is returned.

5-86

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Error Handling
None.

Example
strMml = """ +++ MSC29 2009-09-09 01:53:51-05:59 DST O&M #177132 %%/*5378*/LST VER:;%% RETCODE = 0 Operation succeeded Result of current software query -------------------------------Current Software Version = MSC9880 MSOFTX3000V100R007C01B039 Current Software Status = Normal --END """ p = ParseMMLRpt(strMml) # Parse the MML message.

utcTime = GetUTCTimeOffSet(p) Print('GetUTCTimeOffSet() return: %s'%utcTime)

Result
GetUTCTimeOffSet() return: -05:59

5.4.26 Function: DestroyMMLParser


This topic describes the DestroyMMLParser function. This function enables you to destroy an MM message parsing object so that you can release the system resources for parsing the MM message, and reduce system consumption.

Synopsis
DestroyMMLParser(mparser)

Note
It is advised that you call this interface when handling a mass of MM messages to avoid exceptions during the parsing of MM messages.

Parameter Description
Parameter mparser Description mparser is the parsing object of MM messages.

Return Value
If you delete the parsing object successfully, 1 is returned. If you fail to delete the parsing object, 0 is returned.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-87

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Error Handling
None.

Example
mml = """ +++ NE 2007-12-07 10:13:53 O&M #243 %%/*570*/LST CELL:;%% RETCODE = 0 Execution succeeded. List cell basic information --------------------------Cell ID Cell name NodeB ID NodeB name Local cell ID Subrack No. Subsystem No. 0 1 12 15 0 1 12 3802 300 300 302 3802 3812 3812 3812E 3802 0 1 2 0 3 3 3 3 0 0 0 0

(Number of results = 4) --END """ p = ParseMMLRpt(mml) success=DestroyMMLParser(p) if success == 1 Print("destroy success") end

Result
destroy success

5.4.27 Examples of MML Message Parse Functions


This topic describes the examples of the MML message parse functions and the method of using some functions related to the MML message.

Scenario
In routine maintenance work, you always need to check the status of a subrack on a frame and output the types and states of the boards on the slots of this subrack.

Procedure
1. 2. 3. Obtain the message returned by the MML command. By using the 5.4 MML Message Parse Functions function, parse the message and obtain the information about the status of each frame. By using the 5.14.2.2 Function: NewReport, 5.14.3.2 Function: AddSheet, 5.14.3.3 Function: AddTable, 5.14.3.12 Function: SetTableValue, and 5.14.2.3 Function: SaveReportAs functions, save the parsing results to an .xls report.

Example
Print('*************Subrack status check starts*************') mml = """

5-88

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


+++ NE 2007-11-29 16:41:27 O&M #230229 %%/*2621529*/LST FRM:;%% RETCODE = 0 Operation succeeded Frame information ----------------Frame Slot number

5 HFC Library Reference

Location 2

0 0 (Number of results = 2) --END """ parser = ParseMMLRpt(mml)

# If the MML message did not return success, the processing is stopped. if not parser or GetResultCode(parser) != '0' Print('The information about the subrack of the current NE is unavailable. exit.') Exit(1) end if GetObjNum(parser) < 1 Print('The information about the subrack of the current NE is unavailable.exit.') Exit(2) end # Get the subrack list. frame_list = GetColumnByIndex(parser, 0, 0) # Create a report and add a page about subrack information. NewReport() sId = AddSheet('subrack information') # Searching for all the subrack information cyclically. for frmNo in frame_list mml = """ +++ NE 2007-11-29 16:42:12 O&M #230231 %%/*2621530*/DSP FRM: FN=0;%% RETCODE = 0 Operation succeeded Frame 0 Information ------------------Frame Slot FrontBrd

FrontBrdState

UpperPMC

LowerPMC

BackBrd

BackBrdState

0 0 WCSU Main OK 0 1 WCSU Main OK 0 2 WCCU Main OK 0 3 WCSU Main OK 1 4 WCSU Main OK (Number of results = 5) --""" END # Parse the returned message. parser = ParseMMLRpt(mml)

Normal Normal WEPI Normal Uninstalled Uninstalled WEPI Normal Uninstalled Uninstalled WBFI Uninstalled Uninstalled Uninstalled WBFI Normal Uninstalled Uninstalled <NULL> Normal

# From the obtained parsing object, get the title #and data information (a two-dimensional list). title, tb = GetDataFrmMMLRpt(parser, 0) # Create a table. tId = AddTable(sId, len(tb), len(tb[0]), title) # Convert the two-dimensional list into a one-dimensional list. dataset = []

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-89

5 HFC Library Reference


for r in tb dataset += r end # Set the data to the table. SetTableValue(tId, dataset) end

iManager N2000 UMS Element Management System iSStar

#Save the subrack information. SaveReportAs('Subrackinfo.xls') Print('*************The subrack status check ends*************')

Result
*************Subrack status check starts ************* *************The subrack status check ends*************

Precautions
The script of the previous task exports a report in .xls format to the output directory. Figure 5-5lists the elements in the report. Figure 5-5 Elements in the report

5.5 Alarm Message Parsing Function


This describes the alarm message parsing functions. Using these functions, you can obtain the information about the alarms in a message, such as alarm severity and alarm location information. This facilitates future maintenance. 5.5.1 Overview of Alarm Message Parsing Function This describes the basic functions and procedures of alarm message parsing functions. 5.5.2 Alarm Message Format This describes the structure, components, and format of an alarm message. 5.5.3 Function: ParseAlmRpt
5-90 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

This describes the ParseAlmRpt function. This function enables you to parse an alarm message and convert it into a format that can be recognized by other alarm message parsing functions. You need to call this function before calling other alarm message parsing functions. 5.5.4 Function: GetAlmSource This describes the GetAlmSource function. This function enables you to obtain the source identity of an alarm message. A source identity is used for identifying the physical area where an alarm is generated. 5.5.5 Function: GetAlmRptDate This describes the GetAlmRptDate function. This function enables you to get the create date of an alarm report. 5.5.6 Function: GetAlmRptTime This describes the GetAlmRptTime function. This function enables you to obtain the generation time of an alarm message. 5.5.7 Function: GetAlmRptNum This describes the GetAlmRptNum function. This function enables you to obtain the number of entries in an alarm message. Entry n refers to alarm n, where n is an entry of the alarm message. 5.5.8 Function: GetAlmServiceTag This describes the GetAlmServiceTag function. This function enables you to obtain the service message flag of the specified alarm. 5.5.9 Function: GetAlmTimeAdjustFlag This describes the GetAlmTimeAdjustFlag function. This function enables you to obtain the time adjustment flag of an alarm message. 5.5.10 Function: GetAlmServiceFlag This describes the GetAlmServiceFlag function. This function enables you to obtain the service message flag of an alarm message. The service message flag is ALARM. 5.5.11 Function: GetAlmRptIdx This describes the GetAlmRptIdx function. This function enables you to obtain the serial number of an alarm message. A serial number uniquely identifies an alarm message. 5.5.12 Function: GetAlmMMLCmd This describes the GetAlmMMLCmd function. This function enables you to obtain the MML command output of an alarm message. 5.5.13 Function: GetAlmResultCode This describes GetAlmResultCode function. This function enables you to obtain the return codes. 5.5.14 Function: GetAlmResultCause This describes the GetAlmResultCause function. This function enables you to obtain the information about the return code of an alarm message. 5.5.15 Function: GetAlmTips This describes the GetAlmTips function. This function enables you to get the tips of an alarm message. 5.5.16 Function: GetAlmFlowNumber This describes the GetAlmFlowNumber function. This function enables you to obtain the alarm flow number of the specified alarm in an alarm message. Alarm flow numbers are serial numbers sequenced by the alarm generation time. 5.5.17 Function: GetAlmType
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-91

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

This describes the GetAlmType function. This function enables you to obtain the alarm category of the specified alarm. Alarm category is defined by alarm nature. Alarms can be categorized into fault alarm and event alarm. 5.5.18 Function: GetAlmLevel This describes the GetAlmLevel function. This function enables you to obtain the alarm severity of the specified alarm in an alarm message. Alarm severity is used for identifying the impact of the alarm on the service. Four types are available: critical, major, minor, and warning. 5.5.19 Function: GetAlmNEType This describes the GetAlmNEType function. This function enables you to obtain the NE type of the specified alarm. NE type is used for identifying the type of the NE that generates an alarm. 5.5.20 Function: GetAlmID This describes the GetAlmID function. This function enables you to obtain the alarm ID of the specified entry in an alarm message.Alarm ID is used for identifying the same type of alarms. For the same product, the alarm ID is unique for one type of alarms. 5.5.21 Function: GetAlmSort This describes the GetAlmSort function. This function enables you to obtain the alarm name of the specified alarm. The following alarm types are available: power system, environment system, signaling system, relay system, hardware system, software system, running system, Qos, handling error, and internal NM system. 5.5.22 Function: GetAlmSyncSerialNo This describes the GetAlmSyncSerialNo function. This function enables you to obtain the alarm synchronization number of the specified alarm. Alarm synchronization number is used for synchronizing the alarm from Manager to Agent. Each alarm has one and only one alarm synchronization number. 5.5.23 Function: GetAlmName This describes the GetAlmName function. This function enables you to obtain the alarm name of the specified alarm. An alarm name briefly describes an alarm. 5.5.24 Function: GetAlmRaiseTime This describes the GetAlmRaiseTime function. This function enables you to obtain the generation time of the specified alarm. 5.5.25 Function: GetAlmLocationInfo This describes the GetAlmLocationInfo function. This function enables you to obtain the alarm location information about the Index alarm in an alarm message. The location information helps identify the object that generates the alarm. 5.5.26 Function: GetAlmAttrValueByName This describes the GetAlmAttrValueByName function. This function enables you to obtain the attribute value of the Index entry in an alarm message. 5.5.27 Function: GetAlmAttrValueByIdx This describes the GetAlmAttrValueByIdx function. This function enables you to obtain the value of specified attribute of the specified alarm in an alarm message. 5.5.28 Function: GetAlmNumByLevel This describes the GetAlmNumByLevel function. This function enables you to obtain the number of alarms of the specified severity. 5.5.29 Function: GetAlmNumByTimeDur This describes the GetAlmNumByTimeDur function. This function enables you to obtain the number of alarms in a specified period.
5-92 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.5.30 Function: GetAlmRptUTCTimeOffSet This describes the GetAlmRptUTCTimeOffSet function. This function enables you to obtain the offset between the UTC time and the time when the alarm is generated. 5.5.31 Examples of Alarm Message Parsing Function This gives examples of the alarm message parsing function. You can better understand how to use NE operation functions to perform routine maintenance.

5.5.1 Overview of Alarm Message Parsing Function


This describes the basic functions and procedures of alarm message parsing functions.

Basic Functions
After the N2000 UMS issues alarm MML commands to an NE, the NE returns an alarm message. An alarm message is an MML message that contains alarm information. An alarm message includes the following items: source identifier, creation date, creation time, service message flag, time adjustment flag, flow number, alarm category, alarm severity, and alarm ID. By using alarm message parsing functions, you can obtain the information about an alarm message, thus facilitating the related maintenance. Table 5-6 lists the alarm message parsing functions. Table 5-6 Alarm message parsing function list Function 5.5.3 Function: ParseAlmRpt Description Parses an alarm message and convert it into a format that can be recognized by other alarm message parsing functions. You need to call this function before calling other alarm message parsing functions. Returns the source identifier of an MML message. A source identifier identifies the physical area of an message output. Generally, it is an equipment identifier. You can specify source identifiers when specifying the equipment, for example, office name. Returns the creation date of an alarm message. Returns the creation time of an alarm message. Returns the number of entries in an alarm message. The Nth entry of an alarm message refers to the Nth alarm. Returns the service message flag of the specified alarm in an alarm message.

5.5.4 Function: GetAlmSource

5.5.5 Function: GetAlmRptDate 5.5.6 Function: GetAlmRptTime 5.5.7 Function: GetAlmRptNum

5.5.8 Function: GetAlmServiceTag

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-93

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Function 5.5.9 Function: GetAlmTimeAdjustFlag

Description Returns the time adjustment flag of an alarm message. A time adjustment flag indicates a periodic adjustment of time, for example, the DST. The N2000 UMS can precisely determine the time with the help of this flag. For example, when the DST starts, the time adjustment flag helps the N2000 UMS to solve the time overlaps before and after the DST. Returns the service message flag of an alarm message. A service message flag is used for identifying the service type of a message. The service message flag of an alarm message is ALARM. Returns the serial number of an alarm message. An alarm serial number uniquely identifies an alarm message. Returns the MML command output of an alarm message. The echo of an MML command shows the issued MML command. The password echo is *****, that is, five asterisks. If an alarm message is displayed as multiple submessages, the command echoes of all the submessages are the same. Returns the return codes of an alarm message. Return codes are contained in a system report. The system report refers to the returned message which indicates whether the system has successfully processed the alarm message. A return code is represented by a 32-bit decimal positive integer. The value 0 indicates that the system process is successful. Other return codes are defined by the NE applications.

5.5.10 Function: GetAlmServiceFlag

5.5.11 Function: GetAlmRptIdx

5.5.12 Function: GetAlmMMLCmd

5.5.13 Function: GetAlmResultCode

5.5.14 Function: GetAlmResultCause

Returns the information about the return codes of an alarm message. The remarks of a return code is contained in a system report. The system report refers to the returned message which indicates whether the system has successfully processed the alarm message. If the command is successfully run, the remark shows success. If a command is not successfully run, the remark gives the cause. This helps you to locate the error.

5-94

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Function 5.5.15 Function: GetAlmTips

Description Returns the tips of an alarm message. For some commands, you need to provide detailed explanations in the form of tips for integrity purpose. Returns the alarm flow number of the specified alarm in an alarm message. Alarm flow numbers are serial numbers sequenced by the alarm generation time. Returns the alarm category of the specified alarm. Alarm category is defined by alarm nature. Alarms can be categorized into fault alarm and event alarm. Returns the severity of the specified alarm. Alarm severity is used for identifying the impact of the fault on the service. Alarms has four severity levels: critical, major, minor, and warning. Returns the NE type of the specified alarm. NE type is used for identifying the type of the NE that generates an alarm. Returns the alarm ID of the specified entry in an alarm message. Alarm ID is used for identifying the same type of alarms. For the same product, the alarm ID is unique for one type of alarms. Returns the alarm type of the specified alarm. The following alarm types are available: power system, environment system, signaling system, relay system, hardware system, software system, running system, Qos, handling error, and internal NM system. Returns the alarm synchronization number of the specified alarm. Alarm synchronization number is used for synchronizing the alarm from Manager to Agent. Each alarm has one and only one alarm synchronization number. Returns the alarm name of the specified alarm. An alarm name briefly describes an alarm. Returns the generation time of the specified alarm in an alarm in an alarm message.

5.5.16 Function: GetAlmFlowNumber

5.5.17 Function: GetAlmType

5.5.18 Function: GetAlmLevel

5.5.19 Function: GetAlmNEType

5.5.20 Function: GetAlmID

5.5.21 Function: GetAlmSort

5.5.22 Function: GetAlmSyncSerialNo

5.5.23 Function: GetAlmName 5.5.24 Function: GetAlmRaiseTime

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-95

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Function 5.5.25 Function: GetAlmLocationInfo

Description Returns the alarm location information of the specified alarm in an alarm message. The alarm location information uniquely identifies the object that generates the alarm. Returns the attribute value of the specified attribute of the specified alarm in an alarm message. Returns the value of specified attribute of the specified alarm in an alarm message. Returns the number of alarms of the specified severity. Returns the number of alarms in a specified period.

5.5.26 Function: GetAlmAttrValueByName 5.5.27 Function: GetAlmAttrValueByIdx 5.5.28 Function: GetAlmNumByLevel 5.5.29 Function: GetAlmNumByTimeDur

Procedure
Figure 5-6 shows how to use the alarm message parsing functions to obtain the alarm message contents. Figure 5-6 Workflow of alarm message parsing functions

The procedure is as follows: 1. Obtain the alarm message. You can obtain the message by calling 5.1.14 Function: GetMMLReport or by manually entering the alarm message. Note that you must conform to the format specifications to enter alarm messages. Otherwise, the alarm message parsing functions fail to parse the messages. For details of alarm message format, refer to 5.5.2 Alarm Message Format.
5-96 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

2. 3.

Parse the MML message by calling 5.5.3 Function: ParseAlmRpt. Obtain the required data from the parsed message.

5.5.31 Examples of Alarm Message Parsing Function shows the examples.

5.5.2 Alarm Message Format


This describes the structure, components, and format of an alarm message. An alarm message is an MML message that contains alarm information. It is composed of a head, a body, and an end identifier. l A head marks the starting of an alarm message. It defines the start mark as well as the source identity, service message flag, serial number, creation time, command echo, return code, and return code explanation. These points are the common features of MML messages and are processed primarily when the system identifies an MML message.The head structure of an alarm message is the same as that of an MML message. The MML message head parsing function is also applicable for parsing alarm messages. A body is the main part of the alarm message. It contains all the information to be transmitted in the message. An end identifier represents the end of the alarm message. It is used together with the start identifier to identify an alarm message. The alarm in an alarm message, that is, the message body is composed of the following items: basic attributes, alarm synchronization number, alarm name, generation time, and alarm location information. Some alarms may also contain alarm details, alarm cause, handling suggestion, restoration type, and restoration time. The basic alarm attributes include service message identity, flow number, alarm type, alarm severity, NE type, alarm ID, and alarm class.

l l l

Figure 5-7 shows the format of an alarm message. For details of Figure 5-7, see Table 5-7. Figure 5-7 Alarm Message Format

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-97

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Table 5-7 Description of the Alarm Message Format SN (1) (2) Field Meaning Start identifier Source identity (equipment identification) Creation time Service message flag Serial number Description An alarm message starts with +++ . A source identity is used for identifying the physical area where an alarm is generated. It can be obtained through 5.5.4 Function: GetAlmSource. The YYYY-MM-DD HH:MM:SS format is applied. It can be obtained through 5.5.6 Function: GetAlmRptTime. The service message flag is ALARM. It can be obtained through 5.5.10 Function: GetAlmServiceFlag. A serial number uniquely identifies an alarm message. It can be obtained through 5.5.11 Function: GetAlmRptIdx. The command echo of an MML command displays the issued MML command. It can be obtained through 5.4.10 Function: GetMMLCmd. A return code identifies whether the NE system has successfully processed the MML commands. A return code is represented by a 32-bit decimal positive integer. The value 0 indicates that the system process is successful. Other return codes are defined by the NE applications. It can be obtained through 5.5.13 Function: GetAlmResultCode. (8) Remarks of a return code If the command is successfully run, the remark shows success. If a command is not successfully run, the remark gives the cause, which helps locate the error. It can be obtained through 5.5.14 Function: GetAlmResultCause. (9) (10) Service message flag of alarm 0 Flow number of alarm 0 Alarm category of alarm 0 Alarm severity of alarm 0 It can be obtained through 5.5.8 Function: GetAlmServiceTag. An alarm flow number identifies the sequence of the alarms generated on an NE. It can be obtained through 5.5.16 Function: GetAlmFlowNumber. Alarm category is defined by the alarm nature. Alarms can be categorized into fault alarm and event alarm. It can be obtained through 5.5.17 Function: GetAlmType. Alarm severity indicates the degree of impact on the service. Four types are available: critical, major, minor, and warning. It can be obtained through 5.5.18 Function: GetAlmLevel.

(3) (4) (5)

(6)

Command echo of an MML command in an alarm message Return code

(7)

(11)

(12)

5-98

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

SN (13)

Field Meaning NE type of alarm 0

Description NE type indicates the type of the NE where an alarm is generated. It can be obtained through 5.5.19 Function: GetAlmNEType. Alarm ID is used for identifying alarms of the same type. For the same product, the alarm ID is unique for one type of alarms. It can be obtained through 5.5.20 Function: GetAlmID. Alarm type is used for identifying the source of an alarm, such as: l Power system l Environment system l Signaling system l Relay system l Hardware system l Software system l Running system l Communications system l QoS l Handling error l Internal NM system It can be obtained through 5.5.21 Function: GetAlmSort.

(14)

Alarm ID of alarm 0

(15)

Alarm type of alarm 0

(16)

Basic attributes of an alarm Attribute name

The basic attributes include service message identity, flow number, alarm type, alarm severity, NE type, alarm ID, and alarm type. An alarm message contains the following items: alarm synchronization number, alarm name, alarm generation time, and location information. Some alarm messages also contain detailed description, alarm cause, handling suggestions, restoration type, and restoration time. It can be obtained through 5.5.26 Function: GetAlmAttrValueByName and 5.5.27 Function: GetAlmAttrValueByIdx. Alarm synchronization No. is used during the process of the NM synchronizes alarms with the NE. Each alarm has one and only one alarm synchronization number. It can be obtained through 5.5.22 Function: GetAlmSyncSerialNo. An alarm name briefly describes an alarm. Its length cannot exceed 100 English characters. It can be obtained through 5.5.23 Function: GetAlmName.

(17)

(18)

Attribute value

(19)

Alarm synchronization No.

(20)

Alarm name

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-99

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

SN (21)

Field Meaning Alarm generation time

Description Alarm generation time refers to the time when an alarm is generated on a device. The format is YYYY-MM-DD HH:MM:SS. It can be obtained through 5.5.24 Function: GetAlmRaiseTime. Alarm location information uniquely identifies the object of an alarm. It can be obtained through 5.5.25 Function: GetAlmLocationInfo. Location information is composed of multiple sub-items which are separated by , , that is, an English comma and an English space. The format if each item is Item=Item value. l Item describes the location field, for example, subrack No., and board No. It is composed of Chinese characters, English letters, numbers, or English underscores. l Item value describes the location field value. It is composed of Chinese characters, English letters, or numbers.

(22)

Alarm location information

(23) (24) (25) (26) (27)

Entry 0 Entry 1 Entry 2 End identifier Alarm message

Alarm 0 You can obtain the number of entries in an alarm message by calling 5.5.7 Function: GetAlmRptNum. Alarm 1 Alarm 2 An alarm message ends with --- END . You can create a message parsing object by calling 5.5.3 Function: ParseAlmRpt.

CAUTION
The indexes of entries, attributes, and records of an alarm message count from 0.

5.5.3 Function: ParseAlmRpt


This describes the ParseAlmRpt function. This function enables you to parse an alarm message and convert it into a format that can be recognized by other alarm message parsing functions. You need to call this function before calling other alarm message parsing functions.

Synopsis
ParseAlmRpt(AlmRpt)

5-100

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Note
The return value of the ParseAlmRpt function is the parsing object of the alarm message. The parsing object of the alarm message is necessary for other alarm message parsing functions. Therefore, you need to call this function before calling other alarm message parsing functions.

Parameter Description
Parameter AlmRpt Description AlmRpt is a string. It indicates the alarm message to be resolved. The AlmRpt string can be obtained through reading the alarm files or calling 5.1.14 Function: GetMMLReport.

Return Value
The return value is an integer. If the function is called successfully, the alarm message resolving object is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 4) --""" END

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-101

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

#Create a flag for the alarm message parsing object. p = ParseAlmRpt(strAlarm) Print("ParseAlmRpt(strAlarm) return: " + str(p))

Result
ParseAlmRpt(strAlarm) return: <AlarmParser.AlarmParser instance at 0x0A4BB508>

Related Example

5.5.4 Function: GetAlmSource


This describes the GetAlmSource function. This function enables you to obtain the source identity of an alarm message. A source identity is used for identifying the physical area where an alarm is generated.

Synopsis
GetAlmSource(pAlmRpt)

Note
None

Parameter Description
Parameter pAlmRpt Description pAlmRpt indicates a parsed alarm message object.

Return Value
The return value is a string. If the function is called successfully, the identity of the alarm message is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 RNC 211 Hardware

ALARM

68037 Fault Major Sync serial No. = 110145

1802

Signaling

5-102

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


Alarm name Alarm raised time Location info ALARM = = =

5 HFC Library Reference

SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

(Number of results = 3) --""" END

#Create an alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the source identifier of the alarm message. Print('Alarm source is: ' + GetAlmSource(p) )

Result
Alarm source is:NE

Related Example

5.5.5 Function: GetAlmRptDate


This describes the GetAlmRptDate function. This function enables you to get the create date of an alarm report.

Synopsis
GetAlmRptDate(pAlmRpt)

Note
None

Parameter Description
Parameter pAlmRpt Description pAlmRpt indicates a parsed alarm message object.

Return Value
The return value is a string. If the function is called successfully, the creation date of the alarm message is returned. Otherwise, a null string is returned.

Error Handling
None.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-103

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

#Create an alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the creation date of the alarm message. Print('The create date of an alarm report is: ' + GetAlmRptDate(p) )

Result
The create date of an alarm report is: 2006-01-04

Related Example

5.5.6 Function: GetAlmRptTime


This describes the GetAlmRptTime function. This function enables you to obtain the generation time of an alarm message.

Synopsis
GetAlmRptTime(pAlmRpt)

Note
None.

5-104

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Description
Parameter pAlmRpt Description pAlmRpt indicates a parsed alarm message object.

Return Value
The return value is a string. If the function is called successfully, the generation time of the message is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

#Create an alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the creation time of the alarm message. Print('The generation time of an alarm message is: ' + GetAlmRptTime(p) )

Result
The generation time of an alarm message is: 11:35:56

Related Example
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-105

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.5.7 Function: GetAlmRptNum


This describes the GetAlmRptNum function. This function enables you to obtain the number of entries in an alarm message. Entry n refers to alarm n, where n is an entry of the alarm message.

Synopsis
GetAlmRptNum(pAlmRpt)

Note
None

Parameter Description
Parameter pAlmRpt Description pAlmRpt indicates a parsed alarm message object.

Return Value
The return value is a string. If the function is called successfully, the number of entries in the alarm message is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3)

5-106

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

--"""

END

#Create an alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the number of alarms in the alarm message. rptNum = GetAlmRptNum(p) Print('The number of alarm reports is: ' + str(rptNum) )

Result
The number of alarm reports is: 3

Related Example

5.5.8 Function: GetAlmServiceTag


This describes the GetAlmServiceTag function. This function enables you to obtain the service message flag of the specified alarm.

Synopsis
GetAlmServiceTag(pAlmRpt, Index)

Note
None

Parameter Description
Parameter pAlmRpt Index Description pAlmRpt indicates a parsed alarm message object. Index is an integer. It indicates the index of the entries in an alarm message. The index counts from 0. The index starts from 0. The Nth entry of the alarm message refers to the Nth alarm.

Return Value
The return value is a string. If the function is called successfully, the service message flag of the specified alarm is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-107

5 HFC Library Reference


ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

iManager N2000 UMS Element Management System iSStar

Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8

211

Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

#Create an alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the service message flag of alarm 0. Print('The alarm service of the specified alarm is: ' + GetAlmServiceTag(p, 0) )

Result
The alarm service of the specified alarm is: ALARM

Related Example

5.5.9 Function: GetAlmTimeAdjustFlag


This describes the GetAlmTimeAdjustFlag function. This function enables you to obtain the time adjustment flag of an alarm message.

Synopsis
GetAlmTimeAdjustFlag(pAlmRpt)

Note
None

Parameter Description
Parameter pAlmRpt Description pAlmRpt indicates the parsing object of the alarm message.

5-108

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Return Value
The return value is a string. If the function is called successfully, the time adjustment code of the alarm message is returned. Otherwise, a null string is returned.

Error Handling
None. Related Example

5.5.10 Function: GetAlmServiceFlag


This describes the GetAlmServiceFlag function. This function enables you to obtain the service message flag of an alarm message. The service message flag is ALARM.

Synopsis
GetAlmServiceFlag(pAlmRpt)

Note
None

Parameter Description
Parameter pAlmRpt Description pAlmRpt indicates a parsed alarm message object.

Return Value
The return value is a string. If the function is called successfully, the service message flag of the alarm message is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 Major RNC 211 Hardware

ALARM

1802

Signaling

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-109

5 HFC Library Reference


Sync serial No. Alarm name Alarm raised time Location info ALARM = = = =

iManager N2000 UMS Element Management System iSStar


110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

(Number of results = 3) --""" END

p = ParseAlmRpt(strAlarm) #Get the service message flag of the alarm message. fl = GetAlmServiceFlag(p) Print('The alarm service flag is: ' + fl)

Result
The alarm service flag is: ALARM

Related Example

5.5.11 Function: GetAlmRptIdx


This describes the GetAlmRptIdx function. This function enables you to obtain the serial number of an alarm message. A serial number uniquely identifies an alarm message.

Synopsis
GetAlmRptIdx(pAlmRpt)

Note
None

Parameter Description
Parameter pAlmRpt Description pAlmRpt indicates a parsed alarm message object.

Return Value
The return value is a string. If the function is called successfully, the serial number of the alarm message is returned. Otherwise, a null string is returned.

Error Handling
None.
5-110 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

#Get the alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the serial number of the alarm message. fl = GetAlmRptIdx(p) Print('The index of the alarm report is: ' + fl)

Result
The index of the alarm report is: 27232

Related Example

5.5.12 Function: GetAlmMMLCmd


This describes the GetAlmMMLCmd function. This function enables you to obtain the MML command output of an alarm message.

Synopsis
GetAlmMMLCmd(pAlmRpt)

Note
None

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-111

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Description
Parameter pAlmRpt Description pAlmRpt indicates a parsed alarm message object.

Return Value
The return value is a string. If the function is called successfully, the command output is displayed. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

#Get the alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the MML command echo of the alarm message. fl = GetAlmMMLCmd(p) Print('GetAlmMMLCmd(p) return: ' + fl)

Result
GetAlmMMLCmd(p) return: LST ALMAF: CNT=0;

Related Example
5-112 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.5.13 Function: GetAlmResultCode


This describes GetAlmResultCode function. This function enables you to obtain the return codes.

Synopsis
GetAlmResultCode(pAlmRpt)

Note
None

Parameter Description
Parameter pAlmRpt Description pAlmRpt indicates a parsed alarm message object.

Return Value
The return value is a string. If the function is called successfully, the information about the return codes of the alarm message is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3)

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-113

5 HFC Library Reference


--""" END

iManager N2000 UMS Element Management System iSStar

#Get the alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the return code of the alarm message. fl = GetAlmResultCode(p) The return code of an alarm message is: ' + fl

Result
The return code of an alarm message is: 0

Related Example

5.5.14 Function: GetAlmResultCause


This describes the GetAlmResultCause function. This function enables you to obtain the information about the return code of an alarm message.

Synopsis
GetAlmResultCause(pAlmRpt)

Note
None

Parameter Description
Parameter pAlmRpt Description pAlmRpt indicates a parsed alarm message object.

Return Value
The return value is a string. If the function is called successfully, the information about the return codes of the alarm message is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Major Sync serial No. = 110134 RNC 211 Hardware

5-114

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


Alarm name Alarm raised time Location info ALARM = = = WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8

5 HFC Library Reference

68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

#Get the alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the remarks of the return code of the alarm message. fl = GetAlmResultCause(p) Print('The information about the return code of an alarm message is: ' + fl)

Result
The information about the return code of an alarm message is: Execution succeeded.

Related Example

5.5.15 Function: GetAlmTips


This describes the GetAlmTips function. This function enables you to get the tips of an alarm message.

Synopsis
GetAlmTips(pAlmRpt)

Note
None

Parameter Description
Parameter pAlmRpt Description pAlmRpt indicates the parsing object of the alarm message.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-115

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Return Value
The return value is a string. If the function is called successfully, the tips of the alarm message is returned. otherwise, a null string is returned.

Error Handling
None. Related Example

5.5.16 Function: GetAlmFlowNumber


This describes the GetAlmFlowNumber function. This function enables you to obtain the alarm flow number of the specified alarm in an alarm message. Alarm flow numbers are serial numbers sequenced by the alarm generation time.

Synopsis
GetAlmFlowNumber(pAlmRpt,Index)

Note
None

Parameter Description
Parameter pAlmRpt Index Description pAlmRpt indicates a parsed alarm message object. Index is an integer. It indicates the index of the alarms in the alarm message. The index starts from 0.

Return Value
The return value is a string. If the function is called successfully, the alarm flow number is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Major RNC Sync serial No. = 110134 Alarm name = WGRU Board Not in Position 211 Hardware

5-116

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


Alarm raised time Location info ALARM = = 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8

5 HFC Library Reference

68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

p = ParseAlmRpt(strAlarm) # Get the flow number of alarm 0. fl = GetAlmFlowNumber(p, 0) Print('The alarm flow number of the Index alarm in the alarm message is: ' + fl)

Result
The alarm flow number of the Index alarm in the alarm message is: 67984

Related Example

5.5.17 Function: GetAlmType


This describes the GetAlmType function. This function enables you to obtain the alarm category of the specified alarm. Alarm category is defined by alarm nature. Alarms can be categorized into fault alarm and event alarm.

Synopsis
GetAlmType(pAlmRpt, Index)

Note
None

Parameter Description
Parameter pAlmRpt Index Description pAlmRpt indicates a parsed alarm message object. Index is an integer. It indicates the index of the entries in an alarm message. The index counts from 0. The index starts from 0. The Nth entry of the alarm message refers to the Nth alarm.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-117

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Return Value
The return value is a string. If the function is called successfully, the alarm catetory of the specified alarm is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

p = ParseAlmRpt(strAlarm) #Get the alarm type of alarm 0. alarmtype = GetAlmType(p, 0) Print('The alarm type of the specified alarm is: ' + alarmtype)

Result
The alarm type of the specified alarm is: Fault

Related Example

5.5.18 Function: GetAlmLevel


This describes the GetAlmLevel function. This function enables you to obtain the alarm severity of the specified alarm in an alarm message. Alarm severity is used for identifying the impact of the alarm on the service. Four types are available: critical, major, minor, and warning.
5-118 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Synopsis
GetAlmLevel(pAlmRpt,Index)

Note
None

Parameter Description
Parameter pAlmRpt Index Description pAlmRpt indicates a parsed alarm message object. Index is an integer. It indicates the index of the entries in an alarm message. The index counts from 0. The index starts from 0. The Nth entry of the alarm message refers to the Nth alarm.

Return Value
The return value is a string. If the function is called successfully, the alarm severity of the specified alarm is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3)

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-119

5 HFC Library Reference


--""" END

iManager N2000 UMS Element Management System iSStar

p = ParseAlmRpt(strAlarm) # Get the alarm severity of alarm 0. almLevel = GetAlmLevel(p, 0) Print('The severity of the Index alarm is: ' + almLevel)

Result
The severity of the Index alarm is: Major

Related Example

5.5.19 Function: GetAlmNEType


This describes the GetAlmNEType function. This function enables you to obtain the NE type of the specified alarm. NE type is used for identifying the type of the NE that generates an alarm.

Synopsis
GetAlmNEType(pAlmRpt,Index)

Note
None

Parameter Description
Parameter pAlmRpt Index Description pAlmRpt indicates a parsed alarm message object. Index is an integer. It indicates the index of the entries in an alarm message. The index counts from 0. The index starts from 0. The Nth entry of the alarm message refers to the Nth alarm.

Return Value
The return value is a string. If the function is called successfully, the NE type of the specified alarm is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE ALARM #27232 2006-01-04 11:35:56

5-120

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


%%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211

5 HFC Library Reference

Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

p = ParseAlmRpt(strAlarm) # Get the NE type of alarm 0. netype = GetAlmNEType(p, 0) Print('The NE type of the 0th alarm in the alarm message is:' + netype)

Result
The NE type of the 0th alarm in the alarm message is: RNC

Related Example

5.5.20 Function: GetAlmID


This describes the GetAlmID function. This function enables you to obtain the alarm ID of the specified entry in an alarm message.Alarm ID is used for identifying the same type of alarms. For the same product, the alarm ID is unique for one type of alarms.

Synopsis
GetAlmID(pAlmRpt,Index)

Note
None

Parameter Description
Parameter pAlmRpt
Issue 02 (2010-10-10)

Description pAlmRpt indicates a parsed alarm message object.


Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-121

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Index

Description Index is an integer. It indicates the index of the entries in an alarm message. The index counts from 0. The index starts from 0. The Nth entry of the alarm message refers to the Nth alarm.

Return Value
The return value is a string. If the function is called successfully, the alarm ID is returned. Otherwise, an empty string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

p = ParseAlmRpt(strAlarm) # Get the alarm ID of alarm 1. almId = GetAlmID(p,1) Print('The alarm ID of the 1st entry in the alarm message: ' + almId)

Result
The alarm ID of the 1st entry in the alarm message: 1802

5-122

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Related Example

5.5.21 Function: GetAlmSort


This describes the GetAlmSort function. This function enables you to obtain the alarm name of the specified alarm. The following alarm types are available: power system, environment system, signaling system, relay system, hardware system, software system, running system, Qos, handling error, and internal NM system.

Synopsis
GetAlmSort(pAlmRpt,Index)

Note
None

Parameter Description
Parameter pAlmRpt Index Description pAlmRpt indicates a parsed alarm message object. Index is an integer. It indicates the index of the entries in an alarm message. The index counts from 0. The index starts from 0. The Nth entry of the alarm message refers to the Nth alarm.

Return Value
The return value is a string. If the function is called successfully, the alarm catetory of the specified alarm is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

68037 Fault Major RNC Sync serial No. = 110145 Alarm name = SAAL Link Unavailable Alarm raised time = 2005-12-27 15:07:23

1802

Signaling

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-123

5 HFC Library Reference


Location info ALARM =

iManager N2000 UMS Element Management System iSStar


Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

(Number of results = 3) --""" END

p = ParseAlmRpt(strAlarm) sort = GetAlmSort(p, 0)

#Get the alarm type of alarm 0.

Print('The alarm sort of the specified alarm is: ' + sort)

Result
The alarm sort of the specified alarm is: Hardware

Related Example

5.5.22 Function: GetAlmSyncSerialNo


This describes the GetAlmSyncSerialNo function. This function enables you to obtain the alarm synchronization number of the specified alarm. Alarm synchronization number is used for synchronizing the alarm from Manager to Agent. Each alarm has one and only one alarm synchronization number.

Synopsis
GetAlmSyncSerialNo(pAlmRpt,Index)

Note
None

Parameter Description
Parameter pAlmRpt Index Description pAlmRpt indicates a parsed alarm message object. Index is an integer. It indicates the index of the entries in an alarm message. The index counts from 0. The index starts from 0. The Nth entry of the alarm message refers to the Nth alarm.

Return Value
The return value is a string. If the function is called successfully, the alarm synchronization number of the specified alarm is returned. Otherwise, a null string is returned.
5-124 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

p = ParseAlmRpt(strAlarm) serial = GetAlmSyncSerialNo(p, 1)

#Get the alarm synchronization number of alarm 1.

Print("The alarm's sync serial No. of the 1st alarm is: " + serial)

Result
The alarm's sync serial No. of the 1st alarm is: 110145

Related Example

5.5.23 Function: GetAlmName


This describes the GetAlmName function. This function enables you to obtain the alarm name of the specified alarm. An alarm name briefly describes an alarm.

Synopsis
GetAlmName(pAlmRpt,Index)

Note
An alarm name can contain a maximum of 1000 English characters.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-125

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Description
Parameter pAlmRpt Index Description pAlmRpt indicates a parsed alarm message object. Index is an integer. It indicates the index of the entries in an alarm message. The index counts from 0. The index starts from 0. The Nth entry of the alarm message refers to the Nth alarm.

Return Value
The return value is a string. If the function is called successfully, the alarm name of the specified alarm is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

# Get the alarm message parsing object. p = ParseAlmRpt(strAlarm) # Get the alarm name of alarm 2. almName = GetAlmName(p, 2) Print('The alarm name of the 2th alarm is: ' + almName)

5-126

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Result
The alarm name of the 2th alarm is: SAAL Link Unavailable

Related Example

5.5.24 Function: GetAlmRaiseTime


This describes the GetAlmRaiseTime function. This function enables you to obtain the generation time of the specified alarm.

Synopsis
GetAlmRaiseTime(pAlmRpt,Index)

Note
None

Parameter Description
Parameter pAlmRpt Index Description pAlmRpt indicates a parsed alarm message object. Index is an integer. It indicates the index of the entries in an alarm message. The index counts from 0. The index starts from 0. The Nth entry of the alarm message refers to the Nth alarm.

Return Value
The return value is a string. If the function is called successfully, the alarm generation time of the specified alarm is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 RNC 211 Hardware

ALARM

68037 Fault Major Sync serial No. = 110145

1802

Signaling

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-127

5 HFC Library Reference


Alarm name Alarm raised time Location info ALARM = = =

iManager N2000 UMS Element Management System iSStar


SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

(Number of results = 3) --""" END

#Create an alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the generation time of alarm 0. rtime = GetAlmRaiseTime(p, 0) Print('The raising time of the Index alarm is: ' + rtime)

Result
The raising time of the Index alarm is: 2005-12-27 15:06:50

Related Example

5.5.25 Function: GetAlmLocationInfo


This describes the GetAlmLocationInfo function. This function enables you to obtain the alarm location information about the Index alarm in an alarm message. The location information helps identify the object that generates the alarm.

Synopsis
GetAlmLocationInfo(pAlmRpt,Index)

Note
The alarm location information field indicates the physical or service object of the alarm, which includes all the necessary elements that can help locate the alarm object. Users can determine a unique alarm object based on the location information. According to the sequence of human perception, the location information is arranged in a descending order, for example, NE -> rack -> subrack -> board.

Parameter Description
Parameter pAlmRpt Index Description pAlmRpt indicates a parsed alarm message object. Index is an integer. It indicates the index of the entries in an alarm message. The index counts from 0. The index starts from 0. The Nth entry of the alarm message refers to the Nth alarm.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

5-128

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Return Value
The return value is a string. If the function is called successfully, the alarm location information of the specified alarm is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

#Create an alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the alarm location information of alarm 0. locInfo = GetAlmLocationInfo(p, 0) Print('The alarm location information about the Index alarm in the alarm message is :\ ' + locInfo)

Result
The alarm location information about the Index alarm in the alarm message is : Subrack No.= 3, Slot No.=8

Related Example

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-129

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.5.26 Function: GetAlmAttrValueByName


This describes the GetAlmAttrValueByName function. This function enables you to obtain the attribute value of the Index entry in an alarm message.

Synopsis
GetAlmAttrValueByName(pAlmRpt, Index, PropName, Case = 0)

Note
None

Parameter Description
Parameter pAlmRpt Index Description pAlmRpt indicates a parsed alarm message object. Index is an integer. It indicates the index of the entries in an alarm message. The index counts from 0. The index starts from 0. The Nth entry of the alarm message refers to the Nth alarm. PropName is a string. It indicates the attribute name of the entries in the alarm message. Case is an integer. By default, the value of Case is 0. l For English alarm messages, if the value of Case is 0, you can infer that the strings to be compared are case sensitive during comparison. If the value of Case is not 0, you can infer that the strings to be compared are case insensitive. l For Chinese alarm messages, the strings to be compared are not case sensitive.

PropName Case

Return Value
The return value is a string. If the function is called successfully, the value of the specified attribute is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded.

5-130

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

ALARM

67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8

211

Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

#Create an alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the attribute value of the alarm named Sync serial No. in alarm 0. propvalue = GetAlmAttrValueByName(p, 0, "Sync serial No.") Print("The attribute value(Sync serial No.) of the Index entry in the alarm message is:\ " + propvalue)

Result
The attribute value(Sync serial No.) of the Index entry in the alarm message is: 110134

Related Example

5.5.27 Function: GetAlmAttrValueByIdx


This describes the GetAlmAttrValueByIdx function. This function enables you to obtain the value of specified attribute of the specified alarm in an alarm message.

Synopsis
GetAlmAttrValueByIdx(pAlmRpt,Index,PropIndex)

Note
None

Parameter Description
Parameter pAlmRpt
Issue 02 (2010-10-10)

Description pAlmRpt indicates a parsed alarm message object.


Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-131

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Index PropIndex

Description Index is an integer. It indicates the index of the alarms in the alarm message. The index starts from 0. PropIndex is an integer. It indicates the index of the entry attributes in the alarm report. The index starts from 0.

Return Value
The return value is a string. If the function is called successfully, the value of the specified attribute is returned. Otherwise, a null string is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

#Create an alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the attribute value of attrtibute 2 in alarm 1. propvalue = GetAlmAttrValueByIdx(p, 0, 2) Print('The 2nd value of attribute Index of the specified alarm in the alarm message is:\ ' + propvalue)

5-132

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Result
The 2nd value of attribute Index of the specified alarm in the alarm message is: 2005-12-27 15:06:50

Related Example

5.5.28 Function: GetAlmNumByLevel


This describes the GetAlmNumByLevel function. This function enables you to obtain the number of alarms of the specified severity.

Synopsis
GetAlmNumByLevel(pAlmRpt, Level, Case = 0)

Note
None

Parameter Description
Parameter pAlmRpt Level Case Description pAlmRpt indicates a parsed alarm message object. Level is a string. It indicates the alarm severity. Case is an integer. By default, the value of Case is 0. l For English alarm messages, if the value of Case is 0, you can infer that the strings to be compared are case sensitive during comparison. If the value of Case is not 0, you can infer that the strings to be compared are case insensitive. l For Chinese alarm messages, the strings to be compared are not case sensitive.

Return Value
The return value is a string. If the function is called successfully, the number of alarms of the specified severity is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-133

5 HFC Library Reference


ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

iManager N2000 UMS Element Management System iSStar


Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

#Get the alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the number of "major" alarms. num = GetAlmNumByLevel(p, "Major") Print('The number of alarms of the specified severity(major) is: ' + str(num) )

Result
The number of alarms of the specified severity(major) is: 3

Related Example

5.5.29 Function: GetAlmNumByTimeDur


This describes the GetAlmNumByTimeDur function. This function enables you to obtain the number of alarms in a specified period.

Synopsis
GetAlmNumByTimeDur(pAlmRpt,Start,Stop)

Note
GetAlmNumByTimeDur(pAlmRpt,Sart,Stop) enables you to obtain the number of alarms in specified period. The stop time must be later than the start time.

Parameter Description
Parameter pAlmRpt Start Description pAlmRpt indicates a parsed alarm message object. Start is a string. It indicates the start time. The valid range is from 2000-01-01 00:00:00 to 2037-12-31 23:59:59.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

5-134

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Stop

Description Stop is a string. It indicates the end time. The valid range is from 2000-01-01 00:00:00 to 2037-12-31 23:59:59.

Return Value
The return value is a string. If the function is called successfully, the number of alarms in the specified period is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 3) --""" END

#Get the alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the number of alarms generated between 2005-12-27 15:06:50 and 2005-12-27 15:06:59. num = GetAlmNumByTimeDur(p, "2005-12-27 15:06:50", "2005-12-27 15:06:59") Print('The number of alarms in a specified period is: ' + str(num) )

Result
The number of alarms in a specified period is: 1

Related Example
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-135

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.5.30 Function: GetAlmRptUTCTimeOffSet


This describes the GetAlmRptUTCTimeOffSet function. This function enables you to obtain the offset between the UTC time and the time when the alarm is generated.

Synopsis
GetAlmRptUTCTimeOffSet(pAlmRpt)

Note
None.

Parameter Description
Parameter pAlmRpt Description pAlmRpt is the return value of 5.5.3 Function: ParseAlmRpt.

Return Value
The return value is a string. If the function is called successfully, the return value is the offset between the UTC time and the time when the alarm is generated. Otherwise, null string is returned.

Error Handling
None.

Example
""" ConnectNE('MSC29') #Sending MML command sendmml = SendMML("LST ALMAF:;") mml = GetMMLReport(0) Print(mml) """ mml = """ LST ALMAF:; +++ MSC29 2009-09-11 03:09:35-05:59 DST O&M #186443 %%/*39220*/LST ALMAF:;%% RETCODE = 0 Operation succeeded ALARM 3 Fault Warning Exchange 4366 Running Sync serial No. = 3 Alarm name = First Level Warning on Insufficient BAM Logical Driver Space Alarm raised time = 2009-07-15 17:11:23+08:00 Location info = ServerName=CN2_MSX3000,Disk Drive=C, UpperThreshold=75%, LowerThreshold=70%, DiskUsage=88%, TotalSpace=12001M, FreeSpace=1444M Module No. = 0(BAM)

5-136

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


ALARM 5 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Module No. = 34 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Module No. =

5 HFC Library Reference

Major Exchange 833 Communication 5 Disconnect with Emergency Resuming Workstation 2009-07-15 17:15:29+08:00 None 0(BAM) Critical Exchange 2071 Communication 37 TCP Link Fault 2009-07-15 17:53:22+08:00 Shelf No.=0, Frame No.=0, Slot No.=6, Module No.=2, Link Type=TCP TO iGWB Mobile Service IP 172.20.200.1 2

ALARM

(Number of results = 3) --END """ p = ParseAlmRpt(mml)

# Parse the MML message.

utcTime = GetAlmRptUTCTimeOffSet(p) Print('GetAlmRptUTCTimeOffSet() return: %s'%utcTime)

Result
GetAlmRptUTCTimeOffSet() return: -05:59

5.5.31 Examples of Alarm Message Parsing Function


This gives examples of the alarm message parsing function. You can better understand how to use NE operation functions to perform routine maintenance.

Example 1 of MML Message Parsing Function


def showAlmInfoByIndex(strAlarm, index) if index < 0 Print("The index is invalid") return end almParser = ParseAlmRpt(strAlarm) if GetAlmRptNum(almParser) <= 0 Print("No alarm exists") else flowNumber = GetAlmFlowNumber(almParser, index) Print('The flownumber of alarm No '+str(index)+': ' + flowNumber) alarmtype = GetAlmType(almParser, index) Print('The alarm type of alarm No '+str(index)+': ' + alarmtype) almLevel = GetAlmLevel(almParser, index) Print('The alarm level of alarm No '+str(index)+': ' + almLevel) netype = GetAlmNEType(almParser, index) Print('The type of the NE of alarm No '+str(index)+': ' + netype) end end strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-137

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

ALARM

68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. Major RNC 1802 Signaling 110154 SAAL Link Unavailable 2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

ALARM

(Number of results = 4) --END """ showAlmInfoByIndex(strAlarm, 0)

Result
The The The The flownumber of alarm No 0: 67984 alarm type of alarm No 0: Fault alarm level of alarm No 0: Major type of the NE of alarm No 0: RNC

Example 2 of MML Message Parsing Function


def getAlmTypeByTime(strAlarm, time) almParser = ParseAlmRpt(strAlarm) numAlm = GetAlmRptNum(almParser) if(numAlm < 0) return "No alarm exists" else for item in range(numAlm) if(time == GetAlmRaiseTime(almParser, item)) return GetAlmLevel(almParser, item) end end end return "No alarm exists" end strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM 67984 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8 211 Hardware

ALARM

Major RNC 1802 Signaling 110145 SAAL Link Unavailable 2005-12-27 15:07:23 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=2, Cause=Unknown Cause. 1802 Signaling

ALARM

68046 Fault Major RNC Sync serial No. = 110154 Alarm name = SAAL Link Unavailable

5-138

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


Alarm raised time Location info = =

5 HFC Library Reference

2005-12-27 15:07:27 Subrack No.=3, Slot No.=10, Subsystem No.=0, SAAL link No.=0, Cause=Unknown Cause.

(Number of results = 3) --""" END

ret = getAlmTypeByTime(strAlarm, "2005-12-27 15:07:27") Print("An %s alarm happended at 2005-12-27 15:07:27 ."%ret)

Result
An Major alarm happended at 2005-12-27 15:07:27 .

5.6 Database Operation Function


The database operation module provides the query operation interface for alarms, performances, and the configuration library. 5.6.1 Overview of Database Operation Functions This describes the basic functions and procedures of database operation functions. 5.6.2 Function: OpenDB This describes how to set up connections between existing tasks and the data center database. 5.6.3 Function: CreateCond This describes the CreateCond(ENUM) function, which enables you to create objects of query conditions, which facilitates the setting of items in the query conditions. 5.6.4 Function: QueryFmRcds This describes the QueryFmRcds function, which enables you to query the alarms that meet the specified conditions. The results are sorted in the specified mode by the specified field. 5.6.5 Function: NextFmRcds This describes the QueryFmRcds function. This function enables you to obtain the alarm data queried by the QueryFmRcds function. 5.6.6 Function: QueryPmRcds This describes the QueryPmRcds function, which enables you to query performance data records. 5.6.7 Function: NextPmRcds This describes the NextPmRcds() function, which enables you to obtain the queried performance data through QueryFmRcds(). 5.6.8 Function: QueryCmRcds This describes the QueryCmRcds function, which enables you to get the queried configuration data records. 5.6.9 Function: NextCmRcds This describes the NextCmRcds() function, which enables you to obtain the configuration data queried through QueryCmRcds(). 5.6.10 Function: GetCmCom This describes the GetCmCom(Fdn,objSeq) function, which enables you to obtain the configuration data of the specified object.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-139

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.6.11 Function: GetChildMoc This describes the GetChildMoc function, which enables you to obtain the child MOC and the attribute list. 5.6.12 Function: GetIntegrityReportCond This describes the GetIntegrityReportCond function. This function enables you to obtain integrity query conditions. 5.6.13 Function: GetFunctionSubSetList This describes the GetFunctionSubSetList function. This function enables you to obtain the list of function subsets, including their IDs and names. 5.6.14 Function: QueryIntegrityResult This describes the QueryIntegrityResult function. This function enables you to query an integrity result based on the integrity query conditions. 5.6.15 Function: GetOneNEInteLst This describes the GetOneNEInteLst function. This function enables you to obtain the integrity result of a specified NE from the integrity query results. 5.6.16 Function: GetOneFssInte This describes the GetOneFssInte function. This function enables you to obtain the integrity report of a specified function subset from an NE integrity report. 5.6.17 Function: GetOneIntegrity This describes the GetOneIntegrity function. This function enables you to obtain the integrity result of a specified NE or a function subset from an integrity report. 5.6.18 Function: GetPmCond The GetPmCond function is used to create performance query conditions that contain only default values. After creating performance query conditions, you can set data items for specific query conditions based on the actual requirement. 5.6.19 Function: GetFmCond The GetFmCond function is used to create an alarm query condition that contains only default values. After creating an alarm query condition, you can set data items for a specific query condition based on the actual requirement. 5.6.20 Function: QueryRecord The QueryRecord function is used to query the performance data or alarm data that meets the query conditions. 5.6.21 Function: RecordCount The RecordCount function is used to obtain the records returned by the QueryRecord function. 5.6.22 Function: NextRecord The NextRecord function is used to obtain the records obtained by the QueryRecord function. 5.6.23 Function: GetMocAttrNameList The GetMocAttrNameList function is used to query MOC attribute names based on MOC names and NE FDNs. 5.6.24 Function: GetMocList The GetMocList function is used to query the MOC name of an NE based on the FDN of the NE. 5.6.25 Function: GetNeObjInfo The GetNeObjInfo function is used to obtain the information about the NE performance measurement objects of a certain type based on the function set ID and FDN of an NE.
5-140 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.6.26 Function: GetCounterInfo The GetCounterInfo function is used to obtain the information about performance counters based on the function subset IDs and measurement periods of NEs. 5.6.27 Function: GetFuncSetList The GetFuncSetList function is used to obtain the information about NE function sets based on NE types. 5.6.28 Function: GetFuncSubSetList The GetFuncSubSetList function is used to obtain the information about NE function subsets based on the IDs of NE function sets. 5.6.29 Function: GetMoiAttrValueList The GetMoiAttrValueList function is used to obtain MOI attribute values based on the MOI information and the list of attribute names. 5.6.30 Function: GetMoiListByFilter The GetMoiListByFilter function is used to query the MOIs of an MOC based on the MOC name, NE FDN, and filtering conditions. 5.6.31 Function: GetPmNeType The GetPmNeType function is used to obtain the information about NE types, including the names and IDs of NE types. 5.6.32 Function: GetNeInfo The GetNeInfo function is used to obtain the NE information based on the NE FDN, such as the NE name and type ID. 5.6.33 Function: CloseDB This describes the CloseDB function, which enables you to close the connection with the database center.

5.6.1 Overview of Database Operation Functions


This describes the basic functions and procedures of database operation functions.

Basic Functions
By using the database operation functions, you can easily establish the connection with the database of the N2000 UMS data center. In this way, you can quickly obtain the alarm data, performance data, and configuration data. Table 5-8 lists the database operation functions. Table 5-8 Database operation function list Function 5.6.2 Function: OpenDB 5.6.3 Function: CreateCond 5.6.4 Function: QueryFmRcds 5.6.5 Function: NextFmRcds
Issue 02 (2010-10-10)

Description Establishes a connection with the N2000 UMS data center. Create objects of query condition. Returns the alarms that meet the conditions. Returns the queried alarm data.
5-141

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Function 5.6.6 Function: QueryPmRcds 5.6.7 Function: NextPmRcds 5.6.8 Function: QueryCmRcds 5.6.9 Function: NextCmRcds 5.6.10 Function: GetCmCom 5.6.11 Function: GetChildMoc 5.6.33 Function: CloseDB 5.6.12 Function: GetIntegrityReportCond 5.6.13 Function: GetFunctionSubSetList 5.6.14 Function: QueryIntegrityResult 5.6.15 Function: GetOneNEInteLst 5.6.16 Function: GetOneFssInte 5.6.17 Function: GetOneIntegrity 5.6.18 Function: GetPmCond 5.6.19 Function: GetFmCond 5.6.20 Function: QueryRecord 5.6.21 Function: RecordCount 5.6.22 Function: NextRecord 5.6.23 Function: GetMocAttrNameList

Description Returns the performance data that meets the conditions. Returns the queried performance data. Returns the configuration data that meets the conditions. Returns the queried configuration data. Returns the MO data that meets the conditions in the configuration database. Returns child MOC data of the specified NEs in the configuration database. Closes the connection with the N2000 UMS data center. Obtains integrity query conditions. Obtains the list of function subsets, including their IDs and names. Queries an integrity result based on the integrity query conditions. Obtains the integrity result of a specified NE from the integrity query results. Obtains the integrity report of a specified function subset from an NE integrity report. Obtains the integrity result of a specified NE or a function subset from an integrity report. Create performance query conditions that contain only default values. Create an alarm query condition that contains only default values. Query the performance data or alarm data that meets the query conditions. Obtain the records returned by the QueryRecord function. Obtain the records obtained by the QueryRecord function. Query MOC attribute names based on MOC names and NE FDNs.

5-142

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Function 5.6.24 Function: GetMocList

Description Query the MOC name of an NE based on the FDN of the NE. Obtain the information about the NE performance measurement objects of a certain type based on the function set ID and FDN of an NE. Obtain the information about performance counters based on the function subset IDs and measurement periods of NEs. Obtain the information about NE function sets based on NE types. Obtain the information about NE function subsets based on the IDs of NE function sets. Obtain MOI attribute values based on the MOI information and the list of attribute names. Query the MOIs of an MOC based on the MOC name, NE FDN, and filtering conditions. Obtain the information about NE types, including the names and IDs of NE types. Oobtain the NE information based on the NE FDN, such as the NE name and type ID.

5.6.25 Function: GetNeObjInfo

5.6.26 Function: GetCounterInfo

5.6.27 Function: GetFuncSetList 5.6.28 Function: GetFuncSubSetList 5.6.29 Function: GetMoiAttrValueList 5.6.30 Function: GetMoiListByFilter 5.6.31 Function: GetPmNeType 5.6.32 Function: GetNeInfo

Procedure
Figure 5-8 shows how to use the database operation functions.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-143

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Figure 5-8 Procedure for using database operation functions

The procedure shown in Figure 5-8 is as follows: 1. Establish the connection with the database. Use 5.6.2 Function: OpenDB to establish the connection with the database in the data center. 2. 3. Create database query conditions. Use 5.6.3 Function: CreateCond to create objects of query conditions. Perform database queries. Based on the actual requirements, use the database operation functions such as 5.6.4 Function: QueryFmRcds, 5.6.6 Function: QueryPmRcds, or 5.6.8 Function: QueryCmRcds to query alarms, performance, or configuration data and then obtain the execution result. 4. 5. Process the returned results. You can process the returned results, such as make statistical analysis and generate reports. Close the connection with the database. After all the database operations are complete, use 5.6.33 Function: CloseDB to close the connection with the database in the data center.

5.6.2 Function: OpenDB


This describes how to set up connections between existing tasks and the data center database.

Synopsis
OpenDB(UserName, Password)
5-144 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Note
None

Parameter Description
Parameter UserName Password Description UserName is a string. It is an optional argument indicating the name of the user. Password is a string. It is an optional argument indicating the user password.

NOTE

l l l

If the user name and password are not entered, the database is accessed through the current client login user and password. If the user name and password are entered, the database is accessed through the entered user name and password. To invoke the OpenDB interface, you must enter both the user name and password, or enter neither of them.

Return Value
The return value is an integer. If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
#Connect the database. returncode = OpenDB("admin", "11111111") Print('OpenDB() return: ' + str(returncode)) #Close the database connection. CloseDB()

Result
OpenDB() return: 1

5.6.3 Function: CreateCond


This describes the CreateCond(ENUM) function, which enables you to create objects of query conditions, which facilitates the setting of items in the query conditions.

Synopsis
CreateCond(ENUM)
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-145

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Note
None

Parameter Description
Name ENUM Description The ENUM type is enumeration. It is the basis for creating objects of condition objects. ENUM = { FM_COND, PM_COND, CM_COND }. #alarm query condition ID #performance query condition ID #configuration query condition ID

Return Value
If this function is called successfully, the objects of query conditions are returned. Otherwise, None is returned.

Error Handling
None

Example
#Connect the database. OpenDB("admin", "11111111") #Create an object of alarm query condition. fmcond = CreateCond(FM_COND) #Set the time segment for alarm query. fmcond[START_TIME] = (2006, 12, 29, 18, 24, 39) fmcond[END_TIME] = (2006, 12, 30, 10, 20, 40) #Query the alarms that meet the condition and output the number of alarm records. returncode = QueryFmRcds(fmcond) Print('QueryFmRcds() return: ' + str(returncode)) #Get the alarm records queried by the QueryFmRcds function. FmRecords = NextFmRcds() #Close the database connection. CloseDB()

5.6.4 Function: QueryFmRcds


This describes the QueryFmRcds function, which enables you to query the alarms that meet the specified conditions. The results are sorted in the specified mode by the specified field.

5-146

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Synopsis
QueryFmRcds(Fmcond)

Note
l QueryFmRcds(Fmcond) enables you to query the alarms that meet the specified conditions. The results are sorted in the specified mode by the specified field. You can get the queried results by calling the function NextFmRcds. Call the function OpenDB to connect to the database before calling this function.

Parameter Description
Parameter Fmcond Description Fmcond is the query condition object. It is the return value of calling CreateCond(FM_COND). Items of Fmcond are enumeration values. The items are: {RESULT_SORT, ALARM_CATE, TIME_MODE, START_TIME, END_TIME, ALARMINFO_SEQ, NEFDN_SEQ, ALARMCAUSE_SEQ, ALARMLEVEL_SEQ, ALARMSTATUS_SEQ, LINKFDN_SEQ, IDENTIF_SEQ}. For details of meanings for the items, refer to Table 5-9.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-147

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Table 5-9 Description of items in Fmcond Enumerated Type Detailed Information Sorts the results. You can set the item by using Fmcond[RESULT_SORT]. Fmcond [RESULT_SORT] is a tuple containing the element (OrderItem, OrderType). The default value is (0, 1). OrderItem: is an integer. It indicates the field by which the results are sorted. The values and meanings are as follows: l 0: not sort l 1: sort by serial number l 2: sort by NEFDN l 3: sort by alarm time RESULT_SORT l 4: sort by alarm severity l 5: sort by alarm causes l 6: sort by acknowledge status l 9: sort by NEType l 10: sort by FDN l 16: sort by device flow number l 17: sort by alarm ID l 18: sort by clearance time Ordertype: is an integer. It indicates the field by which the results are sorted. The values and meanings are as follows: l 1: ascending order l 2: descending order Alarm type. You can set the item by using Fmcond[ALARM_CATE]. Fmcond [ALARM_CATE] is an integer with the default value as 1. The values and meanings are as follows: l 1: current fault alarm l 2: event alarm l 3: history fault alarm

ALARM_CATE

5-148

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Enumerated Type

Detailed Information Time mode. You can set the item by using Fmcond[TIME_MODE]. Fmcond [TIME_MODE] is an integer. The values and meanings are as follows:

TIME_MODE

l 0: server time mode l 1: NE time mode


NOTE If you do not set Fmcond[TIME_MODE], the default value is 1.

START_TIME

Start time. You can set the item by using Fmcond[START_TIME]. Fmcond [START_TIME] is a tuple indicating the start time of the alarm query. The time composes year, month, day, hour, minute, and second. The default value indicates querying all alarms generated before Fmcond [END_TIME].
NOTE If neither the start time nor the end time is set, all the alarm data is queried.

END_TIME

End time. You can set the item by using Fmcond[END_TIME]. Fmcond [END_TIME] is a tuple indicating the end time of the alarm query. The time composes year, month, day, hour, minute, and second. The default value indicates querying all alarms generated after Fmcond [START_TIME].
NOTE If neither the start time nor the end time is set, all the alarm data is queried.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-149

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Enumerated Type

Detailed Information Sequence of alarm records. You can set the item by using Fmcond [ALARMINFO_SEQ]. Fmcond [ALARMINFO_SEQ] indicates the information of queried alarms. The value is a list containing unlimited elements (null is allowed). Alms = [listalm, listalm1,..]. The elements in the list are tuples with each containing three elements, that is, listalm = (ProductId, NeTypeId, AlarmId). ProductId: integer type. It indicates the type of the product that generates the alarm. The values and meanings are: l 1: transmission l 2: mobile l 3: fixed network narrowband l 4: fixed network wideband l 5: intelligent

ALARMINFO_SEQ

l 6: network management NTTypeID: is an integer. It indicates the NE type of the alarm. The values and meanings are as follows: l 100000: OMC l 1: RNC l 2: NodeB l 3: SGSN l 4: GGSN l 5: CG l 6: SoftX l 7: MGW l 8: HLR AlarmId: is an integer. If alarm ID, ProductID, and NEType are specific, an alarm can be uniquely identified. The value of AlarmId can be any integer including negative integers, except -1. Sequence of NE Fdns. You can set the item by using Fmcond[FDN_SEQ]. The value is a list containing unlimited elements, that is, [Fdn, Fdn1,...]. Set the length of the sequence to 0 unless otherwise specified. Fdn is a string. It is the FDN of an NE and uniquely identifies an NE.

NEFDN_SEQ

5-150

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Enumerated Type

Detailed Information Sequence of alarm causes. You can set the item by using Fmcond [ALARMCAUSE_SEQ]. The value is a list containing unlimited elements indicating the causes to generate alarms. Set the length of the sequence to 0 unless otherwise specified. The values and meanings are as follows: l 1: power system l 2: environment system

ALARMCAUSE_SEQ

l 3: signaling system l 4: relay system l 5: hardware system l 6: software system l 7: running system l 8: communications system l 9: QoS l 10: handling error l 11: internal NM system Sequence of alarm severities. You can set the item by using Fmcond [ALARMLEVEL_SEQ]. The value is a list containing unlimited elements indicating alarm severity. Set the length of the sequence to 0 unless otherwise specified. The values and meanings are as follows: l 1: critical l 2: major l 3: minor l 4: warning

ALARMLEVEL_SEQ

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-151

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Enumerated Type

Detailed Information Sequence of alarm status. You can set the item by using Fmcond [ALARMSTATUS_SEQ]. The value is a list containing unlimited elements indicating alarm status. Set the length of the sequence to 0 unless otherwise specified. For fault alarms, the values and meanings are as follows:

ALARMSTATUS_SEQ

l 1: unacknowledged and uncleared l 2: unacknowledged and cleared l 3: acknowledged and uncleared l 4: acknowledged and cleared For event alarms, the values and meanings are as follows: l 5: acknowledged l 6: unacknowledged Sequence of link FDNs. You can set the item by using Fmcond[LINKFDN_SEQ]. The value is a list containing string type elements indicating link FDN. FDN uniquely identifies a link. The list contains unlimited elements. Set the length of the sequence to 0 unless otherwise specified. Sequence of alarm identity. You can set this item by using Fmcond[IDENTIF_SEQ]. The value is a list containing elements indicating alarm identities. For fault alarms, the values and meanings are as follows: l 0: note

LINKFDN_SEQ

IDENTIF_SEQ

l 1: intermittent fault l 2: high frequency intermittent fault For event alarms, the values and meanings are as follows: l 0: note l 3: repetitive event l 4: high frequency repetitive event

Return Value
The return value is an integer. If the function is called successfully, the number of records that meet the querying conditions is returned. Otherwise, 0 is returned.

5-152

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Error Handling
None. Related Example

5.6.5 Function: NextFmRcds


This describes the QueryFmRcds function. This function enables you to obtain the alarm data queried by the QueryFmRcds function.

Synopsis
NextFmRcds()

Note
l The NextFmRcds function enables you to obtain the alarm data that is queried by 5.6.4 Function: QueryFmRcds. Each time 200 alarm data records are returned. If the number of the returned records exceeds 200, you need to use the NextFmRcds function for multiple times to return all the alarm data. If the number does not reach 200, all the alarm data is returned at a time. Call 5.6.2 Function: OpenDB to connect to the database before calling this function.

Parameter Description
None.

Return Value
The return value is a set of custom objects. Each set contains a maximum of 2,000 data records at a time. You can traverse each data through interaction. An example of the code is as follows:
FmRecords = NextFmRcds() while FmRecords for fm in FmRecords ...... end FmRecords = NextFmRcds() end

Each record is a custom object and has its own attributes. Table 5-10 describes the attributes. You can access the object attributes in the format of ".attribute name" in the script. For example, in the previous code, you can access the Category attribute of fm in the format of fm.Category. Table 5-10 Attributes of alarm data records Attribute Category Description Refers to an alarm category. The parameter value is an integer. The specific values and meanings are as follows: l 1: Current Fault Alarms l 2: Event Alarms l 3: History Fault Alarms
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-153

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Attribute DevFdn

Description Refers to the FDN of a device, which is the only identifier of the device that generates alarms. The parameter value is a string. Refers to NE information, which is a custom data type and contains the following three fields: ProductID, NEType, and NEFdn. Refers to the serial number (SN) of a device. The parameter value is an integer. Refers to the ID of an alarm. The parameter value if an integer. Refers to the type of a cause that generates alarms. The parameter value is an integer. The specific values and meanings are as follows: l 1: Power system l 2: Environment system l 3: Signaling system l 4: Relay system l 5: Hardware system l 6: Software system l 7: Running system l 8: Communications system l 9: QoS l 10: Handling error l 11: Internal NM system

NE

DevCsn Id Type

Level

Refers to an alarm severity. The parameter value is an integer. The specific values and meanings are as follows: l 1: Critical l 2: Major l 3: Minor l 4: Warning

Restore

Refers to the cleared state of an alarm, which identifies whether an alarm is cleared. The parameter value is an integer. The specific values and meanings are as follows: l 0: Uncleared l 1: Cleared

5-154

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Attribute Confirm

Description Refers to the acknowledgement state of an alarm, which identifies whether an alarm is acknowledged. The parameter value is an integer. The specific values and meanings are as follows: l 0: Unacknowledged l 1: Acknowledged

Operator

Refers to the user name of the operator who acknowledges the alarm. The parameter value is a string. Refers to the sequence of an alarm parameter. The parameter value is a list whose length is 10. This parameter represents the additional information to alarm data. Refers to the additional information about an alarm. The parameter value is a string. Refers to the ID of a link object. The parameter is a string. Refers to the link type of an alarm. The parameter value is an integer. The specific values and meanings are as follows: l -1: indicates that the alarm is a link alarm. l An integer that is greater than 0: indicates that the alarm is a link alarm.

Paras

ExtendInfo LinkObjId LinkType

ReasonId ClearOperator

Currently, ReasonId is not used and conveys no meaning. Refers to the user name of the operator who clears an alarm. The parameter value is a string. Refers to the SN of a network. The parameter value is an integer.

Csn

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-155

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Attribute dtRaise

Description Refers to the generation time of an alarm. This is a custom object. The elements and meanings are as follows: l dt: Time. l timezoneOffset: refers to the offset of a time zone. l dstTimeOffset: refers to the time offset of daylight saving time. The element dt is also an object type and its elements and their meanings are as follows: l year l month l day l hour l minute l second

dtAck

Refers to the acknowledgement time of an alarm. This is a custom object. The elements and meanings are as follows: l dt: Time. l timezoneOffset: refers to the offset of a time zone. l dstTimeOffset: refers to the time offset of daylight saving time. The element dt is also an object type and its elements and their meanings are as follows: l year l month l day l hour l minute l second

5-156

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Attribute dtClear

Description Refers to the clearance time of an alarm. This is a custom object. The elements and meanings are as follows: l dt: Time. l timezoneOffset: refers to the offset of a time zone. l dstTimeOffset: refers to the time offset of daylight saving time. The element dt is also an object type and its elements and their meanings are as follows: l year l month l day l hour l minute l second

Error Handling
None.

Example
################################################# # # parse one record of the alarm data# # Input: record # # ################################################# def detail(record) Print('Category:' + str(record.Category)) Print('DevFdn: ' + str(record.DevFdn)) Print('NE: (' + str(record.NE.ProctID) + ', ' + str(record.NE.NEType) + ', ' \ + str(record.NE.objectid) + ')') Print('DevCsn: ' + str(record.DevCsn)) Print('CSN: ' + str(record.Csn)) Print('Id: ' + str(record.Id)) Print('Type: ' + str(record.Type)) Print('Level: ' + str(record.Level)) Print('Restore: ' + str(record.Restore)) Print('Confirm: ' + str(record.Confirm)) Print('Operator: ' + str(record.Operator)) i = [] for p in record.Paras i.append(p) end Print('Paras: ' + str(i)) Print('ExtendInfo: ' + str(record.ExtendInfo)) Print('LinkObjId: ' + str(record.LinkObjId)) Print('LinkType: ' + str(record.LinkType)) Print('ReasonId: ' + str(record.ReasonId)) Print('ClearOperator: ' + str(record.ClearOperator)) Print('Raise Time: (' + str(record.dtRaise.dt.year) + ', ' \

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-157

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

+ str(record.dtRaise.dt.month) + ', ' + str(record.dtRaise.dt.day) + ',' \ + str(record.dtRaise.dt.hour) + ', ' + str(record.dtRaise.dt.minute) + ',' \ + str(record.dtRaise.dt.second) + '; ' + str(record.dtRaise.timezoneOffset) + ',' \ + str(record.dtRaise.dstTimeOffset) + ')') Print('Acknowledge Time: (' + str(record.dtAck.dt.year)+', ' \ + str(record.dtAck.dt.month) + ', ' + str(record.dtAck.dt.day) + ',' \ + str(record.dtAck.dt.hour) + ', ' + str(record.dtAck.dt.minute) + ',' \ + str(record.dtAck.dt.second) + '; ' + str(record.dtAck.timezoneOffset) + ',' \ + str(record.dtAck.dstTimeOffset) + ')') Print('Clear Time: (' + str(record.dtClear.dt.year)+', ' \ + str(record.dtClear.dt.month) + ', ' + str(record.dtClear.dt.day) + ',' \ + str(record.dtClear.dt.hour) + ', ' + str(record.dtClear.dt.minute) + ',' \ + str(record.dtClear.dt.second) + '; ' + str(record.dtClear.timezoneOffset) + ',' \ + str(record.dtClear.dstTimeOffset) + ')') end #Connect the database. OpenDB() #Create an object of alarm query condition. fmcond = CreateCond(FM_COND) #Set the sorting type of the queried alarms. fmcond[RESULT_SORT] = (3, 2) #Set the time mode for alarm query. fmcond[TIME_MODE] = 0 #Set the time segment for alarm query. fmcond[START_TIME] = (2008, 11, 17, 15, 00, 00) fmcond[END_TIME] = (2008, 11, 17, 16, 00, 00) #Set alarm types, which include current fault alarms, events, and #history fault alarms. fmcond[ALARM_CATE] = 1 # Set alarm conditions such as product types, NE types, and alarm IDs. fmcond[ALARMINFO_SEQ] = [(2,7,1815)] fdn=GetNEFDN('msc_yang') Print(fdn) #Set the FDN of the NE fmcond[NEFDN_SEQ] = list(fdn) #Set alarm severities, which can be critical, major, minor, warning, and uncertain. fmcond[ALARMLEVEL_SEQ] = [2] #Query the alarms that meet the condition and output the number of alarm records. returncode = QueryFmRcds(fmcond) Print('QueryFmRcds() return: ' + str(returncode)) #Get the alarm records queried by the QueryFmRcds function. FmRecords = NextFmRcds() while FmRecords for fm in FmRecords detail(fm) end FmRecords = NextFmRcds() end #Close the database connection. CloseDB()

Result
Acknowledge Time: (0, 0, 0,0, 0,0; 0,0) Clear Time: (2008, 12, 10,12, 9,29; 480,0) Category:1 DevFdn: .OMCNE.0.10 NE: (6, 100000, .OMCNE.0)

5-158

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

DevCsn: 1200 CSN: 7158 Id: 301 Type: 11 Level: 1 Restore: 1 Confirm: 0 Operator: Paras: [0, 0, 0, 0, 0, 0, 0, 0, 0, 1] ExtendInfo: neName = bsc6000, neIP = 10.121.45.78, neErrPort = 6000, neErrCode = N/ A, neErrMsg = closed by peer LinkObjId: LinkType: -1 ReasonId: 0 ClearOperator: < NE operator > Raise Time: (2008, 12, 10,12, 5,30; 480,0) ...

5.6.6 Function: QueryPmRcds


This describes the QueryPmRcds function, which enables you to query performance data records.

Synopsis
QueryPmRcds(Pmcond)

Note
l l QueryPmRcds(Pmcond) enables you to query performance data records. You can get the performance results by calling the function NextPmRcds. Call the functionOpenDB to connect to the database before calling this function.

Parameter Description
Parameter Pmcond Description Pmcond is the query condition object. It is the return value of calling CreateCond(PM_COND). Item of pmcond are enumeration values. The items are: {NE_TYPEID, FUNCTION_SUBSET, TIME_MODE, TIME_DEFAULT, PERIOD, START_TIME, END_TIME, COUNTERID_SEQ, OBJINDEX_SEQ, NEFDN_SEQ, RESULT_SORT}. For details, refer to Table 5-11.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-159

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Table 5-11 Description of items of Pmcond Enumerated Type Detailed Information ID of NE type. You must set it before querying the performance data. You can set it through pmcond[NE_TYPEID]. It indicates the NE type of the alarm. The values and meanings are: l 0: COMMON l 1: N2000 UMS l 2: LMT NE_TYPEID l 3: NodeB l 4: RNC l 5: MSCServer l 6: MGW l 7: SGSN l 8: GGSN80 l 9: HLR l 10: CG l 17: SGSN_MML Function subset. You must set it before querying the performance data. You can set it through pmcond[FUNCTION_SUBSET]. It indicates the ID of function subset which is the last part of the FDN field, that is, the part behind the last ".". Time mode. It indicates the adopted time mode. You can set this item by using pmcond [TIME_MODE]. The values and meanings are: l 0: server time mode l 1: NE time mode The default value is 0.

FUNCTION_SUBSET

TIME_MODE

5-160

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Enumerated Type

Detailed Information Default time. You can set it through pmcond [TIME_DEFAULT]. It is used to defined the time range for querying performance data. The values and meanings are as follows: l 0: TODAY l 1: YESTERDAY l 2: THISWEEK l 3: LASTWEEK l 4: SPEC l 5: ALL The default value is 5, indicating querying all performance data generated at all times. Only when timedefault=SPEC, the time specified by pmcond[START_TIME] and pmcond [END_TIME] serves as query condition. In other cases, the query condition is the default value of pmcond[TIME_DEFAULT]. Period for querying results. You can set it through pmcond[PERIOD]. The values and meaning are as follows: l 0: 5 minutes l 1: 15 minutes l 2: 30 minutes l 3: 60 minutes l 4: 1440 minutes The default value is 2, that is, the period defaults 30 minutes. Start time. You can set it through pmcond [START_TIME]. The values are tuples indicating the start time for querying performance records. It is represented by (year, month, day, hour, minute, second, time zone offset, DST offset). By default, all alarms generated after pmcond [START_TIME] are queried.

TIME_DEFAULT

PERIOD

START_TIME

NOTE If neither the start time nor the end time is set, all performance data is queried.

In this format, l Time zone offset is an integer. The value ranges from -12 to 13. The default value is 0. l DST offset is an integer. The value ranges from 0 to 2. The default value is 0.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-161

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Enumerated Type

Detailed Information End time. You can set it through pmcond [END_TIME]. The values are tuples indicating the end time for querying performance records. It is represented by (year, month, day, hour, minute, second, time zone offset, DST offset). By default, all alarms generated after pmcond[END_TIME] are queried. In this foramt, l Time zone offset is an integer. The value ranges from -12 to 13. The default value is 0. l DST offset is an integer. The value range ranges from 0 to 2. The default value is 0. Sequence of counter IDs. You can set it through pmcond[COUNTERID_SEQ]. The value is a list whose length is not limited. Elements in the list are of long integer type, indicating the counter IDs. Sequence of objects indexed. You can set it through pmcond[OBJINDEX_SEQ]. The value is a list whose elements are of integer type indicating the index numbers of objects.
NOTE This parameter is outdated and retained for compatibility with previous versions.

END_TIME

COUNTERID_SEQ

OBJINDEX_SEQ

NEFDN_SEQ

FDN sequence of objects. You can set it through pmcond[NEFDN_SEQ]. The value is a list whose elements are of string type indicating the object FDNs. FDN uniquely identifies an NE.

5-162

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Enumerated Type

Detailed Information Rule of sorting results. You can set it through pmcond[RESULT_SORT]. The value is a list, [resultsort, resultsort1,...]. Elements in the list are tuples containing three elements. That is, resultsort = (sortType, counterId, sortDirection). sortType: integer type. It indicates the field by which the results are sorted. The values and meanings are as follows:

RESULT_SORT

l 1: sort by object l 2: sort by time l 3: sort by counter counterId: long integer type. It indicates the counter ID. sortDirection: integer type. The values and meanings are as follows: l 0: not sort l 1: ascending order l 2: descending order

Return Value
The return value is an integer. If calling the function succeeds, the number of performance records is returned. Otherwise, 0 is returned.

Error Handling
None. Related Example

5.6.7 Function: NextPmRcds


This describes the NextPmRcds() function, which enables you to obtain the queried performance data through QueryFmRcds().

Synopsis
NextPmRcds()

Note
l NextPmRcds() enables you to obtain the queried performance data through 5.6.4 Function: QueryFmRcds. Each time 2000 records are returned. If the number of performance records exceeds 2000, call the function for multiple times to return all the performance data. If the number of performance records does not reach 2000, all the performance data is returned.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-163

Issue 02 (2010-10-10)

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Call 5.6.2 Function: OpenDB to connect to the database before calling this function.

Parameter Description
None

Return Value
The return value is a list. If calling the function succeeds, the performance data list is returned. Otherwise, an empty list is returned.

Error Handling
None.

Example
#Open the database connection. OpenDB("admin", "11111111") #Create an object of performance query. pmcond = CreateCond(PM_COND) #Set the NE type. pmcond[NE_TYPEID] = 1 #Set function subsets. pmcond[FUNCTION_SUBSET] = 67109402 #Set the time mode to server mode. pmcond[TIME_MODE] = 0 #Set the query time segment to the specified time segment. pmcond[TIME_DEFAULT] = 4 #Set the query period to 30 minutes. pmcond[PERIOD] = 2 #Set the start time of the time segment for performance data query. pmcond[START_TIME] = (2006, 12, 29, 18, 24, 39, 1, 1) #Set the end time of the time segment for performance data query. pmcond[END_TIME] = (2006, 12, 30, 10, 20, 40, 2, 1) #Set the counter ID sequence. pmcond[COUNTERID_SEQ] = [67190482, 67190483, 67190731, 67190732, 67202907, 67202908] #Set the object index sequence. pmcond[OBJINDEX_SEQ] = [60, 61, 62, 63, 64, 65] #Set the object FDN. pmcond[NEFDN_SEQ] = ['.3221229568.3221233664.3221291041'] #Set the sorting rule of query results. pmcond[RESULT_SORT] = (0, 0, 0) #Query the performance data that meets the condition. returncode = QueryPmRcds(pmcond) Print("QueryPmRcds() return: " + str(returncode)) #Get the performance data queried by the QueryPmRcds() function. PmRecords = NextPmRcds() #Close the database connection. CloseDB()

5-164

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Result
QueryPmRcds() return:3498

5.6.8 Function: QueryCmRcds


This describes the QueryCmRcds function, which enables you to get the queried configuration data records.

Synopsis
QueryCmRcds(Cmcond)

Note
l l QueryCmRcds(Cmcond) enables you to get the queried configuration data records. Get the queried result by calling 5.6.9 Function: NextCmRcds. Before calling this function, call 5.6.2 Function: OpenDB to connect the database.

Parameter Description
Parameter Cmcond Description Cmcond is the query condition object. It is the return value of calling CreateCond(CM_COND). The items of Cmcond are enumeration values, that is, {PARENT_ID, NE_FDN, CHILD_MOC}. The meanings are as follows: l ParentObjId: ID of parent managed object (MO). Cmcond [ParentObjId] is a long integer. You can set it through Cmcond [ParentObjId]. l NE_FDN: FDN of an NE. Cmcond[NE_FDN] is a string. You can set it through Cmcond[NE_FDN]. l CHILD_MOC: name of child manage object class (MOC). Cmcond [CHILD_MOC] is a string. You can set it through Cmcond [CHILD_MOC].

Return Value
The return value is an integer. If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None. Related Example

5.6.9 Function: NextCmRcds


This describes the NextCmRcds() function, which enables you to obtain the configuration data queried through QueryCmRcds().
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-165

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Synopsis
NextCmRcds()

Note
l NextCmRcds() enables you to obtain the configuration data queried through 5.6.8 Function: QueryCmRcds. Each time 1000 records are returned. If the number of configuration records exceeds 1000, call the function for multiple times to return all the alarm data. If the number of alarm records does not reach 1000, all the configuration data is returned. Call 5.6.2 Function: OpenDB to connect to the database before calling this function.

Parameter Description
None

Return Value
The return value is a list. If calling this function succeeds, the configuration data list is returned and the elements in the lists are of long integer type. Otherwise, an empty list is returned.

Error Handling
None.

Example
#Open the database connection. OpenDB("admin", "11111111") Print("") Print("----------### Query the configuration ####----------") cmcond = CreateCond(CM_COND) cmcond[PARENT_ID] = 3223011329 cmcond[NE_FDN] = '.3221229568.3221233664.3221291041' cmcond[CHILD_MOC] = 'RNCOriginSigPoint' ee = QueryCmRcds(cmcond) Print("CM result: " + str(ee) ) CMlist = NextCmRcds() while CMlist CMlist = NextCmRcds() end

Result
----------### Query the configuration ####---------CM result:2360

5.6.10 Function: GetCmCom


This describes the GetCmCom(Fdn,objSeq) function, which enables you to obtain the configuration data of the specified object.

Synopsis
GetCmCom(Fdn,objSeq)
5-166 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Note
l l GetCmCom(Fdn,objSeq) enables you to obtain the configuration data of the specified object. Obtain the queried results through 5.6.9 Function: NextCmRcds. Call 5.6.2 Function: OpenDB to connect to the database before calling this function.

Parameter Description
Parameter Fdn objSeq Description Fdn is a string. It indicates the NE FDN. If the list is empty, the return value is the configuration data of the root MO. objSeq is a list. It indicates the ID sequence of MOs.

Return Value
The return value is a list. If calling the function succeeds, the configuration data is returned. Otherwise, an empty list is returned. The return value of GetCmCom() is a list. The configuration data of the specified object ID is returned. The return value is: MoDataSeq = [MoData, MoData1, MoData2, ...]. MoData is of MO data type. It has the following elements: objId, mocName, displayMocName, name, and groupSeq. The meaning of each element is as follows: l l l l l objId: long integer type. It indicates the ID of the MO object in the configuration data. MocName: character type. It indicates the name of MOC. displayMocName: string type. It indicates the display name of MOC. name: character type. It indicates the name of MO. groupSeq: list type. The elements in the list are attribute groups. The list is: groupSeq = [group, group1, ...]. The element group is the attribute group which has two elements: groupName and data. The meaning of each element is as follows: groupName: string type. It indicates the name of the attribute group. data: string type. It indicates results of the attributes in the attribute list.

Error Handling
None.

Example
#Connect the database. OpenDB("admin", "11111111") #sNeFdn,oidSeq returncode = GetCmCom('.3221229568.3221233664.3221278720', [3221291008, 3221295104]) Print('GetCmCom() return recordCount: ' + str(len(returncode))) #Close the database connection. CloseDB()

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-167

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.6.11 Function: GetChildMoc


This describes the GetChildMoc function, which enables you to obtain the child MOC and the attribute list.

Synopsis
GetChildMoc(NEFdn, ParentMoc)

Note
Call 5.6.2 Function: OpenDB to connect to the database before calling this function.

Parameter Description
Parameter NEFdn ParentMoc Description NEFdn is a string. It indicates the NE FDN which uniquely identifies the configuration data. ParentMoc is a string. It indicates the name of the parent managed object class (MOC).

Return Value
The return value is a list. If the function is called successfully, the attribute list of parent MOC is returned. Otherwise, an empty list is returned.
NOTE

The return value of GetChildMoc() is a list. The elements in the list are the types of MOC data objects. The return value can be represented by [Moc, Moc1, ...]. An MOC has three attributes: name, displayName, and attrInfoGroups. The meanings are as follows: l l l name: string type. It indicates the name of the MOC. displayName: string type. It indicates displayed MOC name. attrInfoGroups: list type. attrInfoGroups = [attrInfoGroup, attrInfoGroup1, ...], where attrInfoGroup is of attribute information group object type indicating the attribute information group of MOC. attrInfoGroup = [attrInfo, attrInfo1, ...], where attrInfo is of attribute information object type and contains three elements: name, displayName, and attrtype: l name: string type. It indicates the attribute name. l displayName: string type. It indicates the displayed attribute name. l attrtype: enumeration type. It indicates the attribute type. The value 0 indicates the integer type; 1 indicates the double type; 2 indicates the string type.

Error Handling
None.

Example
#Connect the database. OpenDB("admin", "11111111") retlist = GetChildMoc('.3221229568.3221233664.3221278720', 'RncEquipment')

5-168

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Print('GetChildMoc() return recordCount: ' + str(len(retlist))) #Close the database connection. CloseDB()

5.6.12 Function: GetIntegrityReportCond


This describes the GetIntegrityReportCond function. This function enables you to obtain integrity query conditions.

Synopsis
GetIntegrityReportCond()

Note
None.

Parameter Description
None.

Return Value
The return value is the object of the integrity query conditions. The following table describes the attributes and meanings of the return value. You can set the specific attributes of the objects of query conditions in the format of ".attribute name" in the script. Attribute neTypeName period neFDNList FssIdList timeMode Description Refers to the name of an NE type. Refers to a query period. Refers to the list of NE FDNs, which is in the form of [FDN1, FDN2, ...]. Refers to the list of function subset IDs, which is in the form of [Subset ID1, Subset ID2, ...]. Refers to a time mode, whose values and meanings are as follows: l 0: Server time mode l 1: NE time mode
NOTE The default time mode is server time mode.

startTime endTime timezoneOffset

Refers to the start time for query. The format is (year, month, day, hour, minute, second). Refers to the end time for query. The format is (year, month, day, hour, minute, second). Refers to the offset of a time zone. The default value is -1.
5-169

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Attribute dstTimeOffset

Description Refers to the offset of the daylight saving time. The default value is -1.

Error Handling
None.

Example
cond = GetIntegrityReportCond() cond.neTypeName = 'RNC' cond.period=0 cond.neFDNList=['.3221229568.3221233664.3221282816','.3221229568.3221233664.3221282817',\ '.3221229568.3221233664.3221282825','.3221229568.3221233664.3221282826',\ '.3221229568.3221233664.3221282842'] cond.FssIdList=[67109391,67109473,67109395,6710943] cond.timeMode=0 cond.startTime=(2008, 8, 4, 10, 0, 0) cond.endTime=(2008, 8, 4, 16, 0, 0) li = QueryIntegrityResult(cond) l = GetOneNEInteLst(li,'.3221229568.3221233664.3221282842') t = GetOneFssInte(l,67109473) d = GetOneIntegrity(li,'.3221229568.3221233664.3221282842',67109391) Print(d)

Result
fssId: 67109391;actualNum: 0;dueNum: 0;percentOfIntegrity: 100;

5.6.13 Function: GetFunctionSubSetList


This describes the GetFunctionSubSetList function. This function enables you to obtain the list of function subsets, including their IDs and names.

Synopsis
GetFunctionSubSetList(neTypeName)

Note
None.

Parameter Description
Parameter neTypeName Name of an NE type. Description

5-170

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Return Value
The return value is a list of function subsets, whose form is as follows: [function subset ID1: "function subset name 1", function subset ID2: "function subset name 2"].

Error Handling
None.

Example
resList = GetFunctionSubSetList('RNC') keyList = resList.keys() for key in keyList Print(str(key) + ": " + resList[key]) end

Result
67109376: 67109377: 67109378: 67109379: 67109380: 67109381: 67109382: 67109383: 67109384: ... Measurement of RAB release triggered by UTRAN per cell Measurement of multi-RAB service per cell Measurement of RB Procedure per cell Soft Handover Measurement per cell Hard Handover Measurement per cell InterRAT Handover Measurement per cell Cell Update Measurement per cell URA Update Measurement per cell RRC Reporting Measurement per cell

5.6.14 Function: QueryIntegrityResult


This describes the QueryIntegrityResult function. This function enables you to query an integrity result based on the integrity query conditions.

Synopsis
QueryIntegrityResult(IntegrityReportCond)

Note
None.

Parameter Description
Parameter IntegrityReport Cond Description Refers to the integrity query conditions, which can be set through 5.6.12 Function: GetIntegrityReportCond.

Return Value
The return value is an integrity report.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-171

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Error Handling
None.

Example
#Set querying condition cond = GetIntegrityReportCond() cond.neTypeName = 'RNC' cond.period=0 cond.neFDNList=['.3221229568.3221233664.3221282816','.3221229568.3221233664.3221282817',\ '.3221229568.3221233664.3221282825','.3221229568.3221233664.3221282826',\ '.3221229568.3221233664.3221282842'] cond.FssIdList=[67109391,67109473,67109395,6710943] cond.timeMode=0 cond.startTime=(2008, 8, 4, 10, 0, 0) cond.endTime=(2008, 8, 4, 16, 0, 0) #query the integrity report li = QueryIntegrityResult(cond) Print("result length is: " + str(len(li)))

Result
result length is: 5

5.6.15 Function: GetOneNEInteLst


This describes the GetOneNEInteLst function. This function enables you to obtain the integrity result of a specified NE from the integrity query results.

Synopsis
GetOneNEInteLst(resultNeIntegrityLst, neFdn)

Note
None.

Parameter Description
Parameter resultNeIntegri tyLst neFdn Description Refers to the integrity result, which may contain the integrity results of multiple NEs. This parameter value is the return value of 5.6.14 Function: QueryIntegrityResult. Refers to the FDN of an NE.

Return Value
The return value is the integrity result of a specified NE.
5-172 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Error Handling
None.

Example
cond = GetIntegrityReportCond() cond.neTypeName = 'RNC' cond.period=0 cond.neFDNList=['.3221229568.3221233664.3221282816','.3221229568.3221233664.3221282817',\ '.3221229568.3221233664.3221282825','.3221229568.3221233664.3221282826',\ '.3221229568.3221233664.3221282842'] cond.FssIdList=[67109391,67109473,67109395,6710943] cond.timeMode=0 cond.startTime=(2008, 8, 4, 10, 0, 0) cond.endTime=(2008, 8, 4, 16, 0, 0) li = QueryIntegrityResult(cond) l = GetOneNEInteLst(li,'.3221229568.3221233664.3221282842') Print("one ne integrity report number is: " + str(len(l)))

Result
one ne integrity report number is: 3

5.6.16 Function: GetOneFssInte


This describes the GetOneFssInte function. This function enables you to obtain the integrity report of a specified function subset from an NE integrity report.

Synopsis
GetOneFssInte(integrityNE, fssId)

Note
None.

Parameter Description
Parameter integrityNE fssId Description Refers to an NE integrity report. The parameter value is the return value of 5.6.15 Function: GetOneNEInteLst. Refers to an ID of a function subset.
TIP By using 5.6.13 Function: GetFunctionSubSetList, you can specify the IDs and names of all the function subsets of an NE type so that you can obtain the ID of a certain function subset.

Return Value
The return value is the integrity value of a specified function subset of an NE.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-173

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Error Handling
None.

Example
cond = GetIntegrityReportCond() cond.neTypeName = 'RNC' cond.period=0 cond.neFDNList=['.3221229568.3221233664.3221282816','.3221229568.3221233664.3221282817',\ '.3221229568.3221233664.3221282825','.3221229568.3221233664.3221282826',\ '.3221229568.3221233664.3221282842'] cond.FssIdList=[67109391,67109473,67109395,6710943] cond.timeMode=0 cond.startTime=(2008, 8, 4, 10, 0, 0) cond.endTime=(2008, 8, 4, 16, 0, 0) li = QueryIntegrityResult(cond) l = GetOneNEInteLst(li,'.3221229568.3221233664.3221282842') t = GetOneFssInte(l,67109473) Print(t)

Result
fssId: 67109391;actualNum: 0;dueNum: 0;percentOfIntegrity: 100;

5.6.17 Function: GetOneIntegrity


This describes the GetOneIntegrity function. This function enables you to obtain the integrity result of a specified NE or a function subset from an integrity report.

Synopsis
GetOneIntegrity(resultNeIntegrityLst, neFdn, fssId)

Note
None.

Parameter Description
Parameter resultNeIntegrityLst neFdn fssId Description Refers to an integrity result. This parameter value is the return value of 5.6.14 Function: QueryIntegrityResult. Refers to the FDN of an NE. Refers to an ID of a function subset.
TIP By using 5.6.13 Function: GetFunctionSubSetList, you can specify the IDs and names of all the function subsets of an NE type so that you can obtain the ID of a certain function subset.

5-174

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Return Value
The return value is the integrity value of a specified NE or a function subset.

Error Handling
None.

Example
cond = GetIntegrityReportCond() cond.neTypeName = 'RNC' cond.period=0 cond.neFDNList=['.3221229568.3221233664.3221282816','.3221229568.3221233664.3221282817',\ '.3221229568.3221233664.3221282825','.3221229568.3221233664.3221282826',\ '.3221229568.3221233664.3221282842'] cond.FssIdList=[67109391,67109473,67109395,6710943] cond.timeMode=0 cond.startTime=(2008, 8, 4, 10, 0, 0) cond.endTime=(2008, 8, 4, 16, 0, 0) li = QueryIntegrityResult(cond) l = GetOneNEInteLst(li,'.3221229568.3221233664.3221282842') t = GetOneFssInte(l,67109473) d = GetOneIntegrity(li,'.3221229568.3221233664.3221282842',67109391) Print(d)

Result
fssId: 67109391;actualNum: 0;dueNum: 0;percentOfIntegrity: 100;

5.6.18 Function: GetPmCond


The GetPmCond function is used to create performance query conditions that contain only default values. After creating performance query conditions, you can set data items for specific query conditions based on the actual requirement.

Synopsis
GetPmCond()

Note
None.

Parameter Description
None.

Return Value
Refers to the conditions for querying performance data after the GetPmCond function is invoked successfully. The items in the return values are enumerated values. For details about each item, see Table 5-12.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-175

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Assume that cond is a condition for querying performance data and is created in 5.6.18 Function: GetPmCond. You can access and set the items of cond in the following format: cond[name of an item]. An example of the code is as follows:
cond=GetPmCond() #assign values to function subset IDs cond[FUNCTION_SUBSET]=1644179460 #assign values to measurement periods cond[PERIOD]=P5 ...

Table 5-12 Description of conditions for querying performance data Name NE_FDN TIME_MODE Detailed Information NE_FDN is a string and refers to the NE FDN. Refers to the time mode. The values and meanings are as follows: l NE_MODE: NE time mode l SERVER_MODE: server time mode
NOTE The default time mode is server time mode.

FUNCTION_SUBSET

Refers to the function subset ID and is a numeral. Unless otherwise specified, the default value is -1.
TIP You can obtain the IDs and names of all the function subsets of a specified NE type by referring to 5.6.13 Function: GetFunctionSubSetList. Thus, you can obtain the ID of a certain function subset.

TIME_DEFAULT

Refers to the date range within which the performance data is to be queried. The values and meanings are as follows: l TODAY: Today l YESTERDAY: Yesterday l THISWEEK: This week l LASTWEEK: Last week l SPEC: The date range is specified by START_TIME and END_TIME. l ALL: All time
NOTE l Unless otherwise specified, the default value of TIME_DEFAULT is ALL. l The time specified by START_TIME and END_TIME can be used as a query condition only when TIME_DEFAULT is set to SPEC.

5-176

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Name PERIOD

Detailed Information Refers to a measurement period. The values and meanings are as follows: l P5: 5 minutes l P15: 15 minutes l P30: 30 minutes l P60: 60 minutes l P1440: 1440 minutes (24 hours)
NOTE The default period is 30 minutes.

START_TIME

Refers to the start time of the time range for querying performance records. The start time is a string and its format is as follows: yyyymm-dd HH:mm:ss. Refers to the end time of the time range for querying performance records. The end time is a string and its format is yyyy-mm-dd HH:mm:ss. Refers to the sequence of counter IDs and is displayed in a list. Each element in the list is a counter ID.
TIP You can obtain the counter ID of an NE by referring to 5.6.26 Function: GetCounterInfo.

END_TIME

COUNTERID_SEQ

OBJINSTANCE_SEQ

Refers to the sequence of object indexes and is displayed in a list. Each element in the list is an integer indicating an object index number.

Error Handling
None.

Example
fdn=GetNEFDN('BWA140') #Create performance query object cond=GetPmCond() #Set query conditiongs cond[FUNCTION_SUBSET]=1644179460 cond[NE_FDN]=fdn cond[COUNTERID_SEQ]=[1644625920,1644625944,1644625943] cond[PERIOD]=P30 cond[START_TIME]=StrfTime(TIME_FORMAT,t=(2008,12,31,03,17,00,0,1,0)) cond[END_TIME]='2009-1-21 15:00:00' cond[TIME_DEFAULT]=SPEC iter=QueryRecord(cond) lens=RecordCount(iter)

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-177

5 HFC Library Reference


Print(lens)

iManager N2000 UMS Element Management System iSStar

Resut
71

5.6.19 Function: GetFmCond


The GetFmCond function is used to create an alarm query condition that contains only default values. After creating an alarm query condition, you can set data items for a specific query condition based on the actual requirement.

Synopsis
GetFmCond()

Note
None.

Parameter Description
None.

Return Value
Refers to the conditions for querying alarm data after the GetFmCond function is invoked successfully. The items in the return values are enumerated values. For details about each item, see Table 5-13. Assume that cond is a condition for querying alarm data and is created by referring to 5.6.19 Function: GetFmCond. You can access and set the items of cond in the following format: cond [name of an item]. An example of the code is as follows:

cond=GetPmCond() #assign values to alarm types cond[ALARM_CATE]=1 #assign values to time modes co

Table 5-13 Description of conditions for querying alarm data Name ALARM_CATE Detailed Information Refers to the alarm type. The values and meanings are as follows: l 1: Current fault alarm l 2: Event alarms l 3: History fault alarm
NOTE The default alarm type is current fault alarm.

5-178

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Name TIME_MODE

Detailed Information Refers to the time mode. The values and meanings are as follows: l NE_MODE: NE time mode l SERVER_MODE: server time mode
NOTE The default time mode is server time mode.

START_TIME

Refers to the start time of the time range for querying alarm records. The start time is a string and its format is yyyy-mm-dd HH:mm:ss. Refers to the end time of the time range for querying alarm records. The end time is a string and its format is yyyy-mm-dd HH:mm:ss.

END_TIME

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-179

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Name ALARMINFO_SEQ

Detailed Information Refers to the sequence of alarm information, which is displayed in a list. Each element in the list is a tuple and its format is (Proudct ID, NE type, Alarm ID). Product ID refers to the type of the product on which an alarm is generated. The values and meanings are as follows: l 1: Transmission l 2: Mobile l 3: Fixed network narrowband l 4: Fixed network wideband l 5: Intelligent l 6: Network management NE type refers to the type of the NE on which an alarm is generated. The values and meanings are as follows: l 100000: OMC l 1: RNC l 2: NodeB l 3: SGSN l 4: GGSN l 5: CG l 6: MSoftX l 7: MGW l 8: HLR Alarm ID refers to the ID of an NE and is an integer. If the product ID and NE type are specific, the alarms of a certain type can be uniquely identified. The value of the alarm ID can be any integer except -1.

NEFDN_SEQ

Refers to the FDN sequence of NEs and is displayed in a list. Each element in the list is an FDN.

5-180

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Name ALARMCAUSE_SEQ

Detailed Information Refers to the type sequence of alarm causes and is displayed in a list. The values and meanings are as follows: l 1: Power system l 2: Environment system l 3: Signaling system l 4: Relay system l 5: Hardware system l 6: Software system l 7: Operating system l 8: Communication system l 9: Quality of service (QoS) l 10: Handling error l 11: Internal network management system (NMS)

ALARMLEVEL_SEQ

Refers to the sequence of alarm severities and is displayed in a list. The list contains unlimited elements indicating alarm severities. Unless otherwise specified, set the length of the sequence to 0. The values and meanings are as follows: l 1: Critical l 2: Major l 3: Minor l 4: Warning l 5: Unassured

ALARMSTATUS_SEQ

Refers to the sequence of alarm states and is displayed in a list. The list contains unlimited elements indicating alarm states. Unless otherwise specified, set the length of the sequence to 0. In the case of fault alarms, the values and meanings are as follows: l 1: Unacknowledged and uncleared l 2: Unacknowledged and cleared l 3: Acknowledged and uncleared l 4: Acknowledged and cleared In the case of event alarms, the values and meanings are as follows: l 5: Acknowledged l 6: Unacknowledged

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-181

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Name LINKFDN_SEQ

Detailed Information Refers to the sequence of link FDNs and is displayed in a list. Each element in the list is a string indicating the FDN of the link to be queried. The FDN uniquely identifies a link for link data configuration. The list contains unlimited elements. Unless otherwise specified, set the length of the sequence to 0. Refers to the sequence of link types. The values and meanings are as follows: l 400: MTP3 l 401: MTP3B l 408: H248 l 409: BICCSCTP l 410: M3UA l 499: DATA

LINKTYPE_SEQ

IDENTIF_SEQ

Refers to the sequence of alarm identifiers and is displayed in a list. Each element in the list is an alarm identifier. In the case of fault alarms, the values and meanings are as follows: l 0: Note l 1: Intermittent fault l 2: High frequency flash fault In the case of event alarms, the values and meanings are as follows: l 0: Note l 3: Repeat event l 4: High frequency repeat event

Error Handling
None.

Example
#Create alarm query object cond=GetFmCond() cond[START_TIME]=StrfTime(TIME_FORMAT,t=(2008,12,29,00,00,00,0,1,0)) cond[END_TIME]=StrfTime(TIME_FORMAT,t=(2009,02,04,23,59,59,0,1,0)) #alarm type is current alarm cond[ALARM_CATE]=1 #Time mode is server mode cond[TIME_MODE]=0 record=QueryRecord(cond) count=RecordCount(record)

5-182

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


Print(count)

5 HFC Library Reference

Resut
71

5.6.20 Function: QueryRecord


The QueryRecord function is used to query the performance data or alarm data that meets the query conditions.

Synopsis
QueryRecord(queryCond)

Note
None.

Parameter Description
Parameter queryCond Description queryCond refers to the conditions for querying performance data or alarm data. You can set conditions for querying performance data and alarm data by referring to 5.6.18 Function: GetPmCond and 5.6.19 Function: GetFmCond, respectively.

Return Value
Refers to the set of results. You can obtain each record by referring to 5.6.22 Function: NextRecord.

Error Handling
None.

Example 1
#Create alarm query object cond=GetFmCond() cond[START_TIME]=StrfTime(TIME_FORMAT,t=(2008,12,29,00,00,00,0,1,0)) cond[END_TIME]=StrfTime(TIME_FORMAT,t=(2009,02,04,23,59,59,0,1,0)) #Alarm type is current alarm cond[ALARM_CATE]=1 #Time mode is server mode cond[TIME_MODE]=0 record=QueryRecord(cond) count=RecordCount(record) Print(count)

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-183

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Result of Example 1
3154

Example 2
fdn=GetNEFDN('BWA140') #Create performance query object cond=GetPmCond() #Set query conditions cond[FUNCTION_SUBSET]=1644179460 cond[NE_FDN]=fdn cond[COUNTERID_SEQ]=[1644625920,1644625944,1644625943] cond[PERIOD]=P30 cond[START_TIME]=StrfTime(TIME_FORMAT,t=(2008,12,31,03,17,00,0,1,0)) cond[END_TIME]='2009-1-21 15:00:00' cond[TIME_DEFAULT]=SPEC iter=QueryRecord(cond) lens=RecordCount(iter) Print(lens)

Result of Example 2
71

5.6.21 Function: RecordCount


The RecordCount function is used to obtain the records returned by the QueryRecord function.

Synopsis
RecordCount(resultHolder)

Note
None.

Parameter Description
Parameter resultHolder Description resultHolder refers to the results that are obtained after you invoke the QueryRecord function by referring to 5.6.20 Function: QueryRecord.

Return Value
Refers to the records obtained through the QueryRecord function. The value is an integer.

Error Handling
None.
5-184 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Example
#Create alarm query object cond=GetFmCond() cond[START_TIME]=StrfTime(TIME_FORMAT,t=(2008,12,29,00,00,00,0,1,0)) cond[END_TIME]=StrfTime(TIME_FORMAT,t=(2008,12,29,23,59,59,0,1,0)) record=QueryRecord(cond) count=RecordCount(record) Print(count)

Resut
545

5.6.22 Function: NextRecord


The NextRecord function is used to obtain the records obtained by the QueryRecord function.

Synopsis
NextRecord(resultHolder)

Note
None.

Parameter Description
Parameter resultHolder Description resultHolder refers to the results that are obtained after you invoke the QueryRecord function by referring to 5.6.20 Function: QueryRecord.

Return Value
Refers to one of the records that are obtained after the QueryRecord function is invoked. Each record is a tuple and its format is (Whether to obtain the record end identifier, [record 1, record 2, ...]). The first element in the tuples indicates whether all records are obtained and the element is a Boolean value. The values and meanings are as follows: l l True: Indicates that the record is the last record. True: Indicates that the record is not the last record.

The second element in the tuples refers to the data that is queried and displayed in a list. A maximum of 2000 elements can be contained. The elements in the list are also lists and vary based on the situation, that is, whether the found records are alarm records or performance records. l If the found records are alarm records, a list whose length is 19 is returned. For descriptions of the elements in the list, see Table 5-14.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-185

Issue 02 (2010-10-10)

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

If the found records are performance records, a list whose length is uncertain is returned. The first fourth elements of the list are fixed whereas the rest elements vary based on the found performance counters. For descriptions of the elements in the list, see Table 5-15.

Table 5-14 Items in the list of alarm records Location in the List 1 Detailed Information Refers to the alarm type such as a current fault alarm, event alarm, or history fault alarm. This element is an integer. The values and meanings are as follows: l 1: Current fault alarm l 2: Event alarm l 3: History fault alarm 2 3 4 5 6 7 Refers to the serial number (SN) of a network. This element is an integer. Refers to the FDN of an NE. This element is represented by characters. Refers to the SN of a device. This element is an integer. Refers to the sub-device identifier of the NE on which an alarm is generated. This element is an integer. Refers to the alarm ID. This element is an integer. Refers to the type of alarm causes. This element is an integer. The values and meanings are as follows: l 1: Power system l 2: Environment system l 3: Signaling system l 4: Relay system l 5: Hardware system l 6: Software system l 7: Operating system l 8: Communications system l 9: Quality of service (QoS) l 10: Handling error l 11: Internal NMS 8 Refers to the alarm severity. This element is an integer. The values and meanings are as follows: l 1: Critical l 2: Major l 3: Minor l 4: Warning

5-186

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Location in the List 9

Detailed Information Refers to the clearance status of an alarm. This element is an integer. The values and meanings are as follows: l 0: Uncleared l 1: Cleared

10

Refers to the acknowledgement status of an alarm. This element is an integer. The values and meanings are as follows: l 0: Unacknowledged l 1: Acknowledged

11 12 13 14 15 16

Refers to the user name of the operator who acknowledges an alarm. This element is represented by characters. Refers to the user name of the operator who clears an alarm. This element is represented by characters. Refers to the additional information about an alarm. This element is represented by characters. Refers to the cause ID of an alarm. This element is an integer. Refers to the FDN of the alarm link. This element is an integer. Refers to the type of an alarm link. This element is an integer. The values and meanings are as follows: l -1: Indicates that the alarm is not a link alarm. l An integer that is greater than 0: Indicates that the alarm is a link alarm.

17

Refers to the time when an alarm is generated. This element is represented by characters and its format is yyyy-mm-dd HH:mm:ss. Refers to the time when an alarm is acknowledged. This element is represented by characters and its format is yyyy-mm-dd HH:mm:ss. Refers to the time when an alarm is cleared. This element is represented by characters and its format is yyyy-mm-dd HH:mm:ss.

18

19

Table 5-15 Items in the list of alarm records Location in the List 1 2 Detailed Information Refers to the start time of the query. This element is represented by characters and its format is yyyy-mm-dd HH:mm:ss. Refers to the end time of the query. This element is represented by characters and its format is yyyy-mm-dd HH:mm:ss.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-187

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Location in the List 3 4

Detailed Information Refers to the name of an performance measurement object. This element is represented by characters. Refers to the credibility identifier of a result. This element is a Boolean value. The values and meanings are as follows: l True: Credible l False: Incredible

Refers to a performance counter. This element is a tuple and its format is as follows: (ID, Value). The meanings are as follows: l ID: Refers to an integer indicating the ID of a performance counter. l Value: Refers to the value of a performance counter. The value can be a string or an integer.

...

Refers to a counter. This element is a tuple and its format is (ID, Value). The meanings are as follows: l ID: Refers to an integer indicating the ID of a performance counter. l Value: Refers to the value of a performance counter. The value can be a string or an integer.

NOTE

Starting from the fifth element, all the elements in the list are performance counter tuples. Performance counters are grouped into integer counters (the counter values are integers) and character counter (the counter values are characters).

Error Handling
None.

Example 1
#Create alarm query object cond=GetFmCond() cond[START_TIME]=StrfTime(TIME_FORMAT,t=(2008,12,01,00,00,00,0,1,0)) cond[END_TIME]=StrfTime(TIME_FORMAT,t=(2008,12,29,23,59,59,0,1,0)) record=QueryRecord(cond) count=RecordCount(record) returnCode=False while not returnCode returnCode,lists=NextRecord(record) lens=len(lists) if lens==0 break end #Get the first record oneRecord=lists[0] recordLen=len(oneRecord) Print(oneRecord) end

5-188

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Result of Example 1
[1, 3002, '.3221229568.3221233664.3221291008', 1, '. 3221229568.3221233664.3221291008', 405, 5, 2, 0, 0, '', '', 'Site No.=0,Cell Index.=0, Site Type=0,Site Name=please replace,Cell Name=please replace', 0, '', -1, '2008-12-05 14:26:04', '0000-00-00 00:00:00', '0000-00-00 00:00:00']

Example 2
fdn = GetNEFDN('CBSC_241') #fdn='.3221229568.3221233664.3221286947' #Create performance query object cond=GetPmCond() #Set query conditions cond[FUNCTION_SUBSET]=1157627909 cond[NE_FDN]=fdn cond[COUNTERID_SEQ]=[1157627932,1157627934,1157627935,1157627936,1157627937,1157628216] iter=QueryRecord(cond) returnCode=False while not returnCode returnCode,lists=NextRecord(iter) lens=len(lists) if lens==0 break end #Get the first record oneRecord=lists[0] recordLens=len(oneRecord) Print(oneRecord) end

Result of Example 2
['2009-02-04 19:00:00', '2009-02-04 19:30:00', '', True, (1157627932, 0.0), (1157627934, 0.0), (1157627935, 0.0), (1157627936, 0.0), (1157627937, 0.0), (1157628216, 0.0)]

5.6.23 Function: GetMocAttrNameList


The GetMocAttrNameList function is used to query MOC attribute names based on MOC names and NE FDNs.

Synopsis
GetMocAttrNameList(mocName, neFdn)

Note
None.

Parameter Description
Parameter mocName neFdn
Issue 02 (2010-10-10)

Description mocName is a string and refers to an MOC name. neFdn is a string and refers to an NE FDN.

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-189

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Return Value
Refers to the MOC attribute names obtained through the GetMocAttrNameList function and displayed in a list. The list format is [attrname1, attrname1, ...].

Error Handling
None.

Example
#Get the Fdn of the NE neFdn=GetNEFDN('ty') lists=GetMocAttrNameList('BSC6000NE', neFdn) Print(lists)

Resut
['InternalId', 'InternalSubId', 'district', 'entityVersionId', 'isLocked', 'latitude', 'locationName', 'longitude', 'matchVersion', 'medPartition', 'memo', 'name', 'neID', 'neType', 'neVersion', 'omcID', 'parentMoIndex', 'productID', 'realLatitude', 'realLongitude', 'subarea', 'subnetworkID', 'userLabel', 'vendorName']

5.6.24 Function: GetMocList


The GetMocList function is used to query the MOC name of an NE based on the FDN of the NE.

Synopsis
GetMocList(neFdn)

Note
None.

Parameter Description
Parameter neFdn Description neFdn is a string and refers to the NE FDN.

Return Value
Refers to the MOC name obtained through the GetMocList function. The list format is [name1, name2, ...]. Each element in the list is a string and refers to an MOC name.
5-190 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Error Handling
None.

Example
#Get the Fdn of the NE fdn=GetNEFDN('ty') moclist=GetMocList(fdn) Print(moclist)

Resut
['BSC6000Cabinet', 'BSC6000Cell', 'BSC6000NE', 'BSC6000Service', 'BSC6000Site', 'BSC6000SiteBoard', 'BSC6000SiteCabinet', 'BSC6000SiteSubRack', 'BSC6000TRX', 'CBaseAttr']

5.6.25 Function: GetNeObjInfo


The GetNeObjInfo function is used to obtain the information about the NE performance measurement objects of a certain type based on the function set ID and FDN of an NE.

Synopsis
GetNeObjInfo(funcSubsetId, neFdn)

Note
None.

Parameter Description
Parameter funcSubsetId Description funcSubsetId is an integer and refers to the function subset ID of an NE. You can obtain funcSubsetId by referring to 5.6.28 Function: GetFuncSubSetList. neFdn is a string and refers to the NE FDN. You can obtain neFdn by referring to 5.1.6 Function: GetNEFDN.

neFdn

Return Value
Refers to the NE performance measurement objects that are obtained through the GetNeObjInfo function. The objects are displayed in a list and the format is [neObjInfo1, neObjInfo2, ...]. Each item in the list is a tuple and its format is (Measurement object sequence number, Measurement object name).

Error Handling
None.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-191

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Example
fdn=GetNEFDN('Real_RNC_170') neObjInfo=GetNeObjInfo(67109435,fdn) Print(neObjInfo)

Resut
[(1835627379,'Real_RNC_170/RncFunction:All'),(1702000229,'Real_RNC_170/ RncFunction:Real_RNC_170')]

5.6.26 Function: GetCounterInfo


The GetCounterInfo function is used to obtain the information about performance counters based on the function subset IDs and measurement periods of NEs.

Synopsis
GetCounterInfo(funcSubsetId, period, neTypeID, neFdnLst)

Note
None.

Parameter Description
Parameter funcSubsetId Description funcSubsetId is an integer and refers to the function subset ID of an NE. You can obtain funcSubsetId by referring to 5.6.28 Function: GetFuncSubSetList. period is an enumerated value and refers to the measurement period of an NE, which can take on the following values: l P5: 5 minutes l P15: 15 minutes l P30: 30 minutes l P60: 60 minutes l P1440: 1440 minutes (24 hours) neTypeId neTypeId is an integer and refers to the type ID of an NE. You can obtain the type ID of an NE by referring to 5.1.10 Function: GetNETypeIDByName. neFdnLst is a list. Each element in the list is a string and refers to an FDN.

period

neFdnLst

5-192

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Return Value
Refers to the NE performance counters that are obtained through the GetCounterInfo function and displayed in a list. The list format is [counterInfo1, counterInfo2, ...]. Each item in the list is a tuple and its format is (Counter ID, Counter name).

Error Handling
None.

Example
couerInfo=GetCounterInfo(67109473,P30) Print(couerInfo)

Resut
[(67192134, 'VS.IUB.CongUL'), (67192135, 'VS.IUB.CongDL'), (67203852, 'VS.NodeB.Ratio.of.UnavailTime.OM'), (67203853, 'VS.NodeB.UnavailTime.OM'), (67203854, 'VS.IUB.TimeCongUL'), (67203855, 'VS.IUB.TimeCongDL')]

5.6.27 Function: GetFuncSetList


The GetFuncSetList function is used to obtain the information about NE function sets based on NE types.

Synopsis
GetFuncSetList(neTypeId)

Note
None.

Parameter Description
Parameter neTypeId Description neTypeId is an integer and refers to the type ID of an NE. You can obtain the type ID of an NE by referring to 5.1.10 Function: GetNETypeIDByName.

Return Value
Refers to the NE function sets that are obtained through the GetFuncSetList function and are displayed in a list. The list format is [counterInfo1, counterInfo2, ...]. Each item in the list is a tuple and its format is (Function set ID, Function set name).

Error Handling
None.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-193

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Example
funList=GetFuncSetList(4) Print(funList)

Resut
[(67109365, 'Measurements related to Algorithm'), (67109366, 'Measurements related to AMR'), (67109368, 'Measurements related to CPU'),...]

5.6.28 Function: GetFuncSubSetList


The GetFuncSubSetList function is used to obtain the information about NE function subsets based on the IDs of NE function sets.

Synopsis
GetFuncSubSetList(funcsetId)

Note
None.

Parameter Description
Parameter funcsetId Description funcsetId is an integer and refers to the ID of an NE function set. You can obtain the ID of an NE function set by referring to 5.6.27 Function: GetFuncSetList.

Return Value
Refers to the function subsets of a specified NE function set, which are obtained through the GetFuncSubSetList function and displayed in a list. The list format is [funcSubsetInfo, funcSubsetInfo 1, ...]. Each item in the list is a tuple and its format is (Function subset ID, Function subset name).

Error Handling
None.

Example
subSetList=GetFuncSubsetList(67109365) Print(subSetList)

5-194

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Resut
[(67109391, 'Measurement related to Algorithm per cell'), (67109473, 'Measurement related to Algorithm per NodeB')]

5.6.29 Function: GetMoiAttrValueList


The GetMoiAttrValueList function is used to obtain MOI attribute values based on the MOI information and the list of attribute names.

Synopsis
GetMoiAttrValueList(moiuni, attrList)

Note
None.

Parameter Description
Parameter moiuni Description moiuni is a tuple whose length is 3 and whose format is (objID, moiFdn, neFdn). The meanings of elements in the tuple are as follows: l objId: MOI ID l moiFdn: MOI FDN l neFdn: NE FDN attrList attrList is a list of attribute names. Each element in the list is a string.
NOTE If the list of attribute names is [], that is, the list is null, it indicates that all attribute values of this MOI are to be queried.

Return Value
Refers to the MOC attribute values obtained through the GetMoiAttrValueList function and displayed in a list. The list format is [value1, value2, ...].

Error Handling
None.

Example 1
moi=(3221987331L, '.3221287013.3221975040.3221979139.3221987331', \ '.3221229568.3221233664.3221287013') moiattr=GetMoiAttrValueList(moi,[]) Print(moiattr)

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-195

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Result of Example 1
['NULL', 'NULL', 'NULL', 'NULL', 'Cabinet No.=0, Site Index=3', '116', 'NULL']

Example 2
moi=(3221987329L, '.3221287013.3221975040.3221979136.3221987328', \ '.3221229568.3221233664.3221287013') moiattr=GetMoiAttrValueList(moi,['CabinetGrpNo', 'CabinetNo', \ 'CabinetType', 'name', 'SiteIndex', 'neID']) Print(moiattr)

Result of Example 2
['NULL', 'NULL', 'NULL', 'Cabinet No.=0, Site Index=1', 'NULL', '116']

5.6.30 Function: GetMoiListByFilter


The GetMoiListByFilter function is used to query the MOIs of an MOC based on the MOC name, NE FDN, and filtering conditions.

Synopsis
GetMoiListByFilter(mocName, neFdn, attrFilters)

Note
None.

Parameter Description
Parameter mocName neFdn Description mocName is a string and refers to the MOC name. neFdn is a string and refers to the NE FDN.

5-196

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter attrFilters

Description attrFilters is a list of filtering condition. The list format is [filter1, filter2, ]. Each element in attrFilters is a list whose length is 4 and whose format is [attr1, attr2, attr3, attr4]. The descriptions of the elements are as follows: l attr1: Refers to an enumerated value that is used to specify the relation between this filtering condition and the subsequent filtering condition. The values and meanings are as follows: AND: The filtering condition and the subsequent filtering condition must be met at the same time. AND: The filtering condition and the subsequent filtering condition need not be met at the same time. End: No subsequent filtering condition exists. l attr2: Refers to a string that is used to specify the name of an MOI attribute. You can obtain the name of an MOI attribute by referring to 5.6.23 Function: GetMocAttrNameList. l attr3: Refers to a string. l attr4: Refers to an enumerated value that is used to specify the relation between attr2 and attr3. The values and meanings are as follows: R: Greater than L: Less than Equal: Equal to Unequal: Unequal to BEqual: Greater than or equal to LEqual: Less than or equal to
NOTE If the filtering condition is [], that is, there is no filtering condition, it indicates that all MOIs of all MOCs are to be queried.

Return Value
Refers to the list of the MOIs obtained through the GetMoiListByFilter function. The tuple format is [MOI1, MOI2, ]. Each element in the list is a tuple and its format is (objId, moiFdn, neFdn). The meanings of the elements in the tuple are as follows: l l l objId: MOI ID moiFdn: MOI FDN neFdn: NE FDN

Error Handling
None.

Example 1
#Get the Fdn of the NE

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-197

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

fdn=GetNEFDN('ty') mocuni=GetMoiListByFilter('BSC6000SiteCabinet',fdn,[]) Print(mocuni)

Result of Example 1
[(3221987328L, '.3221287013.3221975040.3221979136.3221987328', '. 3221229568.3221233664.3221287013'), (3221987329L, '.3221287013.3221975040.3221979137.3221987329', '. 3221229568.3221233664.3221287013'), (3221987330L, '.3221287013.3221975040.3221979138.3221987330', '. 3221229568.3221233664.3221287013'), (3221987331L, '.3221287013.3221975040.3221979139.3221987331', '. 3221229568.3221233664.3221287013'), (3221987332L, '.3221287013.3221975040.3221979140.3221987332', '. 3221229568.3221233664.3221287013')]

Example 2
#Get the Fdn of the NE fdn=GetNEFDN('ty') mocuni=GetMoiListByFilter('BSC6000SiteCabinet',fdn,[(END,'name','Cabinet No.=0, \ Site Index=1',Equal)]) Print(mocuni)

Result of Example 2
[(3221987329L,'.3221287013.3221975040.3221979137.3221987329','. 3221229568.3221233664.3221287013')]

5.6.31 Function: GetPmNeType


The GetPmNeType function is used to obtain the information about NE types, including the names and IDs of NE types.

Synopsis
GetPmNeType([typeName])

Note
None.

Parameter Description
Parameter typeName Description typeName is a string and refers to the type name of an NE. This parameter is optional.

Return Value
The information obtained through the GetPmNeType function varies based on the actual situation, that is, whether parameters are provided when the function is invoked:
5-198 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

If parameters are not provided, the information obtained through the function consists of the names and IDs of NE types and is displayed in a list. The list format is [netypeInfo1, netypeInfo2, ...]. Each element in the list is a tuple and its format is (NE type ID, NE type name). If parameters are provided, the information obtained through the function consists of the names and IDs of the NE types specified by typeName. The information is a tuple and its format is (NE type ID, NE type name).

Error Handling
None.

Example 1
neInfo=GetPmNeType() Print(neInfo)

Result of Example 1
[(76, 'BSC6000'), (69, 'CBSC'), (6, 'MGW'), (5, 'MSCServer'), (3, 'NodeB'), (4, 'RNC'), (11, 'SG7000'), (7, 'SGSN'), (77, 'SPS')]

Example 2
neInfo=GetPmNeType('RNC') Print(neInfo)

Result of Example 2
(4, 'RNC')

5.6.32 Function: GetNeInfo


The GetNeInfo function is used to obtain the NE information based on the NE FDN, such as the NE name and type ID.

Synopsis
GetNeInfo(neFdn)

Note
None.

Parameter Description
Parameter neFdn Description neFdn is a string and refers to the NE FDN.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-199

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Return Value
Refers to a tuple obtained through the GetNeInfo function. The tuple format is (NE name, NE type ID).

Error Handling
None.

Example
neFdn='.3221229568.3221274624.3221278720' neinfo=GetNeInfo(neFdn) Print(neinfo)

Resut
('RNC_cjw', 1)

5.6.33 Function: CloseDB


This describes the CloseDB function, which enables you to close the connection with the database center.

Synopsis
CloseDB()

Note
Call 5.6.2 Function: OpenDB to connect to the database before calling this function.

Parameter Description
None

Return Value
The return value is an integer. If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
#Connect the database. OpenDB("admin", "11111111") #Close the database connection. returncode = CloseDB() Print('CloseDB() return: ' + str(returncode))

5-200

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Result
CloseDB() return: 1

5.7 Alarm Operation Function


This describes the alarm operation function. This function enables you to send to the N2000 UMS the detected exceptions during the running of a script. In this way, you can monitor and manage the exceptions occurred on the network. The alarms that can be sent are fault alarms, clearance alarms, and event alarms. 5.7.1 Overview of Alarm Operation Function This describes the alarm operation function. By using this function, you can send alarm information to the N2000 UMS. 5.7.2 Function: SendAlarm This section describes the SendAlarm function, which enables you to send OMC alarm information to the N2000 UMS. The alarm information includes alarm IDs, alarm categories, and alarm details.

5.7.1 Overview of Alarm Operation Function


This describes the alarm operation function. By using this function, you can send alarm information to the N2000 UMS. When maintaining and monitoring a network, you are always required to report the exceptions occurred on the system. The alarm operation functions provided by the iSStar well assist you in this task. The alarm information sent by the alarm sending functions are saved in the alarm database. You can view the information about the sent alarms on the N2000 UMS client. Table 5-16 lists the alarm operation functions. Table 5-16 Alarm function list Function 5.7.2 Function: SendAlarm Description Sends alarms to the system.

5.7.2 Function: SendAlarm


This section describes the SendAlarm function, which enables you to send OMC alarm information to the N2000 UMS. The alarm information includes alarm IDs, alarm categories, and alarm details.

Synopsis
SendAlarm(alarmID, category, alarmInfo)

Precautions
This function is used only for remote tasks. It runs on the server.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-201

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Description
Parameter alarmID Description Refers to the ID of an alarm or event. The parameter value is an integer. The value of alarmID can only be the ID of an OMC alarm or OMC event. l Alarm ID: Monitor > Browse Alarm List l Event ID: Monitor > Query Event Logs category Refers to an alarm category. The parameter value is an integer. The specific meanings are as follows: l 1: Fault alarm l 2: Clearance alarm. A clearance alarm can be sent only when the corresponding fault alarm exists. l 3: Event alarmInfo Refers to the details about an alarm or event. The parameter value is a string.

Return Value
The return value is an integer. If this function is called successfully, 0 is returned. Otherwise, a different value is returned.

Error Handling
None.

Example
Print("Sending an event: event ID:600, category:Event event information,:alarm detail") ret = SendAlarm(600, 3, 'alarm detail') Print("To View the event, please click Monitor->Query Event Logs")

Result
Sending an event: event ID:600, category:Event event information,:alarm detail To View the Alarms,please click Monitor->Query Event Logs

5.8 OM Operation Function


This describes the OM operation function. This function enables you to obtain the version number of the NM software, record the operations of a script and generate logs, and obtain the information of the subareas of the NE. 5.8.1 Overview of OM Operation Function
5-202 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

OM operation functions refer to the om version query function, the log recording function and the subarea query funtion. 5.8.2 Function: GetOMCVersion This describes the GetOMCVersion function. This function enables you to obtain the version number of the current NM system. 5.8.3 Function: LOG_OP This describes the LOG_OP function. This function records the operations of a script and generates operation logs. 5.8.4 Function: GetAllSubareaInformation This describes the GetAllSubareaInformation function, This function enables you to obtain the information of all subareas, including their host names, fixed IPs and floating IPs. 5.8.5 Function: GetFdnListByHostname This describes the GetFdnListByHostname function, This function enables you to obtain the list of the FDNs of all NEs under a subarea according to its host name. 5.8.6 Function: GetHostNameByNeFdn This describes the GetHostNameByNeFdn function, This function enables you to obtain the information of the subarea that an NE belongs to according to its FDN. The information includes its host name, fixed IP and floating IP.

5.8.1 Overview of OM Operation Function


OM operation functions refer to the om version query function, the log recording function and the subarea query funtion. By using the OM operation functions provided by the iSStar, you can obtain the version information about the current NM. In addition, you can record the operations of the codes in a script anytime and generate operation logs that you can query on the N2000 UMS client, and you can query the information about the subareas. Table 5-17 lists the OM operation functions. Table 5-17 OM function list Function 5.8.3 Function: LOG_OP 5.8.2 Function: GetOMCVersion 5.8.4 Function: GetAllSubareaInformation 5.8.5 Function: GetFdnListByHostname 5.8.6 Function: GetHostNameByNeFdn Description Records the operations of a script and generates operation logs. Returns the version number of the current NM system. Obtains the information of all subareas, including their host names, fixed IPs and floating IPs. Obtains the list of the FDNs of all NEs under a subarea according to its host name. Obtains the information of the subarea that an NE belongs to according to its FDN. The information includes its host name, fixed IP and floating IP.
5-203

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.8.2 Function: GetOMCVersion


This describes the GetOMCVersion function. This function enables you to obtain the version number of the current NM system.

Synopsis
GetOMCVersion ()

Note
None

Parameter Description
None

Return Value
The return value is a string. If this function is called successfully, the version string is returned. Otherwise, None is returned.

Error Handling
None

Example
version = GetOMCVersion() Print("OMC Version is: %s"%version)

Result
OMC Version is: iManagerM2000V200R0010C00SPC100

5.8.3 Function: LOG_OP


This describes the LOG_OP function. This function records the operations of a script and generates operation logs.

Synopsis
LOG_OP(opName, targetName, detailInfo, auditResult)

Note
This function can be used for only a local task. It is run on the client.
5-204 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Description
Parameter opName targetName detailInfo auditResult Description opName is a string. It indicates the operation name. targetName is a string. It indicates the name of the operation object. detailInfo is a string. It indicates the operation details. detailInfo is an integer. The meanings are as follows: l 0: The operation succeeded. l 1: The operation failed. l 2: The operation partially succeeded. l 3: The operation started.

Return Value
The return value is null.

Error Handling
None

Example
Print("operation log:operation:my op,object:OMC,details:op details,result:success") LOG_OP("my op", 'OMC', 'op details', 0) Print("To view the Operation Logs,please Click System->Log Management->Query Operation Logs")

Result
operation log:operation:my op,object:OMC,details:op details,result:success To view the Operation Logs,please Click System->Log Management->Query Operation Logs

5.8.4 Function: GetAllSubareaInformation


This describes the GetAllSubareaInformation function, This function enables you to obtain the information of all subareas, including their host names, fixed IPs and floating IPs.

Synopsis
GetAllSubareaInformation()

Note
None
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-205

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Description
None

Return Value
The return value is a list of subareas, whose form is as follows: [SubareaInfo1, SubareaInfo2, ...]. Each item in the list is a tuple and its format is (The host name of the subarea, the fixed IP of the subarea, the floating IP of the subarea).

Error Handling
None

Example
subinfo=GetAllSubareaInformation() Print(subinfo)

Result
[('HOST01', '10.71.15.35', '10.71.15.35'), ('HOST02', '10.71.15.75', '10.71.15.75')]

5.8.5 Function: GetFdnListByHostname


This describes the GetFdnListByHostname function, This function enables you to obtain the list of the FDNs of all NEs under a subarea according to its host name.

Synopsis
GetFdnListByHostname(hostname)

Note
None

Parameter Description
Parameter hostname Description hostnamea string and refers to the host name of a subarea.

Return Value
The return value is a list, which refers to the FDNs of the NEs under a subarea.

Error Handling
None
5-206 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Example
fdnlist= GetFdnListByHostname('HOST01') Print(fdnlist)

Result
['.3221229568.3221278720.3221282822','.3221229568.3221278720.3221282823', '. 3221229568.3221278720.3221282826']

5.8.6 Function: GetHostNameByNeFdn


This describes the GetHostNameByNeFdn function, This function enables you to obtain the information of the subarea that an NE belongs to according to its FDN. The information includes its host name, fixed IP and floating IP.

Synopsis
GetHostNameByNeFdn(neFdn)

Note
None

Parameter Description
Parameter neFdn Description neFdn is a string and refers to the NE FDN. You can obtain neFdn by referring to 5.1.6 Function: GetNEFDN.

Return Value
The return value is a tuple, which is in the format (The host name of the subarea, the fixed IP of the subarea, the floating IP of the subarea).

Error Handling
None

Example
fdn = GetNEFDN("GU240") Print("FDN: " + fdn) hostnameip= GetHostNameByNeFdn (fdn) Print(hostnameip)

Result
FDN : .3221229568.3221278720.3221282825 ('HOST02', '10.71.15.75', '10.71.15.75')

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-207

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.9 Type Conversion Functions


The iSStar uses the type conversion function to provide the exception protection mechanism for data type conversion. This prevents the script execution from being terminated by a conversion error. 5.9.1 Overview of the Type Conversion Functions The type conversion functions provided by the iSStar form a protection mechanism that is used in the case of type conversion error. This prevents the error from terminating the entire script execution process. 5.9.2 Function: String2Int This function convert a string into an integer value. 5.9.3 Function: String2Float This function converts a string into a float value. 5.9.4 Function: String2Long This function converts a string into a long value. 5.9.5 Function: Sequence2Tuple This function converts a sequence into a tuple. 5.9.6 Function: Sequence2List This function converts a sequence into a list. 5.9.7 Function: ToString This function converts a value of any type into a string.

5.9.1 Overview of the Type Conversion Functions


The type conversion functions provided by the iSStar form a protection mechanism that is used in the case of type conversion error. This prevents the error from terminating the entire script execution process. Table 5-18 lists the type conversion functions provided by the iSStar. Table 5-18 List of type conversion functions Function 5.9.2 Function: String2Int 5.9.3 Function: String2Float 5.9.4 Function: String2Long 5.9.5 Function: Sequence2Tuple Description This function convert a string into an integer value. This function converts a string into a float value. This function converts a string into a long value. This function converts a sequence into a tuple.

5-208

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Function 5.9.6 Function: Sequence2List 5.9.7 Function: ToString

Description This function converts a sequence into a list. This function converts a value of any type into a string.

5.9.2 Function: String2Int


This function convert a string into an integer value.

Synopsis
String2Int(value)

Note
The conversion rule of this interface is the same as that of Python. If the value is empty or the string cannot map to an integer value, the conversion fails.

Description
Parameter value String to be converted. Description

Return Value
The function returns a binary tuple. l l The value of the first element in the tuple is Boolean. True indicates that the type conversion succeeds. False indicates that the type conversion fails. The second element is the integer value after conversion.

Error Handling
None.

Example
Print("================String2Int(value) Wrong====================") Print(String2Int('')) Print(String2Int('3.0')) Print("================String2Int(value) Correct====================") Print(String2Int('3')) Print(String2Int('-3'))

Result
================String2Int(value) Wrong==================== (False, '')

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-209

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

(False, '3.0') ================String2Int(value) Correct==================== (True, 3) (True, -3)

5.9.3 Function: String2Float


This function converts a string into a float value.

Synopsis
String2Float(value)

Note
The conversion rule of this interface is the same as that of Python. If the value is empty or the string cannot map to a float value, the conversion fails.

Description
Parameter value String to be converted. Description

Return Value
The function returns a binary tuple. l l The value of the first element in the tuple is Boolean. True indicates that the type conversion succeeds. False indicates that the type conversion fails. The second element is the float value after conversion.

Error Handling
None.

Example
Print("================String2Float(value) Wrong====================") Print(String2Float('')) Print(String2Float('abc')) Print("================String2Float(value) Correct====================") Print(String2Float('3.0')) Print(String2Float('0.5'))

Result
================String2Float(value) Wrong==================== (False, '') (False, 'abc') ================String2Float(value) Correct==================== (True, 3.0) (True, 0.5)

5-210

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.9.4 Function: String2Long


This function converts a string into a long value.

Synopsis
String2Long(value)

Note
The conversion rule of this interface is the same as that of Python. If the value is empty or the string cannot map to a long value, the conversion fails.

Description
Parameter value String to be converted. Description

Return Value
The function returns a binary tuple. l l The value of the first element in the tuple is Boolean. True indicates that the type conversion succeeds. False indicates that the type conversion fails. The second element is the long value after conversion.

Error Handling
None.

Example
Print("================String2Long(value) Wrong====================") Print(String2Long('')) Print(String2Long('3.0')) Print("================String2Long(value) Correct====================") Print(String2Long('3')) Print(String2Long('-3'))

Result
================String2Long(value) Wrong==================== (False, '') (False, '3.0') ================String2Long(value) Correct==================== (True, 3L) (True, -3L)

5.9.5 Function: Sequence2Tuple


This function converts a sequence into a tuple.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-211

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Synopsis
Sequence2Tuple(value)

Note
The conversion rule of this interface is the same as that of Python. If the value is not a sequence, the conversion fails.

Description
Parameter value Description Sequence to be converted, such as strings, tuples, lists, and dictionaries. For dictionaries, the collection of key values of the dictionaries is converted to a tuple.

Return Value
The function returns a binary tuple. l l The value of the first element in the tuple is Boolean. True indicates that the type conversion succeeds. False indicates that the type conversion fails. The value of the second element is the tuple after conversion.

Error Handling
None.

Example
Print("================Sequence2Tuple(value) Wrong====================") Print(Sequence2Tuple(123)) Print("================Sequence2Tuple(value) Correct====================") Print(Sequence2Tuple("abc")) Print(Sequence2Tuple([1,2,3]))

Result
================Sequence2Tuple(value) Wrong==================== (False, 123) ================Sequence2Tuple(value) Correct==================== (True, ('a', 'b', 'c')) (True, (1, 2, 3))

5.9.6 Function: Sequence2List


This function converts a sequence into a list.

Synopsis
Sequence2List(value)
5-212 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Note
The conversion rule of this interface is the same as that of Python. If the value is not a sequence, the conversion fails.

Description
Parameter value Description Sequence to be converted, such as strings, tuples, lists, and dictionaries. For dictionaries, the collection of key values of the dictionaries is converted to a tuple.

Return Value
The function returns a binary tuple. l l The value of the first element in the tuple is Boolean. True indicates that the type conversion succeeds. False indicates that the type conversion fails. The value of the second element is the list after conversion.

Error Handling
None.

Example
Print("================Sequence2List(value) Wrong====================") Print(Sequence2List(123)) Print("================Sequence2List(value) Correct====================") Print(Sequence2List('abc')) Print(Sequence2List((1,2,3)))

Result
================Sequence2List(value) Wrong==================== (False, 123) ================Sequence2List(value) Correct==================== (True, ['a', 'b', 'c']) (True, [1, 2, 3])

5.9.7 Function: ToString


This function converts a value of any type into a string.

Synopsis
ToString(value)

Note
The conversion rule of this interface is the same as that of Python.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-213

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Description
Parameter value Description Data to be converted. The data can be of any type.

Return Value
The function returns a binary tuple. l l The value of the first element in the tuple is Boolean. True indicates that the type conversion succeeds. False indicates that the type conversion fails. The second element is the string after conversion.

Error Handling
None.

Example
Print("================ToString(value)====================") a=[1] b={"b":2} c=(a,b,3) Print(ToString(a)) Print(ToString(b)) Print(ToString(c)) Print(ToString(None))

Result
================ToString(value)==================== (True, '[1]') (True, "{'b': 2}") (True, "([1], {'b': 2}, 3)") (True, 'None')

5.10 Time Functions


This topic describes the time functions which enable you to obtain the information related to time and provide the function for converting time formats. 5.10.1 Overview of the Time Functions The time function provided in the iSStar can be used to obtain the information on time. 5.10.2 Time Format This topic describes all the time formats contained in the return value string (StrfTime). 5.10.3 Time Tuple A time tuple includes the following elements: year, month, date, hour, minute, second, week, day, and DST. The return value of the LocalTime or GMTime function is a time tuple. 5.10.4 Function: GMTime This function is used to return the GMT time according to the difference (second) of the GMT time and the epoch time. If you only know the difference of the GMT time and the epoch time,
5-214 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

you can obtain the specific GMT time through the GMTime function. Greenwich Mean Time (GMT) is also called Universal Coordinated Time (UTC). 5.10.5 Function: LocalTime This function is used to return the local time according to the difference (second) of the local time and the epoch time. If you only know the difference of the local time and the epoch time, you can obtain the specific local time through the LocalTime function. 5.10.6 Function: MkTime This function returns the difference between the GMT time (or local time) and the epoch time. The unit is second. 5.10.7 Function: Sleep This function is used to continue to execute the next statement after pausing the required time. 5.10.8 Function: StrfTime This function is used to convert the time represented in tuple into the string in a specified time format. 5.10.9 Function: StrpTime This function is used to convert the time string in a specified format into the time tuple. 5.10.10 Function: Time This function enables you to obtain the GMT time and convert it into the difference (expressed in second) between 1970/01/01 00:00:00 and the current local time. 5.10.11 Function: CTime This function enables you to obtain the string of the local time. 5.10.12 Function: AscTime This function enables you to convert the tuple indicating the time into a string containing 24 characters.

5.10.1 Overview of the Time Functions


The time function provided in the iSStar can be used to obtain the information on time. Through the time function, you can obtain the Greenwich Mean Time (GMT) time and local time. Also, you can convert the format of the obtained time. The time functions provided in the iSStar is listed in Table 5-19. Table 5-19 List of time functions Function 5.10.4 Function: GMTime 5.10.5 Function: LocalTime 5.10.6 Function: MkTime 5.10.7 Function: Sleep Description This function is used to return the GMT time according to the difference of the GMT time and the epoch time. This function is used to return the local time according to the difference (second) of the local time and the epoch time. This function returns the difference between the GMT time (or local time) and the epoch time. The unit is second. This function is used to continue to execute the next statement after pausing the required time.
5-215

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Function 5.10.8 Function: StrfTime 5.10.9 Function: StrpTime 5.10.10 Function: Time

Description This function is used to convert the time represented in tuple into the string with a specified time format. This function is used to convert the time string in a specified format into the time tuple. This function is used to obtain the GMT time and converts it into the difference (second) of the epoch time (1970/01/01 00:00:00) and the current GMT time. This function is used to obtain the local time string. This function is used to convert the tuple indicating the time into the string containing 24 characters.

5.10.11 Function: CTime 5.10.12 Function: AscTime

5.10.2 Time Format


This topic describes all the time formats contained in the return value string (StrfTime).

Time Format
Format %a %A %b %B %c %d %H %I %j %m %M %p %S %U Description Abbreviated weekday name in the local time. Full weekday name in the local time. Abbreviated month name in the local time. Full month name in the local time. Appropriate date and time representation in the local time. Day of the month as a decimal number [01, 31]. Hour (24-hour clock) as a decimal number [00, 23]. Hour (12-hour clock) as a decimal number [01,12]. Day of the year as a decimal number [001, 366]. Month as a decimal number [01,12]. Minute as a decimal number [00, 59]. Equivalent of either AM or PM in the local time. Second as a decimal number [00, 59]. Week number of the year (Sunday as the first day of the week) as a decimal number [00, 53]. All days in a new year preceding the first Sunday are considered to be in week 0.

5-216

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Format %w %W %x %X %y %Y %Z %%

Description Weekday as a decimal number [0(Sunday),6]. Week number of the year (Monday as the first day of the week) as a decimal number [00, 53]. All days in a new year preceding the first Monday are considered to be in week 0. Appropriate date representation in the local time. Appropriate time representation in the local time. Year without century as a decimal number [00, 99]. Year with century as a decimal number. Time zone name (no characters if no time zone exists). A literal "%" character.

5.10.3 Time Tuple


A time tuple includes the following elements: year, month, date, hour, minute, second, week, day, and DST. The return value of the LocalTime or GMTime function is a time tuple.

Tuple Elements
No. 0 1 2 3 4 5 6 7 Element Year Month Date Hour Minute Second Week Day Value Range 0-9999 1-12 1-31 0-23 0-59 0-59 0-6 1-366 Description Full year name, for example, 2006 Month as a numerical value Date as a numerical value Hour, in 24-hour format, as a numerical value Minute as a numerical value Second as a numerical value Weekday as a numerical value (0 indicates Monday) Day of the year as a numerical value 1 indicates that the DST is used. 0 indicates that the DST is not used. -1 indicates that the DST is not available.
5-217

DST

-1, 0, and 1

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.10.4 Function: GMTime


This function is used to return the GMT time according to the difference (second) of the GMT time and the epoch time. If you only know the difference of the GMT time and the epoch time, you can obtain the specific GMT time through the GMTime function. Greenwich Mean Time (GMT) is also called Universal Coordinated Time (UTC).

Synopsis
GMTime([Secs])

Note
None.

Parameter Description
Parameter Name Secs Description Secs is a floating number with the unit represented in second. The time starts from 1970/01/01 00:00:00. The default of secs is the return value of invoking the Time function.

Return Value
The return value is a tuple, which contains year, month, date, hour, minute, second, week, day, and DST. For details about the structure of a tuple, see Time Tuple.

Error Handling
None.

Example
#Get and print the current GMT time. Convert 30 into a GMT time. Print(GMTime()) # The current time in GMT format. Print(GMTime(30)) # The time 30 seconds in GMT format.

Result
(2006, 10, 12, 6, 16, 55, 3, 285, 0) (1970, 1, 1, 0, 0, 30, 3, 1, 0)

5.10.5 Function: LocalTime


This function is used to return the local time according to the difference (second) of the local time and the epoch time. If you only know the difference of the local time and the epoch time, you can obtain the specific local time through the LocalTime function.
5-218 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Synopsis
LocalTime([Secs])

Note
None.

Parameter Description
Parameter Name Secs Description Secs is a floating number with the unit expressed in second. The time starts from 1970/01/01 00:00:00. The default of Secs is the return value of invoking the Time function.

Return Value
A tuple, which contains year, month, date, hour, minute, second, week, day, and DST, is returned.

Error Handling
None.

Example
(year,month,day) = LocalTime()[0:3] #Get the local time and the values of year, month, and date. Print("%d/%d/%d"%(day,month,year))

Result
13/10/2006

5.10.6 Function: MkTime


This function returns the difference between the GMT time (or local time) and the epoch time. The unit is second.

Synopsis
MkTime([t])

Note
None.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-219

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Description
Parameter Name Description The value elements of t is consists of year, month, day, hour, minute, second, week, date number, and DST. It can be the return value of LocalTime() or GMTime(). For details about the value format, see5.10.3 Time Tuple.

Return Value
A floating number with the unit expressed in second. The time starts from 1970/01/01 00:00:00.

Error Handling
None.

Example
Print(MkTime(GMTime())) #According to the GMT time, obtain the difference (in second) between the GMT time and #the epoch time (1970/01/01 00:00:00). Print(MkTime(LocalTime())) #According to the local time, obtain the difference (in second) between the local time #and the epoch time (1970/01/01 00:00:00).

Result
1210213390.0 1210184590.0

5.10.7 Function: Sleep


This function is used to continue to execute the next statement after pausing the required time.

Synopsis
Sleep(Secs)

Note
None.

Parameter Description
Parameter Name Secs Description The Secs parameter is of the numeric type. It indicates the paused time. The unit is expressed in second. Secs can be a decimal.

5-220

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Return Value
None.

Error Handling
None.

Example
t1 = CTime() Print('Sleep begins:%s'%t1) Sleep(10) t2 = CTime() Print('Sleep ends:%s'%t2)

Result
Sleep begins:Tue Jan 08 09:33:55 2008 Sleep ends:Tue Jan 08 09:34:05 2008

5.10.8 Function: StrfTime


This function is used to convert the time represented in tuple into the string in a specified time format.

Synopsis
StrfTime(format[,t])

Note
None.

Parameter Description
Parameter Name format t Description It is used to define the time format. For details, see the Time Format function. t indicates the time. It is a tuple containing nine elements. The default return value is the return value of the LocalTime function. The parameter t can be the return value of the GMTime or LocalTime function.

Return Value
The formatted time string is returned.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-221

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Error Handling
None.

Example
Print(StrfTime("%a, %d %b %Y %H:%M:%S +0000", GMTime()))

Result
Fri, 13 Oct 2006 09:52:24 +0000

5.10.9 Function: StrpTime


This function is used to convert the time string in a specified format into the time tuple.

Synopsis
StrpTime(string[,format])

Note
The time string must match with the time format.

Parameter Description
Parameter string format Description It is a time string to be converted. It is used to define the time format. This parameter is optional. If you do not set it, the default value is "%a %b %d %H:%M:% S %Y". For details, see the 5.10.2 Time Format.

Return Value
In case of success, return the time tuple. Otherwise, the exception information is displayed.

Error Handling
None

Example
time= LocalTime() Print(time) stringtype = StrfTime("%a %d %b %Y %H:%M:%S +0000",time) Print(stringtype) tupletype = StrpTime(stringtype,"%a %d %b %Y %H:%M:%S +0000") Print(tupletype)

5-222

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Result
(2008, 1, 7, 15, 6, 51, 0, 7, 0) Mon 07 Jan 2008 15:06:51 +0000 (2008, 1, 7, 15, 6, 51, 0, 7, -1)

5.10.10 Function: Time


This function enables you to obtain the GMT time and convert it into the difference (expressed in second) between 1970/01/01 00:00:00 and the current local time.

Synopsis
Time()

Note
None

Parameter Description
None.

Return Value
The time difference of a floating number is returned.

Error Handling
None.

Example
#Get the GMT time. secs = Time() #Output the GMT time. Print("GMT in seconds : " + str(secs) + " S") Print("The tuple representation of the GMT time: " + str(GMTime(secs)) ) Print("---------------------------------") #Output the hour, minute, and second of the GMT time. Print(StrfTime("%H:%M:%S", GMTime(secs) )) #Add 3600 S, that is, one hour, to secs. #Then, output the hour, minute, and second of the result. Print(StrfTime("%H:%M:%S", GMTime(secs + 3600) ))

Result
The numeric representation of the GMT time: 1160821557.89S The tuple representation of the GMT time: (2006, 10, 14, 10, 25, 57, 5, 287, 0) --------------------------------10:25:57 11:25:57

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-223

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.10.11 Function: CTime


This function enables you to obtain the string of the local time.

Synopsis
CTime()

Note
None.

Parameter Description
None.

Return Value
A string is returned, representing the local time. The format is Week Month Date Hour: Minute: Second Year.

Error Handling
None.

Example
#Return and print the string of the local time. Print(CTime())

Result
Mon Sep 11 14:51:15 2006

5.10.12 Function: AscTime


This function enables you to convert the tuple indicating the time into a string containing 24 characters.

Synopsis
AscTime([t])

Note
None.

5-224

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Description
Parameter Description t is a tuple, which can be the return value of GMTime or LocalTime. For details of the structure, see the Time Tuple function. The default value is the return value of the LocalTime function.
NOTE If t is not provided, the current time returned by the LocalTime function is used.

Return Value
The return value is a string in the format of Week Month Day Hour: Minute: Second Year.

Error Handling
None.

Example
t = AscTime() Print(t) t = AscTime(GMTime()) Print(t) t = AscTime(LocalTime()) Print(t)

Result
Tue Nov 07 21:14:26 2006 Tue Nov 07 13:14:26 2006 Tue Nov 07 21:14:26 2006

5.11 Input and Output Functions


This topic describes input and output functions and the function of setting the output mode. 5.11.1 Overview of Input and Output Functions The iSStar provides input and output functions. These functions are used to set the information output mode, obtain the user input information, and display the output information. 5.11.2 Function: UserInput This function enables you to export the prompt information and obtain the strings entered from the client. The input information ends with Enter. InputText() is the alias of the UserInput() function. 5.11.3 Function: UserOutput The function UserOutput() is used to receive strings entered by the user on the client. OutputText () is the alias of the UserOutput() function. 5.11.4 Function: SetOutMode This function enables you to set the output mode of the Print function.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-225

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.11.5 Function: SetOutFlag This function enables you to set the output switch of the Print function. 5.11.6 Function: SetOutFileName This function enables you to set the output file of the Print function. To call the SetOutMode function to set the output file of the Print function, you need to call the SetOutFileName function to set the output file name. 5.11.7 Function: Print This function enables you to output the string information to a target object. The target object is set by the SetOutMode function. 5.11.8 Function: GetOutputPath This function enables you to obtain the default output path of the task. 5.11.9 Function: NotifyProgress This function is used to view the execution progress of the task on the iSStar Task Manage Window progress bar.

5.11.1 Overview of Input and Output Functions


The iSStar provides input and output functions. These functions are used to set the information output mode, obtain the user input information, and display the output information. The output functions allow you to output the running information of the task to the interface or a specified file in the set output mode. The input functions allow you to input the information required when the task is running. Table 5-20 lists the input and output functions provided by the iSStar. Table 5-20 List of input and output functions Function 5.11.2 Function: UserInput 5.11.3 Function: UserOutput 5.11.4 Function: SetOutMode 5.11.5 Function: SetOutFlag 5.11.6 Function: SetOutFileName 5.11.7 Function: Print 5.11.8 Function: GetOutputPath Description This function is used to obtain entered strings from the client. The function UserOutput() is used to receive strings entered by the user on the client. OutputText() is the alias of the UserOutput () function. This function is used to set the output mode of the Print function. This function is used to set the output switch of the Print function. This function is used to set the output file of the Print function. This function is used to export the string information to the target object set by the SetOutMode function. This function is used to obtain the default output path of the task.

5-226

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Function 5.11.9 Function: NotifyProgress

Description This function is used to view the execution progress of the task on the iSStar Task Manage Window progress bar.

5.11.2 Function: UserInput


This function enables you to export the prompt information and obtain the strings entered from the client. The input information ends with Enter. InputText() is the alias of the UserInput() function.

Synopsis
UserInput(EventPropmt[, EventType[, Items]]), InputText(EventPropmt[, EventType[, Items]])

Note
The function UserInput() is equivalent to InputText().

Parameter Description
Parameter EventPropmt EventType Description EventPropmt is a string. It indicates the prompt of the user input on GUI. EventType is an integer. When it is 1, the input string is returned. When it is 2, the return value is represented by *. The default value is 1. Items can be a sequence (string, list, or tuple). It indicates the option of the input information. There is no limit to the input information by default.
NOTE l If the Items parameter is given and the parameter is a string, the input information must be the substring of Items. l If the Items parameter is given and the parameter is a list or tuple (elements in the list or tuple must be strings), the input information must be the elements of Items.

Items

Return Value
The string entered from the client is returned.

Error Handling
None.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-227

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Example
Msg = UserInput('input: ', 1) Print('UserInput() return: ' + Msg) Msg = UserInput('input: ', 2) Print('UserInput() return: ' + Msg) Msg = UserInput('input item from ABCD:',1,'ABCD') Print('UserInput() return: ' + Msg) # Assume the user type Hello # Assume the user type World # Assume the user type A

Result
UserInput() return: Hello UserInput() return: World UserInput() return: A

5.11.3 Function: UserOutput


The function UserOutput() is used to receive strings entered by the user on the client. OutputText () is the alias of the UserOutput() function.

Synopsis
UserOutput(EventPropmt[, EventType]),OutputText(EventPropmt[, EventType])

Note
The function UserOutput() is equivalent to OutputText().

Parameter Description
Parameter Name EventPropmt EventType Description EventPropmt is a string. It is the message entered by the user on the client. EventType is an integer. It is fixed to 0.

Return Value
None.

Error Handling
None.

Example
UserOutput("This is a test text of UserOutput function.") #Output the test infomation: This is a test text of UserOutput function.

Result
This is a test text of UserOutput function.

5-228

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.11.4 Function: SetOutMode


This function enables you to set the output mode of the Print function.

Synopsis
SetOutMode(Mode)

Note
None.

Parameter Description
Parameter Mode Description Mode is a string. It indicates the output mode. The value of the output modes is as follows: l 'gui': outputs to GUI l 'file': Outputs to file
NOTE Before the function is invoked, the default output mode is gui.

Return Value
If the output mode is set successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
SetOutMode('gui') Print("Hello!") SetOutMode("file") SetOutFileName("E:\\sample.txt") Print("Hello!") # Set the output mode to GUI # Print the string Hello! on the GUI # Set the output mode to file # Set the output file name to E:\sample.txt. # Save the string to the file E:\sample.txt.

Results
Hello! (The string is also saved in the file E:\sample.txt.)

5.11.5 Function: SetOutFlag


This function enables you to set the output switch of the Print function.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-229

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Synopsis
SetOutFlag(Flag)

Note
By default, the output switch is enabled.

Parameter Description
Parameter Flag Description Set whether the Print function outputs the information. Flag is of any types, including boolean, number, string, dictionary, list, and tuple. The values indicating that the Print function does not output any information are as follows: l FALSE l 0.0 l 0 l [] l () l {} l None l "" l '' Other values indicate that the Print function can output the information. The default value is True, and it allows the Print function to output the information.

Return Value
If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
SetOutFlag(False) Print("Hello world!") SetOutFlag(True) Print("Hello!") # # # # Set The Set The output to false strings cannot be printed on the GUI output to true string can be printed on the GUI

Result
Hello!

5-230

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.11.6 Function: SetOutFileName


This function enables you to set the output file of the Print function. To call the SetOutMode function to set the output file of the Print function, you need to call the SetOutFileName function to set the output file name.

Synopsis
SetOutFileName(FileName)

Note
l l If the output file is not set, the output mode contains the file mode. The default output file is used. The default output file is installation path\script\output\system-generated result folder \OutputFile.txt. The rule for naming the system-generated result folder is 'script operating time in YYYYMMDDHHMMSS format'-'script name'. For example, the name of a result folder can be D:\Client\script\output\061230230059-checklink\OutputFile.txt.

Parameter Description
Parameter FileName Description FileName is a string. It indicates the output file name. Windows-style file path (containing \\) and Unix-style file path (containing /) are both supported.

Return Value
If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
Print("Hello! iSStar") SetOutMode("file") SetOutFileName("D:\\sample.txt") Print("Hello!") # Print the string on the GUI # Set the output mode to file # Set the name of the output file # Print the string to the file sample.txt in D:\

Result
After the programming is complete, the string Hello! is appended to the file sample.txt in D:\. On the GUI:
Hello! iSStar

5.11.7 Function: Print


This function enables you to output the string information to a target object. The target object is set by the SetOutMode function.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-231

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Synopsis
Print(Msg[,endline])

Note
None.

Parameter Description
Parameter Msg endline Description Msg is a string. It indicates the information needed to be printed. For details of the string, see 4.3.3 String. This parameter indicates whether a line is added after Msg. True indicates that a line is added. False indicates that a line is not added. This parameter is optional. If you do not set it, the default value is False.

Return Value
If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
Print("Hello! iSStar!") SetOutMode("file") SetOutFileName("D:\\sample.txt") Print("Hello!") # Print to the GUI # Set the output mode to file mode # Set the output file # Print to the file "D:/sample.txt"

Results
After the programming is complete, the string Hello! is appended to the file sample.txt in D:\. On the GUI:
Hello! iSStar!

5.11.8 Function: GetOutputPath


This function enables you to obtain the default output path of the task.

Synopsis
GetOutputPath()
5-232 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Note
None.

Parameter Description
None.

Return Value
The return value is the default output file path of string type.

Error Handling
None.

Example
# Obtain the default output path returncode = GetOutputPath() Print('GetOutputPath() return: ' + returncode)

Result
GetOutputPath() return: C:\Client\script\output\061028093234-sample

5.11.9 Function: NotifyProgress


This function is used to view the execution progress of the task on the iSStar Task Manage Window progress bar.

Synopsis
NotifyProgress(Progress, Description)

Note
If you call this function multiple times during the execution of a task, the currently displayed result covers the former one.

Parameter Description
Parameter Progress Description Description Progress is an integer, ranging from 0 to 99. It indicates the progress of a task. Description is a string. It indicates the description of a task.

Return Value
None
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-233

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Error Handling
None

Example
# Pause for 10 seconds. Sleep(10) # Call the progress notifying function to display the task progress. NotifyProgress(20, "sample Sleep 1.") Sleep(10) NotifyProgress(40, "sample Sleep 2.") Sleep(10) NotifyProgress(60, "sample Sleep 3.") Sleep(10) NotifyProgress(80, "sample Sleep 4.") Sleep(10) NotifyProgress(99, "sample Sleep 5.")

5.12 GetError Function


This functions provides the unified handling function for error codes. It enables you to obtain the last error information list and the error cause function. 5.12.1 Overview of GetError Function The iSStar provides the GetError function. This function is used to obtain error codes and find out root causes. 5.12.2 Function: GetLastError This function enables you to obtain the last error information of the current task. The obtained information includes the error code, the function where an error occurs, and the line number of the error. 5.12.3 Function: GetErrorMsg This function enables you to obtain the cause of the error according to the error code.

5.12.1 Overview of GetError Function


The iSStar provides the GetError function. This function is used to obtain error codes and find out root causes. For the error occurred in the process of calling the HFC library function, the corresponding error code is set to indicate the causes. You can obtain the error code of the current error through the 5.12.2 Function: GetLastError function in the GetError function, and then parse the error code through 5.12.3 Function: GetErrorMsg to find out the error cause. The GetError function allows you to obtain only the error code of the last error occurred in the current task, and only one error code can be obtained at one time. The GetError functions provided by the iSStar are listed in Table 5-21.

5-234

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Table 5-21 List of GetError functions Function 5.12.2 Function: GetLastError 5.12.3 Function: GetErrorMsg Description This function enables you to obtain the last error information of the current task. This function enables you to obtain the cause according to the error code.

5.12.2 Function: GetLastError


This function enables you to obtain the last error information of the current task. The obtained information includes the error code, the function where an error occurs, and the line number of the error.

Synopsis
GetLastError()

Note
None.

Parameter Description
None.

Return Value
The tuple (errID, errInfo, trace_back) is returned. The meanings of the three elements in the tuple are as follows: l l l errID is the error code in integer type. The initial value is 0. errInfo is the error description in string type. By default, it is a null string ''. You need to obtain the information through the GetErrorMsg function. trace_back is a tuple containing three elements: filename, lineno, and func_name. filename is a string. It indicates the current file path. If no error occurs in the current file, the value is '<string>' . lineno is an integer. It indicates the line number of the error. The initial value is 0. func_name is a string. It indicates the name of the error function. The initial value is '?'.

Error Handling
None.

5.12.3 Function: GetErrorMsg


This function enables you to obtain the cause of the error according to the error code.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-235

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Synopsis
GetErrorMsg(errID)

Note
None.

Parameter Description
Parameter errID Description The value of errID is a positive integer or zero. It indicates the error code.

Return Value
The return value is a string. If the operation is successful, the error information is returned. If the operation fails, the Unknown inner error string is returned. For details of error information, see Table 5-22. Table 5-22 Description of error information Name ErrorCode ErrorLevel Meaning Indicates the error code represented by hex. For example, the error code can be 0x0. Indicates the error level. For example, the first 0 in 0x0 represents the error level. For details, see Table 5-23. Indicates the faulty module. For example, the second 0 in 0x0 represents the faulty module. Describes the details of the error.

ModuleID ErrorDescription

Table 5-23 Description of error level Level ERROR_LEV_OK ERROR_LEV_NOTICE ERROR_LEV_WARNING Meaning If the value of ERROR_LEV_OK is 0, it indicates that the error level is normal. If the value of ERROR_LEV_NOTICE is 1, it indicates that the error is of the notice level. If the value of ERROR_LEV_WARNING is 2, it indicates that the error is of the warning level.
Issue 02 (2010-10-10)

5-236

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Level ERROR_LEV_ERROR

Meaning If the value of ERROR_LEV_ERROR is 3, it indicates that the error is of the critical level.

Error Handling
None.

5.13 Network Operation Function


You can perform network communications operations through the network operation functions. For example, you can upload and download files, log in the system remotely, and run commands remotely. 5.13.1 Overview of Network Operation Function The iSStar provides network operation functions for network communications. Through the network operation functions, you can create FTP connections, upload files to an FTP server, download files from an FTP server, and run commands remotely. 5.13.2 Function: SetPassive This function enables you to set the transfer mode for the FTP server. 5.13.3 Function: LoginFTP This function enables you to log in to the FTP server. 5.13.4 Function: Upload This function enables you to upload the file to the connected FTP server. 5.13.5 Function: Download This function enables you to download specified files from the existing FTP server to target file path. 5.13.6 Function: GetFTPStatus This function enables you to obtain the current FTP connection status. 5.13.7 Function: LogoutFTP This function enables you to log out of the FTP server. 5.13.8 Function: OpenTelnet This function is used to enable the Telnet connections to the specified NE and the Solaris OS. 5.13.9 Function: ExecuteCmd After connecting an NE or a Solaris OS through Telnet, you can operate the commands supported by the NE and the Solaris OS. 5.13.10 Function: IsConnected This function is used to judge the Telnet connection state. 5.13.11 Function: CloseTelnet This function is used to disable the connection to the specified Telnet object. 5.13.12 Examples of Network Operation Function
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-237

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Through the example of the network operation function, you can get an overall knowledge about the usages of the FTP functions and telnet functions.

5.13.1 Overview of Network Operation Function


The iSStar provides network operation functions for network communications. Through the network operation functions, you can create FTP connections, upload files to an FTP server, download files from an FTP server, and run commands remotely. To upload or download the file, you need to set up the FTP connection first. Only one FTP connection can be created for the same task and at one time when you set up the FTP connection through the FTP operation function. If you set up a FTP connection again after a connection is set up, the original connection is disconnected, and a FTP connection is re-created according to the entered parameter. The iSStar provides Telnet operation functions. You can log in to an NE or a Solaris OS through the iSStar, and then perform operations remotely.
NOTE

Currently, the telnet operation functions do not support remote operations on the Linux OS.

The Network operation functions provided by the iSStar are listed in Table 5-24. Table 5-24 List of Network operation functions Function 5.13.2 Function: SetPassive 5.13.3 Function: LoginFTP 5.13.4 Function: Upload 5.13.5 Function: Download 5.13.6 Function: GetFTPStatus 5.13.7 Function: LogoutFTP 5.13.8 Function: OpenTelnet 5.13.10 Function: IsConnected 5.13.9 Function: ExecuteCmd 5.13.11 Function: CloseTelnet Description This function enables you to set the transfer mode for the FTP server. This function enables you to log in to the FTP server. This function enables you to upload the source file to the specified FTP server. This function enables you to download the specified files from the current FTP server to target folders. This function enables you to obtain the current FTP connection status. This function enables you to log out of the FTP server. To enable the Telnet connection to the specified NE and the Solaris OS. To judge the Telnet connection state. To operate an NE or a Solaris OS by using the commands supported by it after connecting the NE or the OS through Telnet. To disable the connection to the specified Telnet object.

5-238

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

The procedures for uploading files through the FTP operation function is listed as below. For detailed examples, see 5.13.12 Examples of Network Operation Function. 1. 2. 3. 4. 5. Obtain the IP address, user name, and password to log in to the FTP server. Upload files to target folders of the FTP server. Log in to the FTP server. For how to set up the FTP connection, see 5.13.3 Function: LoginFTP. Upload files to the specified folder of the FTP server. For details, see 5.13.4 Function: Upload. Log out of the FTP server. For details, see 5.13.7 Function: LogoutFTP.

The procedures for downloading files through the FTP operation function are listed as below. For detailed examples, see 5.13.12 Examples of Network Operation Function. 1. 2. 3. 4. 5. Obtain the IP address, user name, and password to log in to the FTP server. Obtain the folder where the files to be downloaded are located. Log in to the FTP server. For how to set up the FTP connection, see 5.13.3 Function: LoginFTP. Download files from the FTP server to the local computer. For details, see 5.13.5 Function: Download. Log out of the FTP server. For details, see 5.13.7 Function: LogoutFTP.

The procedure for running the command through the Telnet functions is as follows. For the instances, see 5.13.12 Examples of Network Operation Function. 1. 2. 3. 4. Obtain the IP address and port number of the telnet server. Log in to and connect to the telnet server. For details, see 5.13.8 Function: OpenTelnet. Run commands through the telnet. For details, see 5.13.9 Function: ExecuteCmd. Disconnect from the telnet. For details, see 5.13.11 Function: CloseTelnet.

5.13.2 Function: SetPassive


This function enables you to set the transfer mode for the FTP server.

Synopsis
SetPassive([mode])

Note
None.

Parameter Description
Parameter mode Description mode is of Boolean. The default value is True. When the mode parameter is True, set the FTP mode to passive. When the mode parameter is False, set the FTP mode to active.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-239

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Return Value
If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

5.13.3 Function: LoginFTP


This function enables you to log in to the FTP server.

Synopsis
LoginFTP(Host,UserName,Password[,Port])

Note
l l You need to call this function before performing other FTP operations. Only one FTP connection is allowed for the same task at the same time. If the FTP login interface is used again, the established FTP connection is closed and then you need to establish a new FTP connection.

Parameter Description
Parameter Host UserName Password Port Description Host is a string. It indicates the IP address of the FTP server to be logged in. UserName is a string. It indicates the name of the login user. Password is a string. It indicates the password of the FTP server to be logged in. Port is an integer. It indicates the port of the FTP server. This parameter is optional. If you do not set it, the default value is 21.

Return Value
If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None. Related Examples

5.13.4 Function: Upload


This function enables you to upload the file to the connected FTP server.
5-240 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Synopsis
Upload(SrcFile, TargetFile)

Note
l l l l You need to call the LoginFTP function to connect to the server before calling this function. The source file path and target file path must exist. Otherwise uploading fails. If a file with the name of the uploaded one exists in the target file path, overwrite the file. You need to upload the file in a binary mode.

Parameter Description
Parameter Name SrcFile Description SrcFile is a string. It indicates the name of the file to be uploaded. It supports Windows-style file path (containing \\) and Unix-style file path (containing /).
NOTE l If the file to be uploaded exists, SrcFile must be set to an absolute path. l If the file to be uploaded is generated during the execution of the task, SrcFile can be set to a relative path, and the relative path is the task output path.

TargetFile

TargetFile is a string. It indicates the target file which the uploaded file is saved. It supports Windows-style file path (containing \\) and Unixstyle file path (containing /).

Return Value
If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None. Related Examples

5.13.5 Function: Download


This function enables you to download specified files from the existing FTP server to target file path.

Synopsis
Download(SrcFile, TargetFile)

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-241

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Note
l l l l You need to call the LoginFTP function to connect to the server before calling this function. The source file path and target file path must exist. Otherwise downloading fails. If a file with the name of the downloaded one exists in the target file path, overwrite the file. You need to download the file in a binary mode.

Parameter Description
Parameter Name SrcFile Description SrcFile is a string. It indicates the name of the file to be downloaded. It supports Windows-style file path (containing \\) and Unix-style file path (containing /). TargetFile is a string. It indicates the target file which the downloaded file is saved. It supports Windows-style file path (containing \\) and Unix-style file path (containing /).

TargetFile

Return Value
If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None. Related Examples

5.13.6 Function: GetFTPStatus


This function enables you to obtain the current FTP connection status.

Synopsis
GetFTPStatus()

Note
None.

Parameter Description
None.

Return Value
If the function is called successfully, 1 is returned. Otherwise, 0 is returned.
5-242 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Error Handling
None. Related Examples

5.13.7 Function: LogoutFTP


This function enables you to log out of the FTP server.

Synopsis
LogoutFTP()

Note
l l After the operation of the FTP is complete, you must call this function to ensure that the existing FTP connection is disconnected. When the established FTP connection is disconnected, this function can still return success if you call this function again. It indicates that this function can be continuously called for many times.

Parameter Description
None.

Return Value
If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None. Related Examples

5.13.8 Function: OpenTelnet


This function is used to enable the Telnet connections to the specified NE and the Solaris OS.

Synopsis
OpenTelnet(strHostIp[,port])

Note
None.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-243

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Description
Parameter strHostIp Description String that indicates the IP address of the NE device that you want to log in to. Integer that indicates the port number of the NE device that you want to log in to. This parameter is optional. If you do not set it, the default value is 23.

port

Return Value
If the login succeeds, the connected Telnet object is returned. Otherwise, None is returned.

Error Handling
None.

Example 1
# Connect an MML NE. Take RNC whose port is 6000 as an example. telrnc = OpenTelnet('10.161.196.246',6000) # Enter the login command. rernc1 = ExecuteCmd(telrnc, 'LGI:op="lmtlmtlmt",pwd="lmtlmtlmt";',5) Print(rernc1) # Judge the Telnet connection state. rernc2 = IsConnected(telrnc) Print(rernc2) # Run the MML command. rernc3 = ExecuteCmd(telrnc, 'LST OP:;',5) Print(rernc3) CloseTelnet(telrnc)

Result
================Print(rernc1) output==================== +++ RNC_2122 2008-12-10 16:52:24 O&M #541 %%LGI:op="lmtlmtlmt",pwd="*****";%% RETCODE = 235143178 Login failed because lmtlmtlmt is incorrect. --END ================Print(rernc2) output==================== 0 ================Print(rernc3) output==================== +++ RNC_2122 2008-12-10 16:52:34 O&M #542 %% LST OP:;%% RETCODE = 235143318 You have not yet logged in. Please log in first to run the command. --END

Example 2
# Connect to the Solaris OS. Because the port is not set, the default port 23 is used. telnetS=OpenTelnet("10.161.196.247") # User name for login.

5-244

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


retVal=ExecuteCmd(telnetS,"username",2) Print(retVal) # Password for login. retVal=ExecuteCmd(telnetS,"password",2) Print(retVal) # Check whether connecting to the Solaris OS succeeds. Print(IsConnected(telnetS)) # Run the command. retVal=ExecuteCmd(telnetS,"ls",2) Print(retVal) # Disable the Telnet connection. ret=CloseTelnet(telnetS) Print(IsConnected(telnetS))

5 HFC Library Reference

Result
Password: Last login: Fri Jan 16 14:00:11 from 10.161.196.247 Sun Microsystems Inc. SunOS 5.10 Generic January 2005 Welcom To ****** Solaris Server. # 1 20080811164533 bin ftpfolder net 20080811190030 cdrom hom opt 20080813102233 core home optOMC 20080902144810 core.2806 imapuser platform Desktop data ip.sh proc Documents dev kernel pub Mail devices lib root TT_DB etc lost+found sbin bb.sh export mnt system #

test1 tmp upgradeSM.log usr var vol

5.13.9 Function: ExecuteCmd


After connecting an NE or a Solaris OS through Telnet, you can operate the commands supported by the NE and the Solaris OS.

Synopsis
ExecuteCmd(telnet,strCmd[,timeout])

Note
None.

Description
Parameter telnet strCmd Description Object of Telnet, which is returned by 5.13.8 Function: OpenTelnet. String that is used to specify the command to be run. Integer that is used to specify the timeout period of command. After the strCmd is run, if no result is returned within the timeout period, the function invocation ends. This parameter is optional. If you do not set it, the default value is 60, in the unit of second.

timeout

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-245

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Return Value
If the command is run successfully, a result is returned. Otherwise, when the time reaches the timeout period, the function invocation ends.

Error Handling
None.

Example 1
# Connect an MML NE. Take RNC whose port is 6000 as an example. telrnc = OpenTelnet('10.161.196.246',6000) # Enter the login command. rernc1 = ExecuteCmd(telrnc, 'LGI:op="lmtlmtlmt",pwd="lmtlmtlmt";',5) Print(rernc1) # Judge the Telnet connection state. rernc2 = IsConnected(telrnc) Print(rernc2) # Run the MML command. rernc3 = ExecuteCmd(telrnc, 'LST OP:;',5) Print(rernc3) CloseTelnet(telrnc)

Result
================Print(rernc1) output==================== +++ RNC_2122 2008-12-10 16:52:24 O&M #541 %%LGI:op="lmtlmtlmt",pwd="*****";%% RETCODE = 235143178 Login failed because lmtlmtlmt is incorrect. --END ================Print(rernc2) output==================== 0 ================Print(rernc3) output==================== +++ RNC_2122 2008-12-10 16:52:34 O&M #542 %% LST OP:;%% RETCODE = 235143318 You have not yet logged in. Please log in first to run the command. --END

Example 2
# Connect to the Solaris OS. Because the port is not set, the default port 23 is used. telnetS=OpenTelnet("10.161.196.247") # User name for login. retVal=ExecuteCmd(telnetS,"username",2) Print(retVal) # Password for login. retVal=ExecuteCmd(telnetS,"password",2) Print(retVal) # Check whether connecting to the Solaris OS succeeds. Print(IsConnected(telnetS)) # Run the command. retVal=ExecuteCmd(telnetS,"ls",2) Print(retVal) # Disable the Telnet connection. ret=CloseTelnet(telnetS) Print(IsConnected(telnetS))

5-246

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Result
Password: Last login: Fri Jan 16 14:00:11 from 10.161.196.247 Sun Microsystems Inc. SunOS 5.10 Generic January 2005 Welcom To ****** Solaris Server. # 1 20080811164533 bin ftpfolder net 20080811190030 cdrom hom opt 20080813102233 core home optOMC 20080902144810 core.2806 imapuser platform Desktop data ip.sh proc Documents dev kernel pub Mail devices lib root TT_DB etc lost+found sbin bb.sh export mnt system #

test1 tmp upgradeSM.log usr var vol

5.13.10 Function: IsConnected


This function is used to judge the Telnet connection state.

Synopsis
IsConnected(telnet)

Note
None.

Description
Parameter telnet Description Object of Telnet, which is returned by 5.13.8 Function: OpenTelnet.

Return Value
If the connection is normal, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example 1
# Connect an MML NE. Take RNC whose port is 6000 as an example. telrnc = OpenTelnet('10.161.196.246',6000) # Enter the login command. rernc1 = ExecuteCmd(telrnc, 'LGI:op="lmtlmtlmt",pwd="lmtlmtlmt";',5) Print(rernc1) # Judge the Telnet connection state. rernc2 = IsConnected(telrnc) Print(rernc2) # Run the MML command.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-247

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

rernc3 = ExecuteCmd(telrnc, 'LST OP:;',5) Print(rernc3) CloseTelnet(telrnc)

Result
================Print(rernc1) output==================== +++ RNC_2122 2008-12-10 16:52:24 O&M #541 %%LGI:op="lmtlmtlmt",pwd="*****";%% RETCODE = 235143178 Login failed because lmtlmtlmt is incorrect. --END ================Print(rernc2) output==================== 0 ================Print(rernc3) output==================== +++ RNC_2122 2008-12-10 16:52:34 O&M #542 %% LST OP:;%% RETCODE = 235143318 You have not yet logged in. Please log in first to run the command. --END

Example 2
# Connect to the Solaris OS. Because the port is not set, the default port 23 is used. telnetS=OpenTelnet("10.161.196.247") # User name for login. retVal=ExecuteCmd(telnetS,"username",2) Print(retVal) # Password for login. retVal=ExecuteCmd(telnetS,"password",2) Print(retVal) # Check whether connecting to the Solaris OS succeeds. Print(IsConnected(telnetS)) # Run the command. retVal=ExecuteCmd(telnetS,"ls",2) Print(retVal) # Disable the Telnet connection. ret=CloseTelnet(telnetS) Print(IsConnected(telnetS))

Result
Password: Last login: Fri Jan 16 14:00:11 from 10.161.196.247 Sun Microsystems Inc. SunOS 5.10 Generic January 2005 Welcom To ****** Solaris Server. # 1 20080811164533 bin ftpfolder net 20080811190030 cdrom hom opt 20080813102233 core home optOMC 20080902144810 core.2806 imapuser platform Desktop data ip.sh proc Documents dev kernel pub Mail devices lib root TT_DB etc lost+found sbin bb.sh export mnt system #

test1 tmp upgradeSM.log usr var vol

5.13.11 Function: CloseTelnet


This function is used to disable the connection to the specified Telnet object.
5-248 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Synopsis
CloseTelnet(telnet)

Note
None.

Description
Parameter telnet Description Object of Telnet, which is returned by 5.13.8 Function: OpenTelnet.

Return Value
None.

Error Handling
None.

Example 1
# Connect an MML NE. Take RNC whose port is 6000 as an example. telrnc = OpenTelnet('10.161.196.246',6000) # Enter the login command. rernc1 = ExecuteCmd(telrnc, 'LGI:op="lmtlmtlmt",pwd="lmtlmtlmt";',5) Print(rernc1) # Judge the Telnet connection state. rernc2 = IsConnected(telrnc) Print(rernc2) # Run the MML command. rernc3 = ExecuteCmd(telrnc, 'LST OP:;',5) Print(rernc3) CloseTelnet(telrnc)

Result
================Print(rernc1) output==================== +++ RNC_2122 2008-12-10 16:52:24 O&M #541 %%LGI:op="lmtlmtlmt",pwd="*****";%% RETCODE = 235143178 Login failed because lmtlmtlmt is incorrect. --END ================Print(rernc2) output==================== 0 ================Print(rernc3) output==================== +++ RNC_2122 2008-12-10 16:52:34 O&M #542 %% LST OP:;%% RETCODE = 235143318 You have not yet logged in. Please log in first to run the command. --END

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-249

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Example 2
# Connect to the Solaris OS. Because the port is not set, the default port 23 is used. telnetS=OpenTelnet("10.161.196.247") # User name for login. retVal=ExecuteCmd(telnetS,"username",2) Print(retVal) # Password for login. retVal=ExecuteCmd(telnetS,"password",2) Print(retVal) # Check whether connecting to the Solaris OS succeeds. Print(IsConnected(telnetS)) # Run the command. retVal=ExecuteCmd(telnetS,"ls",2) Print(retVal) # Disable the Telnet connection. ret=CloseTelnet(telnetS) Print(IsConnected(telnetS))

Result
Password: Last login: Fri Jan 16 14:00:11 from 10.161.196.247 Sun Microsystems Inc. SunOS 5.10 Generic January 2005 Welcom To ****** Solaris Server. # 1 20080811164533 bin ftpfolder net 20080811190030 cdrom hom opt 20080813102233 core home optOMC 20080902144810 core.2806 imapuser platform Desktop data ip.sh proc Documents dev kernel pub Mail devices lib root TT_DB etc lost+found sbin bb.sh export mnt system #

test1 tmp upgradeSM.log usr var vol

5.13.12 Examples of Network Operation Function


Through the example of the network operation function, you can get an overall knowledge about the usages of the FTP functions and telnet functions.

Example of FTP function


#Upload the local file ftpsample.txt in D:\ to the ftp server, #and download the files on the server to the local computer. localFilePath = "d:\\ftpsample.txt" serverFilePath = "/export/home/ftpsample.txt" distFilePath = "d:\\ftpdownload.txt" # Upload file to ftp server def uploadFileToServer() if GetFTPStatus() and Upload(localFilePath,serverFilePath) Print("upload finished!") else Print("upload failed!") Print(GetLastError()) end end # Download file from server def downloadFileFromServer() if GetFTPStatus() and Download(serverFilePath, distFilePath) Print("download finished!")

5-250

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


else Print("download failed!") Print(GetLastError()) end end # Log in serverIp userName password

5 HFC Library Reference

to the ftp server = UserInput("Please input ip address of ftpserver: ",0) = UserInput("Please input user name: ",0) = UserInput("Input your password: ",2)

if not LoginFTP(serverIp,userName,password) # if fail in login, print information Print("login error!") else uploadFileToServer() downloadFileFromServer() LogoutFTP() end

Result of FTP function


Please input ip address of ftpserver: >>>10.161.213.188 Please input user name: >>>root Input your password: >>>****** upload finished! download finished!

Example of Telnet function


# Connect a solaris Server tel = OpenTelnet('10.121.71.188') #input username rep = ExecuteCmd(tel,'root',5) Print(rep) # input password rep = ExecuteCmd(tel,'root188',5) Print(rep) rep = ExecuteCmd(tel,'ls',5) Print(rep) CloseTelnet(tel) # connect an NE telrnc = OpenTelnet('10.161.196.246',6000) #login rernc = ExecuteCmd(telrnc, 'LGI:op="lmtlmtlmt",pwd="lmtlmtlmt";',5) Print(rernc) # execute MML command rernc = ExecuteCmd(telrnc, 'LST OP:;',5) Print(rernc) CloseTelnet(telrnc)

Result of Telnet function


Password: Last login: Fri Aug 29 14:35:57 from 10.121.44.81 Sourcing //.profile-EIS..... root@script # 1.txt devices opt 10.121.71.188.url etc platform AMSvr export proc OMC_upgrade_bak home pycorba.txt

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-251

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

OutputFileMML.txt kernel sbin SunWS_config lib tmp TT_DB litemp.txt toolboxes TaskInterfaceForIstar log.txt usr _vimrc logs var bin lost+found vol cache mnt workspace cdrom net xfn data nsmail yuxin dev ok1.txt root@script # ++++++++++++++++++++++++++++++++++++++++++++++++++++ WCDMA RNC maintenance system Version: BSC6800V100R011 Copyright(c) 2001-2003 All rights reserved ++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ HW-BSC6800 2008-10-25 16:41:49 O&M #873 %%LGI:op="lmtlmtlmt",pwd="*****";%% RETCODE = 234915312 "lmtlmtlmt" is an invalid operator name, login failed. --END 2008-10-25 16:41:59

+++ HW-BSC6800 O&M #874 %% LST OP:;%% RETCODE = 234915884 command. --END

The operator didn't login, please login first and execute

5.14 Report Operation Function


This topic describes the report operation functions. By using these functions, you can perform the related operations such as design, display, and manage reports. 5.14.1 Overview of Report Operation Function The iSStar provides report operation functions which enable you to operate reports. 5.14.2 Report Management Function This topic describes the report management function. This function enables you to import, create, and save report files, and export report model files. 5.14.3 Report Design Function This topic describes the report design functions. You can use these functions to add sheets, ranges, or tables, obtain the number of rows, insert or delete rows, and set display contents and style. 5.14.4 Report Display Function This topic describes the report display function. This function enables you to define the display style of the a table, range, or cell. For example, you can define the background color, alignment mode, font, and column width. 5.14.5 Parameters for Operating Report This topic describes the values and meanings of the report operation parameters. The parameters are Color, FontType, and Type.
5-252 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.14.6 Examples of Report Operation Function This gives the examples of the report operation function. You can better understand how to use report operation functions to perform routine maintenance.

5.14.1 Overview of Report Operation Function


The iSStar provides report operation functions which enable you to operate reports. The report operation functions provided by the iSStar enable you to easily create a professional report. You can write the required information to the custom report to facilitate future query. By using the report operation functions, you can perform the related operations, for example, you can set the display contents of a range, customize the display mode of a report, such as the background color and alignment mode of a table, range, or cell. Table 5-25 lists the report operation functions. Table 5-25 Report operation function list Function 5.14.2.2 Function: NewReport 5.14.3.2 Function: AddSheet 5.14.3.3 Function: AddTable 5.14.3.1 Function: AddRange 5.14.3.10 Function: SetRangeValue 5.14.3.9 Function: SetCellValue 5.14.3.12 Function: SetTableValue 5.14.3.11 Function: SetTableValueEx 5.14.3.4 Function: GetRowCount 5.14.3.5 Function: GetRowData 5.14.3.6 Function: InsertRow 5.14.3.7 Function: RemoveRow 5.14.3.13 Function: UpdateRow 5.14.3.8 Function: Selector 5.14.4.1 Function: ReportStyle 5.14.4.10 Function: SetTableFont 5.14.4.11 Function: SetTableTitleFont 5.14.4.8 Function: SetRangeFont Creates a report. Adds a sheet. Adds a table. Creates a range. Sets the range value. Sets the cell-specified value. Sets the values of multiple cells in the table. Sets the contents of multiple cells in a table and specifies the display style. Returns the number of rows in a table. Returns the data of a row in a table. Inserts a row of data in a table. Deletes a row of data from a table. Updates the contents of a row. Sets the display style of the data aggregate that meets the conditional expression. Sets the cell display style. Sets the table font. Sets the table title font. Sets the range font. Description

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-253

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Function 5.14.4.4 Function: SetCellFont 5.14.4.9 Function: SetTableBGColor 5.14.4.7 Function: SetRangeBGColor 5.14.4.3 Function: SetCellBGColor 5.14.4.6 Function: SetRangeAlign 5.14.4.2 Function: SetCellAlign 5.14.4.5 Function: SetColumnWidth 5.14.2.1 Function: LoadReport 5.14.2.3 Function: SaveReportAs 5.14.2.4 Function: StoreReport

Description Sets the font of the specified cell. Sets the background color of a table. Sets the background color of a range. Sets the background color of a cell. Sets the alignment type of a range. Sets the alignment type of a cell. Sets the column width. Imports a report object. Save the report. Exports the report model files.

5.14.6 Examples of Report Operation Function shows the examples. The procedure of report operations is as follows: 1. 2. 3. 4. 5. Create a report object. Create a sheet. Create a table. Set the cell data and format. Save the report.

5.14.2 Report Management Function


This topic describes the report management function. This function enables you to import, create, and save report files, and export report model files. 5.14.2.1 Function: LoadReport This topic describes the LoadReport function. This function enables you to import the reports in the specified path. 5.14.2.2 Function: NewReport This topic describes the NewReport function. This function enables you to create a report. 5.14.2.3 Function: SaveReportAs This topic describes the SaveReportAs function. This function enables you to save the created report file. 5.14.2.4 Function: StoreReport This topic describes the StoreReport function. This function enables you to export the report model files. The report model file is a data file specially used to store the contents of a report. You can export, import, or modify a report model file. A generated report file cannot be modified.
5-254 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Through the iSStar, you can import a report model file and modify it. In this way, the existing report files can be modified.

5.14.2.1 Function: LoadReport


This topic describes the LoadReport function. This function enables you to import the reports in the specified path.

Synopsis
LoadReport(FilePath)

Note
None

Parameter Description
Parameter FilePath Description FilePath is of string type. It indicates the full path of the imported model file.

Return Value
The return value is an integer. If the report is imported successfully, the value 1 is returned. Otherwise, 0 is returned.

Error Handling
None

Example
NewReport() page1 = AddSheet("Page1") table1 = AddTable(page1, 6, 8, "Table1") valueList = [str(i) for i in range(6 * 8)] SetTableValue(table1, valueList) SaveReportAs("oldfile.xls") StoreReport("c:/storefile.dat") ret = LoadReport("c:/storefile.dat") RemoveRow("Page1", 0, 0) SaveReportAs("newfile.xls")

5.14.6 Examples of Report Operation Function

5.14.2.2 Function: NewReport


This topic describes the NewReport function. This function enables you to create a report.

Synopsis
NewReport()
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-255

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Note
l l During the report operation, this function must be called before it is called by other report operations. For one task, NewReport can be called only once. If the NewReport() interface is invoked again, all the previous report operations are deleted.

Parameter Description
None

Return Value
The return value is an integer. If the report is created successfully, the value 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
NewReport() page1 = AddSheet("page1") SaveReportAs("exa08.xls")

Related Example

5.14.2.3 Function: SaveReportAs


This topic describes the SaveReportAs function. This function enables you to save the created report file.

Synopsis
SaveReportAs(FilePath)

Note
l l l The save path does not support the network path format. If the same file name exists in the specified directory, an extension .bak is added to the file name, and then the system saves the created file. Before the function is called, call 5.14.2.2 Function: NewReport to create a report.

5-256

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Description
Parameter FilePath Description FilePath is a character string. It indicates the file save path. It can support Window style file path (containing \) and Unix style file path (containing //). The file is in .xls, .html, or .htm format.
CAUTION FilePath must not contain the following special characters; otherwise, saving the file fails: !"#$%'()*+-,.;<=>[]^`{|}~"|&

Return Value
The return value is an integer. If the report file is saved successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
NewReport() page1 = AddSheet("page1") SaveReportAs("exa08.xls") SaveReportAs("exa08.html")

Result
A file exa08.xls is created

Related Example

5.14.2.4 Function: StoreReport


This topic describes the StoreReport function. This function enables you to export the report model files. The report model file is a data file specially used to store the contents of a report. You can export, import, or modify a report model file. A generated report file cannot be modified. Through the iSStar, you can import a report model file and modify it. In this way, the existing report files can be modified. After a model file is imported, you can modify the objects such as sheet and table, and then save the report by using 5.14.2.3 Function: SaveReportAs. Figure 5-9 lists the operators. Figure 5-9 Procedure for modifying a report

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-257

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Synopsis
StoreReport(filePath)

Note
None

Parameter Description
Parameter FilePath Description FilePath is of string type. It indicates the save path of the model file.

Return Value
The return value is an integer. If the report model file is exported successfully, a positive integer is returned. Otherwise, 0 is returned.

Error Handling
None

Example
NewReport() page1 = AddSheet("Page1") table1 = AddTable(page1, 6, 8, "Table1") valueList = [str(i) for i in range(6 * 8)] SetTableValue(table1, valueList) SaveReportAs("oldfile.xls") StoreReport("c:/storefile.dat") ret = LoadReport("c:/storefile.dat") RemoveRow("Page1", 0, 0) SaveReportAs("newfile.xls")

Related Example

5.14.3 Report Design Function


This topic describes the report design functions. You can use these functions to add sheets, ranges, or tables, obtain the number of rows, insert or delete rows, and set display contents and style. 5.14.3.1 Function: AddRange This topic describes the AddRange function. This function enables you to create a range in the specified table. 5.14.3.2 Function: AddSheet This topic describes the AddSheet function. This function enables you to add a sheet to the specified report.
5-258 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.14.3.3 Function: AddTable This topic describes the AddTable function. This function enables you to add a table to the specified page. 5.14.3.4 Function: GetRowCount This topic describes the GetRowCount function. This function enables you to obtain the number of rows in the specified table. 5.14.3.5 Function: GetRowData This topic describes the GetRowData function. This function enables you to obtain the data of a row in a table. 5.14.3.6 Function: InsertRow This topic describes the InsertRow function. This function enables you to insert a row in the specified table according to the row number. 5.14.3.7 Function: RemoveRow This topic describes the RemoveRow function, which enables you to remove a row. 5.14.3.8 Function: Selector This topic describes the Selector function. The display style of cells refers to the background color, alignment mode, and font. 5.14.3.9 Function: SetCellValue This topic describes the SetCellValue function. This function enables you to set the values of the specified cell. 5.14.3.10 Function: SetRangeValue This topic describes the SetRangeValue function. This function enables you to set the value of the specified range. 5.14.3.11 Function: SetTableValueEx This topic describes the SetTableValueEx function. This function enables you to add data to a table and set the display style of the placement specified by the conditional expression. 5.14.3.12 Function: SetTableValue This topic describes the SetTableValue function. This function enables you to set the contents of the cells in a table. 5.14.3.13 Function: UpdateRow This topic describes the UpdateRow function. This function enables you to update the contents of a row in the specified table.

5.14.3.1 Function: AddRange


This topic describes the AddRange function. This function enables you to create a range in the specified table.

Synopsis
AddRange(TableHandle, RowFrom, ColFrom, RowTo, ColTo[, bMerged])

Note
l The range cannot overlap or include each other.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-259

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

When creating a range, you can specify whether to merge the cells in the range. After the cells are merged, all the operations related to the cells are invalid. You can only operate the whole range. Before calling this function, you should call the following functions: 1. 2. 3. Call 5.14.2.2 Function: NewReport to create a report object. Call 5.14.3.2 Function: AddSheet to create a sheet. Call 5.14.3.3 Function: AddTable to create a table.

Parameter Description
Parameter TableHandle RowFrom Description TableHandle is a long integer. It is the unique identifier of a table. RowFrom is an integer. It indicates the start row number of the range in the table. Row number begins from 0. ColFrom ColFrom is an integer. It indicates the start column number of the range in the table. The column number begins from 0. RowTo ColTo bMerged RowTo is an integer. It indicates the end row number of the range in the table. ColTo is an integer. It indicates the end column number of the range in the table. bMerged is an integer. It indicates whether cells are merged. The value can be 1 or 0. By default, 0 is used. The values and related meanings are as follows: l 1: indicates that merging is performed. l 0: indicates that no merging is performed.

Return Value
The return value is an integer. If the range is created successfully, the range Handle (the unique identifier of the range) is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
#Create a report object. NewReport() #Add a sheet named page one. page1 = AddSheet("page one")

5-260

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

#Add a table with six rows and eight columns. The title is table1. table1 = AddTable(page1, 6, 8, "table1",) #Specifiy a range in the table. The range is from row 1 to row 3 and column 2 to column 5. #Note that numbers of the rows and columns start from 0. range1 = AddRange(table1, 1, 2, 3, 5, 1) #Save the report as an .xls file. SaveReportAs("d:/exa04.xls")

Related Example

5.14.3.2 Function: AddSheet


This topic describes the AddSheet function. This function enables you to add a sheet to the specified report.

Synopsis
AddSheet(SheetName)

Note
l l l l The total number of rows in the pages is 65535, and total number of columns is 255. SheetName cannot be null, and the length of the character string cannot be more than 31 characters. The symbols \:/*[] are not allowed in the sheet name. SheetName must be unique. If the new sheet name exists in the report, the invalid handle number 0 is returned after you call the AddSheet function. Before the function is called, call 5.14.2.2 Function: NewReport to create a report. If NewReport was not called before, it is automatically called.

Parameter Description
Parameter SheetName Description SheetName is a character string. It indicates the sheet name. The sheet name must be unique.
CAUTION SheetName must not contain the following special characters: !"#$%'()*+-,.;<=>[]^`{|}~"|&

Return Value
l l l The return value is an integer. If the function is executed successfully, the Handle, that is, the unique identifier of the sheet, is returned. If the execution fails, 0 is returned. If the new sheet name exists in the report, the sheet cannot be created and 0 is returned.

Error Handling
None.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-261

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Example
#Create a report object. NewReport() #Add a sheet named page one. page1 = AddSheet("page one") #Add a second sheet named page two. page2 = AddSheet("page two") #Save the report as an .xls file. SaveReportAs("d:/exa02.xls")

Related Example

5.14.3.3 Function: AddTable


This topic describes the AddTable function. This function enables you to add a table to the specified page.

Synopsis
AddTable(SheetHandle, Row, Col, TableName = "")

Note
l l l l The title of the generated table occupies one row. If you add multiple tables to the same page, tables are separated by three blank rows. The maximum row number is 65530, and the maximum of total column number is 255. Before this function is called, you should call the following functions: 1. 2. Call 5.14.2.2 Function: NewReport to create a report. Call 5.14.3.2 Function: AddSheet to create a sheet.

Parameter Description
Parameter SheetHandle Row Col TableName Description SheetHandle is a long integer. It indicates Handle of the page (the unique mark of the page). Row is an integer. It indicates the number of rows. Col is an integer. It indicates the number of columns. TableName is a string. It indicates the table name. TableName cannot exceed 128 characters. If more than 128 characters are contained, only the first 128 characters are valid.
NOTE TableName is an optional parameter, but this parameter affects the table heading. If TableName is not a null string, the report has a table heading. If TableName is a null string, the report does not have a table heading.

5-262

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Return Value
The return value is an integer. If the function is called successfully, the table Handle (the unique mark of the table) is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
#Create a report object. NewReport() #Add a sheet named page one. page1 = AddSheet("page one") #Add a table with six rows and eight columns. The title is table1. table1 = AddTable(page1, 6, 8, "table1") #Save the report as an .xls file. SaveReportAs("d:/exa03.xls")

Related Example

5.14.3.4 Function: GetRowCount


This topic describes the GetRowCount function. This function enables you to obtain the number of rows in the specified table.

Synopsis
GetRowCount(SheetName,TableNo)

Note
None

Parameter Description
Parameter SheetName TableNo Description Name of a sheet. This parameter is of string type. Number of a table. This parameter indicates the number of the table, of which the number of rows is required, in the specified sheet. This parameter is of integer type. The value ranges from 0.

Return Value
The return value is an integer. If this function is called successfully, the number of rows in the table is returned. Otherwise, 0 is returned.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-263

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Error Handling
None

Example
NewReport() page1 = AddSheet("sheet1") table1 = AddTable(page1, 6, 8, "table1") #Get the number of rows in the specified table on the specified page. count = GetRowCount("sheet1", 0) Print(count) SaveReportAs("result.xls")

Result
6

Related Example

5.14.3.5 Function: GetRowData


This topic describes the GetRowData function. This function enables you to obtain the data of a row in a table.

Synopsis
GetRowData(SheetName,TableNo,RowNo)

Note
None

Parameter Description
Parameter SheetName TableNo Description Name of the sheet to be modified. This parameter is of string type. Number of a table. This parameter indicates the number of the table, whose data is required, in the specified sheet. This parameter is of integer type. The value ranges from 0. Number of a row. This parameter indicates the number of the row, whose data is required, in the specified table. This parameter is of integer type. The value ranges from 0.

RowNo

5-264

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Return Value
The return value is a string list. If this function is successfully called, the contents of the obtained row is returned. Otherwise, an empty list is returned.

Error Handling
None

Example
sheetName = "sheet1" tableNo = 0 datalist = ["data0", "data1", "data2", "data3"] NewReport() page1 = AddSheet(sheetName) table1 = AddTable(page1, 6, 4, "table1") data = GetRowData(sheetName, tableNo, 2) Print(data) InsertRow( sheetName, tableNo, 2, datalist ) data = GetRowData(sheetName, tableNo, 2) Print(data) SaveReportAs("result.xls")

Result
['', '', '', ''] ['data0', 'data1', 'data2', 'data3']

Related Example

5.14.3.6 Function: InsertRow


This topic describes the InsertRow function. This function enables you to insert a row in the specified table according to the row number.

Synopsis
InsertRow(SheetName,TableNo,RowNo,DataList)

Note
None

Parameter Description
Parameter SheetName Description Name of a sheet. This parameter is of string type.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-265

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter TableNo

Description Number of a table. This parameter indicates the number of the table, to which you plan to insert data, in the specified sheet. This parameter is an integer ranging from 0. Number of a row. This parameter indicates the number of the table, to which you plan to insert a row. The value is an integer ranging from 0. The value -1 indicates the last row. Data list. This parameter indicates the data to be inserted. This parameter is of string sequence type.

RowNo

DataList

Return Value
The return value is an integer. If this function is successfully called, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
sheetName = "sheet1" tableNo = 0 rowNo = -1 datalist = ["data0", "data1", "data2", "data3"] NewReport() page1 = AddSheet("sheet1") table1 = AddTable(page1, 6, 4, "table1") #Insert a row to the specified row in the specified table. InsertRow( sheetName, tableNo, rowNo, datalist ) SaveReportAs("result.xls")

Related Example

5.14.3.7 Function: RemoveRow


This topic describes the RemoveRow function, which enables you to remove a row.

Synopsis
RemoveRow(SheetName, TableNo, RowNo = -1)

Note
None
5-266 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Description
Parameter SheetName TableNo Parameter Description Name of a sheet. This parameter is of string type. Number of a table. This parameter indicates the number of the table, whose data needs to be deleted, in the specified sheet. This parameter is of integer type. The value ranges from 0. Number of a row. Number of the row to be deleted The value is an integer ranging from 0. The default value is -1, which indicates the last row.

RowNo

Return Value
The return value is an integer. If row number is modified successfully called, 1 is returned. Otherwise, 0 is returned.

Error Handling
None

Example
NewReport() page1 = AddSheet("sheet1") table1 = AddTable(page1, 6, 8, "table1") valueList = [str(i) for i in range(6 * 8)] SetTableValue(table1, valueList) #Delete the second row from table 0 in sheet1. ret = RemoveRow("sheet1", 0, 2) SaveReportAs("result.xls")

Related Example

5.14.3.8 Function: Selector


This topic describes the Selector function. The display style of cells refers to the background color, alignment mode, and font.

Synopsis
Selector(Exp,Default,Mode)

Note
You need to ensure that the condition logic of the expression is rational. A self-contradictory condition causes the failure to execute the expression.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-267

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Description
Parameter Exp Description Exp is a string. It indicates a conditional expression. The keywords of the conditional expressions are as follows: l $X: indicates the x row. l :$Y: indicates the y column. l $$: indicates the whole table. Table 5-26 describes the instances of the common conditional expressions supported by the iSStar. Default Default is of integer type. It indicates the identifier of the display style. It is the return value of the 5.14.4.1 Function: ReportStyle function. Mode is of enumeration type. It indicates the mode used to define the display style of the data aggregate that meets the conditional expression. The value can be CELL_MODE, ROW_MODE, and COL_MODE. The meaning of each value is as follows: l CELL_MODE: applies to only the specific placement that meets the requirement. l ROW_MODE: applies to the entire row of the placement that meets the requirement. l COL_MODE: applies to the entire column of the placement that meets the requirement.

Mode

Table 5-26 Example of Using Conditional Expressions Conditional Expression $1:$2 == 'Error' and $2:$1 == 'Unavailable' Meaning Indicates that in a data aggregate, the condition is met if the data in row 1 column 2 is error and the data in row 2 column 1 is unavailable. The data aggregate of row 1 column 2 and row 2 column 1 is returned.
NOTE The configuration mode of this type of expression can only be CELL_MODE. Other configuration modes are not applicable.

$1 > 50 and $1 <= 75

Indicates that in a data aggregate, the condition is met if the data values in row 1 is greater than 50 and equal to or smaller than 75. Then the data aggregate that meets the condition is returned.
NOTE For a combined condition, the keywords must refer to the same range. A condition like $1 > 50 and $2 <= 75, where the first keyword refers to row 1 and the second row 2, is invalid.

5-268

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Conditional Expression :$1 > 50 and :$1 <= 75

Meaning Indicates that in a data aggregate, the condition is met if the data values in column 1 are greater than 50 and equal to or smaller than 75. Then the data aggregate that meets the condition is returned.
NOTE l For a combined condition, the keywords must refer to the same range. A condition like :$1 > 50 and :$2 <= 75, where the first keyword refers to column 1 and the second column 2, is invalid. l For a combined condition, the expressions must not contradict each other. That is, the expression type must be the same, for example, all the expressions are led by $, :$, or $X:$Y. $1 > 50 and :$2 <= 75 is an invalid expression.

$$ == 'Error'

Indicates that in a data aggregate, the condition is met if the data in a placement is error. The data aggregate that meets the condition is returned.
NOTE The configuration mode of this type of expression can only be CELL_MODE. Other configuration modes are not applicable.

Return Value
The return value is the handle number of the Selector object. If this function is successfully called, a non-null handle is returned. Otherwise, None is returned.

Error Handling
None.

Example
style = ReportStyle(Light_Orange, 'C') exp1 = Selector(':$1 > 50 and :$1 <= 75', style, ROW_MODE)

Related Example

5.14.3.9 Function: SetCellValue


This topic describes the SetCellValue function. This function enables you to set the values of the specified cell.

Synopsis
SetCellValue(TableHandle, Row, Col, Value)

Note
Before calling this function, you should call the following functions. 1.
Issue 02 (2010-10-10)

Call 5.14.2.2 Function: NewReport to create a report object.


Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-269

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

2. 3.

Call 5.14.3.2 Function: AddSheet to create a sheet. Call 5.14.3.3 Function: AddTable to create a table.

Parameter Description
Parameter TableHandle Row Col Value Parameter Description TableHandle is a long integer. It indicates the return value of the 5.14.3.3 Function: AddTable function. Row is an integer. It indicates the row position. Row number begins from 0. Col is an integer. It indicates the column position. The column number begins from 0. Value indicates the cell contents.

Return Value
The return value is an integer. If the contents of the specified cell is set successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
NewReport() page1 = AddSheet("Page1") table1 = AddTable(page1, 6, 8, "Table1") #Set the value of the cell in row 3 and column 3 in table1. resultCode = SetCellValue(table1, 3, 5, "SetCellValue") SaveReportAs("example.xls")

Related Example

5.14.3.10 Function: SetRangeValue


This topic describes the SetRangeValue function. This function enables you to set the value of the specified range.

Synopsis
SetRangeValue(RangeHandle, Value)

Note
l Before this function is called, you should call the following functions. 1.
5-270

Call 5.14.2.2 Function: NewReport to create a report.


Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

2. 3. 4. l l

Call 5.14.3.2 Function: AddSheet to add a sheet. Call 5.14.3.3 Function: AddTable to add a table. Call 5.14.3.1 Function: AddRange to get a range.

If the cells are set to merge when you create the range, this function sets the display contents of the merged range. If the cells are not set to merger when you create the range, this function sets the display contents of each cell in the range.

Parameter Description
Parameter RangeHandle Value Description RangeHandle is a long integer and refers to an area object. It indicates the return value of called 5.14.3.1 Function: AddRange. Value indicates the range value.

Return Value
The return value is an integer. If the contents of the specified range is set successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
NewReport() #Create a report. page1 = AddSheet("Page1") #Add a page to the report. table1 = AddTable(page1, 6, 8, "Table1") #Add a table to the page. valueList = [str(i) for i in range(6 * 8)] #Construct 6*8 values. #Set the values of all the cells in table1. resultCode = SetRangeValue(range1, "SetRangeValue") SaveReportAs("D:/example.xls") #Save the report to a file.

Related Example

5.14.3.11 Function: SetTableValueEx


This topic describes the SetTableValueEx function. This function enables you to add data to a table and set the display style of the placement specified by the conditional expression.

Synopsis
SetTableValueEx(TableHandle,TbData[,Exps])

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-271

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Note
l l l Before calling the SetTableValueEx function, you need to call the 5.14.2.2 Function: NewReport. This function supports a maximum of 10 conditional expressions. Only the first 10 conditional expressions can be set successfully if more than 10 expressions are created. When the function is called, the rows or columns that are beyond the settings of TbData are truncated.

Parameter Description
Parameter TableHandle TbData Description TableHandle is an integer. It indicates a table object. TbData is of two-dimensional list type. It indicates the data to be added to a table. If a conditional expression is specified, TbData refers to the object of the conditional expression. Exps is a conditional express list. Each element in the list is the conditional expression object of the Selector function.

Exps

Return Value
The return value is an integer. If the data is successfully added to the table, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
#Create a two-dimensional list. data = [['Name', 'English', 'Maths', 'History', 'Chinese']] data.append(['Jacky', 65, 79, 56, 85]) data.append(['Tommy', 85, 70, 87, 90]) data.append(['Marry', 46, 56, 59, 85]) data.append(['Rob', 85, 80, 87, 74]) data.append(['Jenny', 90, 75, 67, 65]) NewReport() sId = AddSheet('school report card') tId = AddTable(sId, len(data), len(data[0])) rId = AddRange(tId, 0, 0, 0, len(data[0])-1 ) SetRangeBGColor(rId, Teal) #Set the style. style1 = ReportStyle(Red) #Set the condition expression. If the score is lower than 60, #the background color is red. ex1 = Selector('$$ < 60', style1) #Put the data in the table. Fill in the style through the condition expression. SetTableValueEx(tId, data, [ex1])

5-272

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

SaveReportAs('report.xls')

Result
The following figure shows the contents of report.xls.

Related Example

5.14.3.12 Function: SetTableValue


This topic describes the SetTableValue function. This function enables you to set the contents of the cells in a table.

Synopsis
SetTableValue(TableHandle, ValueList)

Note
l l l For a table with m rows and n columns, set contents of the cells in the sequence of (0,0), (0, 1)...(0,n),(1,0),(1,1)...(1,n),(m,0),(m,1)...(m,n). If a cell is actually a range merged by multiple cells, set the range value to the value of the first cell in the range. Before calling this function, you should call the following functions. 1. 2. 3. Call 5.14.2.2 Function: NewReport to create a report object. Call 5.14.3.2 Function: AddSheet to create a sheet. Call 5.14.3.3 Function: AddTable to create a table.

Parameter Description
Parameter TableHandle ValueList Description TableHandle is a long integer. It indicates the return value of the Function: AddTable function. ValueList is of list type. The elements in the list indicate the values of the cells in the table.

Return Value
The return value is an integer. If the contents of the cells in the table is set successfully, 1 is returned. Otherwise, 0 is returned.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-273

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Error Handling
None.

Example
NewReport() #Create a report. page1 = AddSheet("Page1") #Add a page to the report. table1 = AddTable(page1, 6, 8, "Table1") #Add a table to the page. valueList = [str(i) for i in range(6 * 8)] #Construct 6*8 values. #Set the values of all the cells in table1. resultCode = SetRangeValue(range1, "SetRangeValue") SaveReportAs("D:/example.xls") #Save the report to a file.

Related Example

5.14.3.13 Function: UpdateRow


This topic describes the UpdateRow function. This function enables you to update the contents of a row in the specified table.

Synopsis
UpdateRow(SheetName, TableNo,RowNo,DataList)

Note
None

Parameter Description
Parameter SheetName TableNo Parameter Description Name of a sheet. This parameter is of string type. Number of a table. This parameter indicates the number of the table that needs to be updated in the specified sheet. This parameter is of integer type. The value ranges from 0. Number of a row. This parameter indicates the number of the row to be updated. This parameter is of integer type. The value ranges from 0. This parameter is of string sequence type.

RowNo

DataList

Return Value
The return value is an integer. If the data in the specified row is modified successfully, 1 is returned. Otherwise, 0 is returned.

5-274

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Error Handling
None.

Example
NewReport() page1 = AddSheet("sheet1") table1 = AddTable(page1, 6, 8, "table1") valueList = [str(i) for i in range(6 * 8)] SetTableValue(table1, valueList) ret = UpdateRow("sheet1", 0, 1, ["Happy ","new ","year ! "]) SaveReportAs("result.xls")

Related Example

5.14.4 Report Display Function


This topic describes the report display function. This function enables you to define the display style of the a table, range, or cell. For example, you can define the background color, alignment mode, font, and column width. 5.14.4.1 Function: ReportStyle Sets the cell display style. The display style of cells refers to the background color, alignment mode, and font. 5.14.4.2 Function: SetCellAlign This topic describes the SetCellAlign function. This function enables you to set the alignment type of a cell. 5.14.4.3 Function: SetCellBGColor This topic describes the SetCellBGColor function. This function enables you to set the background color of a cell. 5.14.4.4 Function: SetCellFont This topic describes the SetCellFont function. This function enables you to set the font, size, color, bold of a cell. 5.14.4.5 Function: SetColumnWidth This topic describes the SetColumnWidth function. This function enables you to set the width of the specified column in a sheet. 5.14.4.6 Function: SetRangeAlign This topic describes the SetRangeAlign function. This function enables you to set the content alignment type of the specified range. 5.14.4.7 Function: SetRangeBGColor This topic describes the SetRangeBGColor. This function enables you to set the background color of the specified range. 5.14.4.8 Function: SetRangeFont This topic describes the function SetRangeFont function. This function enables you to set the type, size, color, bold of a range in a table. 5.14.4.9 Function: SetTableBGColor This topic describes the SetTableBGColor. This function enables you to set the background color of a table. 5.14.4.10 Function: SetTableFont
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-275

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

This topic describes the SetTableFont function. This function enables you to set the table font. 5.14.4.11 Function: SetTableTitleFont This topic describes the SetTableTitleFont function. This function enables you to set the font, size, color, and bold of the table title.

5.14.4.1 Function: ReportStyle


Sets the cell display style. The display style of cells refers to the background color, alignment mode, and font.

Synopsis
ReportStyle([BgColor[,Align[,Font]]])

Note
l l All input parameters of this function have default values. If you do not specify the input parameters, the default display style is white background and centered. Before calling the ReportStyle function, you need to call the NewReport function.

Parameter Description
Parameter BgColor Description BgColor is an integer. It indicates the background color. The values range from 0 to 39. The default value is White. To know the meaning of Bgcolor, refer to 5.14.5.1 Parameter: Color. Align Align is a character. It indicates the content alignment type within the range. The optional values are as follows: l L or I l C or c l R or r The default value is L. 5.14.5.3 Parameter: Type describes the meanings of Align.

5-276

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Font

Description Font is of tuple type. It contains four elements, that is, type, size, color, and bold. l Type is an integer. It indicates the font type. The optional value ranges from 0 to 8. For details of the meanings of type, refer to 5.14.5.2 Parameter: FontType. l Size is an integer. It indicates the font size. The value ranges from 7 to 36 pounds. l Color is an integer. It indicates the background color. The value ranges from 0 to 39. To know the meaning of color, refer to 5.14.5.1 Parameter: Color. l Bold is an integer. It indicates whether fonts are in bold. The value 1 means that the fonts are in bold. The value 0 means that the fonts are displayed in normal conditions.

Return Value
The return value is an integer. If the display style of cells is created, a value greater than 0 is returned. Otherwise, -1 is returned.

Error Handling
None.

Example
style = ReportStyle(Light_Orange, 'C') exp1 = Selector(':$1 > 50 and :$1 <= 75', style, ROW_MODE)

Related Example

5.14.4.2 Function: SetCellAlign


This topic describes the SetCellAlign function. This function enables you to set the alignment type of a cell.

Synopsis
SetCellAlign(TableHandle, Row, Col[, Type])

Note
Before this function is called, you should call 5.14.3.3 Function: AddTable to create a table.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-277

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Description
Parameter TableHandle Row Parameter Description TableHandle is a long integer. It indicates Handle of the table (the unique identifier of the table). Row is an integer. It indicates the row position. Row number begins from 0. Col Col is an integer. It indicates the column position. The column number begins from 0. Type Type is a character. It indicates the content align type within the range. The optional values are as follows: l L l C l R l l l c l r For detailed meanings of Type, refer to 5.14.5.3 Parameter: Type. The default value is L.

Return Value
The return value is an integer. If the alignment type of the cell is set successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
NewReport() page1 = AddSheet("page1") table1 = AddTable(page1, 6, 8) valueList = [str(i) for i in range(6 * 8)] SetTableValue(table1, valueList) #Set the cell in row 3 and column 5 in table1 to be centered. SetCellAlign(table1, 3, 5, "C") SaveReportAs("example.xls")

Result
A file example.xls is created

Related Example
5-278 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.14.4.3 Function: SetCellBGColor


This topic describes the SetCellBGColor function. This function enables you to set the background color of a cell.

Synopsis
SetCellBGColor(TableHandle, Row, Col, Color)

Note
Before this function is called, you should call 5.14.3.3 Function: AddTable to create a table.

Parameter Description
Parameter TableHandle Row Parameter Description TableHandle is a long integer. It indicates Handle of the table (the unique identifier of the table). Row is an integer. It indicates the row position. Row number begins from 0. Col Col is an integer. It indicates the column position. The column number begins from 0. Color Color is an integer. It indicates the background color. The optional values of Color range from 0 to 39. To know the meaning of Color, refer to 5.14.5.1 Parameter: Color.

Return Value
The return value is an integer. If the background color of the cell is set successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
NewReport() page1 = AddSheet("page1") table1 = AddTable(page1, 6, 8) valueList = [str(i) for i in range(6 * 8)] resultCode = SetTableValue(table1, valueList) resultcode = SetCellBGColor(table1, 3, 3, Teal) SaveReportAs("example.xls")

Related Example
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-279

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.14.4.4 Function: SetCellFont


This topic describes the SetCellFont function. This function enables you to set the font, size, color, bold of a cell.

Synopsis
SetCellFont(TableHandle, Row, Col, FontType[, FontSize[,Color[, bBold]]])

Note
Before calling this function, call 5.14.2.2 Function: NewReport to create a report object, call 5.14.3.2 Function: AddSheet to create a sheet, and call 5.14.3.3 Function: AddTable to create a table.

Parameter Description
Parameter TableHandle Row Col FontType Parameter Description TableHandle is a long integer. It indicates Handle of the table (the unique identifier of the table). Row is an integer. It indicates the row position. Row number begins from 0. Col is an integer. It indicates the column position. The column number begins from 0. FontType is an integer. It indicates the font type. The optional value starts from 0 to 8. For detailed meanings of the values of FontType, refer to 5.14.5.2 Parameter: FontType. FontSize Color FontSize is an integer. It indicates the font size. The value ranges from 7 to 36 pounds. The default value is 9 pounds. Color is an integer. It indicates the background color. The optional values range from 0 to 39. The default value is 0, which indicates black. For details of the optional values for Color, refer to 5.14.5.1 Parameter: Color. bBold bBold is of Boolean type. It indicates whether fonts are in bold. l The value 1 means that the fonts are in bold. l The value 0 means that the fonts are displayed in normal conditions. The default value is 0.

Return Value
The return value is an integer. If the font the cell is set successfully, 1 is returned. Otherwise, 0 is returned.
5-280 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Error Handling
None.

Example
NewReport() page1 = AddSheet("page1") table1 = AddTable(page1, 8, 10, "table1") SetCellValue(table1, 6, 7, "cellvalue") #Set the font of the cell in row 6 and column 7 in table1 to Arial, 10 pounds, #and bold. resultcode = SetCellFont(table1, 6, 7, 0, 10, 19, 1) SaveReportAs("example.xls")

Related Example

5.14.4.5 Function: SetColumnWidth


This topic describes the SetColumnWidth function. This function enables you to set the width of the specified column in a sheet.

Synopsis
SetColumnWidth(SheetHandle, Col[, Width])

Note
l l The setting for column width of the page is only valid for files in .xls format. Before this function is called, you should call 5.14.2.2 Function: NewReport to create a report and call 5.14.3.2 Function: AddSheet to create a sheet.

Parameter Description
Parameter SheetHandle Col Description TableHandle is a long integer. It indicates Handle of the table (the unique identifier of the table). Col is an integer. It indicates the column position. The column number begins from 0. The maximum value is 255. Width Width is an integer. It indicates a multiple of default column width. The default value is 1. The maximum value is 10.

Return Value
The return value is an integer. If the column width of the specified column is set successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-281

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Example
NewReport() page1 = AddSheet("page1") for row in range(4) ret = SetColumnWidth(page1, row, 2 ) end SaveReportAs("example.xls")

Result
A file example.xls is created

Related Example

5.14.4.6 Function: SetRangeAlign


This topic describes the SetRangeAlign function. This function enables you to set the content alignment type of the specified range.

Synopsis
SetRangeAlign(RangeHandle[, Type])

Note
l l For a range whose cells are not set to merge when being created, this function sets the alignment mode of all the cells in the range. Before this function is called, you should call 5.14.3.1 Function: AddRange to create an area.

Parameter Description
Parameter RangeHandle Type Description RangeHandle is a long integer. It indicates Handle of the range (the unique identifier of the range). Type is a string. It indicates the content alignment type. The optional values are as follows: l L l C l R l l l c l r For detailed meanings of the values of Type, refer to 5.14.5.3 Parameter: Type. The default value is L.

5-282

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Return Value
The return value is an integer. If the alignment type of the specified range is set successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
NewReport() page1 = AddSheet("page1") table1 = AddTable(page1, 6, 8) range1 = AddRange(table1, 1, 2, 3, 5, 1) SetRangeValue(range1,'right') resultcode = SetRangeAlign(range1, "R") SaveReportAs("example.xls")

Result
A file example.xls is created

Related Example

5.14.4.7 Function: SetRangeBGColor


This topic describes the SetRangeBGColor. This function enables you to set the background color of the specified range.

Synopsis
SetRangeBGColor(RangeHandle, Color)

Note
l l For a range whose cells are not set to merge when being created, this function sets the background color of all the cells in the range. Before this function is called, you should call 5.14.3.1 Function: AddRange to create an area.

Parameter Description
Parameter RangeHandle Color Description RangeHandle is a long integer. It indicates Handle of the range (the unique identifier of the range). Color is an integer. It indicates the background color. Its value ranges from 0 to 39. For details of the optional values for Color, refer to 5.14.5.1 Parameter: Color.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-283

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Return Value
The return value is an integer. If the background color of the range is set successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
NewReport() page1 = AddSheet("page1") table1 = AddTable(page1, 6, 8) range1 = AddRange(table1, 1, 2, 3, 5, 1) resultcode = SetRangeBGColor(range1, Blue) SaveReportAs("example.xls")

Related Example

5.14.4.8 Function: SetRangeFont


This topic describes the function SetRangeFont function. This function enables you to set the type, size, color, bold of a range in a table.

Synopsis
SetRangeFont(RangeHandle, FontType[, FontSize[, Color[, bBold]]])

Note
l l For the range whose cells are not set to merge when being created, this function sets the font of all the cells in the range. Before this function is called, you should call 5.14.2.2 Function: NewReport to create a report, call 5.14.3.2 Function: AddSheet to add a sheet, call 5.14.3.3 Function: AddTable to add a table, and call 5.14.3.1 Function: AddRange to get a range.

Parameter Description
Parameter RangeHandle FontType Parameter Description RangeHandle is a long integer. It indicates Handle of the range (the unique identifier of the range). FontType is an integer. It indicates the font type. The optional value starts from 0 to 8. To know the meaning of FontType, refer to 5.14.5.2 Parameter: FontType. FontSize FontSize is an integer. It indicates the font size. The value ranges from 7 to 36 pounds. The default value is 9 pounds by default.
5-284 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Color

Parameter Description Color is an integer. It indicates the background color. The optional values range from 0 to 39. The default value is 0, which indicates black. To know the meaning of Color, refer to 5.14.5.1 Parameter: Color.

bBold

bBold is of Boolean type. It indicates whether fonts are in bold. l The value 1 means that the fonts are in bold. l The value 0 means that the fonts are displayed in normal conditions. The default value is 0.

Return Value
The return value is an integer. If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
NewReport() page1 = AddSheet("page1") table1 = AddTable(page1, 6, 8) range1 = AddRange(table1, 1, 2, 3, 5, 1) SetRangeValue(range1, "SetRangeFont") #Set the font of the range to Arial, 9 pounds, red, and not bold. resultcode = SetRangeFont(range1, 0, 9, 16, 0) SaveReportAs("exa09.xls")

Related Example

5.14.4.9 Function: SetTableBGColor


This topic describes the SetTableBGColor. This function enables you to set the background color of a table.

Synopsis
SetTableBGColor(TableHandle, Color)

Note
l l This function re-defines the background color of the cells and ranges in the table. Before calling this function, call 5.14.2.2 Function: NewReport to create a report object, call 5.14.3.2 Function: AddSheet to create a sheet, and call 5.14.3.3 Function: AddTable to create a table.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-285

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Description
Parameter TableHandle Color Description TableHandle is a long integer. It indicates Handle of the table (the unique identifier of the table). Color is an integer. It indicates the background color. Its value ranges from 0 to 39. The default value is 39, representing white. For details of the optional values for Color, refer to 5.14.5.1 Parameter: Color.

Return Value
The return value is an integer. If the background color of the table is set successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
NewReport() page1 = AddSheet("Page1") table1 = AddTable(page1, 6, 8, "Table1") #Set the background color of table1 to yellow. resultcode = SetTableBGColor(table1, 26) SaveReportAs("example.xls")

Related Example

5.14.4.10 Function: SetTableFont


This topic describes the SetTableFont function. This function enables you to set the table font.

Synopsis
SetTableFont(TableHandle, FontType[, FontSize[, Color[, bBold]]])

Note
Before calling this function, call 5.14.2.2 Function: NewReport to create a report object, call 5.14.3.2 Function: AddSheet to create a sheet, and call 5.14.3.3 Function: AddTable to create a table.

5-286

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Description
Parameter TableHandle FontType Description TableHandle is a long integer. It indicates the return value of the Function: AddTable function. FontType is an integer. It indicates the font type. The optional value ranges from 0 to 8. For detailed meaning of the FontType parameter refer to 5.14.5.2 Parameter: FontType. FontSize FontSize is an integer. It indicates the font size. The value ranges from 7 to 36 pounds. The default value is 9 pounds by default. Color Color is an integer. It indicates the background color. The values ranges from 0 to 39. The default value is 0, which indicates black. For detailed meaning of the Color parameter, refer to 5.14.5.1 Parameter: Color. bBold bBold is an integer. It indicates whether fonts are in bold. l The value 1 means that the fonts are in bold. l The value 0 means that the fonts are displayed in normal conditions. The default value is 0.

Return Value
The return value is an integer. If the font of the table is set successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
NewReport() page1 = AddSheet("Page1") table1 = AddTable(page1, 6, 8, "Table1") valueList = [str(i) for i in range(6 * 8)] SetTableValue(table1, valueList) #Set the font of table1 to Century, 9 pounds, red, and bold. resultCode = SetTableFont(table1, 5, 9, Red, 1) SaveReportAs("example.xls")

Related Example

5.14.4.11 Function: SetTableTitleFont


This topic describes the SetTableTitleFont function. This function enables you to set the font, size, color, and bold of the table title.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-287

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Synopsis
SetTableTitleFont(TableHandle, FontType[, FontSize[, FontColor[, bBold]]])

Note
Before calling this function, call 5.14.2.2 Function: NewReport to create a report object, call 5.14.3.2 Function: AddSheet to create a sheet, and call 5.14.3.3 Function: AddTable to create a table.

Parameter Description
Parameter TableHandle FontType Parameter Description TableHandle is a long integer. It indicates Handle of the table (the unique identifier of the table). FontType is an integer. It indicates the font type. The optional value ranges from 0 to 8. To know the meaning of FontType, refer to 5.14.5.2 Parameter: FontType. FontSize FontSize is an integer. It indicates the font size. The value ranges from 7 to 36 pounds. The default value is 9 pounds by default. Color Color is an integer. It indicates the background color. The value ranges from 0 to 39. The default value is 0, which indicates black. For detailed meaning of the Color parameter, refer to 5.14.5.1 Parameter: Color. bBold bBold is an integer. It indicates whether fonts are in bold. l The value 1 means that the fonts are in bold. l The value 0 means that the fonts are displayed in normal conditions. The default value is 0.

Return Value
The return value is an integer. If the font of the table title is set successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
NewReport() page1 = AddSheet("Page1") table1 = AddTable(page1, 6, 8, "Table1")

5-288

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

#Set the font of the title of table1 to "Black", 12 pounds, gray, and bold. resultcode = SetTableTitleFont(table1, 4, 12, 15, 1) SaveReportAs("exa08.xls")

Related Example

5.14.5 Parameters for Operating Report


This topic describes the values and meanings of the report operation parameters. The parameters are Color, FontType, and Type. 5.14.5.1 Parameter: Color This topic describes the Color values and their meanings related to report operations. 5.14.5.2 Parameter: FontType This topic describes the values and meanings of the FontType parameter, which is associated with report operations. 5.14.5.3 Parameter: Type This topic describes the Type values and their meanings related to report operations.

5.14.5.1 Parameter: Color


This topic describes the Color values and their meanings related to report operations. The optional value for Color ranges from 0 to 39, as shown in Figure 5-10. Table 5-27 describes the meaning of each color. Figure 5-10 Optional colors

Table 5-27 Meanings of optional colors Value 0 1


Issue 02 (2010-10-10)

Meaning Black Brown


Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-289

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Value 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

Meaning Olive_Green Dark_Green Dark_Teal Dark_Blue Indigo Gray80 Dark_Red Orange Dark_Yellow Green Teal Blue Blue_Gray Gray50 Red Light_Orange Lime Sea_Grean Aqua Light_Blue Violet Gray40 Pink Gold Yellow Bright_Green Turquoise Sky_Blue Plum Gray25

5-290

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Value 32 33 34 35 36 37 38 39

Meaning Rose Tan Light_Yellow Light_Green Light_Turquoise Pale_Blue Lavender White

5.14.5.2 Parameter: FontType


This topic describes the values and meanings of the FontType parameter, which is associated with report operations. The value of FontType ranges from 0 to 8. Table 5-28 lists the meaning of each value.
NOTE

If the fonts are not defined, the default settings are as follows: l l l l Font: Arial Size: 9 pounds Color: Black Bold: No

Table 5-28 Description of optional font values Value 0 1 2 3 4 5 Century Arial Courier New Meaning Sample

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-291

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Value 6 MS Gothic

Meaning

Sample

7 8

5.14.5.3 Parameter: Type


This topic describes the Type values and their meanings related to report operations. To know the optional Type values and their meanings, refer to Table 5-29. Table 5-29 Type Description Format 'L','l' 'C','c' 'R','r' Meaning The content alignment format is align left. The content alignment format is align center. The content alignment format is align right.

5.14.6 Examples of Report Operation Function


This gives the examples of the report operation function. You can better understand how to use report operation functions to perform routine maintenance.

Example
#create a report object NewReport() Call("cell_sample.hsl") Call("color_sample.hsl") Call("font_sample.hsl") Call("Align_sample.hsl") #save report SaveReportAs("d:/reportSample.xls") SaveReportAs("d:/reportSample.html")

cell_sample.hsl
#create new sheet named"color" page = AddSheet("Edit Table") table1 = AddTable(page, 6, 8, "Modify single cell") table2 = AddTable(page, 6, 8, "Modify cells in range") table3 = AddTable(page, 6, 8, "Fill table with list") #########set a single cell's value###### SetCellValue(table1, 0, 0, "hello")

5-292

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

########set several at one time########## rowFrom = 2 colFrom = 2 rowTo = 3 colTo = 3 range = AddRange(table2, rowFrom, colFrom, rowTo, colTo) SetRangeValue(range, "hello") #########fill table with list################# valueList = ['A','B','C','D','E','F','G','H','I','J','K','L',\ 'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] SetTableValue(table3, valueList) # # # # # AddSheet(sheetname) AddTable(SheetHandle, row, col, tablename) SetCellValue(TableHandle, row, col, pszValue) SetRangeValue(RangeHandle, pszValue) SetTableValue(TableHandle, list)

color_sample.hsl
#create new sheet named"color" page1 = AddSheet("color") table1 = AddTable(page1, 6, 8, "color sample") table2 = AddTable(page1, 25, 8, "Edit table color") ########### set "color sample" table################### def setCellColor(row, col, colorIndex) cell = AddRange(table1, row, col, row, col, 1) if cell SetRangeBGColor(cell, colorIndex) else Print("cell is not found") end end colorIndex = 0; for row in range(6) for col in range(8) setCellColor(row, col, colorIndex) colorIndex = colorIndex + 1 end end ########### set "Edit table color" table################### range1 = AddRange(table2, 1, 0, 7, 7) range2 = AddRange(table2, 8, 0, 9, 7) range3 = AddRange(table2, 10, 0, 13, 7) range4 = AddRange(table2, 14, 0, 20, 7) range5 = AddRange(table2, 21, 0, 24, 7) range6 = AddRange(table2, 1, 5, 3, 7) range7 = AddRange(table2, 1, 6, 2, 7) Color0 = 15 Color1 = 37 Color2 = 38 Color3 = 31 Color4 = 37 Color5 = 36 Color6 = 29 Color7 = 21 Color8 = 13 SetTableBGColor(table2, Color0) SetRangeBGColor(range1, Color1) SetRangeBGColor(range2, Color2) SetRangeBGColor(range3, Color3) SetRangeBGColor(range4, Color4) SetRangeBGColor(range5, Color5) SetRangeBGColor(range6, Color6) SetRangeBGColor(range7, Color7) SetCellBGColor(table2, 1, 7,Color8) #AddRange(TableHandle, rowFrom, colFrom, rowTo, colTo[, bMerged])

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-293

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

#SetRangeBGColor(RangeHandle, Color) #SetCellBGColor(TableHandle, row, col,Color)

font_sample.hsl
#1 create new sheet named "font" page = AddSheet("font") #2 create a table table = AddTable(page, 5, 6, "font") #3 set table header range1 = AddRange(table, 0, 0, 4, 5) SetRangeValue(range1, "Hello world") valueList = ['Font','Normal','Size 15','Size 25','Color','Bold'] SetTableValue(table, valueList) SetCellValue(table, 1, 0, "Arial") SetCellValue(table, 2, 0, "Courier New") SetCellValue(table, 3, 0, "Century") SetCellValue(table, 4, 0, "MS Gothic") #4 basic font sample defaultSize = 15 defaultColor = 0 red = 16 bold = 1 def setRowFont(row,font) SetCellFont(table, row, 1, font) SetCellFont(table, row, 2, font, 7) SetCellFont(table, row, 3, font, 15) SetCellFont(table, row, 4, font, defaultSize, red) SetCellFont(table, row, 5, font, defaultSize, defaultColor, bold) end fontList = [0,1,5,6] for row in range(1,5) font = fontList[row - 1] setRowFont(row,font) end

Align_sample.hsl
#create new sheet named"Align" page1 = AddSheet("Align") #create a table named "Align_Sample" table1 = AddTable(page1, 7, 6, "table1") for row in range(1,7) for col in range(6) SetCellValue(table1, row, col ,"Hello") end end #flush left cellRow = 0 cellCol = 0 SetCellAlign(table1, cellRow, cellCol, 'L') SetCellValue(table1, cellRow, cellCol, 'left') #flush right cellRow = 0 cellCol = 1 SetCellAlign(table1, cellRow, cellCol, 'R') SetCellValue(table1, cellRow, cellCol, 'right') #flush center cellRow = 0 cellCol = 2 SetCellAlign(table1, cellRow, cellCol, 'C') SetCellValue(table1, cellRow, cellCol, 'center') #set align by range range1 = AddRange(table1, 1, 0, 2, 5) SetRangeAlign(range1, 'L') SetRangeValue(range1, "left") range2 = AddRange(table1, 3, 0, 4, 5)

5-294

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


SetRangeAlign(range2, 'R') SetRangeValue(range2, "right") range3 = AddRange(table1, 5, 0, 6, 5) SetRangeAlign(range3, 'C') SetRangeValue(range3, "center")

5 HFC Library Reference

5.15 Directory and File Operation Function


This topic describes the operation functions related to the directories and files. 5.15.1 Overview of Directory and File Operation Function The iSStar provides the directory and file operation functions to operate files and directories. 5.15.2 Function: Open This function enables you to open the file in a specified mode. After the file is successfully opened, you can obtain a file operation ID of unsigned integer. Through the file operation ID, you can have the rights of operating the files through the read, write, and close functions. 5.15.3 Function: read This function enables you to read the data from the opened file. 5.15.4 Function: write This function enables you to write the data into the opened file. 5.15.5 Function: close This function enables you to close the opened file. 5.15.6 Function: FindFiles This function returns the absolute path list for the files that meet the search conditions such as Day. 5.15.7 Function: MkDir This function enables you to create a directory. You must ensure that the parent directory exists. 5.15.8 Function: RmDir This function enables you to delete the specified directory. 5.15.9 Function: GetCwd This function is used to display the current working path. 5.15.10 Function: Remove This function enables you to delete the specified file. 5.15.11 Function: Rename This function enables you to change the name of a file or directory. 5.15.12 Function: ListDir This function lists all the files in the specified folder. 5.15.13 Function: MakeDirs This function enables you to create directories recursively, such as, creating all the intermediatelevel directories (including the lead directory). 5.15.14 Function: RemoveDirs This function enables you to recursively remove the specified directories. 5.15.15 Examples of Directory Operation Function This topic describes how to use the directory operation function through the following example.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-295

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.15.1 Overview of Directory and File Operation Function


The iSStar provides the directory and file operation functions to operate files and directories. The directory and file operation functions enable you to do the following operations: l l l l Create and delete a specified directory. Open a file to read and write. Delete a specified file. Change the file name.

The directory and file operation functions provided by the iSStar are listed in Table 5-30. Table 5-30 List of directory operation functions Function 5.15.2 Function: Open 5.15.3 Function: read 5.15.4 Function: write 5.15.5 Function: close 5.15.6 Function: FindFiles 5.15.7 Function: MkDir 5.15.8 Function: RmDir 5.15.9 Function: GetCwd 5.15.10 Function: Remove 5.15.11 Function: Rename 5.15.12 Function: ListDir 5.15.13 Function: MakeDirs 5.15.14 Function: RemoveDirs Description This function enables you to open the file in a specified mode. This function enables you to read the data from the opened file. This function enables yo to write the data to the opened file. This function enables you to close the opened file. This function returns the absolute path list for the files that meet the search conditions such as Day. This function enables you to create a directory. Ensure that the parent directory exists. This function enables you to delete a specified directory. This function enables you to display get the existing path. This function enables you to delete a specified file. This function enables you to change the name of a file or directory. This function lists all the files in the specified directory. This function enables you to create directories recursively. This function enables you to delete the specified directories recursively.

5.15.2 Function: Open


This function enables you to open the file in a specified mode. After the file is successfully opened, you can obtain a file operation ID of unsigned integer. Through the file operation ID, you can have the rights of operating the files through the read, write, and close functions.
5-296 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Synopsis
Open(filename[,mode])

Note
l l When the file is opened in a 'w' or 'w+' mode, the original data in the file is overwritten when you perform the write operation. When the file is opened in an 'a' or 'a+' mode, the content to be written is added to the end of the file when you perform the write operation.

Parameter Description
Parameter Name The file to be opened. filename
CAUTION For a relative path, the path is relative to that where the script for interface invocation exists. For example, if a.hsl invokes b.hsl and b.hsl invokes Open("test.txt"), the relative path of test.txt is the path of b.hsl.

Description

The modes for opening the file are as follows: l 'r' indicates the read mode. The opened file is used for reading. l 'w' indicates the write mode. In this mode, the file can be cleared. l 'a' indicates the append mode. l 'r+' indicates the read and write mode. l 'w+' indicates the read and write mode. In this mode, the file can be cleared. l 'a+' indicates the read and write mode. The data is written in an append mode.
NOTE l If 't' is appended to the mode, you can specify that the file is opened in text mode. l If 'b' is appended to the mode, you can specify that the file is opened in binary mode. l The 'r+', 'w+', and 'a+' modes support reading and writing operations, but they do not support reading and writing operations at the same time. l In the 'r+' mode, you can write the data at the beginning of the file. The content of the file is overwritten partially. Therefore, illegible characters may occur after you write the data into the file. l In the 'w', 'a', 'w+', 'a+' mode, if the file to be opened does not exist, the file is created.

mode

Return Value
In case of success, the file operation ID is returned. Otherwise, an exception occurs.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-297

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Error Handling
If the specified file does not exist when you open the file in a read mode, the program throws an exception that the specified file does not exist.

5.15.3 Function: read


This function enables you to read the data from the opened file.

Synopsis
File_object.read([size])

Note
l l When using the Read function, you need to open the existing file in a read mode through the Open function. If the length of the data needed to be read exceeds the maximum, you need to read all the data of the file.

Parameter Description
Parameter Name Description By default, the length of the data needed to be read is the maximum data length of the file. The unit is byte, and the value range must be greater than 0. This parameter is optional. If you do not set it, all the data of the file are read by default.

size

Return Value
The return value is the data read from the file.

Error Handling
None.

Example
fp = Open("d:\\Hello.txt",'r') #Assmue that the content of the Hello.txt file is 12345. str = fp.read() Print(str)

Results
12345

5-298

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.15.4 Function: write


This function enables you to write the data into the opened file.

Synopsis
File_object.write(str)

Note
l l When using the Write function, you need to open the existing file in a read mode through the Open function. When the file is opened in a 'w'or 'w+'mode, the written data overwrites the original data of the file. When the file is opened in an 'a'or 'a+'mode, the written data is appended to the end of the file.

Parameter Description
Parameter Name str The string to be written. Description

Return Value
None.

Error Handling
None.

Example
fp = Open("d:\\Hello.txt",'w') str = "12345" fp.write(str) fp.close() fp = Open("d:\\Hello.txt",'r') read_str = fp.read() fp.close() Print(read_str)

Results
12345

5.15.5 Function: close


This function enables you to close the opened file.

Synopsis
File_object.close()
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-299

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Note
None.

Parameter Description
None.

Return Value
None.

Error Handling
None.

Example
fp = Open("d:\\Hello.txt") fp.close()

5.15.6 Function: FindFiles


This function returns the absolute path list for the files that meet the search conditions such as Day.

Synopsis
FindFiles(Directory ,days[,bSubDirectory])

Note
It is recommended to specify an absolute path in Directory. If you specify a relative path, only the current working directory is searched.

Parameter Description
Parameter Name Directory Description The parameter value is a string that indicates the folder path to be searched. Both the Windows path format ('\\') and UNIX path format ('/') are supported. The parameter value is an integer. The positive integer indicates that the files generated several days before are searched. The negative value indicates that the files generated within several days are searched.

days

5-300

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Name

Description This parameter indicates that whether subdirectories are searched. The value is Boolean.

bSubDirectory

If bSubDirectory is True, it indicates that the subdirectories of the directory specified in Directory are searched. If the value is False, it indicates that the subdirectories are not searched. This parameter is optional. If it is not set, the default value False is taken.

Return Value
A string list is returned. The list contains the absolute paths of the files that meet the search conditions.

Error Handling
None.

Example
#Search /export/home/test for the files that were modified three days before. #The subdirectories are not searched. files = FindFiles('/export/home/test', 3) Print(files) #Search d:/test for the files that were modified within three days. #The subdirectories are also searched. files = FindFiles('d:/test', -3, True) Print(files)

5.15.7 Function: MkDir


This function enables you to create a directory. You must ensure that the parent directory exists.

Synopsis
MkDir(Path)

Note
None.

Parameter Description
Parameter Description l Path is a string. It indicates the directory path to be created. It supports Windows-style file path (containing \\) and Unix-style file path (containing /). l Path supports a relative path. The root directory of a relative path is the directory where the iSStar client script is started.

Path

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-301

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Return Value
The return value is of Boolean. If the function is called successfully, True is returned. Otherwise, False is returned.

Error Handling
None. Related Examples

5.15.8 Function: RmDir


This function enables you to delete the specified directory.

Synopsis
RmDir(Path)

Note
When a specified directory is deleted, the directory must be empty. If Path is the existing work path, then the specified directory fails to be deleted.

Parameter Description
Parameter Path Description Path is a string. It indicates the directory path to be deleted. It supports Windows-style file path (containing \\) and Unix-style file path (containing /).

Return Value
The return value is of Boolean. If the function is called successfully, True is returned. Otherwise, False is returned.

Error Handling
None. Related Examples

5.15.9 Function: GetCwd


This function is used to display the current working path.

Synopsis
GetCwd()
5-302 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Note
None.

Parameter Description
None.

Return Value
The return value is a string indicating the current working path.

Error Handling
None. Related Examples

5.15.10 Function: Remove


This function enables you to delete the specified file.

Synopsis
Remove(filename)

Note
l l The file name represented by the filename parameter must exist and allows to be deleted. If the file to be deleted is being used, then the file fails to be deleted.

Parameter Description
Parameter Description filename is a string. It indicates the file to be removed, which may contain the path (the default path is the current path). It supports Windows-style file path (containing \\) and Unix-style file path (containing /).

filename

Return Value
The return value is of Boolean. If the function is called successfully, True is returned. Otherwise, False is returned.

Error Handling
None. Related Examples
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-303

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.15.11 Function: Rename


This function enables you to change the name of a file or directory.

Synopsis
Rename(Src,Dst)

Note
l l l The Src file must exist and allows to be accessed and modified. Dst must ensure that the name of a file or directory is unique. If the name of a file or directory is the same as another name, then the rename operation fails. Scr and Dst must ensure that the rename operation is in accordance with the rule for naming a file name on the current operating system.

Parameter Description
Parameter Src Description Src is a string. It indicates the path of the original file, which may contain the path with the default as the current path. It supports Windows-style file path (containing \\) and Unix-style file path (containing /). Dst is a string. It indicates the path of the renamed file, which may contain the path with the default as the current path. It supports Windows-style file path (containing \\) and Unix-style file path (containing /).

Dst

Return Value
The return value is of Boolean. If the function is called successfully, True is returned. Otherwise, False is returned.

Error Handling
None. Related Examples

5.15.12 Function: ListDir


This function lists all the files in the specified folder.

Synopsis
ListDir(Path)

Note
l
5-304

The directory specified by Path must be available.


Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Files are arranged in the alphabetic order and do not display the symbols "." and ".." in the file directory.

Parameter Description
Parameter Description Path is a string. It indicates the directory of the specified folder. It supports Windows style file path (containing \\) and Unix style file path (containing /). If the Path is null, then the function lists all the files in the folder on the current working path.

Path

Return Value
The return value is a list containing the names of all files in the directory.

Error Handling
None. Related Examples

5.15.13 Function: MakeDirs


This function enables you to create directories recursively, such as, creating all the intermediatelevel directories (including the lead directory).

Synopsis
MakeDirs(Path)

Note
This function can be used to create all the intermediate-level directories, including the leaf directory.

Parameter Description
Parameter Description l Path is a string. It indicates the directory to be created. It supports Windows style file path (containing \\) and Unix style file path (containing /). l Path supports a relative path. The root directory of a relative path is the directory where the iSStar client script is started.

Path

Return Value
The return value is of Boolean. If the function is called successfully, True is returned. Otherwise, False is returned.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-305

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Error Handling
None. Related Examples

5.15.14 Function: RemoveDirs


This function enables you to recursively remove the specified directories.

Synopsis
RemoveDirs(Path)

Note
The leaf directory to be removed is empty, removing succeeds. Otherwise, removing fails. Then you need to remove the parent directory of this leaf directory recursively.

Parameter Description
Parameter Path Description Path is a string. It indicates the directory to be removed. It supports Windows style file path (containing \\) and Unix style file path (containing /).

Return Value
The return value is of Boolean. If the function is called successfully, True is returned. Otherwise, False is returned.

Error Handling
None. Related Examples

5.15.15 Examples of Directory Operation Function


This topic describes how to use the directory operation function through the following example.

Example
#Create a directory MkDir("d:\\Path") MkDir("d:\\Path\\Path1") MkDir("d:\\Path\\Path2") #Create directories recursively MakeDirs("d:\\Path\\Path3\\input") #Get the current path Print("Current path is:") Print(GetCwd()) #Change the file name Rename("d:\\Src.txt","d:\\Path\\Dst.txt")

5-306

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar


#List all the files in the specified folder lst = ListDir("d:\\Path") Print("The file contained in d:\\Path is:") Print(lst) #Remove the specified file Remove("d:\\Path\\Dst.txt") #Remove the specified folder RmDir("d:\\Path\\Path1") #Remove the folder recursively RemoveDirs("d:\\Path\\Path3\\inPut")

5 HFC Library Reference

Result
Assume that the current path is d:, so the results is as follows. Current path is: d: The file contained in d:\Path is: ['Dst.txt', 'Path1', 'Path2', 'Path3']

5.16 GUI Interactive Library Function


GUI interactive library functions enable you to interact with the GUI through the controls during the execution of a task. 5.16.1 Overview of GUI Interactive Library Function The iSStar provides the GUI Interactive library function. This function enables you to interact with the iSStar in the user-defined work area of the GUI interactive interface. 5.16.2 Introduction to GUI Interactive Library Controls The GUI interactive library provides multiple controls to support the function of service interaction. The controls include the single-line input control, password control, radio control, and checkbox control. 5.16.3 Function: CreateForm This function enables you to create a blank form. 5.16.4 Function: Label This function enables you to create a label control. The label control supports only the function of displaying the information. It does not provide the editing function. 5.16.5 Function: Edit This function enables you to create a single-line input control. 5.16.6 Function: CheckBox This function enables you to create a check box control. 5.16.7 Function: RadioBoxGroup This function enables you to create a radio control. 5.16.8 Function: Enter This function enables you to create a feed line control. Feed line controls are used to adjust the layout of an interface. They do not support the input and display functions. The controls of a form can be orderly arranged. You can use a feed line control to locate controls on a new line. 5.16.9 Function: Space This function enables you to create a placeholder control. This control is used to adjust the horizontal locations of the controls. 5.16.10 Function: ShowForm
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-307

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

This function is used to display a new form on the task window. 5.16.11 Function: GetValue This function enables you to obtain the input on controls. 5.16.12 Function: DeleteForm This function enables you to delete not required forms for releasing resources. 5.16.13 Function: TextArea This function enables you to create a text box. The text box is used to display text. 5.16.14 Examples of GUI Interactive Library Function This topic gives some examples to describe how to use GUI interactive library functions.

5.16.1 Overview of GUI Interactive Library Function


The iSStar provides the GUI Interactive library function. This function enables you to interact with the iSStar in the user-defined work area of the GUI interactive interface. l The iSStar provides the work area for GUI interactive interface (It is short for form). This function enables you to input multiple pieces of information on the task once through the form. This function allows you to customize the form to display the user-defined controls. The GUI interactive components are placed in the form. This work area is integrated in the task running window. The form view is hidden by default. The GUI interactive library, however, provides the function for displaying the form. If the function for displaying the form is called, the form view is displayed. After the form is submitted and the interaction is complete, the form is hidden automatically. The GUI interactive library provides multiple controls to support the function of service interaction. The controls include the single-line input control, password control, radio control, checkbox control, and NE display control. The iSStar can automatically lay out the controls on a form view. In addition, you can also adjust the layout flexibly and easily. For details, see 5.16.2 Introduction to GUI Interactive Library Controls.
NOTE

The GUI functions are provided for the locals tasks; therefore, these functions cannot be called when you perform the remote tasks.

The GUI interactive library functions provided by the iSStar are listed in Table 5-31. Table 5-31 List of GUI interactive library functions Function 5.16.3 Function: CreateForm 5.16.4 Function: Label 5.16.5 Function: Edit 5.16.6 Function: CheckBox
5-308

Description This function enables you to create a blank form. This function enables you to create a label. This function enables you to create a single-line input control. This function enables you to create a checkbox control.

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Function 5.16.7 Function: RadioBoxGroup 5.16.8 Function: Enter 5.16.9 Function: Space 5.16.10 Function: ShowForm 5.16.11 Function: GetValue 5.16.12 Function: DeleteForm

Description This function enables you to create a radio control. This function enables you to create a feed line control. This function enables you to create a placeholder control. This function is used to display a new form on the task window. This function enables you to obtain the input information on controls. This function enables you to delete unnecessary forms.

5.16.14 Examples of GUI Interactive Library Function shows examples of creating a GUI interactive interface. The procedure is as follows: 1. 2. 3. 4. 5. 6. Create a blank form. For details, see 5.16.3 Function: CreateForm. Create and customize the controls provided by the library. Then, add the controls to the form. For details, see 5.16.2 Introduction to GUI Interactive Library Controls. Adjust the layout of the controls. For details, see 5.16.2 Introduction to GUI Interactive Library Controls. Call the function for displaying the form. The form controls are displayed. For details, see 5.16.10 Function: ShowForm. After interaction, obtain the input information on the interactive interface. For details, see 5.16.11 Function: GetValue. Remove the form if required. For details, see 5.16.12 Function: DeleteForm.

5.16.2 Introduction to GUI Interactive Library Controls


The GUI interactive library provides multiple controls to support the function of service interaction. The controls include the single-line input control, password control, radio control, and checkbox control.

Introduction to the GUI Interactive Library Controls


For details of GUI interactive library functions, see Table 5-32. Table 5-32 GUI interactive library controls Function 5.16.4 Function: Label
Issue 02 (2010-10-10)

Description Create a label

Control Preview

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-309

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Function 5.16.5 Function: Edit 5.16.6 Function: CheckBox 5.16.7 Function: RadioBoxGro up

Description Create a singleline input control Create a checkbox control Create a radio control

Control Preview ,

Introduction to the Layout of the GUI Interactive Library Controls


For basic concepts involved in the layout of GUI interactive library controls and the details on how to adjust the layout by using auxiliary controls, see Table 5-33. Table 5-33 Layout of the controls Concept Composition of a form view Description A form view consists of title area, control area, and button area, as shown in the following figure.

l Title area: Located on the top of a form view. This area displays the title of the form. The contents of the title area are customized when you create the form. l Control area: This area displays the custom controls, such as ratio controls and input controls. This area is located in the middle of a form view. l Button area: This area displays the buttons in a form view. You can customize the number of buttons and the characters over the buttons. For details, see 5.16.3 Function: CreateForm.

5-310

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Concept Layout of the controls in the control area

Description The controls are arranged horizontally, that is, the controls are arranged from left to right according to the sequence of creation time, as shown in the following figure.

The script is as follows:


form1 = CreateForm("Layout Sample",["send", "cancel"]) Label(form1,100, "label1") Label(form1,100, "label2") Label(form1,100, "label3") ShowForm(form1)

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-311

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Concept Usage of auxiliary layout controls

Description Auxiliary layout controls are used to adjust the layout of the interface. Two types are available, that is, placeholder control and line feed control. l Placeholder control: used to adjust the horizontal location of the controls in a line. The control does not display any character. l Line feed control: used to adjust the vertical location of the controls. All the controls after a line feed character are displayed in a new line. The effect that uses the placeholder control is shown in the following figure.

The script is as follows:


form1 = CreateForm("Layout Sample",["send", "cancel"]) Space(form1,100) Label(form1,100, "label1") Label(form1,100, "label2") Label(form1,100, "label3") ShowForm(form1)

The effect that uses the line feed control is shown in the following figure.

The script is as follows:


form1 = CreateForm("Layout Sample",["send", "cancel"]) Label(form1,100, "label1") Enter(form1) Label(form1,100, "label2") Enter(form1) Label(form1,100, "label3") ShowForm(form1)

5.16.3 Function: CreateForm


This function enables you to create a blank form.

Synopsis
CreateForm (title, buttonList)

Precaution
None.
5-312 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Description
Parameter title buttonList Description title is of string type. It indicates the title of the form to be customized. buttonList is of string list type. It indicates the button list of the form to be customized. The created buttons are displayed on the bottom of the form. The function of the buttons is to check whether the interaction is performed. The form is automatically hidden after the interaction is complete.

Return Value
The return value is an integer. If the function is successfully called, the form ID is returned. Otherwise, a non-positive integer is returned.
NOTE

The form ID uniquely identifies a form object. A valid form ID is a positive integer.

Error Handling
None.

Example
form1 = CreateForm(" This is a form.",["Confirm"]) ShowForm(form1) DeleteForm(form1)

5.16.4 Function: Label


This function enables you to create a label control. The label control supports only the function of displaying the information. It does not provide the editing function.

Synopsis
Label(formId, width, text)

Note
The height of the control is twenty-one pixels and cannot be set.

Parameter Description
Parameter formId Description formId is of integer type. It indicates the ID of a form object.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-313

Issue 02 (2010-10-10)

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter width text

Description It indicates the width of a control. The unit is pixel. It indicates the text information displayed on the Label control. This parameter is of string type.

Return Value
The return value is an integer. In case of success, the ID of the created label control is returned. Otherwise, 0 is returned. The ID of a valid label control is a positive integer.

Error Handling
None.

Example
form1 = CreateForm(" Welcome !",["Confirm"]) Label(form1,180, " This is label.") ShowForm(form1) DeleteForm(form1)

5.16.5 Function: Edit


This function enables you to create a single-line input control.

Synopsis
Edit(formId, width[, text][, bPwd])

Note
The height of the control is twenty-one pixels and cannot be set.

Parameter Description
Parameter formId width text Description formId is of integer type. It indicates the ID of a form object. It indicates the width of the Edit control It indicates the text information displayed on the Edit control. This parameter is optional. If you do not set it, the text information is null by default.

5-314

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter bPwd

Description It is used to define whether a password is required for the Edit control If it is set to True, you need to create a text input control of password type. This parameter is optional. If you do not set it, the default value is False.

Return Value
The return value is an integer. In case of success, the ID of the created text input control is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
bform1 = CreateForm(" Welcome !",["Confirm", "Cancel"]) Label(form1,180, " Please enter your name:") hEdit1 = Edit(form1, 100) Enter(form1) Label(form1,180, " Please enter your password:") hEdit2 = Edit(form1,100,"",True) Enter(form1) ShowForm(form1) DeleteForm(form1)

5.16.6 Function: CheckBox


This function enables you to create a check box control.

Synopsis
CheckBox(formId, width, caption[,selected])

Note
The height of the control is fixed and cannot be set.

Description
Parameter formId Description formId is of integer type. It indicates the ID of a form object.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-315

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter width caption selected

Description It indicates the width of the check box control. The unit is pixel. It indicates the caption displayed on the option. This parameter is of string type. It is used to set the initial selected status of the option control. The value can be True or False. This parameter is optional. If you do not set it, the default value is False. l True: indicates that the control is automatically selected after being created. l False: indicates that the control is automatically deselected after being created.

Return Value
The return value is an integer. In case of success, the ID of the check box control is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
form1 = CreateForm(" Welcome !",["Confirm"]) CheckBox(form1, 150, "CheckBox") ShowForm(form1) DeleteForm(form1)

5.16.7 Function: RadioBoxGroup


This function enables you to create a radio control.

Synopsis
RadioBoxGroup(formId, width, choices, caption[,dimension])

Note
The height of the control is twenty-one pixels and cannot be set.

5-316

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Description
Parameter formId width Description formId is of integer type. It indicates the ID of a form object. It indicates the width of a control. The unit is pixel. The height of the control is twenty-one pixels and cannot be set. It indicates the content of each radio box. This parameter is of string list type. It indicates the caption displayed on the control. This parameter is of string type. dimension is of integer type. It is used to set the column number that the radio controls are displayed. This parameter is optional. If you do not set it, the default value is 1.

choices caption dimension

Return Value
The return value is an integer. In case of success, the ID of the RadioBoxGroup control is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
form1 = CreateForm(" Welcome !",["Confirm"]) choices = ['one','two','three','four','five'] caption = 'A Radio Box' RadioBoxGroup(form1, 200, choices, caption, 2) ShowForm(form1) DeleteForm(form1)

5.16.8 Function: Enter


This function enables you to create a feed line control. Feed line controls are used to adjust the layout of an interface. They do not support the input and display functions. The controls of a form can be orderly arranged. You can use a feed line control to locate controls on a new line.

Synopsis
Enter(formId [,number])

Note
None.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-317

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Description
Parameter formId number Description formId is of integer type. It indicates the ID of a form object. Number of feed lines. The default value is 1.

Return Value
The return value is an integer. In case of success, the ID of the feed line control is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
form1 = CreateForm(" Welcome !",["Confirm"]) Label(form1,150, "p_line1") Enter(form1) Label(form1,150, "p_line2") Enter(form1,2) ShowForm(form1) DeleteForm(form1)

5.16.9 Function: Space


This function enables you to create a placeholder control. This control is used to adjust the horizontal locations of the controls.

Synopsis
space(formId, width)

Note
The height of the control is twenty-one pixels and cannot be set.

Parameter Description
Parameter formId width Description formId is of integer type. It indicates the ID of a form object. It indicates the width of the placeholder control. The unit is pixel.

5-318

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Return Value
The return value is an integer. In case of success, the ID of the created placeholder control is returned. Otherwise, 0 is returned.

Error Handling
None.

Example
form1 = CreateForm(" Welcome !",["Confirm"]) Label(form1,150, "Line1: begin") Label(form1,50, "end") Enter(form1) Label(form1,150, "Line2: begin") Space(form1,100) Label(form1,50, "end") ShowForm(form1) DeleteForm(form1)

5.16.10 Function: ShowForm


This function is used to display a new form on the task window.

Synopsis
ShowForm (formId)

Note
l l A form is not automatically displayed after you call the CreateForm function. You need to call the ShowForm function in the script to display the created form. For a task that does not support the interaction with the GUI, calling the ShowForm function leads to the termination of the task.

Parameter Description
Parameter formId Description It indicates the ID of a form object, that is, the value returned after you call the CreateForm function. This parameter is of integer type.

Return Value
After you call the ShowForm function, the script continues to be executed until you complete the interaction operation in the form. The return value is the text displayed on the button that indicates the completion in the form. For example, in the form, click Continue to complete the interaction. The return value of the ShowForm function is Continue.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-319

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

l l

If the formId entered in the ShowForm function is invalid, for example, no form is corresponding to the formId, the return value of the ShowForm function is None. If calling the ShowForm function fails, None is returned.

Error Handling
None.

Example
form1 = CreateForm(" Welcome !",["Confirm"]) ShowForm(form1) DeleteForm(form1)

5.16.11 Function: GetValue


This function enables you to obtain the input on controls.

Synopsis
GetValue(componentId)

Note
l l l You can call this function only after it is displayed in the home form and the interaction is complete. The return value is None if you call this function to obtain the input information before the controls are displayed. The GetValue function is applicable to only the controls that support the input function. For the controls that do not support the input function, such as the Space and Label controls, the return value is None.

Parameter Description
Parameter componentId Description It indicates the ID assigned to a created control. This parameter is of integer type.

Return Value
The return value is related to the type of the control. For details, see Table 5-34. Table 5-34 Return values Control Type Edit Return Value It is used to return the input information on a text control. The return value is of string type.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Example input

5-320

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Control Type CheckBox

Return Value It is used to return whether the control is selected. If the control is selected, True is returned. Otherwise, False is returned. It is used to return the number of the selected option in the radio control group. The number is an integer ranging from 0. If no option is selected, None is returned.

Example True or False

RadioBoxGroup

Other types

For the controls that do not support the input function, None is returned.

None

Error Handling
None.

5.16.12 Function: DeleteForm


This function enables you to delete not required forms for releasing resources.

Synopsis
DeleteForm(formId)

Precaution
After a form is created, you can repeatedly call the ShowForm function to display the form many times. A form cannot be displayed once being deleted.

Parameter Description
Parameter formId Description formId is of integer type. It indicates the ID of a form object.

Return Value
None.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-321

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Error Handling
None.

Example
form1 = CreateForm(" Welcome !",["Confirm"]) ShowForm(form1) DeleteForm(form1)

5.16.13 Function: TextArea


This function enables you to create a text box. The text box is used to display text.

Synopsis
TextArea(formId,width,height[,text][,editable][,wrapStyleWord])

Note
None.

Parameter Description
Parameter formId width height text editable Description formId is of integer type. It indicates the ID of a form object. Width of the text box, in the unit of pixel. Height of the text box, in the unit of pixel. Text displayed in the text box. The reference type of text is string. By default, no text is displayed. Whether the text box is editable. True indicates that the text is editable, whereas False indicates that the text is not editable. The default value is False. If the length of a row exceeds the allocated control width, the string in the text box has to be displayed in different lines. This parameter is used to set whether the line feed is based on the word border or the character border. True indicates that the line feed is based on the word border, whereas False indicates that the line feed is based on the character border. The default value is False.

wrapStyleWord

Return Value
The return value is an integer. In case of success, the ID of the created text box is returned. Otherwise, 0 is returned.
5-322 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Error Handling
None.

Example
form1 = CreateForm(" Welcome !",["Confirm"]) TextArea(form1,350,20,"Welcome to use TextArea component.") ShowForm(form1) DeleteForm(form1)

5.16.14 Examples of GUI Interactive Library Function


This topic gives some examples to describe how to use GUI interactive library functions.

Example
#Create the first form. form1 = CreateForm(" Welcome !",["Confirm", "Cancel"]) Label(form1,180, " Please enter your name:") hEdit1 = Edit(form1, 100) Enter(form1) Label(form1,180, " Please enter your password:") hEdit2 = Edit(form1,100,"",True) Enter(form1) chkbox = CheckBox(form1, 500, "Don't show this next time.") #Display a dialog box and return the characters on the button clicked. userSelect = ShowForm(form1) #Get the user input. strName = GetValue(hEdit1) strPswd = GetValue(hEdit2) Print("UserName is:%s"%strName) Print("Password is:%s"%strPswd) Print("CheckBox selected is: %s"%str(GetValue(chkbox))) #Delete the form. DeleteForm(form1) #Create a second form. if userSelect == "Confirm" form2 = CreateForm("Please select the right answer",["OK"]) Label(form2, 500, "1+1 =? ") hEnter = Enter(form2) ls=["0","1","2","3"] hRadio1 = RadioBoxGroup(form2, 150, ls, "", 2) ShowForm(form2) #The index counts from 0. "2" corresponds to index 2. #That is, the third option is correct. if GetValue(hRadio1) == 2 Print (strName +"," + " you are right ^_^") else Print (strName + "," + " you are wrong.") end DeleteForm(form2) else Print("User canceled. Bye Bye!") end

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-323

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.17 Task Management Function


The task management functions are the operation functions related to the task. 5.17.1 Overview of Task Management Function The iSStar provides task management functions. These functions enable you to create the required sub tasks when the task is running, obtain the value of the extension parameter of the project and exit from the running script. 5.17.2 Function: CreateTask This function is used to create a sub task. When the task is running, you can call the CreateTask function to create a sub task for concurrently running other required scripts. 5.17.3 Function: Wait This function is used to wait for the sub task to be executed. 5.17.4 Function: GetRegisterKey This function is used to obtain the value of the task parameter, or the value of the extension parameter of the project. 5.17.5 Function: Exit This function is used to exit from the running script.

5.17.1 Overview of Task Management Function


The iSStar provides task management functions. These functions enable you to create the required sub tasks when the task is running, obtain the value of the extension parameter of the project and exit from the running script. A task is a process in which a group of related script files are executed. The scripts in the task are run in serial mode. If these scripts need to call other scripts when the task is running and these called scripts are not associated, you can call the task management function to create sub tasks for concurrently running these called scripts, improving the execution efficiency. The task management functions provided by the iSStar are listed in Table 5-35. Table 5-35 List of task management functions Function 5.17.2 Function: CreateTask 5.17.3 Function: Wait 5.17.4 Function: GetRegisterKey 5.17.5 Function: Exit Description This function is used to create sub tasks for concurrently running other scripts required by the task. This function is used to wait sub tasks to be executed. This function is used to obtain the value of the task parameter, or the value of the extension parameter of the project. This function is used to exit from the running script.

5-324

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.17.2 Function: CreateTask


This function is used to create a sub task. When the task is running, you can call the CreateTask function to create a sub task for concurrently running other required scripts.

Synopsis
CreateTask(filename[,kwargs])

Note
None.

Parameter Description
Parameter Description filename is a string. It indicates the name of the script file run by the task. filename
NOTE filename can be set to a relative path, and the relative path is the path of the current script file.

kwargs

l kwargs is a dictionary. It is a user-defined parameter. It is used to enter the parameter value required when the filename script is running. l The values of both key and value in the kwargs function must be a string.

Return Value
The return value is a tuple (errcode, taskid). The meanings of the two elements in the tuple are as follows: l l errcode is the error code in integer type. 0 indicates that creation is successful. taskid indicates the returned task ID when the sub task is created successfully. taskid is a string.

Error Handling
None.

Example
Print("This is main task.") for i in range(5) Print("In main task we create a subtask.") errorcode,taskid1 = CreateTask("task1.hsl") if (errorcode == 0) #If 0 is returned, it indicates that creating the sub task is successful. Print("Subtask id is "+taskid1) #Print the ID of the sub task. Print("Invoke Wait interface.")

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-325

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Wait(taskid1) #Call the Wait function, wait until the sub task is executed, #and continue to execute the script. end end

5.17.3 Function: Wait


This function is used to wait for the sub task to be executed.

Synopsis
Wait(taskID)

Note
None.

Parameter Description
Parameter taskID Description taskID is a string. It indicates the task ID, that is, the taskid of the return tuple after the CreateTask function is called successfully.

Return Value
None.

Error Handling
None.

5.17.4 Function: GetRegisterKey


This function is used to obtain the value of the task parameter, or the value of the extension parameter of the project.

Synopsis
GetRegisterKey(key)

Note
None

Parameter Description
Parameter Name key Description key is a string. It indicates the name of the parameter to be obtained.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

5-326

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Return Value
In case of success, return the value of key. Otherwise, return None.

Error Handling
None

Example
ret = GetRegisterKey('aa') Print(ret)

Result
None

5.17.5 Function: Exit


This function is used to exit from the running script.

Synopsis
Exit(errID)

Note
None

Parameter Description
Parameter Name errID Description The value oferrID is a positive integer or zero. It indicates the error code. It can be the return value of the Call function.

Return Value
None

Error Handling
None

Example
Create the test.hsl script whose content is:
Print("hello") Exit(0x10) Print("----------------")

Create the main.hsl script whose content is:


Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-327

5 HFC Library Reference


ret = Call("test.hsl") Print(".................") Print(ret)

iManager N2000 UMS Element Management System iSStar

Run the main.hsl script.

Result
hello ................. 16

5.18 Assertion Function


Assertion functions are the operation functions related to assertion. 5.18.1 Overview of Assertion Function iSStarAssertion functions are used to diagnose expressions. 5.18.2 Function: Assert This function enables you to assert expressions. When the value of an expression is False, a running task is interrupted. 5.18.3 Function: Assert_ON This function enables you to turn on the switch of the Assert function and validate the Assert function. 5.18.4 Function: Assert_OFF This function enables you to turn off the switch of the Assert function and invalidate the Assert function.

5.18.1 Overview of Assertion Function


iSStarAssertion functions are used to diagnose expressions. When the value of an expression is False, a running task is interrupted, and the exception information is output. Assertion functions provided in the iSStar are listed in Table 5-36. Table 5-36 List of assertion functions Function 5.18.2 Function: Assert 5.18.3 Function: Assert_ON 5.18.4 Function: Assert_OFF Description This function is used to judge expressions. When the value of an expression is False, a running task is interrupted. This function is used to turn on the switch of the Assert function and validate the Assert function. This function is used to turn off the switch of the Assert function and invalidate the Assert function.

5-328

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

5.18.2 Function: Assert


This function enables you to assert expressions. When the value of an expression is False, a running task is interrupted.

Synopsis
Assert(cond[,prompt])

Note
By default, the Assert function is invalid. You need to set the Assert function to valid through the Assert_ON function.

Parameter Description
Parameter cond Description It indicates an expression to be asserted. When the value of cond is False, the content of prompt is exported, and a running task exits exceptionally. prompt is a string. It indicates an exceptional information to be exported. This parameter is optional. If you do not set it, the default value is null.

prompt

Return Value
None.

Error Handling
None.

5.18.3 Function: Assert_ON


This function enables you to turn on the switch of the Assert function and validate the Assert function.

Synopsis
Assert_ON()

Note
By default, the Assert function is invalid.

Parameter Description
None.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-329

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Return Value
None.

Error Handling
None.

5.18.4 Function: Assert_OFF


This function enables you to turn off the switch of the Assert function and invalidate the Assert function.

Synopsis
Assert_OFF()

Note
None.

Parameter Description
None.

Return Value
None.

Error Handling
None.

5.19 Function: ModifyProjParam


This function allows you to refresh the service parameter (paramDic) to the HFC interface of the project package.

Synopsis
ModifyProjParam(hspName, paramDic)

Precaution
The maximum number of service parameters is 1000, that is, the values of key and value of the paramDic parameter are 1000 pairs at most.

5-330

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Parameter Description
Parameter hspName paramDic Description hspName is of string type. It must be the local absolute path of the project package. paramDic is of dictionary type. The values of key and value are case sensitive.

Return Value
The return value is of Boolean type. True indicates that refresh operation for project parameters is succeeded. False indicates that parameters refresh operation for project parameters is failed.

Error Handling
None.

5.20 Mail Sending Function


The functions of setting the mail server information, setting mail information, and sending mails are available. 5.20.1 Overview of Mail Sending Functions By using the mail sending functions provided by the iSStar, you can set the parameters about communications with the mail server and then send the specified information to a receiver. 5.20.2 Function: CreateLoginInfo This function is used to set the mail server. 5.20.3 Function: CreateMailInfo This function is used to set the information about a new mail, such as the receiver, copy-to, mail subject, and text. 5.20.4 Function: SendMail This function is used to generate the mail contents based on mail information and send mails. After the mails are sent, the SendMail function disconnects from the mail server automatically.

5.20.1 Overview of Mail Sending Functions


By using the mail sending functions provided by the iSStar, you can set the parameters about communications with the mail server and then send the specified information to a receiver. Table 5-37 lists the Mail Sending functions provided by the iSStar. Table 5-37 List of mail sending functions Function 5.20.2 Function: CreateLoginInfo
Issue 02 (2010-10-10)

Description This function is used to set the mail server.

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-331

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Function 5.20.3 Function: CreateMailInfo 5.20.4 Function: SendMail

Description This function is used to set the information about a new mail, such as the receiver, copy-to, mail subject, and text. This function is used to generate the mail contents based on mail information and send mails. After the mails are sent, the SendMail function disconnects from the mail server automatically.

5.20.2 Function: CreateLoginInfo


This function is used to set the mail server.

Synopsis
CreateLoginInfo(SERVER_ADDR[,SERVER_PORT])

Note
None.

Description
Parameter SERVER_ADDR Description SERVER_ADDR is a dictionary key value. It indicates the address of the SMTP mail server. The value is a string of characters. SERVER_PORT is a dictionary key value. It indicates the port of the mail server. This parameter is optional. If you do not set it, the default value is 25. The value is an integer.

SERVER_PORT

Return Value
Return the data dictionary of the mail server information. Set the value based on the key value of the data dictionary. It is used to set other optional information of the mail server. The options that can be set include: l SSL_MODE: SSL_MODE is a dictionary key value. It indicates whether the mail server supports SSL mode. The options are Boolean values, True or False. The default value is True. NICK_NAME: NICK_NAME is a dictionary key value. It indicates the nick name of the user. The value is a string of characters. USER_NAME: USER_NAME is a dictionary key value. It indicates the mail user registered on the mail server. The value is a string of characters. PASSWORD: PASSWORD is a dictionary key value. It indicates the password of the mail user. The value is a string of characters.
Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

l l l

5-332

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Error Handling
None.

Example
#Replace smtp.test.com in the following example #with the actual domain name of the smtp mail server. #Replace the following sample mail addresses with actual mail addresses. #Set the information of the mail server. The default port number is 25. loginInfo=CreateLoginInfo('smtp.test.com') #Set the following information as required. loginInfo['SSL_MODE']=False loginInfo['NICK_NAME']='tester' loginInfo['USER_NAME']='' loginInfo['PASSWORD']='' #Create the first mail contents. mailInfo1=CreateMailInfo() #Call the key value of the data dictionary to obtain the corresponding value #that is used as the mail contents. #The following items cannot be empty at the same time. mailInfo1['TO_ADDR']='tester@test.com' mailInfo1['CC_ADDR']=('tester2@test.com','tester3@test.com') mailInfo1['BCC_ADDR']=['tester4@test.com','tester5@test.comm'] #Set the following information as required. mailInfo1['FROM_ADDR']='tester1@test.com' mailInfo1['MAIL_SUBJECT']='test1' mailInfo1['MAIL_BODY']='this is a test1' mailInfo1['MAIL_ATTACH']='c:/text.rar' # The attachment text.rar must exist. #Create the second mail contents. mailInfo2=CreateMailInfo() mailInfo2['TO_ADDR']='tester2@test.com' mailInfo2['MAIL_SUBJECT']='test2' mailInfo2['MAIL_BODY']='this is test2' #Call the mail sending function to send the mail customized in mailInfo1. #Check the receivers' mailboxes to see whether the receivers receive the mail. #The title is "test", the contents is "this a test", and the attachment is text.rar. result1=SendMail(mailInfo1) result2=SendMail((mailInfo1,mailInfo2)) Print(result1) Print(result2) # Get the error message for the first mail. errorInf1=result1[0] # Error Code errorCode=errorInf1[0] # Error Description errorMsg=errorInf1[1] # Get the error message for the second mail. errorInf2=result2[1] errorCode=errorInf2[0] errorMsg=errorInf2[1]

Result
# The result of Print(result1) (1, 'success') # The result of Print(result2) [(1, 'success'), (1, 'success')]

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-333

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

5.20.3 Function: CreateMailInfo


This function is used to set the information about a new mail, such as the receiver, copy-to, mail subject, and text.

Synopsis
CreateMailInfo()

Note
None

Description
None

Return Value
Return the data dictionary of mail information. Set the value based on the key value of the data dictionary. It is used to set other optional information of the mail server. The options that can be set include: l l FROM_ADDR: FROM_ADDR is a dictionary key value. It indicates the receiver address of the mail. The value is a string of characters. TO_ADDR: TO_ADDRis a dictionary key value. It indicates the address list of the mail to be sent. The value is a string of characters, or a tuple or list of character strings.
NOTE

l TO_ADDR, CC_ADDR, and BCC_ADDR cannot be null at the same time. l A single address can be represented by a single string of characters. If there are multiple addresses, place them in a pair of parentheses or square brackets, and separate the addresses with commas (",").

l l l l l

CC_ADDR: Indicates the address list of the copy-to mails. The value is the same as that of TO_ADDR. BCC_ADDR: Indicates the address list of the blind-copy mails. The value is the same as that of TO_ADDR. MAIL_SUBJECT: MAIL_SUBJECT is a dictionary key value. It indicates the subject of the mail. The value is a string of characters. MAIL_BODY: MAIL_BODY is a dictionary key value. It indicates the text of the mail. The value is a string of characters. MAIL_ATTACH: MAIL_ATTACH is a dictionary key value. It indicates the list of attachments of the mail. The value is a string of characters.
NOTE

If there is only one attachment, a single string of characters is set as the path of the attachment. If there are multiple attachments, place them in a pair of parentheses or square brackets, and separate the addresses with commas (",").

Error Handling
None.
5-334 Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

Example
#Replace smtp.test.com in the following example #with the actual domain name of the smtp mail server. #Replace the following sample mail addresses with actual mail addresses. #Set the information of the mail server. The default port number is 25. loginInfo=CreateLoginInfo('smtp.test.com') #Set the following information as required. loginInfo['SSL_MODE']=False loginInfo['NICK_NAME']='tester' loginInfo['USER_NAME']='' loginInfo['PASSWORD']='' #Create the first mail contents. mailInfo1=CreateMailInfo() #Call the key value of the data dictionary to obtain the corresponding value #that is used as the mail contents. #The following items cannot be empty at the same time. mailInfo1['TO_ADDR']='tester@test.com' mailInfo1['CC_ADDR']=('tester2@test.com','tester3@test.com') mailInfo1['BCC_ADDR']=['tester4@test.com','tester5@test.comm'] #Set the following information as required. mailInfo1['FROM_ADDR']='tester1@test.com' mailInfo1['MAIL_SUBJECT']='test1' mailInfo1['MAIL_BODY']='this is a test1' mailInfo1['MAIL_ATTACH']='c:/text.rar' # The attachment text.rar must exist. #Create the second mail contents. mailInfo2=CreateMailInfo() mailInfo2['TO_ADDR']='tester2@test.com' mailInfo2['MAIL_SUBJECT']='test2' mailInfo2['MAIL_BODY']='this is test2' #Call the mail sending function to send the mail customized in mailInfo1. #Check the receivers' mailboxes to see whether the receivers receive the mail. #The title is "test", the contents is "this a test", and the attachment is text.rar. result1=SendMail(mailInfo1) result2=SendMail((mailInfo1,mailInfo2)) Print(result1) Print(result2) # Get the error message for the first mail. errorInf1=result1[0] # Error Code errorCode=errorInf1[0] # Error Description errorMsg=errorInf1[1] # Get the error message for the second mail. errorInf2=result2[1] errorCode=errorInf2[0] errorMsg=errorInf2[1]

Result
# The result of Print(result1) (1, 'success') # The result of Print(result2) [(1, 'success'), (1, 'success')]

5.20.4 Function: SendMail


This function is used to generate the mail contents based on mail information and send mails. After the mails are sent, the SendMail function disconnects from the mail server automatically.
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 5-335

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Synopsis
SendMail(mailInfos)

Note
None.

Description
Parameter mailInfos Description This parameter indicates a singular mailInfo instance created by CreateMailInfo, or a list composed by multiple mailInfo instance.

Return Value
If the parameter is a singular mailInfo instance or a list composed by one mailInfo instance, this function returns an array including error code and error message; if the parameter is a list composed by multiple mailInfo instance (two or more), this function returns a same-length list which is composed by the corresponding arrays including error code and error message. Errors that occur during mails sending can be located based on error codes. There are six kinds of error codes: l l l l l l 0: Error in SMTP server connection 1: Successful execution 2: Login error 3: Incorrect mail address 4: Error in attachment loading 5: Incorrect user parameters

Error Handling
None.

Example
#Replace smtp.test.com in the following example #with the actual domain name of the smtp mail server. #Replace the following sample mail addresses with actual mail addresses. #Set the information of the mail server. The default port number is 25. loginInfo=CreateLoginInfo('smtp.test.com') #Set the following information as required. loginInfo['SSL_MODE']=False loginInfo['NICK_NAME']='tester' loginInfo['USER_NAME']='' loginInfo['PASSWORD']='' #Create the first mail contents. mailInfo1=CreateMailInfo() #Call the key value of the data dictionary to obtain the corresponding value #that is used as the mail contents. #The following items cannot be empty at the same time. mailInfo1['TO_ADDR']='tester@test.com'

5-336

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

5 HFC Library Reference

mailInfo1['CC_ADDR']=('tester2@test.com','tester3@test.com') mailInfo1['BCC_ADDR']=['tester4@test.com','tester5@test.comm'] #Set the following information as required. mailInfo1['FROM_ADDR']='tester1@test.com' mailInfo1['MAIL_SUBJECT']='test1' mailInfo1['MAIL_BODY']='this is a test1' mailInfo1['MAIL_ATTACH']='c:/text.rar' # The attachment text.rar must exist. #Create the second mail contents. mailInfo2=CreateMailInfo() mailInfo2['TO_ADDR']='tester2@test.com' mailInfo2['MAIL_SUBJECT']='test2' mailInfo2['MAIL_BODY']='this is test2' #Call the mail sending function to send the mail customized in mailInfo1. #Check the receivers' mailboxes to see whether the receivers receive the mail. #The title is "test", the contents is "this a test", and the attachment is text.rar. result1=SendMail(mailInfo1) result2=SendMail((mailInfo1,mailInfo2)) Print(result1) Print(result2) # Get the error message for the first mail. errorInf1=result1[0] # Error Code errorCode=errorInf1[0] # Error Description errorMsg=errorInf1[1] # Get the error message for the second mail. errorInf2=result2[1] errorCode=errorInf2[0] errorMsg=errorInf2[1]

Result
# The result of Print(result1) (1, 'success') # The result of Print(result2) [(1, 'success'), (1, 'success')]

5.21 Function: SendSMSMessage


This function is used to send short messages on the N2000 UMS server.

Prototype
SendSMSMessage(Destination, Msg)

Precautions
This function can be used on the N2000 UMS server only.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

5-337

5 HFC Library Reference

iManager N2000 UMS Element Management System iSStar

Parameter Description
Parameter Destination Parameter Description Mobile phone number of the receiver, which is of the string type.
NOTE l Multiple mobile phone numbers are separated by semicolons. l Each mobile phone number must contain a country code. For example, in +8613800755500, 86 is the country code of China.

Msg

Contents to be sent, which is of the string type.

Return Values
If the operation is successful, the function returns True; otherwise, the function returns False.

Error Handling
None.

Example
#Send the message "This is a test" to the mobile phone number +8613800755500. SendSMSMessage(+8613800755500, "This is a test")

5-338

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

6 iSStar Interface Description

6
About This Chapter

iSStar Interface Description

This topic provides the reference information of the iSStar GUI. 6.1 Interface Description: iSStar Main Window This topic describes elements and functions provided in iSStar Main Window. 6.2 Interface Description: Application Management Window For users who are only concerned with executing scripts to provide a service function, they can directly use Application Management provided by iSStar. Users can manage the script application through Application Management without having to have special knowledge about implementation details of the script. 6.3 Interface Description: Script Running Window This topic describes the script running window, from which you can know all the parts in the window and the function of each part. 6.4 Interface Description: Script Debugging Window This topic describes the script debugging window, from which you can know all the parts in the window and the function of each part. 6.5 Interface Description: Task Management Window The iSStar Task Manage Window displays the information about and the execution status of all tasks, such as the script file, task type, task status, running progress, start time, and end time. 6.6 Parameter Description: Project Attribute This topic describes the meanings of each parameter in the Project Attributes window. You can use these parameters when you modify or view the project attributes. 6.7 Parameter Description: Configuring Virtual NEs This topic describes the meanings of each parameter in the Configuring Virtual NEs dialog box. You can use these parameters when you configuring virtual NEs. 6.8 Parameter Description: Script Pack Setting This topic describes the meanings of each parameter in the Script Pack Setting window. You need to set these parameters when you pack scripts into a project package through script packing setting. 6.9 Parameter Description: Script Timing Task of the iSStar
Issue 02 (2010-10-10) Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd. 6-1

6 iSStar Interface Description

iManager N2000 UMS Element Management System iSStar

This topic describes the script timing task parameters of the iSStar. When creating or modifying a script timing task of the iSStar, you need to set these parameters.

6-2

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

6 iSStar Interface Description

6.1 Interface Description: iSStar Main Window


This topic describes elements and functions provided in iSStar Main Window. Open the iSStar Main Window, as shown in Figure 6-1. For details about the functions mentioned in Figure 6-1, see Table 6-1.
NOTE

l l

You can manage a maximum of 100 script files in the main window. Only one file can be displayed on a tab page in the window. Various output information about script files is displayed in the output area of the window.

Figure 6-1 iSStar Main Window

Project management area

Information output area

Script editing area

Tab bar

Toolbar

Table 6-1 Description of iSStar Main Window Window Component Project management area Description Provides the functions of creating and editing the project. For the operations that can be performed in the project management area, see 3.2.3 Creating a Script Project, 3.2.4 Debugging a Script Project and 3.3.3 Running a Script Project.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

6-3

6 iSStar Interface Description

iManager N2000 UMS Element Management System iSStar

Window Component Information output area

Description l The Syntax Check tab displays the information of the script running or the debugging syntax check. l The Task Log tab displays the log information of task management operations. The task management operations include creating, running, debugging, and deleting tasks.

Script editing area

Provides the functions of developing , editing the script and setting breakpoints. The common edit functions include copying, cutting, pasting, finding, replacing, printing, undoing, redoing, locating line number, and setting bookmarks. For detailed operations, see 3.2.1 Creating a Script File. By using the breakpoint functions, you can set or delete breakpoints to debug scripts. For detailed operations, refer to Debugging a Script File.

Tab bar

Displays the script that is currently opened and provides the file management functions. The file management functions include creating, opening, saving, saving as, and closing the files, and closing all files.

6-4

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

6 iSStar Interface Description

Window Component Toolbar

Description Provides the shortcuts of the common scripts. l l l l l l l l l l : Create a script file. : Open the existing script file. : Save the script file. : Save the script file as another file. : Print the context of the script file. : Cut the script. : Copy the script. : Paste the script. : Run the task or run only the specified part of script files. : Debug the task. For detailed operations, see 3.2.2 Debugging a Script File. : Check the syntax of the script files. The check results are displayed in the output area. Click the error message (including the file name, details, and line number). The icon is displayed in the location where the error line is. This icon can be used to locate the line where the error is. : Switch the window to iSStar Task Manage Window so as to check whether the task is performed. : Configure virtual NEs. Virtual NEs can be used to simulate interactions through MML commands. Thus, basic logic of an MML script can be debugged. For details about the operations, see 6.7 Parameter Description: Configuring Virtual NEs. : Select an NE for the running task in the Please Select NE dialog box. : Create tasks in batches. You can select multiple NEs and create multiple tasks. : Display the Task Management window.

l l

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

6-5

6 iSStar Interface Description

iManager N2000 UMS Element Management System iSStar

6.2 Interface Description: Application Management Window


For users who are only concerned with executing scripts to provide a service function, they can directly use Application Management provided by iSStar. Users can manage the script application through Application Management without having to have special knowledge about implementation details of the script. You can manage the script applications in the Application Management window. That is, you can create, download, release, execute, view, or delete script applications. Figure 6-2 shows the Application Management window. Figure 6-2 Application Management window

6-6

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

6 iSStar Interface Description

Table 6-2 Description of the Application Management window Area Tool bar Description Displays the shortcut icons for the management of applications. l l l l l l l : adds a workstation. : adds shortcuts. : deletes shortcuts. : runs the programs of the selected shortcuts. : views or modifies the attributes of the selected shortcuts. : releases files. You can upload files to the server. : downloads files. You can download the programs corresponding to the selected remote shortcuts to the local computer. : deletes remote files. You can delete the programs corresponding to the selected remote shortcuts. : manages remote files. You can view the information about the programs on the server. In addition, you can upload and download programs. : selects the NEs required by the program. : creates tasks in batches. You can select multiple NEs to create tasks in batches. : starts the Task Management window. : compresses the script files or Python files into .hsp files for the application platform and script scheduled tasks to use. To set the parameters for script pack please refer to 6.8 Parameter Description: Script Pack Setting. : switches the window to iScript Task Manage Window to display the execution of the tasks.

l l

l l

l Workspace

In iSStar, the tab page of the Application Management window is called workspace. You can create a workspace or create script applications in the workspace.
NOTE A workspace can store less than 70 bookmarks. A maximum of 10 workspaces can be created.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

6-7

6 iSStar Interface Description

iManager N2000 UMS Element Management System iSStar

Area Shortcut

Description A bookmark is related to a script application and is the entrance for execution of the script application. A bookmark is displayed as an icon in the Application Management window.

6.3 Interface Description: Script Running Window


This topic describes the script running window, from which you can know all the parts in the window and the function of each part. l l l l l If the Graphical User Interface (GUI) interaction library function is called in the script file, the running window is displayed, as shown in Figure 6-3. If the GUI interaction library function is not called in the script file, the GUI interaction area in the running window is hidden, as shown in Figure 6-4. For description of the script running window, see Table 6-3. One script task maps to one script running window. The system supports a maximum of 50 tasks that consist of running and debugging tasks, and only one debugging task is supported.

Figure 6-3 iSStar Execute Window

6-8

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

6 iSStar Interface Description

Figure 6-4 iSStar Execute Window

Table 6-3 Description of iSStar Execute Window Window Component Toolbar Description Provides control buttons for executing scripts. The meanings for the buttons are as follows: l : indicates the Stop button, which is used to stop a running task. If execution of a script file is complete, the button is greyed out. : indicates the Run button, which is used to run a script, project or task again. : indicates the Pause/Resume button. After a script file is paused, the button turns execution of the script file. l l l . You can click to resume the

: indicates the folder where the default output file of the task is. : indicates the Close button, which is used to close the iSStar Execute Window. : indicates the Edit button. When a task is being executed, you can click the button to switch to the iSStar Main Window. Then you can edit the script file being executed. After the file is edited, the new settings can take effect during the next running. : indicates the Task Management button. When a task is being executed, you can click the button to switch to the iSStar Task Manage Window. Then you can view the basic information and the execution status of the tasks.
6-9

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

6 iSStar Interface Description

iManager N2000 UMS Element Management System iSStar

Window Component Print output area MML packet output area MML command statistics GUI interaction area

Description Displays the output information on the Print function in the script file. Displays the information of the running MML command and its return value when the script is being executed. Displays the total number of MML commands delivered in the script file, the number of MML commands executed successfully, and the number of MML commands that fail to be executed. Displays the GUI interaction controls created after the GUI interaction library function is called in the script file, to interact with the GUI. If the GUI interaction library function is not called in the script file, the GUI interaction area is hidden.

6.4 Interface Description: Script Debugging Window


This topic describes the script debugging window, from which you can know all the parts in the window and the function of each part. l l l If the Graphical User Interface (GUI) interaction library function is called in the script file, the debugging window is displayed, as shown in Figure 6-5. If the GUI interaction library function is not called in the script file, the GUI interaction area in the debugging window is hidden, as shown in Figure 6-6. For description of the script running window, see Table 6-4.

CAUTION
l l The system can support only one debugging task. The system supports a maximum of 50 tasks that consist of debugging tasks and running tasks.

6-10

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

6 iSStar Interface Description

Figure 6-5 iSStar Debug Window

Toolbar

Display area

Output area

GUI interaction area

Figure 6-6 iSStar Debug Window

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

6-11

6 iSStar Interface Description

iManager N2000 UMS Element Management System iSStar

Table 6-4 Description of iSStar Debug Window Window Component Toolbar Description Provides the shortcut icons for debugging. l : Through this button, you can switch the current window to iSStar Main Window. Then you can edit the corresponding script file according to debugging results. : Through this button, you can switch the current window to iSStar Task Manage Window. Then you can view the execution status of the task in time.

l For details of the shortcut icons for debugging, see 3.2.2 Debugging a Script File. Display area Output area Displays the content of the existing script. For details, see 3.2.2 Debugging a Script File. Displays various information during the debugging of the script file. The information includes output information, MML packet information, stack information, file lists, and variable observation information. For details, see Table 6-5. Displays the GUI interaction controls created after the GUI interaction library function is called in the script file, to interact with the GUI. If the GUI interaction library function is not called in the script file, the GUI interaction area is hidden.

GUI interaction area

Table 6-5 Output area Name Message Output Description l The Message Output tab displays the system information during the execution of the script. The system information includes script output information (debugging information and running information), error, and syntax check results. l The output messages are added to the tab line by line. When the number of the lines exceeds 3000, the first 1000 messages are deleted. l In the Message Output tab, right-click to copy, clear, find, save, or redirect the output message.
NOTE The Redirect to operation is only to save all output messages of the script after it is performed.

6-12

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

6 iSStar Interface Description

Name MML Response

Description l The MML Response tab contains the MML commands and output information that involved in the operation and commissioning of the script file. If the running commands carry subsequent packets, multiple MML packets with the same ID are returned. l The tab displays a maximum of 3000 message lines. If the number exceeds the limit, the earliest 1000 messages are deleted. l In the MML Response tab, right-click to copy, clear, find, save, or redirect the output message.
NOTE The Redirect to operation is only to save all output messages of the script after it is performed.

File List Stack Information

If the script file call other script files, the full path of the called script files will be displayed in the File List window. l The message of the full path called by the active function is displayed on the Stack Information tab. l The stack messages are refreshed when the script file is executed. Stack messages can be displayed in different forms based on the requirements.

Watch

l The changes of arguments during the debugging of script files are displayed on the Watch tab. l In the Watch tab, right-click to add or remove to-be-watched variables.
NOTE l The Watch tab displays a maximum of 32 observed arguments. l If the argument selected from a script has spaces before or after the argument name, the spaces are automatically deleted when you add the argument to the Watch tab. l You can copy, modify, and delete argument names, but you cannot edit argument values. l In the output area of iSStar Debug Window, you can right-click an argument to be observed and choose Add to Watch to add the argument. l If the debugging is stopped, no messages are displayed on the Watch tab.

6.5 Interface Description: Task Management Window


The iSStar Task Manage Window displays the information about and the execution status of all tasks, such as the script file, task type, task status, running progress, start time, and end time. l l iSStar Task Manage Window is shown in Figure 6-7. For details of the iSStar Task Manage Window, see Table 6-6 and Table 6-7.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

6-13

6 iSStar Interface Description

iManager N2000 UMS Element Management System iSStar

Figure 6-7 iSStar Task Manage Window

Table 6-6 Description of iSStar Task Manage Window Name Local Task tab Remote Task tab Script File Description The Local Task tab page displays the information about and execution status of all local tasks. The Remote Task tab page displays the information about and execution status of all remote tasks. Shows the script to be executed or the main file to be run. Setting In iSStar Task Manage Window, when the task state is Waiting, click in the toolbar to select the main file of the task. Task Type Selected NE Status Shows the classification of the tasks. Shows the NE that runs this task. Describes the status of the task that is running or debugged. When the task is running, it has six states. For details, see Table 3-1. When the task is debugged, it has four states. For details, see Table 3-2. -

6-14

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

6 iSStar Interface Description

Name Progress

Description Displays the running progress of the task. Progress display is divided into two types: l The script contains the statement for progress display When the statement for progress display is run, the progress value written in this statement is displayed. l The script does not contain the statement for progress display When the task is executed at the beginning, the progress value is displayed as 0%. When this task is complete, the progress value is displayed as 100%. If the task stops abnormally, the progress value is displayed as 0%.

Setting -

Start Time End Time

Displays the time to start running the task. Displays the time to stop running the task.

Table 6-7 Shortcut buttons Shortcut Button Description To switch the current window to iSStar Main Window. To select main files after you create a task in iSStar Task Manage Window. To select NEs, if required, in the displayed Please Select Ne dialog box. To refresh the iSStar Task Manage Window.

6.6 Parameter Description: Project Attribute


This topic describes the meanings of each parameter in the Project Attributes window. You can use these parameters when you modify or view the project attributes.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

6-15

6 iSStar Interface Description

iManager N2000 UMS Element Management System iSStar

Parameters
Table 6-8 Basic Parameters Parameter Name Project name Description Description: Name of the project. Setting Setting method: In the Project name text box, enter a meaningful project name that can be English letters, numbers and _ only. Setting method: Click next to the Project path text box, and then choose the save path of the project. Setting method: Click next to the Main file text box, and then choose the main file of the project. Main file is optional. You can set the main file of the project after creating the project successfully. For details on how to set the main file of the project, see 3.2.3 Creating a Script Project. Setting method: In the Project description text box, enter the description of the project. You can enter any Chinese and English characters. Running on background Description: Whether the project is running on background. Setting method: Yes: indicates that the project is running on background. The running window and task management window are not displayed. No: indicates that the project is running on the GUI client. The running window is displayed. Created by Description: The creator of the project. Creation time Description: The time to create the project. Description: This parameter is used to display script files making up of the project. Setting method: By default, the creator is the user who logging in to the current operating system. It can be changed. Setting method: The creation time cannot be edited. It is filled in by the system. Setting method: The file list cannot be edited.

Project path

Description: The path used to save the project.

Main file

Description: The main file of the project. It is the entrance to run the project and the project package.

Project description

Description: The description of the project.

File list

6-16

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

6 iSStar Interface Description

Parameter Name Language version

Description Description: The version of the current script language.

Setting Setting method: The language version cannot be edited. It is filled in by the system.

Table 6-9 Preset parameters Parameter Name Variable Description Description: The variable whose variable value needs to be entered when the project is running. Default value Description: The variable value needed to be entered when the project is running. Description: Variable description. Setting Setting method: Click New. In the New Variable dialog box, enter the variable name.

Setting method: Click New. In the New Variable dialog box, enter the default value.

Description

Setting method: Click New. In the New Variable dialog box, provide the variable description.

6.7 Parameter Description: Configuring Virtual NEs


This topic describes the meanings of each parameter in the Configuring Virtual NEs dialog box. You can use these parameters when you configuring virtual NEs.

Parameters
Paramete r Name Use the virtual NE debugging mode Description Description: Enable or disable the virtual NE debugging mode as required. Setting Setting method: Select or deselect Use the virtual NE debugging mode.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

6-17

6 iSStar Interface Description

iManager N2000 UMS Element Management System iSStar

Paramete r Name Virtual NE List

Description Description: Display all virtual NEs of the iSStar.

Setting Setting method: Do as follows to create, copy, and delete a virtual NE: l Create a virtual NE Click . Set the virtual NE parameters, and then configure MML commands as required. Click Confirm. l Copy a virtual NE In the virtual NE list, select a virtual NE, and then click . Set the virtual NE parameters, and then configure MML commands as required. Click Confirm. l Delete a virtual NE In the virtual NE list, select one or more virtual NEs, and then click . In the Confirm dialog box, click Yes.

NE name

Description: Set an NE name.

Setting method: Setting method: Value: Value range: l 0: disconnected. l 1: connected.

NE type

Description: Set the type of a virtual NE.

NE state

Description: Set the state of a virtual NE: connected or disconnected.

NE version

Description: Set the version of a virtual NE.

Setting method: Setting method: Setting method: -

NE IP address

Description: Set the IP address of a virtual NE. Description: Set the globally unique name of a virtual NE.

NE FDN

6-18

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

6 iSStar Interface Description

Paramete r Name MML command configurati on

Description Description: Configure the MML command set of a virtual NE.

Setting Setting method: Configure an MML command as required. l Create an MML command: Click New. In the dialog box titled the virtual NE name, set Virtual MML command and Return message of the virtual MML command. Click Confirm. l Edit an MML command: In MML command configuration, select an MML command, and then click Edit. In the dialog box titled the virtual NE name, edit Virtual MML command and Return message of the virtual MML command. Click Confirm. l Copy an MML command: In MML command configuration, select an MML command, and then click Copy. After copying the MML command, you can edit it. l Delete an MML command: In MML command configuration, select one or more MML commands, and then click Delete. In the displayed Confirm dialog box, click Yes.

6.8 Parameter Description: Script Pack Setting


This topic describes the meanings of each parameter in the Script Pack Setting window. You need to set these parameters when you pack scripts into a project package through script packing setting.

Parameters
Table 6-10 Basic Parameters Parameter Name Package Name Description Description: Name of the .hsp project package after script packing. Description: Path for saving the project package after packing. Setting Setting method: In the Package Name text box, enter a meaningful package name that can be English letters, numbers and _ only. Setting method: Click next to the Package Path text box, and then choose the save path of the project package.

Package Path

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

6-19

6 iSStar Interface Description

iManager N2000 UMS Element Management System iSStar

Parameter Name Package description

Description Description: The description of the project package.

Setting Setting method: In the Package description text box, enter the description of the project package. You can enter any Chinese and English characters.

File List

Description: This parameter is used to display script files to be packed into the project package.

Setting method: Click Add or Delete to add or delete files in the File List.

Add

Description: Add files to File List.

Setting method: Click the button, and then select files to be added from Open window. Setting method: Select one or more files to be deleted in the File List, click the button. Setting method: Select the script to be set as the main file, and then click Set Main File.

Delete

Description: Delete files from File List.

Set Main File

Description: Set the main file of the project package. It is the entrance to run the project package.

Table 6-11 Preset parameters Parameter Name Variable Description Description: The variable whose variable value needs to be entered when the project is running. Default value Description: The variable value needed to be entered when the project is running. Description: Variable description. Setting Setting method: Click New. In the New Variable dialog box, enter the variable name.

Setting method: Click New. In the New Variable dialog box, enter the default value.

Description

Setting method: Click New. In the New Variable dialog box, provide the variable description.

6-20

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

6 iSStar Interface Description

6.9 Parameter Description: Script Timing Task of the iSStar


This topic describes the script timing task parameters of the iSStar. When creating or modifying a script timing task of the iSStar, you need to set these parameters.

Parameters
Parameter Name Task Name Description Description: Refers to the name of a timing task. Setting Value: l This parameter allows a maximum of 60 characters. l This parameter is exclusive and cannot be empty. l These characters are case sensitive. Task Type Description: Refers to the task type of a timing task. Run Type Once Description: Select this check box and the system runs the tasks that you create only once at the special time. Period Description: Select this check box and the system runs the tasks that you create periodically. Time setting of a one-time task Time Settin g Description: Start time of a one-time task. Setting method: You can set the time with the following two methods: l Enter the time in Start Time (you can also use the spin button adjust the time). to Setting method: In the Task Type navigation tree, select the task to be created. -

l Click to select the date and time in the Date/Time Selection dialog box.
NOTE If the Run At Once check box is selected, the task is performed immediately after you set the parameters.

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

6-21

6 iSStar Interface Description

iManager N2000 UMS Element Management System iSStar

Parameter Name DST

Description Description: This parameter indicates whether time use DST. This parameter is configurable only when the current time is DST.

Setting -

Time setting of a periodic task

Start Time

Description: Start time of a periodic task.

Setting method: You can set this parameter with the following two methods: l Enter the time in time textbox (you can also use the spin button adjust the time). to

l Click to select the date and time in the Date/Time Selection dialog box. No. of Period s Description: Interval of periodic tasks. The value consists of numerals and units. Value: l The period can be represented in either of the following units: months, weeks, days, hours, minutes. The period, however, cannot be represented in seconds. l The value range for period should be as follows: Month (1 - 12), Week (1 - 52), Day (1 - 366), Hour (1 - 366 x 24), Minute (1- 366 x 24 x 60). No. of Run Times Description: Number of times for executing periodic tasks. Value: 0 - 65535
NOTE 0 indicates that the number of times for executing periodic tasks is not restricted.

End time

Description: End time range of a periodic task.

Setting method: You can set this parameter with the following two methods: l Enter the time in time textbox (you can also use the spin button adjust the time). to

l Click to select the date and time in the Date/Time Selection dialog box.

6-22

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

Issue 02 (2010-10-10)

iManager N2000 UMS Element Management System iSStar

6 iSStar Interface Description

Parameter Name Script parameters Main File

Description Description: Script file or script engineering file that a script timing task invokes. Description: Another script file or script engineering file invoked when the main file is running. Description: Select the required NE if the script file contains the MML commands used for interaction with the NE.

Setting Setting method: -

Acces sory File

Setting method: -

NE Selecti on

Setting method: -

Issue 02 (2010-10-10)

Huawei Proprietary and Confidential Copyright Huawei Technologies Co., Ltd.

6-23

Vous aimerez peut-être aussi