Isstar Uddddser Guide(v200r008_01)

eeDescripción completa

Views 33 Downloads 5 File size 3MB

Report DMCA / Copyright

DOWNLOAD FILE

Citation preview

M2000 V200R008

iSStar User Guide

Issue

01

Date

2008–12–08

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

Huawei Technologies Co., Ltd. provides customers with comprehensive technical support and service. For any assistance, please contact our local office or company headquarters.

Huawei Technologies Co., Ltd. Address:

Huawei Industrial Base Bantian, Longgang Shenzhen 518129 People's Republic of China

Website:

http://www.huawei.com

Email:

[email protected]

Copyright © Huawei Technologies Co., Ltd. 2008. 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 the property of Huawei Technologies Co., Ltd. All other trademarks and trade names mentioned in this document are the property of their respective holders.

Notice 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 the statements, information, and recommendations in this document do not constitute a warranty of any kind, express or implied.

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

M2000 iSStar User Guide

Contents

Contents About This Document.....................................................................................................................1 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 Architecture...........................................................................................................................1-7 1.5 Functions of iSStar..........................................................................................................................................1-8 1.5.1 Script File Development.........................................................................................................................1-8 1.5.2 Script Application Management...........................................................................................................1-15 1.5.3 Script Task Management......................................................................................................................1-17 1.5.4 HSL Language......................................................................................................................................1-20 1.6 iSStar Script Sample......................................................................................................................................1-22 1.7 iSStar Technical Specifications.....................................................................................................................1-26

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-8 3.2.3 Creating a Script Project......................................................................................................................3-12 3.2.4 Debugging a Script Project..................................................................................................................3-14 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-17 3.3.2 Running a Script File............................................................................................................................3-20 3.3.3 Running a Script Project......................................................................................................................3-22 3.3.4 Running a Script Application...............................................................................................................3-23 3.3.5 Viewing the Result of a Script.............................................................................................................3-25 Issue 01 (2008–12–08)

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

i

M2000 iSStar User Guide

Contents

3.3.6 Monitoring the Process of Running a Script........................................................................................3-26 3.4 Managing Scripts...........................................................................................................................................3-30 3.4.1 Viewing the Script Application Information........................................................................................3-31 3.4.2 Downloading a Script Application to the Local Terminal...................................................................3-32 3.4.3 Issuing a Script Application to the Server............................................................................................3-33 3.4.4 Deleting a Script Application...............................................................................................................3-34 3.4.5 Managing Script Application Bookmarks............................................................................................3-35

4 HSL Reference............................................................................................................................ 4-1 4.1 HSL Syntax.....................................................................................................................................................4-2 4.1.1 Identifier.................................................................................................................................................4-2 4.1.2 Keywords...............................................................................................................................................4-3 4.1.3 Statement................................................................................................................................................4-3 4.1.4 Operator..................................................................................................................................................4-4 4.1.5 String Format..........................................................................................................................................4-5 4.1.6 Comment................................................................................................................................................4-6 4.1.7 Condition................................................................................................................................................4-7 4.1.8 Loop.......................................................................................................................................................4-7 4.1.9 Function..................................................................................................................................................4-9 4.2 Data Types and Methods in the HSL............................................................................................................4-10 4.2.1 Number.................................................................................................................................................4-10 4.2.2 Sequence...............................................................................................................................................4-12 4.2.3 Dictionary.............................................................................................................................................4-22 4.2.4 File........................................................................................................................................................4-24 4.3 HSL Built-In Function..................................................................................................................................4-28 4.3.1 List of Built-In Functions.....................................................................................................................4-29 4.3.2 Example of Data Operation Function...................................................................................................4-32 4.3.3 Example of Type Conversion Function...............................................................................................4-33 4.3.4 Example of Other Functions................................................................................................................4-34

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-6 5.1.3 Function: GetNELst...............................................................................................................................5-8 5.1.4 Function: GetNELstByType..................................................................................................................5-8 5.1.5 Function: GetNEName...........................................................................................................................5-9 5.1.6 Function: GetNEFDN..........................................................................................................................5-10 5.1.7 Function: GetNEIP...............................................................................................................................5-11 5.1.8 Function: GetNEVer............................................................................................................................5-13 5.1.9 Function: GetNEType..........................................................................................................................5-14 5.1.10 Function: GetNEStatus.......................................................................................................................5-15 5.1.11 Function: SendMML..........................................................................................................................5-16 5.1.12 Function: GetMMLReport.................................................................................................................5-17 ii

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

Contents

5.1.13 Function: GetAllMMLReport............................................................................................................5-20 5.1.14 Function: ClearMMLBuffer...............................................................................................................5-22 5.1.15 Function: SetMMLBufferSize............................................................................................................5-23 5.1.16 Example of NE Operation Function...................................................................................................5-24 5.2 MML Message Parsing Function..................................................................................................................5-27 5.2.1 Overview of MML Message Parsing Function....................................................................................5-29 5.2.2 MML Message Format.........................................................................................................................5-33 5.2.3 Function: ParseMMLRpt......................................................................................................................5-36 5.2.4 Function: GetSourceName...................................................................................................................5-37 5.2.5 Function: GetReportDate.....................................................................................................................5-39 5.2.6 Function: GetReportTime....................................................................................................................5-40 5.2.7 Function: GetTimeAdjustFlag..............................................................................................................5-41 5.2.8 Function: GetServiceFlag.....................................................................................................................5-42 5.2.9 Function: GetReportIdx........................................................................................................................5-43 5.2.10 Function: GetMMLCmd....................................................................................................................5-45 5.2.11 Function: GetResultCode...................................................................................................................5-46 5.2.12 Function: GetResultCause..................................................................................................................5-47 5.2.13 Function: GetObjNum........................................................................................................................5-48 5.2.14 Function: GetObjTitle........................................................................................................................5-50 5.2.15 Function: GetRecordNum..................................................................................................................5-51 5.2.16 Function: GetTips...............................................................................................................................5-52 5.2.17 Function: GetAttrValueByName........................................................................................................5-53 5.2.18 Function: GetAttrValueByIdx............................................................................................................5-55 5.2.19 Function: GetAttrNameList................................................................................................................5-56 5.2.20 Function: GetAttrNum.......................................................................................................................5-57 5.2.21 Function: GetColumnByName...........................................................................................................5-58 5.2.22 Function: GetColumnByIndex...........................................................................................................5-60 5.2.23 Function: GetRowByIndex................................................................................................................5-61 5.2.24 Function: GetDataFrmMMLRpt........................................................................................................5-63 5.2.25 Function: DestroyMMLParser...........................................................................................................5-65 5.2.26 Examples of MML Message Parsing Function..................................................................................5-66 5.3 Alarm Message Parsing Function.................................................................................................................5-68 5.3.1 Overview of Alarm Message Parsing Function...................................................................................5-71 5.3.2 Alarm Message Format........................................................................................................................5-75 5.3.3 Function: ParseAlmRpt........................................................................................................................5-78 5.3.4 Function: GetAlmSource......................................................................................................................5-80 5.3.5 Function: GetAlmRptDate...................................................................................................................5-81 5.3.6 Function: GetAlmRptTime..................................................................................................................5-82 5.3.7 Function: GetAlmRptNum...................................................................................................................5-84 5.3.8 Function: GetAlmServiceTag..............................................................................................................5-85 5.3.9 Function: GetAlmTimeAdjustFlag......................................................................................................5-86 5.3.10 Function: GetAlmServiceFlag............................................................................................................5-87 Issue 01 (2008–12–08)

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

iii

M2000 iSStar User Guide

Contents

5.3.11 Function: GetAlmRptIdx....................................................................................................................5-88 5.3.12 Function: GetAlmMMLCmd.............................................................................................................5-89 5.3.13 Function: GetAlmResultCode............................................................................................................5-91 5.3.14 Function: GetAlmResultCause...........................................................................................................5-92 5.3.15 Function: GetAlmTips........................................................................................................................5-93 5.3.16 Function: GetAlmFlowNumber.........................................................................................................5-94 5.3.17 Function: GetAlmType......................................................................................................................5-95 5.3.18 Function: GetAlmLevel......................................................................................................................5-97 5.3.19 Function: GetAlmNEType.................................................................................................................5-98 5.3.20 Function: GetAlmID..........................................................................................................................5-99 5.3.21 Function: GetAlmSort......................................................................................................................5-101 5.3.22 Function: GetAlmSyncSerialNo......................................................................................................5-102 5.3.23 Function: GetAlmName...................................................................................................................5-104 5.3.24 Function: GetAlmRaiseTime...........................................................................................................5-105 5.3.25 Function: GetAlmLocationInfo........................................................................................................5-106 5.3.26 Function: GetAlmAttrValueByName..............................................................................................5-108 5.3.27 Function: GetAlmAttrValueByIdx...................................................................................................5-110 5.3.28 Function: GetAlmNumByLevel.......................................................................................................5-111 5.3.29 Function: GetAlmNumByTimeDur.................................................................................................5-113 5.3.30 Examples of Alarm Message Parsing Function...............................................................................5-114 5.4 Database Operation Function......................................................................................................................5-116 5.4.1 Overview of Database Operation Functions......................................................................................5-118 5.4.2 Function: OpenDB.............................................................................................................................5-121 5.4.3 Function: CreateCond........................................................................................................................5-122 5.4.4 Function: QueryFmRcds....................................................................................................................5-124 5.4.5 Function: NextFmRcds......................................................................................................................5-130 5.4.6 Function: QueryPmRcds....................................................................................................................5-136 5.4.7 Function: NextPmRcds......................................................................................................................5-141 5.4.8 Function: QueryCmRcds....................................................................................................................5-143 5.4.9 Function: NextCmRcds......................................................................................................................5-144 5.4.10 Function: GetCmCom......................................................................................................................5-145 5.4.11 Function: GetChildMoc....................................................................................................................5-146 5.4.12 Function: GetIntegrityReportCond..................................................................................................5-147 5.4.13 Function: GetFunctionSubSetList....................................................................................................5-149 5.4.14 Function: QueryIntegrityResult........................................................................................................5-150 5.4.15 Function: GetOneNEInteLst............................................................................................................5-151 5.4.16 Function: GetOneFssInte..................................................................................................................5-152 5.4.17 Function: GetOneIntegrity...............................................................................................................5-153 5.4.18 Function: GetPmCond......................................................................................................................5-154 5.4.19 Function: GetFmCond......................................................................................................................5-156 5.4.20 Function: QueryRecord....................................................................................................................5-161 5.4.21 Function: RecordCount....................................................................................................................5-163 iv

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

Contents

5.4.22 Function: NextRecord......................................................................................................................5-164 5.4.23 Function: GetMocAttrNameList......................................................................................................5-169 5.4.24 Function: GetMocList......................................................................................................................5-170 5.4.25 Function: GetNeObjInfo..................................................................................................................5-170 5.4.26 Function: GetCounterInfo................................................................................................................5-171 5.4.27 Function: GetFuncSetList................................................................................................................5-172 5.4.28 Function: GetFuncSubSetList..........................................................................................................5-173 5.4.29 Function: GetMoiAttrValueList.......................................................................................................5-174 5.4.30 Function: GetMoiListByFilter..........................................................................................................5-175 5.4.31 Function: GetPmNeType..................................................................................................................5-177 5.4.32 Function: GetNeInfo........................................................................................................................5-178 5.4.33 Function: CloseDB...........................................................................................................................5-179 5.5 Alarm Operation Function..........................................................................................................................5-180 5.5.1 Overview of Alarm Operation Function............................................................................................5-180 5.5.2 Function: SendAlarm.........................................................................................................................5-180 5.6 OM Operation Function..............................................................................................................................5-181 5.6.1 Overview of OM Operation Function................................................................................................5-182 5.6.2 Function: GetOMCVersion................................................................................................................5-182 5.6.3 Function: LOG_OP............................................................................................................................5-183 5.7 Type Conversion Function..........................................................................................................................5-184 5.7.1 Function: String2Int...........................................................................................................................5-184 5.7.2 Function: String2Float........................................................................................................................5-185 5.7.3 Function: String2Long.......................................................................................................................5-186 5.7.4 Function: Sequence2Tuple.................................................................................................................5-187 5.7.5 Function: Sequence2List....................................................................................................................5-188 5.7.6 Function: ToString.............................................................................................................................5-189 5.8 Time Function.............................................................................................................................................5-190 5.8.1 Overview of Time Function...............................................................................................................5-191 5.8.2 Time Format.......................................................................................................................................5-192 5.8.3 Time Tuple.........................................................................................................................................5-193 5.8.4 Function: GMTime.............................................................................................................................5-194 5.8.5 Function: LocalTime..........................................................................................................................5-194 5.8.6 Function: MkTime..............................................................................................................................5-195 5.8.7 Function: Sleep...................................................................................................................................5-196 5.8.8 Function: StrfTime.............................................................................................................................5-197 5.8.9 Function: StrpTime............................................................................................................................5-198 5.8.10 Function: Time.................................................................................................................................5-199 5.8.11 Function: CTime..............................................................................................................................5-199 5.8.12 Function: AscTime...........................................................................................................................5-200 5.9 Input and Output Function..........................................................................................................................5-201 5.9.1 Overview of Input and Output Functions...........................................................................................5-202 5.9.2 Function: UserInput............................................................................................................................5-202 Issue 01 (2008–12–08)

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

v

M2000 iSStar User Guide

Contents

5.9.3 Function: UserOutput.........................................................................................................................5-203 5.9.4 Function: SetOutMode.......................................................................................................................5-204 5.9.5 Function: SetOutFlag.........................................................................................................................5-205 5.9.6 Function: SetOutFileName.................................................................................................................5-206 5.9.7 Function: Print....................................................................................................................................5-207 5.9.8 Function: GetOutputPath....................................................................................................................5-208 5.9.9 Function: NotifyProgress...................................................................................................................5-209 5.10 GetError Function.....................................................................................................................................5-210 5.10.1 Overview of GetError Function.......................................................................................................5-210 5.10.2 Function: GetLastError....................................................................................................................5-210 5.10.3 Function: GetErrorMsg....................................................................................................................5-211 5.10.4 Examples of GetError Function.......................................................................................................5-212 5.11 Network Operation Function.....................................................................................................................5-213 5.11.1 Overview of Network Operation Function.......................................................................................5-214 5.11.2 Function: SetPassive........................................................................................................................5-215 5.11.3 Function: LoginFTP.........................................................................................................................5-216 5.11.4 Function: Upload..............................................................................................................................5-216 5.11.5 Function: Download.........................................................................................................................5-217 5.11.6 Function: GetFTPStatus...................................................................................................................5-218 5.11.7 Function: LogoutFTP.......................................................................................................................5-219 5.11.8 OpenTelnet Function........................................................................................................................5-219 5.11.9 ExecuteCmd Function......................................................................................................................5-220 5.11.10 IsConnected Function.....................................................................................................................5-221 5.11.11 CloseTelnet Function.....................................................................................................................5-221 5.11.12 Example of Network Operation Function......................................................................................5-222 5.12 Report Operation Function........................................................................................................................5-224 5.12.1 Overview of Report Operation Function..........................................................................................5-225 5.12.2 Report Design Function...................................................................................................................5-226 5.12.3 Report Display Function..................................................................................................................5-242 5.12.4 Report Management Function..........................................................................................................5-255 5.12.5 Parameters for Operating Report......................................................................................................5-259 5.12.6 Examples of Report Operation Function..........................................................................................5-262 5.13 Directory Operation Function...................................................................................................................5-264 5.13.1 Overview of Directory Operation Function.....................................................................................5-265 5.13.2 Function: Open.................................................................................................................................5-266 5.13.3 Function: read...................................................................................................................................5-267 5.13.4 Function: write.................................................................................................................................5-268 5.13.5 Function: close.................................................................................................................................5-269 5.13.6 Function: MkDir...............................................................................................................................5-270 5.13.7 Function: RmDir..............................................................................................................................5-270 5.13.8 Function: GetCwd............................................................................................................................5-271 5.13.9 Function: Remove............................................................................................................................5-271 vi

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

Contents

5.13.10 Function: Rename..........................................................................................................................5-272 5.13.11 Function: ListDir............................................................................................................................5-273 5.13.12 Function: MakeDirs........................................................................................................................5-274 5.13.13 Function: RemoveDirs...................................................................................................................5-274 5.13.14 Examples of Directory Operation Function...................................................................................5-275 5.14 GUI Interactive Library Function.............................................................................................................5-276 5.14.1 Overview of GUI Interactive Library Function...............................................................................5-276 5.14.2 Introduction to GUI Interactive Library Controls............................................................................5-278 5.14.3 Function: CreateForm......................................................................................................................5-280 5.14.4 Function: Label................................................................................................................................5-281 5.14.5 Function: Edit...................................................................................................................................5-282 5.14.6 Function: CheckBox.........................................................................................................................5-283 5.14.7 Function: RadioBoxGroup...............................................................................................................5-284 5.14.8 Function: Enter.................................................................................................................................5-285 5.14.9 Function: Space................................................................................................................................5-286 5.14.10 Function: ShowForm......................................................................................................................5-287 5.14.11 Function: GetValue........................................................................................................................5-288 5.14.12 Function: DeleteForm....................................................................................................................5-289 5.14.13 Examples of GUI Interactive Library Function.............................................................................5-290 5.15 Task Management Function......................................................................................................................5-290 5.15.1 Overview of Task Management Function........................................................................................5-291 5.15.2 Function: CreateTask.......................................................................................................................5-291 5.15.3 Function: Wait..................................................................................................................................5-292 5.15.4 Function: GetRegisterKey................................................................................................................5-293 5.15.5 Function: Exit...................................................................................................................................5-294 5.16 Assertion Function....................................................................................................................................5-295 5.16.1 Overview of Assertion Function......................................................................................................5-295 5.16.2 Function: Assert...............................................................................................................................5-295 5.16.3 Function: Assert_ON........................................................................................................................5-296 5.16.4 Function: Assert_OFF......................................................................................................................5-297 5.17 Mail Sending Function..............................................................................................................................5-297 5.17.1 Function: CreateLoginInfo...............................................................................................................5-297 5.17.2 Function: CreateMailInfo.................................................................................................................5-299 5.17.3 Function: SendMail..........................................................................................................................5-301

Index.................................................................................................................................................i-1

Issue 01 (2008–12–08)

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

vii

M2000 iSStar User Guide

Figures

Figures Figure 1-1 iSStar system deployment.................................................................................................................. 1-7 Figure 1-2 iSStar Main Window........................................................................................................................1-9 Figure 1-3 iSStar Debug window.....................................................................................................................1-11 Figure 1-4 iSStar Execute Window..................................................................................................................1-13 Figure 1-5 iSStar Execute Window..................................................................................................................1-14 Figure 1-6 iSStar Application Management window.....................................................................................1-16 Figure 1-7 iSStar Task Manage Window........................................................................................................1-18 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-5 Figure 5-2 Workflow of MML message parsing functions................................................................................5-32 Figure 5-3 MML message format......................................................................................................................5-33 Figure 5-4 Elements in the report.......................................................................................................................5-68 Figure 5-5 Workflow of alarm message parsing functions................................................................................5-74 Figure 5-6 Alarm Message Format....................................................................................................................5-75 Figure 5-7 Procedure for using database operation functions..........................................................................5-121 Figure 5-8 Procedure for modifying a report...................................................................................................5-258 Figure 5-9 Optional colors...............................................................................................................................5-259

Issue 01 (2008–12–08)

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

ix

M2000 iSStar User Guide

Tables

Tables Table 1-1 Basic concepts involved in the iSStar..................................................................................................1-3 Table 1-2 Description of iSStar Main Window..................................................................................................1-9 Table 1-3 Description of iSStar Debug Window..............................................................................................1-11 Table 1-4 Description of the output area............................................................................................................1-12 Table 1-5 Description of iSStar Execute Window...........................................................................................1-15 Table 1-6 Description of the iSStar Application Management window.........................................................1-16 Table 1-7 Description of the parameters of iSStar Task Manage Window.....................................................1-18 Table 1-8 Shortcut buttons.................................................................................................................................1-19 Table 1-9 HFC function library..........................................................................................................................1-21 Table 1-10 List of self-defined functions of CPU load query script..................................................................1-25 Table 1-11 iSStar running environment specifications......................................................................................1-26 Table 1-12 Performance specifications of iSStar...............................................................................................1-26 Table 2-1 Directory structure of the iSStar client.................................................................................................2-2 Table 2-2 iSStar User Right List.......................................................................................................................... 2-7 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-3 Table 4-2 MML statements.................................................................................................................................. 4-4 Table 4-3 Basic operators.....................................................................................................................................4-4 Table 4-4 String format........................................................................................................................................ 4-6 Table 4-5 Formats for writing a comment............................................................................................................4-6 Table 4-6 Classification......................................................................................................................................4-11 Table 4-7 Numeric operations............................................................................................................................4-11 Table 4-8 String object methods.........................................................................................................................4-15 Table 4-9 Special Character...............................................................................................................................4-19 Table 4-10 Rule of escape characters.................................................................................................................4-20 Table 4-11 List object methods..........................................................................................................................4-21 Table 4-12 Operations on dictionary objects......................................................................................................4-22 Table 4-13 Methods about dictionary objects....................................................................................................4-23 Table 4-14 Open function description................................................................................................................4-25 Table 4-15 File object methods..........................................................................................................................4-25 Table 5-1 List of NE operation functions.............................................................................................................5-4 Issue 01 (2008–12–08)

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

xi

M2000 iSStar User Guide

Tables

Table 5-2 MML message parsing functions.......................................................................................................5-30 Table 5-3 Description of MML message format................................................................................................5-33 Table 5-4 Alarm message parsing function list..................................................................................................5-71 Table 5-5 Description of the Alarm Message Format........................................................................................5-76 Table 5-6 Database operation function list.......................................................................................................5-119 Table 5-7 Description of items in Fmcond.......................................................................................................5-124 Table 5-8 Attributes of alarm data records.......................................................................................................5-131 Table 5-9 Description of items of Pmcond.......................................................................................................5-137 Table 5-10 Description of conditions for querying performance data.............................................................5-154 Table 5-11 Description of conditions for querying alarm data.........................................................................5-157 Table 5-12 Items in the list of alarm records....................................................................................................5-165 Table 5-13 Items in the list of alarm records....................................................................................................5-167 Table 5-14 Alarm function list.........................................................................................................................5-180 Table 5-15 OM function list.............................................................................................................................5-182 Table 5-16 List of time functions.....................................................................................................................5-191 Table 5-17 List of input and output functions..................................................................................................5-202 Table 5-18 List of GetError functions..............................................................................................................5-210 Table 5-19 Description of error information....................................................................................................5-212 Table 5-20 Description of error level ..............................................................................................................5-212 Table 5-21 FTP function list.............................................................................................................................5-214 Table 5-22 telnet function list...........................................................................................................................5-214 Table 5-23 Report operation function list.........................................................................................................5-225 Table 5-24 Example of Using Conditional Expressions..................................................................................5-235 Table 5-25 Meanings of optional colors...........................................................................................................5-259 Table 5-26 Description of optional font values................................................................................................5-261 Table 5-27 Type Description............................................................................................................................5-262 Table 5-28 List of directory operation functions..............................................................................................5-265 Table 5-29 List of GUI interactive library functions........................................................................................5-277 Table 5-30 GUI interactive library controls.....................................................................................................5-278 Table 5-31 Layout of the controls....................................................................................................................5-279 Table 5-32 Return values..................................................................................................................................5-288 Table 5-33 List of task management functions................................................................................................5-291 Table 5-34 List of assertion functions..............................................................................................................5-295

xii

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

About This Document

About This Document

Purpose This document describes functions and application scenarios of the iSStar and methods to develop and use scripts with iSStar.

Product Version The following table lists the product version related to this document. Product Name

Product Version

M2000

V200R008

Intended Audience The intended audience of this document are: l

Technical support engineers

l

Maintenance engineers

Update History 01(2008-12-08) This is the first formal release.

Brief Introduction

Issue 01 (2008–12–08)

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

1

M2000 iSStar User Guide

1 iSStar Overview

1

iSStar Overview

About This Chapter Being an enhanced tool component of the M2000, Integration Script Star (iSStar) is a powerful script secondary development platform. The 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 effort-consuming daily maintenance. In this way, daily maintenance can be performed automatically through the iSStar tool. This reduces workload and improves work efficiency. 1.1 Product Features of iSStar The iSStar has all the features that a secondary development platform should have. After you understand these features, you will have a preliminary knowledge about the iSStar. 1.2 Basic Concepts of iSStar The iSStar has its unique concepts. The basic concepts of the iSStar involve script, script development platform, script application platform, user, and script project. These concepts help you better understand the iSStar. 1.3 iSStar Application Scenarios The iSStar is a secondary development platform for users to extend the operation and maintenance of the service functions. Users can perform secondary development in the iSStar secondary platform as required. This secondary platform is used where there is need for bulk operations or routine and automatic executions. The iSStar is complementary to the M2000 system. 1.4 iSStar Software Architecture The iSStar is a subsystem of the M2000, respects the architecture design of the M2000, and is classified into client system and server system. With regards to function modules, the iSStar software system is composed of GUI subsystem, executor (descriptor) subsystem, HFC subsystem, ScriptServer subsystem, and service subsystem. 1.5 Functions of iSStar The 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 Issue 01 (2008–12–08)

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

1-1

M2000 iSStar User Guide

1 iSStar Overview

This describes a sample of querying the CPU load. This sample is provided by the iSStar. By studying this sample, you can have a preliminary understanding of the structure and framework of script files and their applications in the business. 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 01 (2008–12–08)

M2000 iSStar User Guide

1 iSStar Overview

1.1 Product Features of iSStar The iSStar has all the features that a secondary development platform should have. After you understand these features, you will have a preliminary knowledge about the iSStar. As a powerful secondary development platform, the iSStar has the following features: l

The iSStar provides powerful script program development capability and can flexibly customize personalized service. 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. The HSL can customize personalized services as required for fast service deployment.

l

The iSStar provides abundant extendable service functions. The 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 the iSStar, you only need to invoke these functions. You can flexibly extend HFC as required.

l

The iSStar provides a comprehensive program debugging mechanism. The iSStar provides a comprehensive program debugging mechanism. For example, you can set breakpoints and one-step debugging for the script programs. Thus, you can debug the program to check whether the program runs properly and can quickly locate the problems of the program.

l

You can compile MML scripts in batches through the 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 are executed in certain time point or periodically executed can be set as timing tasks. The script automatically executes these tasks.

l

The 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 The iSStar has its unique concepts. The basic concepts of the iSStar involve script, script development platform, script application platform, user, and script project. These concepts help you better understand the iSStar. Table 1-1 describes the basic concepts involved in the iSStar. Table 1-1 Basic concepts involved in the iSStar Basic Concepts

Description

Script

Programs written in the HSL are used to provide specific service functions.

Issue 01 (2008–12–08)

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

1-3

M2000 iSStar User Guide

1 iSStar Overview

Basic Concepts

Description

Script file

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.

Script development platform

Indicates the platform for developing service function scripts. The development platform provides the functions of managing projects and editing, debugging, and running scripts.

Script application platform

Indicates the platform for applying service function scripts. This platform provides the function of managing applications.

Users

Indicates the person who uses the 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

Script application indicates the script application package. A script application is a set of script files that meet specific service requirements, and is 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 and 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.

1-4

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.

Workstation

In the iSStar, the tab page of the script application platform interface is called workspace. You can create workspaces and create script applications in the workspaces.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

1 iSStar Overview

Basic Concepts

Description

Script application bookmark

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 the iSStar platform.

Script task

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. The iSStar has the feature of multiple tasks and a thread. The 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 an NE in a certain time segment.

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

Background The OM personnel of the carriers 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 increase of the OM work. With the business development, the network size expands quickly and the maintenance work 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

Issue 01 (2008–12–08)

Too many manual routine maintenance operations should be performed and some operations are duplicated.

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

1-5

M2000 iSStar User Guide

1 iSStar Overview

Some routine important work, such as routine check and data statistic analysis are repetitive manual operations. They are time-consuming and inefficient. To solve the preceding problems, Huawei provides the 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 the iSStar to perform the tasks such as routine check, real-time monitoring, office data creation, and bulk configuration data delivery.

Routine Check l

Target users: Staff in the OM team and the monitoring team

l

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 running properly and can detect the potential or existing faults. By compiling the 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 \script\samples\en\DailyCheck\sample.hsl

Real-Time Monitoring l

Target users: Staff in the monitoring team

l

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, the 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 M2000. Compared with the alarm module, the monitoring program written by the iSStar is used for specific purposes.

Data Creation l

Target users: Softswitch equipment maintenance personnel

l

1-6

Scenario Description Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd.

Issue 01 (2008–12–08)

M2000 iSStar User Guide

1 iSStar Overview

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.

Batch Configuration Data Delivery l

Target users: Staff in the configuration team

l

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

Target users: Staff in the professional maintenance team

l

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 so as to generate a report.

1.4 iSStar Software Architecture The iSStar is a subsystem of the M2000, respects the architecture design of the M2000, and is classified into client system and server system. With regards to function modules, the 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 the iSStar. Figure 1-1 iSStar system deployment

Issue 01 (2008–12–08)

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

1-7

M2000 iSStar User Guide

1 iSStar Overview

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 development. The application platform provides a function that uses the services through script application and focuses on management and interaction.

l

Executor (descriptor) subsystem: parses scripts and executes and controls tasks.

l

HFC subsystem: provides a group of encapsulated service functions for script developers.

l

ScriptServer subsystem: schedules and executes remote tasks.

l

Service subsystem: provides a group of service scripts and script project packages for users.

1.5 Functions of iSStar The 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.5.1 Script File Development The iSStar provides a main window, a debugging window, and a running window, where you can edit, debug, and run HSL scripts. 1.5.2 Script Application Management For users who are only concerned with executing scripts to provide a service function, the users can directly use iSStar Application Management provided by iSStar. Users can manage the script application through iSStar Application Management without caring about implementation details of the script. 1.5.3 Script Task Management When you execute a script file, script project, or script application to implement a specific service function, the iSStar creates a task. You can view the basic information and execution of all the local tasks and remote tasks of the system in the iSStar Task Manage Window window and can control the execution of the tasks. 1.5.4 HSL Language The High-level Script Language (HSL) is an easy-to-learn and powerful script language provided by the iSStar. The features of the HSL are simple and efficient syntax, abundant data types, and efficient and extendable library functions.

1.5.1 Script File Development The iSStar provides a main window, a debugging window, and a running window, where you can edit, debug, and run HSL scripts.

iSStar Main Window The iSStar Main Window provides an environment for creating, compiling, and editing scripts. Figure 1-2 shows the interface. For details of the functions of Figure 1-2, refer to Table 1-2. NOTE

1-8

l

In the main window, you can manage multiple script files. The number of script files, however, must be less than 100.

l

Each script is displayed as a tab page. The tab page displays the script name. The information output area of the window displays the output information of the script file.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

1 iSStar Overview

Figure 1-2 iSStar Main Window

Table 1-2 Description of iSStar Main Window Area

Description

Project management area

Provides a function for creating and editing projects.

Information output area

l

Syntax Check tab Displays the syntax check information for script file running and debugging.

l

Task Log tab Displays the log information of the task management operations. The task management operations include creating, running, debugging, and deleting operations.

Script editing area

Provides script development, editing, and breakpoints. The common edit functions include copying, cutting, pasting, finding, replacing, printing, undoing, redoing, locating line number, and setting bookmarks. For details, see 3.2.1 Creating a Script File. The breakpoint function includes setting and deleting breakpoints and is used for script debugging. For details, see 3.2.2 Debugging a Script File.

Issue 01 (2008–12–08)

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

1-9

M2000 iSStar User Guide

1 iSStar Overview

Area

Description

Tab

Displays the currently opened script files and provides script file management function. The file management functions include creating, opening, saving, saving as, closing, and closing all files.

Tool bar

Provides the common script operations: l

: exits and closes the iSStar.

l

: creates a script file.

l

: opens an existing script file.

l

: saves a script file.

l

: saves a script file into another file.

l

: prints a script file.

l

: cuts a script.

l

: copies a script.

l

: pastes a script.

l l

: runs a task. You can also run a specific part of a script file. : debugs a task.

l

: checks the syntax of a script file. The result of syntax check is displayed in the information output area. Click the error message (including the file name, details, and line number), if any, and then you can see the icon located besides the error line.

l

: Switches the window to iSStar Task Manage Window to display the execution of the tasks.

l

: to select the NEs required by the program.

l

: Select multiple NEs to create tasks in batches.

l

: Start the Task Management window.

iSStar Debug window The iSStar Debug Window provides an environment for debugging scripts and discovering script errors. Figure 1-3 shows the interface. Table 1-3 describes Figure 1-2. 1-10

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

1 iSStar Overview

CAUTION l

The iSStar allows only one debugging task.

l

A maximum of 50 debugging tasks and running tasks can be supported by the iSStar.

Figure 1-3 iSStar Debug window

Table 1-3 Description of iSStar Debug Window Area

Description

Tool bar

Provides shortcut icons for debugging operation and switching windows.

Display area

Issue 01 (2008–12–08)

l

: switches the window to iSStar Main Window so that you can edit the script file according to the debugging result.

l

: switches the window to iSStar Task Manage Window to display the execution of the tasks.

Displays the content of the current script.

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

1-11

M2000 iSStar User Guide

1 iSStar Overview

Area

Description

Output area

Displays various information during the debugging of the script file. The information consists of output information, MML packet information, stack information, file lists, and variable observation information. For details, refer to Table 1-4.

Table 1-4 Description of the output area Name

Description

Message

l

The Message tab page displays the system information during the debugging of the script files. The system information includes script debugging output information, script running output information, error information, and syntax check results.

l

The output information is exported to Message line by line. When the number of the lines exceeds 3000, the first 1000 messages are deleted.

l

On the Message tab page, right-click the output information to copy, clear, search, save as, or redirect the output information. NOTE Redirection involves saving the script output information to the file under the specified path. Redirection saves all the output information of the scripts that have performed the redirection.

MML Response

l

The MML Response tab page contains the MML commands and displayed information during the running and debugging of the script file. If the running commands include commands of follow-up reports, multiple MML reports with the same ID are returned.

l

The MML Response tab page displays a maximum of 3000 message lines. If the number exceeds the limit, the earliest 1000 messages are deleted.

l

On the MML Response tab page, right-click the output information to copy, clear, search, save as, and redirect the output information. NOTE Redirection means to save the script output information to the file under the specified path. Redirection saves only all the output information after the redirection.

1-12

File List

If the script file invokes other script files, the full path of the invoked script files will be displayed on the File List tab page.

Stack

l

When debugging succeeds, the Stack tab page displays the full path information invoked by the current function.

l

The stack information is refreshed as the script file is executed.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

1 iSStar Overview

Name

Description

Watch

l

The Watch tab page displays the change information of the variables during the debugging of the script file.

l

On the Watch tab page, right-click the variable to be observed to add or delete it.

NOTE l The Watch tab page displays a maximum of 32 watched variables. l If the selected variable has spaces before or after the name, the space(s) is deleted

after being added to the tab. l The variable name can be copied, modified, and deleted. The variable value

cannot be edited. l In the display area of iSStar Debug Window, right-click a variable and select

Add to Watch to add a watched variable. l When you stop debugging, no messages are displayed on Watch.

iSStar Execute Window iSStar Execute Window provides an environment for running scripts and displaying script output. l

Figure 1-4 shows the running window displayed when a script file invokes the GUI interactive library function.

l

Figure 1-5 shows the running window where the GUI interactive area is not displayed when the script file does not invoke the GUI interactive library function.

l

For description of the script running window, see Table 1-5.

l

Each script task corresponds to a script running window.

l

The system supports a maximum of 50 debugging tasks and running tasks. But the system supports only one debugging task.

Figure 1-4 iSStar Execute Window

Issue 01 (2008–12–08)

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

1-13

M2000 iSStar User Guide

1 iSStar Overview

Figure 1-5 iSStar Execute Window

1-14

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

1 iSStar Overview

Table 1-5 Description of iSStar Execute Window Area

Description

Tool bar

Provides control buttons for executing scripts. The meanings for the buttons are as follows: l

: stops a task that you are executing. If a script file is already executed, this button appears dimmed.

l

: re-executes a script, project, or task.

l

: pauses an executing task. After the script file execution is paused, the button changes to execution of the script file.

l l

. Click this button to resume the

: displays the folder of the default output file of a task. : closes iSStar Execute Window.

l

: switches from executing window to editing window. When a task is being executed, you can click the button to switch to the iSStar Main Window to edit the script file. Then you can edit the script file being executed.

l

: switches from executing window to task management window. When a task is being executed, click this button to switch to iSStar Task Manage Window to display the basic information and execution of the task.

Print output area

Displays the output of the print function of the script file.

MML message output area

Displays the MML command and return information during the execution of a script.

MML command statistic bar

Counts and displays the number of MML command deliveries, number of execution successes, and number of execution failures of the script file.

GUI interactive area

Displays the GUI interactive controls created after the script file invokes the GUI interactive library function for simple interaction with the GUI. If the script file does not invoke the GUI interactive library function, the GUI interactive area is not displayed.

1.5.2 Script Application Management For users who are only concerned with executing scripts to provide a service function, the users can directly use iSStar Application Management provided by iSStar. Users can manage the script application through iSStar Application Management without caring about implementation details of the script.

Issue 01 (2008–12–08)

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

1-15

M2000 iSStar User Guide

1 iSStar Overview

You can manage the script applications in the iSStar Application Management window. That is, you can create, download, release, execute, view, or delete script applications. Figure 1-6 shows the iSStar Application Management window. Figure 1-6 iSStar Application Management window

Table 1-6 Description of the iSStar Application Management window Area

1-16

Description

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

1 iSStar Overview

Tool bar

Displays the shortcut icons for the management of applications. l

: adds a workstation.

l

: to add shortcuts.

l

: to delete shortcuts.

l

: to run the programs of the selected shortcuts.

l

: to view or modify the attributes of the selected shortcuts.

l

: releases files. You can upload files to the server.

l

: to download files. You can download the programs corresponding to the selected remote shortcuts to the local computer.

l

: to delete remote files. You can delete the programs corresponding to the selected remote shortcuts.

l

: to manage remote files. You can view the information about the programs on the server. In addition, you can upload and download programs.

l l

l

Workspace

: to select the NEs required by the program. : to create tasks in batches. You can select multiple NEs to create tasks in batches. : Start the Task Management window.

In the iSStar, the tab page of the iSStar 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.

Shortcut

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 iSStar Application Management window.

1.5.3 Script Task Management When you execute a script file, script project, or script application to implement a specific service function, the iSStar creates a task. You can view the basic information and execution of all the local tasks and remote tasks of the system in the iSStar Task Manage Window window and can control the execution of the tasks.

Issue 01 (2008–12–08)

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

1-17

M2000 iSStar User Guide

1 iSStar Overview

iSStar Task Manage Window Figure 1-7 shows the iSStar Task Manage Window window. Table 1-7 describes each area on the interface shown in Figure 1-7. Figure 1-7 iSStar Task Manage Window

Table 1-7 Description of the parameters of iSStar Task Manage Window Parameter/Tab

Description

Local Task tab

Click the Local Task tab to view the basic information and execution results of all the local script tasks in the system. NOTE The files of local tasks are saved and executed on the local computer.

Remote Task tab

Click the Remote Task tab to view the basic information and execution result of all the remote script tasks in the system. NOTE l The files of remote tasks are saved and executed

on the server. l By creating remote script tasks, you can share

the services.

1-18

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

1 iSStar Overview

Parameter/Tab

Description

Script File

The parameter indicates the script entry for debugging and executing script tasks and script applications.

Task Type

The parameter indicates the classification of the script tasks, including Local TaskandRemote Task.

State

The parameter indicates the state of a running or debugging task. For details, see 3.3.1 Types and Status of Script Tasks.

Process

The parameter indicates the execution progress in a progress bar. NOTE Progress is described in scripts and fed back to the client. When the statement about the progress is executed, the progress bar displays the current progress in the script. If the statement about the progress is not configured in the script, the progress value is 0%.

Start Time

The parameter indicates the time when the task starts.

End Time

The parameter indicates the time when the task ends.

Table 1-8 Shortcut buttons Shortcut Button

Description You can switch the window to iSStar Main Window. After creating an empty task in iSStar Task Manage Window, you can use this button to select the main file. If you are required to select an NE for an executing task, click this button and select an NE in the Please select operation NE window. Click this button to refresh iSStar Task manage Window.

Functions of iSStar Task Manage Window iSStar Task Manage Window provides the following functions:

Issue 01 (2008–12–08)

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

1-19

M2000 iSStar User Guide

1 iSStar Overview l

Displaying the basic information and execution of all the local and remote tasks of the system, such as the main file of a task, task type, NE corresponding to the task, task state, task execution progress, and start time and end time of the task execution.

l

Sorts tasks. You can sort the tasks by the fields, such as Script File to quickly locate the task that you want to view.

l

Switching from iSStar Task Manage Window to iSStar Main Window. Click to switch the window to iSStar Main Window so that you can edit the corresponding script file as required.

l

Controlling tasks, including creating, copying, deleting, running, pausing, resuming, and stopping a task.

l

Viewing the output information of the task, including viewing the print output and MML output.

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

Syntax Based on 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 expandability. In terms of basic syntax, the HSL comes from Python. The HSL supports the following common functions: l

Supports simple statements, such as assignment, variable, arithmetic expression, return statement, and continue statement.

l

Supports complex conditional control statements, such as if statement, while statement, and for statement.

l

Supports self-definition of functions.

l

Supports the import of library functions.

l

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

You can send MML commands You can directly write batch MML commands in the script.

l

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 the required information.

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 1-20

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

1 iSStar Overview

compiling of scripts, speed up development of scripts, and improve efficiency of the script running. The HFC function library can be flexibly expanded. Table 1-9 describes the HFC function library provided by the iSStar. Table 1-9 HFC function library Function

Description

HSL built-in function

The HSL built-in function processes characters and data, and converts types.

NE operation function

The NE operation function connects NEs, issues commands, and obtains information about NEs.

MML message parsing function

The MML message parsing function parses MML messages.

Alarm message parsing function

The alarm message parsing function parses alarm messages.

Database operation function

The database operation module provides an interface for querying alarms, performance, and the configuration library.

Alarm operation function

The alarm operation function sends the information about exceptions detected during the script running.

NMS Functions

The network management operation function enables you to query the information about the release of the M2000 and generates operation logs.

Time function

The time function enables you to obtain information related to time and provides the function for converting time formats.

Input and output function

The input and output function provides the input and output function and enables you to set the output modes.

GetError function

The GetError function, which provides the unified handling function for error codes, enables you to obtain the last error information list and the error cause function.

FTP operation function

The FTP operation function enables you to upload or download files.

Report operation function

The report operation function enables you to create reports, add pages, add tables, edit tables, and save reports.

Directory operation function

The directory operation function enables you to create, modify, or delete directories.

Issue 01 (2008–12–08)

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

1-21

M2000 iSStar User Guide

1 iSStar Overview

Function

Description

GUI interactive function

The GUI interactive function enables you to deploy simple controls for interaction with GUI during the task execution.

Task management function

The task management function enables you to manage tasks, which involves creating subtasks, and waiting for completion of sub-task.

Assertion function

The assertion function enables you to diagnose the statements.

1.6 iSStar Script Sample This describes a sample of querying the CPU load. This sample is provided by the iSStar. By studying this sample, you can have a preliminary understanding of the structure and framework of script files and their applications in the business.

Script Content The iSStar provides a sample of querying CPU load. The path is \script\samples\en\DailyCheck\. The content is as follows: ####################################--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

1-22

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

1 iSStar Overview 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: " + 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])

Issue 01 (2008–12–08)

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

1-23

M2000 iSStar User Guide

1 iSStar Overview

#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, obj=0, attridxs=[]) cols = [] #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 normal. 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 lot of complex functions should be implemented by the services, you can classify services into sub services and define these services as functions. Thus, the script organization is clear 1-24

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

1 iSStar Overview

and you can read, write, modify, and maintain scripts conveniently.?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-10 lists the functions. Table 1-10 List of self-defined functions of CPU load query script Function

Description

Principle

Main function

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.

The main function invokes other self-defined functions and HFC library functions to provide control of the execution flow of the script.

ExecMMLCmd function

This function is used to send MML messages and obtain CPU load information.

By sending the MML command @DSP CPUR:; to an NE, this function gets the message, and then analyzes the message by invoking 5.1.12 Function: GetMMLReport, 5.2.3 Function: ParseMMLRpt, 5.2.11 Function: GetResultCode, and 5.2.12 Function: GetResultCause.

CheckValue function

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 analyzes the values the list items. For knowledge about list, see List.

writeTable function

This function is used to create a new table in the Excel table, write data, and set the display style of the table.

The function invokes Function: AddTable, Function: SetTableValue, Function: SetTableTitleFont, Function: SetTableFont, and Function: SetCellBGColor.

setColWidthList function

This function is used to set the column width of the table file.

The function invokes Function: SetColumnWidth.

writeReport function

Write data to Excel report file and set the display style of the report.

This function invokes writeTable function and setColWidthList function.

Issue 01 (2008–12–08)

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

1-25

M2000 iSStar User Guide

1 iSStar Overview

Function

Description

Principle

getColsByIdx function

This function is invoked by ExecMMLCmd function and is used to get the data of some columns.

This function invokes 5.2.15 Function: GetRecordNum, 5.2.20 Function: GetAttrNum, and 5.2.18 Function: GetAttrValueByIdx.

FormatList function

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

The function invokes HSL built-in function str to implement data conversion.

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-11 shows the running environment specifications needed by iSStar. Table 1-11 iSStar running environment specifications Item

Configuration Requirement

Hardware Configuration

PCs working under the Windows operating system

Software configuration

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 Counters Table 1-12 shows the performance specifications of iSStar. Table 1-12 Performance specifications of iSStar

1-26

Item

Range

Number of local tasks simultaneously started in a GUI

iSStar > Development Platform . The iSStar Main Window is displayed.

2.

. Alternatively, right-click the project management area, and then choose Click Open Project .

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. Alternatively, click .

l

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

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

3.3.4 Running a Script Application After creating a script application, you can run the script application to finish specific service function. Issue 01 (2008–12–08)

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

3-23

M2000 iSStar User Guide

3 iSStar Operation

Prerequisite l

The connection between the M2000 and the server is normal.

l

A script application is already created.

Procedure Step 1 Choose Maintenance > iSStar > Application Management. The iSStar 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 an NE Procedure No

Go to Step 4.

Yes

1. Click or . The Please select an operation NE dialog box is displayed. NOTE l The l

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

Procedure

Execute immediately You can use one of the following methods to run an application:

3-24

l

Click

.

l

Double-click the script application bookmark.

l

Right-click the script application bookmark and choose Run.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

3 iSStar Operation

Running Mode

Procedure

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 The 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 Window. For details, see Viewing the Script Task States and 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, the system 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 system Area

Description

Print output area

Displays the output information of the print function during the execution of a script

Issue 01 (2008–12–08)

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

3-25

M2000 iSStar User Guide

3 iSStar Operation

Area

Description

MML message output area

Displays the MML command and return information during the 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 Procedure Copy

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.

Find

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 print output area or 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 describes how to control the execution of scripts through the 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-26

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

3 iSStar Operation

Viewing the Script Task States This 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. Eight task states are available. For details, see Types and States of Script Tasks. l

A running task has the following states: suspended, running, finished, pausing, paused, and exceptionally terminated.

l

A debugging task has the following states: suspended, debugging, debug finished, and exceptionally terminated. NOTE

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

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

Procedure

Immediate tasks

1. Click

. The iSStar Task Manage Window is displayed.

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 the iSStar Task Manage Window.

----End Issue 01 (2008–12–08)

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

3-27

M2000 iSStar User Guide

3 iSStar Operation

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

l

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.

2.

Click

3.

In the iSStar Task Manage Window window, right-click the task to be viewed, and then choose View Output.

on the toolbar.

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

Choose Maintenance > iSStar > Development Platform. The iSStar Main Window is displayed.

2.

Click

3.

In the iSStar Task Manage Window window, right-click the task to be viewed, and then choose View MML Output.

on the toolbar.

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

Choose Maintenance > Task Management. The Task Management window is displayed.

2.

In the navigation tree, choose Task Type > Other > Script Executor . In the right window, select a task that has already been executed.

3.

Click Save Log. In the displayed Please select a directory window, set the file save path.

4.

Click OK. NOTE

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.

3-28

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

3 iSStar Operation

Pausing and Resuming a Script Task This 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 . 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 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, see States of an Immediate Task. ----End

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 . 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 Issue 01 (2008–12–08)

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

3-29

M2000 iSStar User Guide

3 iSStar Operation

Result After a task is stopped, you cannot restart or resume the task.

Deleting a Script Task This 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 M2000 is normal.

Context l

You can delete the local script task that you create on the client and the remote script task that you create.

l

Deleting a script task does not involve the deletion of the script of the script task and of the script project.

l

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 describes how to view the script application information, release and download script application, delete unnecessary script application, and manage script application bookmark through the iSStar. 3.4.1 Viewing the Script Application Information 3-30

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

3 iSStar Operation

This 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 This 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 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 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 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

If you need to view local script applications, ensure that the bookmark of the script application is created on the client.

l

If you need to check remote script applications, ensure that the connection between the client and the M2000 server is normal.

l

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

Procedure 1.

Choose Maintenance > iSStar > Application Management. The iSStar Application Management window is displayed.

2.

Click the target workstation to use the existing workstation.

3.

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.

4. l

Issue 01 (2008–12–08)

Click OK to save the modification and close the window.

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

Choose Maintenance > iSStar > Application Management. The iSStar Application Management window is displayed.

2.

You can perform the following operations according to the existence of the corresponding bookmark of the script application.

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

3-31

M2000 iSStar User Guide

3 iSStar Operation

If...

Then...

The corresponding shortcuts exist.

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 Parameter and Preset Parameter. 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 describes how to download the remote script applications that are shared on the server to the local terminal.

Prerequisite l

The connection between the M2000 and the server is normal.

l

The corresponding applications exist on the server.

Procedure Step 1 Choose Maintenance > iSStar > Application Management. The iSStar 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 iSStar Application Management window has the bookmark of the corresponding script application. 3-32

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

3 iSStar Operation

If...

Then...

The bookmark corresponding to the remote script application exists,

1. Right-click the bookmark of the remote script application, and then choose Download File from the shortcut menu. Alternatively, right-click the bookmark of the remote script application. Then, click . The Open window is displayed. 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 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

The connection between the M2000 and the server is normal.

l

Script applications already exist.

Procedure Step 1 Choose Maintenance > iSStar > Application Management. The iSStar Application Management window is displayed. Step 2 Click . Alternatively, right-click the blank area of the workspace, and then choose Issue File from the shortcut menu. The Open window is displayed. Issue 01 (2008–12–08)

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

3-33

M2000 iSStar User Guide

3 iSStar Operation 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.

Step 3 Select a file to be uploaded, and then click Open. You can click Summary.

to check whether the file is uploaded to the server in Remote File

----End

3.4.4 Deleting a Script Application This describes how to delete script applications. The script applications are categorized into local script applications and remote script applications.

Prerequisite If you need to delete a remote application, ensure that the connection between the client and the M2000 is normal.

Context l

The local script applications are saved and executed on the local PC.

l

The remote script applications are saved and executed on the server.

l

You can delete the script applications on the server issued by yourself or by other users.

l

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. The iSStar 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.

3-34

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

3 iSStar Operation

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.

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. The iSStar 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. . Alternatively, right-click a bookmark, and then choose After you click a bookmark, click 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 Issue 01 (2008–12–08)

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

3-35

M2000 iSStar User Guide

4 HSL Reference

4

HSL Reference

About This Chapter 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 HSL 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 Data Types and Methods in the HSL This section 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 HSL Built-In Function This section describes the HSL built-in function that provides a group of object-specific operation functions.

Issue 01 (2008–12–08)

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

4-1

M2000 iSStar User Guide

4 HSL Reference

4.1 HSL 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.1.1 Identifier An identifier is a string. It is a name that is used to identify a variable or a function in a program. 4.1.2 Keywords A keyword is also called a reserved word. It is an identifier pre-defined in HSL. 4.1.3 Statement As basic units of script programs, statements can be classified into simple statements, MML statements, and compound statements. 4.1.4 Operator Operators are divided into basic operators, bit operators, comparative operators, Boolean operators, sequence operators, and dictionary operators. 4.1.5 String Format This section describes the string formats in HSL. You can view the information and perform operations. 4.1.6 Comment 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.1.7 Condition A condition is used to express the process for selecting the program branches. 4.1.8 Loop 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.1.9 Function A function is the basic multiplex unit provided by the language.

4.1.1 Identifier 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:

4-2

l

Naming rule: An identifier can contain letters (a-z, A-Z), numbers (0-9), and underlines (_). Number cannot be the leading character.

l

The length of an identifier is not restricted.

l

An identifier is case sensitive. For example, FOO and foo are different objects.

l

An identifier cannot be any keyword of HSL. For the keywords of HSL, see 4.1.2 Keywords.

l

An identifier cannot contain special characters such as $, %, or @.

l

When using an identifier, observe the principle of defining (assigning) first.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

4 HSL Reference

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.1.3 Statement.

l

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

CAUTION l

The keywords in HSL are unique in the script.

l

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 and

del

for

is

raise

assert

elif

from

lambda

return

break

else

global

not

try

class

except

if

or

while

continue

exec

import

pass

yield

def

finally

in

Print

end

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

Simple Statement l

Generally, a statement line maps to a text line. A line feed character (\n) is the end mark.

l

If you want to split a statement into multiple text lines, an extended line (\) must be used.

l

A text line can include multiple simple statements which are separated by semicolons (;). NOTE

Issue 01 (2008–12–08)

l

An extended line character cannot be used at the end of files, because semantic mistakes are caused.

l

An extended line character is invalid to a comment line.

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

4-3

M2000 iSStar User Guide

4 HSL Reference

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.

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

Table 4-2 MML statements MML Statement

Format

Line mode

@MMLCMD:MMLargs;

Block mode

@@@ 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

l

stmt [elif expr

stmt] [else

stmt] end

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

l

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

4.1.4 Operator 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 4-4

Operator x+y

Description Add

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

4 HSL Reference

Type

Bit-wise

Comparative

Bool

Sequence

Dictionary

Operator

Description

x-y

Subtract

x*y

Multiply

x/y

Divide

x%y

Get magnitude (x mod y)

-x

Unary negation

+x

x

x ** y

x to the power of y

x > y

Right shift

x&y

Bitwise and

x|y

Bitwise or

~x

Bitwise exclusive

xy

Greater than

x == y

Equal

x != y

Not equal

x >= y

Greater than or equal

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)

Converts x and y into the same numeric type and returns as a tuple.

complex(real [, imag])

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.

divmod(a,b)

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

len(s)

Returns a sequence (string, tuple, or list) or the number of entries in the dictionary (returns the length of the sequence of dictionary).

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

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.

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

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.

pow(x, y [, z])

Returns the power value of x ** y, where y is the index. If z is given, return the result of ((x ** y) % z).

round(num)

Returns the floating point value x rounded to n digits after the decimal point. If n is omitted, the default value is 0.

Related Instances Issue 01 (2008–12–08)

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

4-29

M2000 iSStar User Guide

4 HSL Reference

Type Conversion Functions Function

Description

float(x)

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.

hex(x)

Converts an integer into a hexadecimal string.

int(x [, base])

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.

list(s)

Returns a list whose items and ordering of the items are the same with that of the parameters.

long(x [, base])

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.

oct(x)

Converts an integer or a long integer into an octal string.

ord(c)

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.

chr(i)

Returns the character whose ASCII code is i. The i parameter is an integer and ranges from 0 to 255.

repr(object)

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().

str(object)

Returns the object in the printable string type.

tuple(s)

Returns a tuple. The items and the sequence of the items are the same with those of the parameters.

Related Instances 4-30

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

4 HSL Reference

String Conversion Functions Function

Description

unichr(i)

Returns the character whose Unicode code is i. The i parameter is an integer and ranges from 0 to 65535.

unicode(string[,encoding[,errors]])

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 unknow, errors occur.

4.3.2 Example of Data Operation Function.

Other Common Functions Function

Description

range([start,]stop[,step])

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 01 (2008–12–08)

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

4-31

M2000 iSStar User Guide

4 HSL Reference

Function

Description

Call(FileName)

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.

NOTE For the files with no extension, process them as the script files.

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.3.2 Example of Data Operation Function This section 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 Print("n5 Print("n6

4-32

= = = = = =

"+str(n1)) "+str(n2)) "+str(n3)) "+str(n4)) "+str(n5)) "+str(n6))

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

4 HSL Reference

Result n1 n2 n3 n4 n5 n6

= = = = = =

1 -1 (10+20j) (1, 2) 9 0

4.3.3 Example of Type Conversion Function This section 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 (1, 2) long function convert a string or number to a long integer. 1 oct function convert an integer number (of any size) to an octal string. 010 hex function convert an integer number (of any size) to a hexadecimal string 0xf

Issue 01 (2008–12–08)

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

4-33

M2000 iSStar User Guide

4 HSL Reference int function convert an string to a integer 11 3 17

4.3.4 Example of Other Functions This section 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]). #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, [] []

4-34

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]

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

5

HFC Library Reference

About This Chapter The iSStar provides various library functions, such as Time functions, Input and Output functions, GetError Function, GetError Function, Directory Operation Function and so on. These functions are called High level Foundation Classes (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 MML Message Parsing Function This describes the MML message parsing 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.3 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.4 Database Operation Function The database operation module provides the query operation interface for alarms, performances, and the configuration library. 5.5 Alarm Operation Function This describes the alarm operation function. This function enables you to send to the M2000 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.6 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. 5.7 Type Conversion Function Issue 01 (2008–12–08)

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

5-1

M2000 iSStar User Guide

5 HFC Library Reference

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.8 Time Function This section describes the time functions which enable you to obtain the information related to time and provide the function for converting time formats. 5.9 Input and Output Function This section describes input and output functions and the function of setting the output mode. 5.10 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.11 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.12 Report Operation Function This describes the report operation functions. By using these functions, you can perform the related operations such as design, display, and manage reports. 5.13 Directory Operation Function This section describes the operation functions related to the files and directories. 5.14 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.15 Task Management Function The task management functions are the operation functions related to the task. 5.16 Assertion Function Assertion functions are the operation functions related to assertion. 5.17 Mail Sending Function The functions of setting the mail server information, setting mail information, and sending mails are available.

5-2

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

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 M2000. 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 M2000 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: 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.11 Function: SendMML This describes the SendMML function, which enables you to issue MML commands to the NE that is operated currently. 5.1.12 Function: GetMMLReport This describes the GetMMLReport function. This function enables you to obtain and clear the messages in the buffer. 5.1.13 Function: GetAllMMLReport Issue 01 (2008–12–08)

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

5-3

M2000 iSStar User Guide

5 HFC Library Reference

This describes the GetALLMMLReport function. This function enables you to obtain and clear all the MML messages in the locale buffer. 5.1.14 Function: ClearMMLBuffer This describes the ClearMMLBuffer function. This function enables you to clear the MML messages in the local buffer to save system resources. 5.1.15 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.16 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-4

Description

5.1.2 Function: ConnectNE

Selects the NE that is operated by the current task.

5.1.3 Function: GetNELst

Returns the name list of all the NEs managed by the M2000. The NEs refer to both connected and disconnected NEs.

5.1.4 Function: GetNELstByType

Returns the name list of all the NEs managed by the M2000 by NE type. The NEs refer to both connected and disconnected NEs.

5.1.5 Function: GetNEName

Returns the name of the NE that is operated by the current task.

5.1.6 Function: GetNEFDN

Returns the FDN of the specified NE, or the FDN of the connected NE if NEName is default.

5.1.7 Function: GetNEIP

Returns the IP address of the specified NE, or the IP address of the connected NE if NEName is default.

5.1.8 Function: GetNEVer

Returns the version number of the specified NE.

5.1.9 Function: GetNEType

Returns the type of the specified NE.

5.1.10 Function: GetNEStatus

Returns the status of the NE that is operated by the current task.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Function

Description

5.1.11 Function: SendMML

Issues MML commands to the NE that is operated by the current task.

5.1.12 Function: GetMMLReport

Returns and clears the message with the specified index number in the buffer.

5.1.13 Function: GetAllMMLReport

Returns and clears all MML messages in the buffer.

5.1.14 Function: ClearMMLBuffer

Clears all messages in the buffer to release system resources.

5.1.15 Function: SetMMLBufferSize

Sets the size of the MML message buffer.

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

The procedure is as follows: Issue 01 (2008–12–08)

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

5-5

M2000 iSStar User Guide

5 HFC Library Reference

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.11 Function: SendMML. The returned message shows whether the commands are successfully issued. NOTE

The return value of the function described in 5.1.11 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.12 Function: GetMMLReport or 5.1.13 Function: GetAllMMLReport.

3.

Run the commands on the NE.

4.

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.12 Function: GetMMLReport or 5.1.13 Function: GetAllMMLReport. NOTE

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.14 Function: ClearMMLBuffer. NOTE

After the task is complete, the buffer is cancelled.

5.1.16 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

5-6

l

You must call this function to select the required NE. Then, after the operation is complete, you can issue commands to the NE.

l

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.

l

You can select only the NEs that are properly connected to the M2000.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Description Parameter

Description

NEName

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

Example # Connect the NE. nename = 'rnc01' ret = ConnectNE(nename) # Exist if the connection failed. if ret == 0 Print(' Failed to connect to %s.'%nename) Exit(0) end # The connection is successful. Send an MML command. @LST VER:;

MML Message Output LST VER:; +++

NE

O&M

#41302

2007-06-21 19:38:43

%%/*415*/LST VER:;%% RETCODE = 0

Execution succeeded.

Version information ------------------Product version

---

=

BSC6800V100R008ENGC01B080

END

Related Example

Issue 01 (2008–12–08)

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

5-7

M2000 iSStar User Guide

5 HFC Library Reference

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 M2000. The NEs refer to both connected and disconnected NEs.

Synopsis GetNELst()

Note None

Parameter Description None

Return Value l

The return value is a list. If the function is called successfully, the name list of all the NEs managed by the M2000 is returned. Otherwise, an empty list is returned.

l

Each element in the list is a string indicating the NE name.

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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 M2000 by NE type. The NEs refer to both connected and disconnected NEs. 5-8

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Synopsis GetNELstByType(NEType)

Note None

Parameter Description Parameter NEType

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

Return Value 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.

l

Each element in the list is a string indicating the NE name.

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

Example # Get the NE list based on NE type. 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. Issue 01 (2008–12–08)

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

5-9

M2000 iSStar User Guide

5 HFC Library Reference

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 If errors occur, you can obtain error information by referring to 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

5-10

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.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Return Value The return value is a string. l

If you have specified the NE, its FDN is returned.

l

If no NE is specified but an NE is operated, the FDN of this NE is returned.

l

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 M2000, a null string is returned.

Error Handling If errors occur, you can obtain error information by referring to 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

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]) Issue 01 (2008–12–08)

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

5-11

M2000 iSStar User Guide

5 HFC Library Reference

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

If you have specified the NE, its IP address is returned.

l

If no NE is specified but an NE is operated, the IP address of this NE is returned.

l

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 M2000, a null string is returned.

Error Handling If errors occur, you can obtain error information by referring to 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

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-12

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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

If you have specified the NE, its version number is returned.

l

If no NE is specified but an NE is operated, the version number of this NE is returned.

l

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 M2000, a null string is returned.

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

Issue 01 (2008–12–08)

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

5-13

M2000 iSStar User Guide

5 HFC Library Reference

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

If you have specified the NE, its NE type is returned.

l

If no NE is specified but an NE is operated, the type of this NE is returned.

l

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 M2000, a null string is returned.

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

5-14

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Result of Example 2 GetNEType() return: RNC

Related Example

5.1.10 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

If you have specified an NE, the status of this NE is returned.

l

If no NE is specified but an NE is operated, the status of this NE is returned.

l

If no NE is specified, no NE is operated, or the specified NE does not exist, 0 is returned.

Error Handling If errors occur, you can obtain error information by referring to 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

Issue 01 (2008–12–08)

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

5-15

M2000 iSStar User Guide

5 HFC Library Reference

Result of Example 1 neStatus: 1

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

Result of Example 2 neStatus: 1

Related Example

5.1.11 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 Call 5.1.2 Function: ConnectNE to select the NE to be operated before calling this function.

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.2 MML Message Parsing Function function to view the MML message. Thus, you can obtain the information about the execution of the MML commands on the NE.

Error Handling Obtain the error information by using 5.10.2 Function: GetLastErrorand 5.10.3 Function: GetErrorMsg.

Example #Connect the NE neName.

5-16

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference ConnectNE("neName") #Sending MML command sendmml = SendMML("LST CELL:;") if sendmml==1 Print('SendMML("LST CELL:;") success.') else Print('SendMML("LST CELL:;") failure!') end

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 = ---

300 300 301 302 302 5)

NodeB name

Local cell ID

Subrack No.

Subsystem

3812 3812 BBU 3812E 3812E

0 1 0 1 2

3 3 3 3 3

0 0 0 0 0

END

Related Example

5.1.12 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.15 Function: SetMMLBufferSize.

l

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.

l

After a task is complete, the corresponding buffer is cancelled and the messages are deleted.

l

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.

Issue 01 (2008–12–08)

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

5-17

M2000 iSStar User Guide

5 HFC Library Reference

After you extract message 1, the location position of message 2 changes to 1 and the location position of message 3 changes to 2.

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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)

5-18

NodeB name

Local cell ID

Subrack No.

NODEB1 NODEB1

0 1

3 3

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

---

END

The first 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

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

Service

Login Time

10.161.24.166 NULL

2008-01-10 14:15:50 NULL

Service

Login Time

10.161.24.166 NULL

2008-01-10 14:15:50 NULL

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

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) ---

NodeB name

Local cell ID

Subrack No.

NODEB1 NODEB1

0 1

3 3

NodeB name

Local cell ID

Subrack No.

NODEB1 NODEB1

0 1

3 3

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)

Issue 01 (2008–12–08)

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

5-19

M2000 iSStar User Guide

5 HFC Library Reference

---

END

Related Example

5.1.13 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

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.15 Function: SetMMLBufferSize.

l

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.

l

After a task is complete, the buffer is cancelled and the messages are deleted.

Parameter Description None.

Return Value l

The return value is a list.

l

The elements in the list are the obtained MML messages.

l

If the message fails to be obtained, a null string is returned.

Error Handling Obtain the error information through 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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.

5-20

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference Print("There are %d reports:"%(len(allReport))) for rpt in allReport Print("Report = %s"%rpt) end

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

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

Service

Login Time

10.161.24.166 NULL

2008-01-10 14:15:50 NULL

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

Local cell ID

Subrack No.

NODEB1 NODEB1

0 1

3 3

END

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

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

Service

Login Time

10.161.24.166 NULL

2008-01-10 14:15:50 NULL

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

Issue 01 (2008–12–08)

NodeB name

Local cell ID

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

Subrack No.

5-21

M2000 iSStar User Guide

5 HFC Library Reference

0 CELL1 1 1 CELL2 1 (Number of results = 2) ---

NODEB1 NODEB1

0 1

3 3

END

Related Example

5.1.14 Function: ClearMMLBuffer This 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 message is saved in the buffer. Each task has an individual buffer. You can set the buffer size by referring to 5.1.15 Function: SetMMLBufferSize.

l

The MML messages accumulates in the buffer. When the number of stored messages exceeds the maximum, new messages are lost. Therefore, you need to clear the buffer of MML messages in time.

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

Result ClearMMLBuffer() return: 1

5-22

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

MML Message Output LST VER:; +++ NE 2007-03-26 20:32:25 O&M; #31280 %%/*14263*/LST VER:;%% RETCODE = 0 Execution succeeded. ---

END

LST VER:; +++ NE 2007-03-26 20:32:25 O&M; #31280 %%/*14263*/LST VER:;%% RETCODE = 0 Execution succeeded. ---

END

Related Example

5.1.15 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

After an MML command is issued to an NE, the returned MML message is saved in a buffer. Each task has an individual buffer.

l

The messages accumulates in the buffer. When the number of stored messages exceeds the maximum, new messages are lost.

l

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

Issue 01 (2008–12–08)

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.

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

5-23

M2000 iSStar User Guide

5 HFC Library Reference

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

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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)))

Result The number of mml reports is : 1

MML Message Output LST VER:; +++

UMG8900

O&M

#5852

2008-01-08 12:07:34

%%/*117775*/LST VER:;%% RETCODE = 0

Execution succeeded.

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

---

END

Related Example

5.1.16 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-24

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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.

By using the 5.1.4 Function: GetNELstByType function, check the names of the all the NEs of the ABC type.

2.

By using the 5.1.2 Function: ConnectNE function, specify the NEs that issue the MML commands.

3.

By using the 5.1.11 Function: SendMML function, issue the MML command for querying the hard disk usage of each NE.

4.

By using the 5.1.13 Function: GetAllMMLReport function, obtain the message returned by the MML command in the buffer.

5.

By using the 5.2 MML Message Parsing Function function, parse the message and obtain the data of the remaining space of each disk.

6.

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 en 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

Issue 01 (2008–12–08)

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

5-25

M2000 iSStar User Guide

5 HFC Library Reference 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 han 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) 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.

5-26

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference 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) ---------------------------------Logical harddisk = C:\ Total space(M) = 9546 Free space(M) = 5622 Free space(%) = 58% Logical Total Free Free

harddisk space(M) space(M) space(%)

= = = =

D:\ 9537 2961 31%

(Number of results = 2) ---

END

5.2 MML Message Parsing Function This describes the MML message parsing 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.2.1 Overview of MML Message Parsing Function This describes the basic functions and procedures of MML message parsing functions. 5.2.2 MML Message Format This describes the format of MML messages and the meaning of each part. 5.2.3 Function: ParseMMLRpt This 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.2.4 Function: GetSourceName This describes the GetSourceName function. This function enables you to obtain the source identity of an MML message, that is, equipment identification. A source identifier identifies the physical area of an message output. 5.2.5 Function: GetReportDate Issue 01 (2008–12–08)

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

5-27

M2000 iSStar User Guide

5 HFC Library Reference

This describes the GetReportDate function. This function enables you to obtain the creation date of an MML message. 5.2.6 Function: GetReportTime This describes the GetReportTime function. This function enables you to obtain the creation time of an MML message. 5.2.7 Function: GetTimeAdjustFlag This 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 M2000 can precisely determine the time with the help of this flag. 5.2.8 Function: GetServiceFlag This 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.2.9 Function: GetReportIdx This 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.2.10 Function: GetMMLCmd This 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.2.11 Function: GetResultCode This 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.2.12 Function: GetResultCause This 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.2.13 Function: GetObjNum This describes the GetObjNum function. This function enables you to obtain the number of entries in an MML message. 5.2.14 Function: GetObjTitle This 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.2.15 Function: GetRecordNum This describes the GetRecordNum function. This function enables you to obtain the number of records in the specified entry in an MML message. 5.2.16 Function: GetTips This 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.2.17 Function: GetAttrValueByName This 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-28

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

5.2.18 Function: GetAttrValueByIdx This 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.2.19 Function: GetAttrNameList This describes the GetAttrNameList function. This function enables you to obtain the list of attribute names in the specified entry in an MML message. 5.2.20 Function: GetAttrNum This describes the GetAttrNum function. This function enables you to obtain the number of attributes in the specified entry in an MML message. 5.2.21 Function: GetColumnByName This 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.2.22 Function: GetColumnByIndex This describes the GetColumnByIndex function. This function enables you to obtain the data of the specified column according to the column number. 5.2.23 Function: GetRowByIndex This 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.2.24 Function: GetDataFrmMMLRpt This describes the GetDataFrmMMLRpt function. This function enables you to convert a specified entry into a tuple for report output. 5.2.25 Function: DestroyMMLParser This 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.2.26 Examples of MML Message Parsing Function This describes the examples of the MML message parsing function and the method of using some functions related to the MML message.

5.2.1 Overview of MML Message Parsing Function This describes the basic functions and procedures of MML message parsing 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 parsing functions, you can obtain and output the message information in the tuple format, which can be used for report output. Table 5-2 lists the MML message parsing functions.

Issue 01 (2008–12–08)

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

5-29

M2000 iSStar User Guide

5 HFC Library Reference

Table 5-2 MML message parsing functions FunctiPon 5.2.3 Function: ParseMMLRpt

Description Parses MML message strings. Returns the source identifier of an MML message.

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

5.2.5 Function: GetReportDate

Returns the creation date of an MML message.

5.2.6 Function: GetReportTime

Returns the creation time of an MML message. Returns a time adjustment flag.

5.2.7 Function: GetTimeAdjustFlag

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

5.2.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.2.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.2.10 Function: GetMMLCmd

5-30

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.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

FunctiPon

Description Returns the return codes of an MML message.

5.2.11 Function: GetResultCode

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.

5.2.12 Function: GetResultCause

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. Returns the number of entries in an MML message.

5.2.13 Function: GetObjNum

An MML message can contain multiple entries. The serial numbers of the entries count from 0.

5.2.14 Function: GetObjTitle

Returns the title of an entry in an MML message.

5.2.15 Function: GetRecordNum

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.

5.2.16 Function: GetTips

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.

5.2.17 Function: GetAttrValueByName

Returns the attribute value of a record in the specified entry according to the attribute name.

5.2.18 Function: GetAttrValueByIdx

Returns the attribute value of a record in the specified entry according to the attribute location.

5.2.19 Function: GetAttrNameList

Returns the list of attribute names in the specified entry in an MML message.

Issue 01 (2008–12–08)

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

5-31

M2000 iSStar User Guide

5 HFC Library Reference

FunctiPon

Description

5.2.20 Function: GetAttrNum

Returns the number of attributes in the specified entry in an MML message.

5.2.21 Function: GetColumnByName

Returns the data in a column in the specified entry according to the column name.

5.2.22 Function: GetColumnByIndex

Returns the data in a column in the specified entry according to the column number.

5.2.23 Function: GetRowByIndex

Returns the data in the specified record in the specified entry according to the record number.

5.2.24 Function: GetDataFrmMMLRpt

Returns the contents of the specified entry and output the contents in the tuple format.

5.2.25 Function: DestroyMMLParser

Destroys an MM message parsing object to release the system resources for parsing the MM message.

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

The procedure is as follows: 1.

Obtain the MML message. You can obtain the message by calling 5.2.17 Function: GetAttrValueByName or by manually entering the message. Note that you must conform to the format specifications to enter MML messages. Otherwise, the MML message parsing functions fail to parse the messages. For details of MML message format, refer to 5.2.2 MML Message Format.

5-32

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

2.

Parse the MML message by calling 5.2.3 Function: ParseMMLRpt.

3.

Obtain the required data from the parsed message.

5.2.26 Examples of MML Message Parsing Function shows the examples.

5.2.2 MML Message Format This describes the format of MML messages and the meaning of each part. The format of the MML message is shown in Figure 5-3. For a detailed description of Figure 5-3, refer to Table 5-3. Figure 5-3 MML message format

Table 5-3 Description of MML message format SN

Field Meaning

Description

(1)

Start identifiers of an MML message.

An MML message must start with "+++" as its start identifiers.

Issue 01 (2008–12–08)

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

5-33

M2000 iSStar User Guide

5 HFC Library Reference

SN

Field Meaning

Description

(2)

Source identity (equipment identification).

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.2.4 Function: GetSourceName.

(3)

(4)

Creation date of an MML message.

The YYYY-MM-DD format is applied.

Creation time of an MML message.

The 24 hour clock mode is applied. The expression format is HH:MM:SS.

It can be obtained through 5.2.5 Function: GetReportDate.

It can be obtained through 5.2.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.2.8 Function: GetServiceFlag. (6)

Serial number.

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.2.9 Function: GetReportIdx.

5-34

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

SN

Field Meaning

Description

(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.2.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.2.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.2.12 Function: GetResultCause.

(10)

Title of entry 0 of the MML message.

Specifies the topic of the body.

(11)

Attribute of entry 0.

Obtain the attribute list of the entry through 5.2.19 Function: GetAttrNameList.

(12)

Attribute value of entry 0.

It can be obtained through 5.2.17 Function: GetAttrValueByName and 5.2.18 Function: GetAttrValueByIdx.

(13)

Entry 0.

It is one part of the MML body.

It can be obtained through 5.2.14 Function: GetObjTitle.

You can obtain the number of the entries by calling 5.2.13 Function: GetObjNum. (14)

Record 1 of entry 0.

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

(15)

Sum information of entry 0.

The sum information shows the number of records in the body. You can obtain the number of records of an entry by calling 5.2.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.2.13 Function: GetObjNum.

(17)

Issue 01 (2008–12–08)

End identifier.

An MML message is ended with “ --- END ”.

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

5-35

M2000 iSStar User Guide

5 HFC Library Reference

SN

Field Meaning

Description

(18)

MML message.

You can obtain the MML message by using 5.1.12 Function: GetMMLReport. You can obtain a group of MML messages and clear the buffer by using 5.1.13 Function: GetAllMMLReport. You can create a parsing object flag by using 5.2.3 Function: ParseMMLRpt.

l

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.2.16 Function: GetTips.

l

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.

l

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.2.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.2.3 Function: ParseMMLRpt This 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)

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.

5-36

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Description Parameter

Description

MMLRpt

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.2.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 If errors occur, you can obtain error information by referring to 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

Example ConnectNE("NE001") @LST VER:; mml = GetMMLReport() # Parse the MML message. p = ParseMMLRpt(mml) returnCode = GetResultCode(p) Print('The returncode of the MML command is %s'%returnCode)

Result The returncode of the MML command is 0

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.2.4 Function: GetSourceName This describes the GetSourceName function. This function enables you to obtain the source identity of an MML message, that is, equipment identification. A source identifier identifies the physical area of an message output. Issue 01 (2008–12–08)

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

5-37

M2000 iSStar User Guide

5 HFC Library Reference

Synopsis GetSourceName(pMMLRpt)

Note None

Parameter Description Parameter

Description

pMMLRpt

pMMLRpt 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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

Example mml = ''' +++ NE 2008-01-15 12:04:00 O&M #286 %%/*8326*/LST OP:;%% RETCODE = 0 Execution succeeded. Operator info ------------Operator name

Status

IP Address

admin online 10.161.37.211 guest online 10.161.37.211 ((Result number = 2 )) --END ''' p = ParseMMLRpt(mml) sourceName = GetSourceName(p)

Service 10.161.37.211---O&M System 10.161.37.211---O&M System

Login Time 2006-09-06 16:46:36 2006-09-06 16:47:49

# Parse the MML message. # Get the source equipment identifier from the parsed MML messag

Print('GetSourceName() return: %s'%sourceName)

Result GetSourceName() return: NE

Related Example 5-38

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

5.2.5 Function: GetReportDate This describes the GetReportDate function. This function enables you to obtain the creation date of an MML message.

Synopsis GetReportDate(pMMLRpt)

Note None

Parameter Description Parameter

Description

pMMLRpt

pMMLRpt indicates a parsed MML message object.

Parameter

Description

pMMLRpt

pMMLRpt indicates a parsed MML message object.

Return Value

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

Example mml = ''' +++ 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 0 0 1 1 20 20 11 11 12 12 (Number of results = --'''

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

END

p = ParseMMLRpt(mml)

Issue 01 (2008–12–08)

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

5-39

M2000 iSStar User Guide

5 HFC Library Reference 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.2.6 Function: GetReportTime This describes the GetReportTime function. This function enables you to obtain the creation time of an MML message.

Synopsis GetReportTime(pMMLRpt)

Note None

Parameter Description Parameter

Description

pMMLRpt

pMMLRpt indicates a parsed MML message object.

Return Value The return value is a string. If the function is called successfully, the creation time of the MML message is returned. Otherwise, a null string is returned.

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

Example mml = ''' +++ 2007-04-12 15:58:18 O&M; #812669 %%/*15343*/LST VER:;%% RETCODE = 0 Execution succeeded. Version information ------------------Product version = BSC6800V100R008ENGC01B060 --'''

5-40

END

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

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.2.7 Function: GetTimeAdjustFlag This 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 M2000 can precisely determine the time with the help of this flag.

Synopsis GetTimeAdjustFlag(pMMLRpt)

Note The GetTimeAdjustFlag(pMMLRpt) function enables you to obtain the time adjustment flag, if any. If there is no such record in the message, a null string is returned.

Parameter Description Parameter

Description

pMMLRpt

pMMLRpt 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. It is one hour earlier than the current time.

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

Example mml = """ +++ RNC 2006-12-19 20:48:50 +DST O&M #8522 %%/*2116*/LST CELL:;%% RETCODE = 0 Execution succeeded.

Issue 01 (2008–12–08)

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

5-41

M2000 iSStar User Guide

5 HFC Library Reference List cell basic information --------------------------Cell ID Cell name NodeB ID 0 1 2 3 4 5 6 10 (Number --"""

CELL1 1 CELL2 1 CELL3 1 CELL4 1 CELL5 2 CELL6 2 CELL7 2 CELL10 1 of results = 8)

NodeB name

NODEB1 NODEB1 NODEB1 NODEB1 NODEB2 NODEB2 NODEB2 NODEB1

Local cell ID

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.

DL primary sc

0 128 127 126 125 124 123 1

END

p = ParseMMLRpt(mml) adjust = GetTimeAdjustFlag(p) Print("GetTimeAdjustFlag(p) return: " + adjust)

Result GetTimeAdjustFlag(p) return: DST

Related Example

5.2.8 Function: GetServiceFlag This 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(pMMLRpt)

Note None

Parameter Description Parameter

Description

pMMLRpt

pMMLRpt 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

5-42

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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)

3812 3812 BBU 3812E 3812E 3802

0 1 0 0 2 0

3 3 3 3 3 3

0 0 0 0 0 0

END

p = ParseMMLRpt(mml) #Get and output the service message flag. Print("GetServiceFlag() : "+ str(GetServiceFlag(p)))

Result GetServiceFlag(): O&M

Related Example

5.2.9 Function: GetReportIdx This 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. Issue 01 (2008–12–08)

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

5-43

M2000 iSStar User Guide

5 HFC Library Reference

Synopsis GetReportIdx(pMMLRpt)

Note None

Parameter Description Parameter

Description

pMMLRpt

pMMLRpt 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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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)

3812 3812 BBU 3812E 3812E 3802

0 1 0 0 2 0

3 3 3 3 3 3

0 0 0 0 0 0

END

#Create an MML message parsing object. p = ParseMMLRpt(mml) #Get and output the message serial number. Print("GetReportIdx() : "+ str(GetReportIdx(p)))

5-44

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Result GetReportIdx() : 71476

Related Example

5.2.10 Function: GetMMLCmd This 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(pMMLRpt)

Note None

Parameter Description Parameter

Description

pMMLRpt

pMMLRpt 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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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 =

Issue 01 (2008–12–08)

Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8

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

211

Hardware

5-45

M2000 iSStar User Guide

5 HFC Library Reference ALARM 68037 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.

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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.2.11 Function: GetResultCode This 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(pMMLRpt)

Note None

Parameter Description Parameter

Description

pMMLRpt

pMMLRpt 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. 5-46

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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)

3812 3812 BBU 3812E 3812E 3802

0 1 0 0 2 0

3 3 3 3 3 3

0 0 0 0 0 0

END

#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

5.2.12 Function: GetResultCause This 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(pMMLRpt)

Note None Issue 01 (2008–12–08)

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

5-47

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Description Parameter

Description

pMMLRpt

pMMLRpt 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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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)

3812 3812 BBU 3812E 3812E 3802

0 1 0 0 2 0

3 3 3 3 3 3

0 0 0 0 0 0

END

#Create an MML message parsing object. p = ParseMMLRpt(mml) #Get and output the remarks of the return code. Print("GetResultCause() return: "+ GetResultCause(p) )

Result GetResultCause() return: Execution succeeded.

Related Example

5.2.13 Function: GetObjNum This describes the GetObjNum function. This function enables you to obtain the number of entries in an MML message. 5-48

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Synopsis GetObjNum(pMMLRpt)

Note None

Parameter Description Parameter

Description

pMMLRpt

pMMLRpt 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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

END

#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 Issue 01 (2008–12–08)

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

5-49

M2000 iSStar User Guide

5 HFC Library Reference

5.2.14 Function: GetObjTitle This 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(pMMLRpt, ObjIndex)

Note None

Parameter Description Parameter

Description

pMMLRpt

pMMLRpt indicates a parsed MML message object.

ObjIndex

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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 20 10 12 15 (Number --"""

5-50

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

END

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

#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.2.15 Function: GetRecordNum This describes the GetRecordNum function. This function enables you to obtain the number of records in the specified entry in an MML message.

Synopsis GetRecordNum(pMMLRpt, ObjIndex)

Note None

Parameter Description Parameter

Description

pMMLRpt

pMMLRpt indicates a parsed MML message object.

ObjIndex

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.

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

Example mml=''' +++ NE 2007-12-07 10:13:53 O&M #243 %%/*599*/LST CELL:;%% RETCODE = 0 Execution succeeded.

Issue 01 (2008–12–08)

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

5-51

M2000 iSStar User Guide

5 HFC Library Reference

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) --'''

3812 3812 BBU 3812E 3812E 3802

0 1 0 0 2 0

3 3 3 3 3 3

0 0 0 0 0 0

END

p = ParseMMLRpt(mml) Print("GetRecordNum = "+ str(GetRecordNum(p, 0))) #Get and output the number of records in entry

Result GetRecordNum()= 6

Related Example

5.2.16 Function: GetTips This 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(pMMLRpt)

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 pMMLRpt

Description pMMLRpt indicates a parsed MML message object.

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. 5-52

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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.2.17 Function: GetAttrValueByName This 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(pMMLRpt, ObjIndex, PropName, RecordIdx,Case = 0)

Note None

Issue 01 (2008–12–08)

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

5-53

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Description Parameter

Description

pMMLRpt

pMMLRpt indicates a parsed MML message object.

ObjIndex

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.

PropIndex

PropIndex is a string. It indicates the attribute name of an entry in the MML message.

RecordIdx

RecordIdx is an integer. It indicates the record number in the MML message. The numbers of the records count from 0.

Case

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.

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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) --'''

NodeB name 3812 3812 BBU 3812E 3812E 3802

END

p = ParseMMLRpt(mml)

5-54

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference #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.2.18 Function: GetAttrValueByIdx This 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(pMMLRpt, ObjIndex, PropIndex, RecordIdx)

Note None

Parameter Description Parameter

Description

pMMLRpt

pMMLRpt indicates a parsed MML message object.

ObjIndex

ObjIndex is an integer. It indicates the entry number in the MML message. The numbers of the entries count from 0.

PropIndex

PropIdex is an integer. It indicates the attribute number in the MML message. The numbers of the attributes count from 0.

RecordIdx

RecordIdx is an integer. It indicates the record number in the MML message. The numbers of the records count from 0.

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg. Issue 01 (2008–12–08)

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

5-55

M2000 iSStar User Guide

5 HFC Library Reference

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)

3812 3812 BBU 3812E 3812E 3802

0 1 0 0 2 0

3 3 3 3 3 3

0 0 0 0 0 0

END

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.2.19 Function: GetAttrNameList This 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(pMMLRpt, ObjIndex)

Note None

Parameter Description Parameter

5-56

Description

pMMLRpt

pMMLRpt indicates a parsed MML message object.

ObjIndex

ObjIndex is an integer. It indicates the entry number in the MML message. The numbers of the entries count from 0.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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) --'''

Destination address mask

Forward route address

255.255.0.0 255.255.0.0

10.121.143.208 10.121.143.208

END

p = ParseMMLRpt(mml) attrNames = GetAttrNameList(p,0)

#From the parsed MML message, get the name list of the attribut

Print("GetAttrNameList() return: "+ str(attrNames))

Result GetAttrNameList() return: ['Destination network address', 'Destination address mask', 'Forward route address']

Related Example

5.2.20 Function: GetAttrNum This describes the GetAttrNum function. This function enables you to obtain the number of attributes in the specified entry in an MML message.

Synopsis GetAttrNum(pMMLRpt, ObjIndex)

Note None

Issue 01 (2008–12–08)

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

5-57

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Description Parameter

Description

pMMLRpt

pMMLRpt indicates a parsed MML message object.

ObjIndex

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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.2.21 Function: GetColumnByName This 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-58

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Synopsis GetColumnByName(mParser, objIndex, columnName, ignoreCase)

Note None.

Description Parameter

Description

mParser

mParser indicates the return object of parsing the MML message.

objIndex

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

columnName is of string type. It refers to the name of the column to be extracted.

ignoreCase

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.

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 0 1 2 3 4 5 6

Issue 01 (2008–12–08)

CELL1 CELL2 CELL3 CELL4 CELL5 CELL6 CELL7

1 1 1 1 2 2 2

NodeB name

NODEB1 NODEB1 NODEB1 NODEB1 NODEB2 NODEB2 NODEB2

0 1 2 3 4 5 6

Local cell ID 3 3 3 3 3 3 3

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

Subrack No. 0 0 0 0 0 0 0

Subsystem No.

DL primary sc

0 128 127 126 125 124 123

5-59

M2000 iSStar User Guide

5 HFC Library Reference 10 CELL10 1 (Number of results = 8) --"""

NODEB1

10

3

0

1

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.2.22 Function: GetColumnByIndex This 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

Description

mParser

mParser indicates the MML message object that is parsed.

objIndex

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

columnIndex is of integer type. It specifes the number of the column to be extracted. The number counts from 0.

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. 5-60

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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 0 1 2 3 4 5 6 10 (Number --"""

CELL1 1 CELL2 1 CELL3 1 CELL4 1 CELL5 2 CELL6 2 CELL7 2 CELL10 1 of results = 8)

NodeB name

NODEB1 NODEB1 NODEB1 NODEB1 NODEB2 NODEB2 NODEB2 NODEB1

Local cell ID

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.

DL primary sc

0 128 127 126 125 124 123 1

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

5.2.23 Function: GetRowByIndex This 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. Issue 01 (2008–12–08)

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

5-61

M2000 iSStar User Guide

5 HFC Library Reference

Description Parameter

Description

mParser

mParser indicates the return object of parsing the MML message.

objIndex

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

rowIndex is of integer type. It specifies the number of the record to be abstracted. The number counts from 0.

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 0 1 2 3 4 5 6 10 (Number --"""

CELL1 1 CELL2 1 CELL3 1 CELL4 1 CELL5 2 CELL6 2 CELL7 2 CELL10 1 of results = 8)

NodeB name

NODEB1 NODEB1 NODEB1 NODEB1 NODEB2 NODEB2 NODEB2 NODEB1

0 1 2 3 4 5 6 10

Local cell ID 3 3 3 3 3 3 3 3

Subrack No. 0 0 0 0 0 0 0 0

Subsystem No.

DL primary sc

0 128 127 126 125 124 123 1

END

p = ParseMMLRpt(mml) row = GetRowByIndex(p, 0, 0) for v in row Print(v) end

Result 0 CELL1

5-62

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference 1 NODEB1 0 3 0 0 H'2512(9490)

5.2.24 Function: GetDataFrmMMLRpt This 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

Description

mParser

mParser indicates the return object of parsing the MML message.

objIndex

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.

columnIndexList

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 Tuple. For details of two-dimensional lists, refer to List.

Error Handling None

Example mml = """ +++ RNC 2006-12-19 20:48:50 O&M #8522 %%/*2116*/LST CELL:;%%

Issue 01 (2008–12–08)

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

5-63

M2000 iSStar User Guide

5 HFC Library Reference RETCODE = 0

Execution succeeded.

List cell basic information --------------------------Cell ID Cell name NodeB ID 0 1 2 3 4 5 6 10 (Number --"""

CELL1 1 CELL2 1 CELL3 1 CELL4 1 CELL5 2 CELL6 2 CELL7 2 CELL10 1 of results = 8)

NodeB name

NODEB1 NODEB1 NODEB1 NODEB1 NODEB2 NODEB2 NODEB2 NODEB1

0 1 2 3 4 5 6 10

Local cell ID 3 3 3 3 3 3 3 3

Subrack No. 0 0 0 0 0 0 0 0

Subsystem No.

DL primary sc

0 128 127 126 125 124 123 1

END

p = ParseMMLRpt(mml) title, data = GetDataFrmMMLRpt(p, 0) Print(title) for r in data for v in r Print(v) end Print('-------------') end

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

5-64

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference 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) ------------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) -------------

5.2.25 Function: DestroyMMLParser This 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) Issue 01 (2008–12–08)

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

5-65

M2000 iSStar User Guide

5 HFC Library Reference

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

Description

mparser

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.

Error Handling If errors occur, you can obtain error information by referring to Function: GetLastError and Function: GetErrorMsg.

Example ConnectNE("rnc001") @LST VER:; mml = GetMMLReport() p = ParseMMLRpt(mml) success=DestroyMMLParser(p) if success == 1 Print("destroy success") end

Result destroy success

5.2.26 Examples of MML Message Parsing Function This describes the examples of the MML message parsing function 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.

5-66

By using the 5.1.2 Function: ConnectNE and 5.1.11 Function: SendMML functions, issue MML commands to the NEs to be operated and query the subrack status. Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd.

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

2.

By using the 5.1.12 Function: GetMMLReport function, obtain the message returned by the MML command in the buffer.

3.

By using the 5.2 MML Message Parsing Function function, parse the message and obtain the information about the status of each frame.

4.

By using the Function: NewReport, Function: AddSheet, Function: AddTable, Function: SetTableValue, and Function: SaveReportAs functions, save the parsing results to an .xls report.

Example Print('*************Subrack status check starts *************') if ConnectNE('rnc1') == 0 Print('Failed to connect the NE. Please check whether the NE is disconnected.') Exit(0) end Print('Starting to check the NE. Please wait...') @LST FRM:; mml = GetMMLReport(-1) 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 = AddNewSheet('subrack information') # Searching for all the subrack information cyclically. for frmNo in frame_list @DSP FRM: FN=%frmNo%; mml = GetMMLReport(-1) # Parse the returned message. parser = ParseMMLRpt(mml)

# 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 = [] for r in tb dataset += r end # Set the data to the table. SetTableValue(tId, dataset) end

Issue 01 (2008–12–08)

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

5-67

M2000 iSStar User Guide

5 HFC Library Reference

# Save the subrack information. SaveReportAs('Subrackinfo.xls') Print('*************The subrack status check ends*************')

Result *************Subrack status check starts ************* Starting to check the NE. Please wait... *************The subrack status check ends*************

Precautions The script of the previous task exports a report in .xls format to the output directory.Figure 5-4lists the elements in the report. Figure 5-4 Elements in the report

5.3 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.3.1 Overview of Alarm Message Parsing Function This describes the basic functions and procedures of alarm message parsing functions. 5.3.2 Alarm Message Format This describes the structure, components, and format of an alarm message. 5.3.3 Function: ParseAlmRpt 5-68

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

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.3.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.3.5 Function: GetAlmRptDate This describes the GetAlmRptDate function. This function enables you to get the create date of an alarm report. 5.3.6 Function: GetAlmRptTime This describes the GetAlmRptTime function. This function enables you to obtain the generation time of an alarm message. 5.3.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.3.8 Function: GetAlmServiceTag This describes the GetAlmServiceTag function. This function enables you to obtain the service message flag of the specified alarm. 5.3.9 Function: GetAlmTimeAdjustFlag This describes the GetAlmTimeAdjustFlag function. This function enables you to obtain the time adjustment flag of an alarm message. 5.3.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.3.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.3.12 Function: GetAlmMMLCmd This describes the GetAlmMMLCmd function. This function enables you to obtain the MML command output of an alarm message. 5.3.13 Function: GetAlmResultCode This describes GetAlmResultCode function. This function enables you to obtain the return codes. 5.3.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.3.15 Function: GetAlmTips This describes the GetAlmTips function. This function enables you to get the tips of an alarm message. 5.3.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.3.17 Function: GetAlmType Issue 01 (2008–12–08)

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

5-69

M2000 iSStar User Guide

5 HFC Library Reference

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.3.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.3.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.3.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.3.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.3.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.3.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.3.24 Function: GetAlmRaiseTime This describes the GetAlmRaiseTime function. This function enables you to obtain the generation time of the specified alarm. 5.3.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.3.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.3.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.3.28 Function: GetAlmNumByLevel This describes the GetAlmNumByLevel function. This function enables you to obtain the number of alarms of the specified severity. 5.3.29 Function: GetAlmNumByTimeDur This describes the GetAlmNumByTimeDur function. This function enables you to obtain the number of alarms in a specified period. 5-70

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

5.3.30 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.3.1 Overview of Alarm Message Parsing Function This describes the basic functions and procedures of alarm message parsing functions.

Basic Functions After the M2000 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-4 lists the alarm message parsing functions. Table 5-4 Alarm message parsing function list Function

Description

5.3.3 Function: ParseAlmRpt

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.

5.3.4 Function: GetAlmSource

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.

5.3.5 Function: GetAlmRptDate

Returns the creation date of an alarm message.

5.3.6 Function: GetAlmRptTime

Returns the creation time of an alarm message.

5.3.7 Function: GetAlmRptNum

Returns the number of entries in an alarm message. The Nth entry of an alarm message refers to the Nth alarm.

5.3.8 Function: GetAlmServiceTag

Returns the service message flag of the specified alarm in an alarm message.

Issue 01 (2008–12–08)

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

5-71

M2000 iSStar User Guide

5 HFC Library Reference

Function

Description

5.3.9 Function: GetAlmTimeAdjustFlag

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

5.3.10 Function: GetAlmServiceFlag

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.

5.3.11 Function: GetAlmRptIdx

Returns the serial number of an alarm message. An alarm serial number uniquely identifies an alarm message.

5.3.12 Function: GetAlmMMLCmd

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.

5.3.13 Function: GetAlmResultCode

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.3.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-72

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Function

Description

5.3.15 Function: GetAlmTips

Returns the tips of an alarm message. For some commands, you need to provide detailed explanations in the form of tips for integrity purpose.

5.3.16 Function: GetAlmFlowNumber

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.

5.3.17 Function: GetAlmType

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.

5.3.18 Function: GetAlmLevel

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.

5.3.19 Function: GetAlmNEType

Returns the NE type of the specified alarm. NE type is used for identifying the type of the NE that generates an alarm.

5.3.20 Function: GetAlmID

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.

5.3.21 Function: GetAlmSort

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.

5.3.22 Function: GetAlmSyncSerialNo

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.

5.3.23 Function: GetAlmName

Returns the alarm name of the specified alarm. An alarm name briefly describes an alarm.

5.3.24 Function: GetAlmRaiseTime

Returns the generation time of the specified alarm in an alarm in an alarm message.

Issue 01 (2008–12–08)

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

5-73

M2000 iSStar User Guide

5 HFC Library Reference

Function

Description

5.3.25 Function: GetAlmLocationInfo

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.

5.3.26 Function: GetAlmAttrValueByName

Returns the attribute value of the specified attribute of the specified alarm in an alarm message.

5.3.27 Function: GetAlmAttrValueByIdx

Returns the value of specified attribute of the specified alarm in an alarm message.

5.3.28 Function: GetAlmNumByLevel

Returns the number of alarms of the specified severity.

5.3.29 Function: GetAlmNumByTimeDur

Returns the number of alarms in a specified period.

Procedure Figure 5-5 shows how to use the alarm message parsing functions to obtain the alarm message contents. Figure 5-5 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.12 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.3.2 Alarm Message Format.

5-74

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

2.

Parse the MML message by calling 5.3.3 Function: ParseAlmRpt.

3.

Obtain the required data from the parsed message.

5.3.30 Examples of Alarm Message Parsing Function shows the examples.

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

l

A body is the main part of the alarm message. It contains all the information to be transmitted in the message.

l

An end identifier represents the end of the alarm message. It is used together with the start identifier to identify an alarm message.

l

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.

l

The basic alarm attributes include service message identity, flow number, alarm type, alarm severity, NE type, alarm ID, and alarm class.

Figure 5-6 shows the format of an alarm message. For details of Figure 5-6, see Table 5-5. Figure 5-6 Alarm Message Format

Issue 01 (2008–12–08)

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

5-75

M2000 iSStar User Guide

5 HFC Library Reference

Table 5-5 Description of the Alarm Message Format SN

Field Meaning

Description

(1)

Start identifier

An alarm message starts with “ +++ ”.

(2)

Source identity (equipment identification)

A source identity is used for identifying the physical area where an alarm is generated. It can be obtained through 5.3.4 Function: GetAlmSource.

(3)

Creation time

The YYYY-MM-DD HH:MM:SS format is applied. It can be obtained through 5.3.6 Function: GetAlmRptTime.

(4)

Service message flag

The service message flag is ALARM. It can be obtained through 5.3.10 Function: GetAlmServiceFlag.

(5)

Serial number

A serial number uniquely identifies an alarm message. It can be obtained through 5.3.11 Function: GetAlmRptIdx.

(6)

Command echo of an MML command in an alarm message

The command echo of an MML command displays the issued MML command. It can be obtained through 5.2.10 Function: GetMMLCmd.

(7)

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.3.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.3.14 Function: GetAlmResultCause.

5-76

(9)

Service message flag of alarm 0

It can be obtained through 5.3.8 Function: GetAlmServiceTag.

(10)

Flow number of alarm 0

An alarm flow number identifies the sequence of the alarms generated on an NE. It can be obtained through 5.3.16 Function: GetAlmFlowNumber.

(11)

Alarm category of alarm 0

Alarm category is defined by the alarm nature. Alarms can be categorized into fault alarm and event alarm. It can be obtained through 5.3.17 Function: GetAlmType.

(12)

Alarm severity of alarm 0

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.3.18 Function: GetAlmLevel.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

SN

Field Meaning

Description

(13)

NE type of alarm 0

NE type indicates the type of the NE where an alarm is generated. It can be obtained through 5.3.19 Function: GetAlmNEType.

(14)

Alarm ID of alarm 0

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.3.20 Function: GetAlmID.

(15)

Alarm type of alarm 0

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.3.21 Function: GetAlmSort. (16)

Basic attributes of an alarm

The basic attributes include service message identity, flow number, alarm type, alarm severity, NE type, alarm ID, and alarm type.

(17)

Attribute name

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.

(18)

Attribute value

It can be obtained through 5.3.26 Function: GetAlmAttrValueByName and 5.3.27 Function: GetAlmAttrValueByIdx.

(19)

Alarm synchronization No.

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.3.22 Function: GetAlmSyncSerialNo.

(20)

Alarm name

An alarm name briefly describes an alarm. Its length cannot exceed 100 English characters. It can be obtained through 5.3.23 Function: GetAlmName.

Issue 01 (2008–12–08)

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

5-77

M2000 iSStar User Guide

5 HFC Library Reference

SN

Field Meaning

Description

(21)

Alarm generation time

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.3.24 Function: GetAlmRaiseTime.

(22)

Alarm location information

Alarm location information uniquely identifies the object of an alarm. It can be obtained through 5.3.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.

(23)

Entry 0

Alarm 0 You can obtain the number of entries in an alarm message by calling 5.3.7 Function: GetAlmRptNum.

(24)

Entry 1

Alarm 1

(25)

Entry 2

Alarm 2

(26)

End identifier

An alarm message ends with “ --- END ”.

(27)

Alarm message

You can create a message parsing object by calling 5.3.3 Function: ParseAlmRpt.

CAUTION The indexes of entries, attributes, and records of an alarm message count from 0.

5.3.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-78

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

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

Description

AlmRpt

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.12 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 Obtain the error information through 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(Number of results = 4) --"""

Issue 01 (2008–12–08)

END

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

5-79

M2000 iSStar User Guide

5 HFC Library Reference

#Create a flag for the alarm message parsing object. p = ParseAlmRpt(strAlarm) Print("ParseAlmRpt(strAlarm) return: " + str(p))

Result ParseAlmRpt(strAlarm) return:

Related Example

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

Description

pAlmRpt

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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 =

5-80

Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8

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

211

Hardware

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference ALARM 68037 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.

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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.3.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

Description

pAlmRpt

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.

Issue 01 (2008–12–08)

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

5-81

M2000 iSStar User Guide

5 HFC Library Reference

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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.3.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-82

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Description Parameter

Description

pAlmRpt

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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 01 (2008–12–08)

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

5-83

M2000 iSStar User Guide

5 HFC Library Reference

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

Description

pAlmRpt

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

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.

ALARM

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.

68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

5-84

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

211

Hardware

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference (Number of results = 3) --"""

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

Description

pAlmRpt

pAlmRpt indicates a parsed alarm message object.

Index

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

Example strAlarm = """

Issue 01 (2008–12–08)

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

5-85

M2000 iSStar User Guide

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 =

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

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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.3.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

5-86

Description pAlmRpt indicates the parsing object of the alarm message.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg. Related Example

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

Description

pAlmRpt

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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 =

Issue 01 (2008–12–08)

Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8

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

211

Hardware

5-87

M2000 iSStar User Guide

5 HFC Library Reference

ALARM 68037 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.

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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.3.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

Description

pAlmRpt

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. 5-88

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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.3.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) Issue 01 (2008–12–08)

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

5-89

M2000 iSStar User Guide

5 HFC Library Reference

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 command output is displayed. Otherwise, a null string is returned.

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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)

5-90

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Result GetAlmMMLCmd(p) return: LST ALMAF: CNT=0;

Related Example

5.3.13 Function: GetAlmResultCode This describes GetAlmResultCode function. This function enables you to obtain the return codes.

Synopsis GetAlmResultCode(pAlmRpt)

Note None

Parameter Description Parameter

Description

pAlmRpt

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

ALARM 68037 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.

ALARM

Issue 01 (2008–12–08)

68046

Fault

Major

RNC

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

211

1802

Hardware

Signaling

5-91

M2000 iSStar User Guide

5 HFC Library Reference Sync serial No. Alarm name Alarm raised time Location info

= = = =

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.

(Number of results = 3) --"""

END

#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.3.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

Description

pAlmRpt

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg. 5-92

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

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 =

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

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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.3.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

Issue 01 (2008–12–08)

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

5-93

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Description Parameter pAlmRpt

Description pAlmRpt indicates the parsing object of the alarm message.

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg. Related Example

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

Description

pAlmRpt

pAlmRpt indicates a parsed alarm message object.

Index

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg. 5-94

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

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 =

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

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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.3.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

Issue 01 (2008–12–08)

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

5-95

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Description Parameter

Description

pAlmRpt

pAlmRpt indicates a parsed alarm message object.

Index

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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)

5-96

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Result The alarm type of the specified alarm is: Fault

Related Example

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

Synopsis GetAlmLevel(pAlmRpt,Index)

Note None

Parameter Description Parameter

Description

pAlmRpt

pAlmRpt indicates a parsed alarm message object.

Index

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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 =

Issue 01 (2008–12–08)

Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8

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

211

Hardware

5-97

M2000 iSStar User Guide

5 HFC Library Reference

ALARM 68037 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.

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(Number of results = 3) --"""

END

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

5-98

Parameter

Description

pAlmRpt

pAlmRpt indicates a parsed alarm message object.

Index

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 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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.3.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. Issue 01 (2008–12–08)

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

5-99

M2000 iSStar User Guide

5 HFC Library Reference

Synopsis GetAlmID(pAlmRpt,Index)

Note None

Parameter Description Parameter

Description

pAlmRpt

pAlmRpt indicates a parsed alarm message object.

Index

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

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.

ALARM

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.

68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

211

Hardware

(Number of results = 3)

5-100

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

--"""

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

Related Example

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

Description

pAlmRpt

pAlmRpt indicates a parsed alarm message object.

Index

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg. Issue 01 (2008–12–08)

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

5-101

M2000 iSStar User Guide

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 =

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

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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.3.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

5-102

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Description Parameter

Description

pAlmRpt

pAlmRpt indicates a parsed alarm message object.

Index

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.

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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 =

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

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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)

Issue 01 (2008–12–08)

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

5-103

M2000 iSStar User Guide

5 HFC Library Reference

Result The alarm's sync serial No. of the 1st alarm is: 110145

Related Example

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

Parameter Description Parameter

Description

pAlmRpt

pAlmRpt indicates a parsed alarm message object.

Index

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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 =

5-104

Major RNC 110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8

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

211

Hardware

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference ALARM 68037 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.

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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)

Result The alarm name of the 2th alarm is: SAAL Link Unavailable

Related Example

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

Description

pAlmRpt

pAlmRpt indicates a parsed alarm message object.

Index

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 01 (2008–12–08)

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

5-105

M2000 iSStar User Guide

5 HFC Library Reference

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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.3.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-106

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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

Description

pAlmRpt

pAlmRpt indicates a parsed alarm message object.

Index

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 location information of the specified alarm is returned. Otherwise, a null string is returned.

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

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.

68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

ALARM

68046 Fault Major Sync serial No. = 110154

Issue 01 (2008–12–08)

RNC

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

211

1802

Hardware

Signaling

5-107

M2000 iSStar User Guide

5 HFC Library Reference Alarm name Alarm raised time Location info

= = =

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.

(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

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

5-108

Parameter

Description

pAlmRpt

pAlmRpt indicates a parsed alarm message object.

Index

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

PropName is a string. It indicates the attribute name of the entries in the alarm message.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Parameter

Description

Case

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 value of the specified attribute is returned. Otherwise, a null string is returned.

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

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.

ALARM

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.

68037 Fault Sync serial No. = Alarm name = Alarm raised time = Location info = 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

211

Hardware

(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.")

Issue 01 (2008–12–08)

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

5-109

M2000 iSStar User Guide

5 HFC Library Reference

Print("The attribute value(Sync serial No.) of the Index entry in the alarm message is: " + propva

Result The attribute value(Sync serial No.) of the Index entry in the alarm message is: 110134

Related Example

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

Description

pAlmRpt

pAlmRpt indicates a parsed alarm message object.

Index

Index is an integer. It indicates the index of the alarms in the alarm message. The index starts from 0.

PropIndex

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

Example strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM

5-110

67984

Fault

Major

RNC

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

211

Hardware

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference Sync serial No. Alarm name Alarm raised time Location info

= = = =

110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8

ALARM 68037 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.

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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: ' + propva

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

Description

pAlmRpt

pAlmRpt indicates a parsed alarm message object.

Level

Level is a string. It indicates the alarm severity.

Issue 01 (2008–12–08)

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

5-111

M2000 iSStar User Guide

5 HFC Library Reference

Parameter

Description

Case

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(Number of results = 3) --"""

END

#Get the alarm message parsing object. p = ParseAlmRpt(strAlarm) #Get the number of "major" alarms. num = GetAlmNumByLevel(p, "Major")

5-112

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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

Description

pAlmRpt

pAlmRpt indicates a parsed alarm message object.

Start

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.

Stop

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

Example strAlarm = """ +++ NE 2006-01-04 11:35:56 ALARM #27232 %%LST ALMAF: CNT=0;%% RETCODE = 0 Execution succeeded. ALARM

Issue 01 (2008–12–08)

67984

Fault

Major

RNC

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

211

Hardware

5-113

M2000 iSStar User Guide

5 HFC Library Reference Sync serial No. Alarm name Alarm raised time Location info

= = = =

110134 WGRU Board Not in Position 2005-12-27 15:06:50 Subrack No.=3, Slot No.=8

ALARM 68037 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.

ALARM 68046 Fault Sync serial No. = Alarm name = Alarm raised time = Location info =

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.

(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

5.3.30 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) Raise Time: (2008, 12, 10,12, 5,30; 480,0) ...

5.4.6 Function: QueryPmRcds This describes the QueryPmRcds function, which enables you to query performance data records.

Synopsis QueryPmRcds(Pmcond)

Note

5-136

l

QueryPmRcds(Pmcond) enables you to query performance data records. You can get the performance results by calling the function NextPmRcds.

l

Call the functionOpenDB to connect to the database before calling this function.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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

Table 5-9 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

NE_TYPEID

l

1: M2000

l

2: LMT

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

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

Time mode. It indicates the adopted time mode. You can

Issue 01 (2008–12–08)

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

5-137

M2000 iSStar User Guide

5 HFC Library Reference

Enumerated Type

Detailed Information 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. 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

TIME_DEFAULT

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 PERIOD

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.

5-138

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Enumerated Type

START_TIME

Detailed Information 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. 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.

END_TIME

Issue 01 (2008–12–08)

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.

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

5-139

M2000 iSStar User Guide

5 HFC Library Reference

Enumerated Type

COUNTERID_SEQ

OBJINDEX_SEQ

Detailed Information 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.

NEFDN_SEQ

5-140

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.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

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

RESULT_SORT

sortType: integer type. It indicates the field by which the results are sorted. The values and meanings are as follows: 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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg. Related Example

5.4.7 Function: NextPmRcds This describes the NextPmRcds() function, which enables you to obtain the queried performance data through QueryFmRcds().

Synopsis NextPmRcds() Issue 01 (2008–12–08)

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

5-141

M2000 iSStar User Guide

5 HFC Library Reference

Note l

NextPmRcds() enables you to obtain the queried performance data through 5.4.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.

l

Call 5.4.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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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)

5-142

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference #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()

Result QueryPmRcds() return:3498

5.4.8 Function: QueryCmRcds This describes the QueryCmRcds function, which enables you to get the queried configuration data records.

Synopsis QueryCmRcds(Cmcond)

Note l

QueryCmRcds(Cmcond) enables you to get the queried configuration data records. Get the queried result by calling 5.4.9 Function: NextCmRcds.

l

Before calling this function, call 5.4.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. Issue 01 (2008–12–08)

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

5-143

M2000 iSStar User Guide

5 HFC Library Reference

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg. Related Example

5.4.9 Function: NextCmRcds This describes the NextCmRcds() function, which enables you to obtain the configuration data queried through QueryCmRcds().

Synopsis NextCmRcds()

Note l

NextCmRcds() enables you to obtain the configuration data queried through 5.4.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.

l

Call 5.4.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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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

5-144

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Result ----------### Query the configuration ####---------CM result:2360

5.4.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)

Note l

GetCmCom(Fdn,objSeq) enables you to obtain the configuration data of the specified object. Obtain the queried results through 5.4.9 Function: NextCmRcds.

l

Call 5.4.2 Function: OpenDB to connect to the database before calling this function.

Parameter Description Parameter

Description

Fdn

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

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

objId: long integer type. It indicates the ID of the MO object in the configuration data.

l

MocName: character type. It indicates the name of MOC.

l

displayMocName: string type. It indicates the display name of MOC.

l

name: character type. It indicates the name of MO.

l

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:

Issue 01 (2008–12–08)



groupName: string type. It indicates the name of the attribute group.



data: string type. It indicates results of the attributes in the attribute list. Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd.

5-145

M2000 iSStar User Guide

5 HFC Library Reference

Error Handling Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

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()

5.4.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.4.2 Function: OpenDB to connect to the database before calling this function.

Parameter Description Parameter

Description

NEFdn

NEFdn is a string. It indicates the NE FDN which uniquely identifies the configuration data.

ParentMoc

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.

5-146

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference 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

name: string type. It indicates the name of the MOC.

l

displayName: string type. It indicates displayed MOC name.

l

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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg.

Example #Connect the database. OpenDB("admin", "11111111") retlist = GetChildMoc('.3221229568.3221233664.3221278720', 'RncEquipment') Print('GetChildMoc() return recordCount: ' + str(len(retlist))) #Close the database connection. CloseDB()

5.4.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. Issue 01 (2008–12–08)

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

5-147

M2000 iSStar User Guide

5 HFC Library Reference

Attribute

Description

neTypeName

Refers to the name of an NE type.

period

Refers to a query period.

neFDNList

Refers to the list of NE FDNs, which is in the form of [FDN1, FDN2, ...].

FssIdList

Refers to the list of function subset IDs, which is in the form of [Subset ID1, Subset ID2, ...].

timeMode

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

Refers to the start time for query. The format is (year, month, day, hour, minute, second).

endTime

Refers to the end time for query. The format is (year, month, day, hour, minute, second).

timezoneOffset

Refers to the offset of a time zone. The default value is -1.

dstTimeOffset

Refers to the offset of the daylight saving time. The default value is -1.

Error Handling If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

Example

cond = GetIntegrityReportCond() cond.neTypeName = 'RNC' cond.period=0 cond.neFDNList=['.3221229568.3221233664.3221282816','.3221229568.3221233664.3221282817','.32212 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)

5-148

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Result fssId: 67109391;actualNum: 0;dueNum: 0;percentOfIntegrity: 100;

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

Description Name of an NE type.

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 If errors occur, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

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:

Issue 01 (2008–12–08)

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

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

5-149

M2000 iSStar User Guide

5 HFC Library Reference ...

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

Description

IntegrityReport Cond

Refers to the integrity query conditions, which can be set through 5.4.12 Function: GetIntegrityReportCond.

Return Value The return value is an integrity report.

Error Handling If errors occur, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

Example

#Set querying condition cond = GetIntegrityReportCond() cond.neTypeName = 'RNC' cond.period=0 cond.neFDNList=['.3221229568.3221233664.3221282816','.3221229568.3221233664.3221282817','.32212 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-150

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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

Description

resultNeIntegri tyLst

Refers to the integrity result, which may contain the integrity results of multiple NEs. This parameter value is the return value of 5.4.14 Function: QueryIntegrityResult.

neFdn

Refers to the FDN of an NE.

Return Value The return value is the integrity result of a specified NE.

Error Handling If errors occur, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

Example

cond = GetIntegrityReportCond() cond.neTypeName = 'RNC' cond.period=0 cond.neFDNList=['.3221229568.3221233664.3221282816','.3221229568.3221233664.3221282817','.32212 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:

Issue 01 (2008–12–08)

3

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

5-151

M2000 iSStar User Guide

5 HFC Library Reference

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

Description

integrityNE

Refers to an NE integrity report. The parameter value is the return value of 5.4.15 Function: GetOneNEInteLst.

fssId

Refers to an ID of a function subset. NOTE By using 5.4.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.

Error Handling If errors occur, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

Example

cond = GetIntegrityReportCond() cond.neTypeName = 'RNC' cond.period=0 cond.neFDNList=['.3221229568.3221233664.3221282816','.3221229568.3221233664.3221282817','.32212 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)

5-152

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Result fssId: 67109391;actualNum: 0;dueNum: 0;percentOfIntegrity: 100;

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

Description

resultNeIntegrityLst

Refers to an integrity result. This parameter value is the return value of 5.4.14 Function: QueryIntegrityResult.

neFdn

Refers to the FDN of an NE.

fssId

Refers to an ID of a function subset. NOTE By using 5.4.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 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','.32212 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')

Issue 01 (2008–12–08)

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

5-153

M2000 iSStar User Guide

5 HFC Library Reference t = GetOneFssInte(l,67109473)

d = GetOneIntegrity(li,'.3221229568.3221233664.3221282842',67109391) Print(d)

Result fssId: 67109391;actualNum: 0;dueNum: 0;percentOfIntegrity: 100;

5.4.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-10. Assume that cond is a condition for querying performance data and is created in 5.4.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

Table 5-10 Description of conditions for querying performance data Name

Detailed Information

NE_FDN

NE_FDN is a string and refers to the NE FDN.

TIME_MODE

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.

5-154

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Name

Detailed Information

FUNCTION_SUBSET

Refers to the function subset ID and is a numeral. Unless otherwise specified, the default value is -1. NOTE You can obtain the IDs and names of all the function subsets of a specified NE type by referring to 5.4.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.

Refers to a measurement period. The values and meanings are as follows:

PERIOD

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.

END_TIME

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.

Issue 01 (2008–12–08)

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

5-155

M2000 iSStar User Guide

5 HFC Library Reference

Name

Detailed Information

COUNTERID_SEQ

Refers to the sequence of counter IDs and is displayed in a list. Each element in the list is a counter ID. NOTE You can obtain the counter ID of an NE by referring to 5.4.26 Function: GetCounterInfo.

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 If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

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) Print(lens)

Resut 71

5.4.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. 5-156

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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-11. Assume that cond is a condition for querying alarm data and is created by referring to 5.4.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-11 Description of conditions for querying alarm data Name

Detailed Information

ALARM_CATE

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.

TIME_MODE

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.

END_TIME

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.

Issue 01 (2008–12–08)

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

5-157

M2000 iSStar User Guide

5 HFC Library Reference

Name

Detailed Information

ALARMINFO_SEQ

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: SoftX

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

5-158

Refers to the FDN sequence of NEs and is displayed in a list. Each element in the list is an FDN.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Name

Detailed Information

ALARMCAUSE_SEQ

Refers to the type sequence of alarm causes and is displayed in a list. The values and meanings are as follows:

ALARMLEVEL_SEQ

Issue 01 (2008–12–08)

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)

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

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

5-159

M2000 iSStar User Guide

5 HFC Library Reference

Name

Detailed Information

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:

5-160

l

5: Acknowledged

l

6: Unacknowledged

LINKFDN_SEQ

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.

LINKTYPE_SEQ

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

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Name

Detailed Information

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 If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

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) Print(count)

Resut 71

5.4.20 Function: QueryRecord The QueryRecord function is used to query the performance data or alarm data that meets the query conditions.

Synopsis QueryRecord(queryCond) Issue 01 (2008–12–08)

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

5-161

M2000 iSStar User Guide

5 HFC Library Reference

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.4.18 Function: GetPmCond and 5.4.19 Function: GetFmCond, respectively.

Return Value Refers to the set of results. You can obtain each record by referring to 5.4.22 Function: NextRecord.

Error Handling If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

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)

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)

5-162

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference lens=RecordCount(iter) Print(lens)

Result of Example 2 71

5.4.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.4.20 Function: QueryRecord.

Return Value Refers to the records obtained through the QueryRecord function. The value is an integer.

Error Handling If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

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

Issue 01 (2008–12–08)

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

5-163

M2000 iSStar User Guide

5 HFC Library Reference

5.4.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.4.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

True: Indicates that the record is the last record.

l

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.

5-164

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

l

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

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Table 5-12 Items in the list of alarm records Location in the List

Detailed Information

1

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

Refers to the serial number (SN) of a network. This element is an integer.

3

Refers to the FDN of an NE. This element is represented by characters.

4

Refers to the SN of a device. This element is an integer.

5

Refers to the sub-device identifier of the NE on which an alarm is generated. This element is an integer.

6

Refers to the alarm ID. This element is an integer.

7

Refers to the type of alarm causes. This element is an integer. The values and meanings are as follows:

Issue 01 (2008–12–08)

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

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

5-165

M2000 iSStar User Guide

5 HFC Library Reference

Location in the List

Detailed Information

8

Refers to the alarm severity. This element is an integer. The values and meanings are as follows:

9

10

1: Critical

l

2: Major

l

3: Minor

l

4: Warning

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

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

Refers to the user name of the operator who acknowledges an alarm. This element is represented by characters.

12

Refers to the user name of the operator who clears an alarm. This element is represented by characters.

13

Refers to the additional information about an alarm. This element is represented by characters.

14

Refers to the cause ID of an alarm. This element is an integer.

15

Refers to the FDN of the alarm link. This element is an integer.

16

Refers to the type of an alarm link. This element is an integer. The values and meanings are as follows:

17

5-166

l

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.

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.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Location in the List

Detailed Information

18

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.

19

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.

Table 5-13 Items in the list of alarm records Location in the List

Detailed Information

1

Refers to the start time of the query. This element is represented by characters and its format is yyyy-mm-dd HH:mm:ss.

2

Refers to the end time of the query. This element is represented by characters and its format is yyyy-mm-dd HH:mm:ss.

3

Refers to the name of an performance measurement object. This element is represented by characters.

4

Refers to the credibility identifier of a result. This element is a Boolean value. The values and meanings are as follows:

5

...

Issue 01 (2008–12–08)

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.

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

5-167

M2000 iSStar User Guide

5 HFC Library Reference 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 If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

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

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

5-168

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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

Description

mocName

mocName is a string and refers to an MOC name.

neFdn

neFdn is a string and refers to an NE FDN.

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 If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

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']

Issue 01 (2008–12–08)

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

5-169

M2000 iSStar User Guide

5 HFC Library Reference

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

Error Handling If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

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.4.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) 5-170

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Note None.

Parameter Description Parameter

Description

funcSubsetId

funcSubsetId is an integer and refers to the function subset ID of an NE. You can obtain funcSubsetId by referring to 5.4.28 Function: GetFuncSubSetList.

neFdn

neFdn is a string and refers to the NE FDN. You can obtain neFdn by referring to 5.1.6 Function: GetNEFDN.

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 If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

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.4.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)

Note None. Issue 01 (2008–12–08)

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

5-171

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Description Parameter

Description

funcSubsetId

funcSubsetId is an integer and refers to the function subset ID of an NE. You can obtain funcSubsetId by referring to 5.4.28 Function: GetFuncSubSetList.

period

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)

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 If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

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.4.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. 5-172

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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.4.31 Function: GetPmNeType.

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 If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

Example funList=GetFuncSetList(4) Print(funList)

Resut [(67109365, 'Measurements related to Algorithm'), (67109366, 'Measurements related to AMR'), (67109368, 'Measurements related to CPU'),...]

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

Issue 01 (2008–12–08)

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.4.27 Function: GetFuncSetList.

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

5-173

M2000 iSStar User Guide

5 HFC Library Reference

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 If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

Example subSetList=GetFuncSubsetList(67109365) Print(subSetList)

Resut [(67109391, 'Measurement related to Algorithm per cell'), (67109473, 'Measurement related to Algorithm per NodeB')]

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

attrList

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

5-174

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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 If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

Example 1

moi=(3221987331L, '.3221287013.3221975040.3221979139.3221987331', '.3221229568.3221233664.32212 moiattr=GetMoiAttrValueList(moi,[]) Print(moiattr)

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.32212 moiattr=GetMoiAttrValueList(moi,['CabinetGrpNo', 'CabinetNo', 'CabinetType', 'name', 'SiteIndex' Print(moiattr)

Result of Example 2 ['NULL', 'NULL', 'NULL', 'Cabinet No.=0, Site Index=1', 'NULL', '116']

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

Description

mocName

mocName is a string and refers to the MOC name.

neFdn

neFdn is a string and refers to the NE FDN.

Issue 01 (2008–12–08)

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

5-175

M2000 iSStar User Guide

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

objId: MOI ID

l

moiFdn: MOI FDN

l

neFdn: NE FDN

Error Handling If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

5-176

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Example 1 #Get the Fdn of the NE 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',E Print(mocuni)

Result of Example 2 [(3221987329L,'.3221287013.3221975040.3221979137.3221987329','. 3221229568.3221233664.3221287013')]

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

Issue 01 (2008–12–08)

Description typeName is a string and refers to the type name of an NE. This parameter is optional.

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

5-177

M2000 iSStar User Guide

5 HFC Library Reference

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: l

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

l

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 If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

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('NodeB') Print(neInfo)

Result of Example 2 (3, 'NodeB')

5.4.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. 5-178

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Description Parameter neFdn

Description neFdn is a string and refers to the NE FDN.

Return Value Refers to a tuple obtained through the GetNeInfo function. The tuple format is (NE name, NE type ID).

Error Handling If an error occurs, you can obtain the error information by referring to Function: GetLastError and Function: GetErrorMsg.

Example neFdn='.3221229568.3221274624.3221278720' neinfo=GetNeInfo(neFdn) Print(neinfo)

Resut ('RNC_cjw', 1)

5.4.33 Function: CloseDB This describes the CloseDB function, which enables you to close the connection with the database center.

Synopsis CloseDB()

Note Call 5.4.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 Obtain the error information by using 5.10.2 Function: GetLastError and 5.10.3 Function: GetErrorMsg. Issue 01 (2008–12–08)

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

5-179

M2000 iSStar User Guide

5 HFC Library Reference

Example #Connect the database. OpenDB("admin", "11111111") #Close the database connection. returncode = CloseDB() Print('CloseDB() return: ' + str(returncode))

Result CloseDB() return: 1

5.5 Alarm Operation Function This describes the alarm operation function. This function enables you to send to the M2000 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.5.1 Overview of Alarm Operation Function This describes the alarm operation function. By using this function, you can send alarm information to the M2000. 5.5.2 Function: SendAlarm This describes the SendAlarm function. This function enables you to send alarms to the M2000. The alarm information involves alarm ID, alarm category, and alarm details.

5.5.1 Overview of Alarm Operation Function This describes the alarm operation function. By using this function, you can send alarm information to the M2000. 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 M2000 client. Table 5-14 lists the alarm operation functions. Table 5-14 Alarm function list Function

Description

5.5.2 Function: SendAlarm

Sends alarms to the system.

5.5.2 Function: SendAlarm This describes the SendAlarm function. This function enables you to send alarms to the M2000. The alarm information involves alarm ID, alarm category, and alarm details. 5-180

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Synopsis SendAlarm(alarmID, category, alarmInfo)

Note This function can be used for only a remote task. It is run on the server.

Parameter Description Parameter

Description

alarmID

Alarm ID. This parameter is of integer type.

category

Alarm category. This parameter is of integer type. The meanings are as follows: l

1: fault alarm

l

2: clearance alarm

l

3: event alarm

Detailed information about an alarm. This parameter is of string type.

alarmInfo

Return Value The return value is an integer. If this function is called successfully, 0 is returned. Otherwise, a number rather than 0 is returned.

Error Handling None

Example Print("Sending an alarm:ID Alarm ID:600,Alarm type:Event alarm,:alarm detail") ret = SendAlarm(600, 3, 'alarm detail') Print("To View the Alarms,please click Monitor->Event Alarms")

Result Sending an alarm:ID Alarm ID:600,Alarm type:Event alarm,:alarm detail To View the Alarms,please click Monitor->Event Alarms

5.6 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. Issue 01 (2008–12–08)

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

5-181

M2000 iSStar User Guide

5 HFC Library Reference

5.6.1 Overview of OM Operation Function OM operation functions refer to the GetOMCVersion function and the LOG_OP function. 5.6.2 Function: GetOMCVersion This describes the GetOMCVersion function. This function enables you to obtain the version number of the current NM system. 5.6.3 Function: LOG_OP This describes the LOG_OP function. This function records the operations of a script and generates operation logs.

5.6.1 Overview of OM Operation Function OM operation functions refer to the GetOMCVersion function and the LOG_OP function. 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. You can query the log information on the M2000 client. Table 5-15 lists the OM operation functions. Table 5-15 OM function list Function

Description

5.6.2 Function: GetOMCVersion

Returns the version number of the current NM system.

5.6.3 Function: LOG_OP

Records the operations of a script and generates operation logs.

5.6.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. 5-182

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Error Handling None

Example version = GetOMCVersion() Print("OMC Version is: %s"%version)

Result OMC Version is: iManagerM2000V200R006C01B060

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

Parameter Description Parameter

Description

opName

opName is a string. It indicates the operation name.

targetName

targetName is a string. It indicates the name of the operation object.

detailInfo

detailInfo is a string. It indicates the operation details.

auditResult

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 Issue 01 (2008–12–08)

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

5-183

M2000 iSStar User Guide

5 HFC Library Reference

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.7 Type Conversion Function 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.7.1 Function: String2Int This function convert a string into an integer value. 5.7.2 Function: String2Float This function converts a string into a float value. 5.7.3 Function: String2Long This function converts a string into a long value. 5.7.4 Function: Sequence2Tuple This function converts a sequence into a tuple. 5.7.5 Function: Sequence2List This function converts a sequence into a list. 5.7.6 Function: ToString This function converts a value of any type into a string.

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

5-184

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Description Parameter value

Description String to be converted.

Return Value The function returns a binary tuple. 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.

l

The second element is the integer value after conversion.

Error Handling Obtain the error information by using the GetLastError function and the GetErroMsg function.

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, '') (False, '3.0') ================String2Int(value) Correct==================== (True, 3) (True, -3)

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

Issue 01 (2008–12–08)

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

5-185

M2000 iSStar User Guide

5 HFC Library Reference

Description Parameter value

Description String to be converted.

Return Value The function returns a binary tuple. 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.

l

The second element is the float value after conversion.

Error Handling Obtain the error information by using the GetLastError function and the GetErroMsg function.

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

5-186

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Description Parameter value

Description String to be converted.

Return Value The function returns a binary tuple. 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.

l

The second element is the long value after conversion.

Error Handling Obtain the error information by using the GetLastError function and the GetErroMsg function.

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.7.4 Function: Sequence2Tuple This function converts a sequence into a tuple.

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.

Issue 01 (2008–12–08)

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

5-187

M2000 iSStar User Guide

5 HFC Library Reference

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

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.

l

The value of the second element is the tuple after conversion.

Error Handling Obtain the error information by using the GetLastError function and the GetErroMsg function.

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.7.5 Function: Sequence2List This function converts a sequence into a list.

Synopsis Sequence2List(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.

5-188

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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

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.

l

The value of the second element is the list after conversion.

Error Handling Obtain the error information by using the GetLastError function and the GetErroMsg function.

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

Description Parameter value Issue 01 (2008–12–08)

Description Data to be converted. The data can be of any type.

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

5-189

M2000 iSStar User Guide

5 HFC Library Reference

Return Value The function returns a binary tuple. 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.

l

The second element is the string after conversion.

Error Handling Obtain the error information by using the GetLastError function and the GetErroMsg function.

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.8 Time Function This section describes the time functions which enable you to obtain the information related to time and provide the function for converting time formats. 5.8.1 Overview of Time Function The time function provided in the iSStar can be used to obtain the information on time. 5.8.2 Time Format This section describes all the time formats contained in the return value string (StrfTime). 5.8.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.8.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). 5.8.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-190

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

5.8.6 Function: MkTime This function returns the difference between the GMT time (or local time) and the epoch time. The unit is second. 5.8.7 Function: Sleep This function is used to continue to execute the next statement after pausing the required time. 5.8.8 Function: StrfTime This function is used to convert the time represented in tuple into the string in a specified time format. 5.8.9 Function: StrpTime This function is used to convert the time string in a specified format into the time tuple. 5.8.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.8.11 Function: CTime This function enables you to obtain the string of the local time. 5.8.12 Function: AscTime This function enables you to convert the tuple indicating the time into a string containing 24 characters.

5.8.1 Overview of Time Function 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-16. Table 5-16 List of time functions Function

Description

5.8.4 Function: GMTime

This function is used to return the GMT time according to the difference of the GMT time and the epoch time.

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

5.8.6 Function: MkTime

This function returns the difference between the GMT time (or local time) and the epoch time. The unit is second.

5.8.7 Function: Sleep

This function is used to continue to execute the next statement after pausing the required time.

5.8.8 Function: StrfTime

This function is used to convert the time represented in tuple into the string with a specified time format.

Issue 01 (2008–12–08)

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

5-191

M2000 iSStar User Guide

5 HFC Library Reference

Function

Description

5.8.9 Function: StrpTime

This function is used to convert the time string in a specified format into the time tuple.

5.8.10 Function: Time

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.

5.8.11 Function: CTime

This function is used to obtain the local time string.

5.8.12 Function: AscTime

This function is used to convert the tuple indicating the time into the string containing 24 characters.

5.8.2 Time Format This section describes all the time formats contained in the return value string (StrfTime).

Time Format Format

5-192

Description

%a

Abbreviated weekday name in the local time.

%A

Full weekday name in the local time.

%b

Abbreviated month name in the local time.

%B

Full month name in the local time.

%c

Appropriate date and time representation in the local time.

%d

Day of the month as a decimal number [01, 31].

%H

Hour (24-hour clock) as a decimal number [00, 23].

%I

Hour (12-hour clock) as a decimal number [01,12].

%j

Day of the year as a decimal number [001, 366].

%m

Month as a decimal number [01,12].

%M

Minute as a decimal number [00, 59].

%p

Equivalent of either AM or PM in the local time.

%S

Second as a decimal number [00, 59].

%U

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.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Format

Description

%w

Weekday as a decimal number [0(Sunday),6].

%W

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.

%x

Appropriate date representation in the local time.

%X

Appropriate time representation in the local time.

%y

Year without century as a decimal number [00, 99].

%Y

Year with century as a decimal number.

%Z

Time zone name (no characters if no time zone exists).

%%

A literal "%" character.

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

Element

Value Range

Description

0

Year

0-9999

Full year name, for example, 2006

1

Month

1-12

Month as a numerical value

2

Date

1-31

Date as a numerical value

3

Hour

0-23

Hour, in 24-hour format, as a numerical value

4

Minute

0-59

Minute as a numerical value

5

Second

0-59

Second as a numerical value

6

Week

0-6

Weekday as a numerical value (0 indicates Monday)

7

Day

1-366

Day of the year as a numerical value

-1, 0, and 1

1 indicates that the DST is used. 0 indicates that the DST is not used. -1 indicates that the DST is not available.

8

Issue 01 (2008–12–08)

DST

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

5-193

M2000 iSStar User Guide

5 HFC Library Reference

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

Description Secs is a floating number with the unit represented in second. The time starts from 1970/01/01 00:00:00.

Secs

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.8.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-194

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Synopsis LocalTime([Secs])

Note None.

Parameter Description Parameter Name

Description Secs is a floating number with the unit expressed in second. The time starts from 1970/01/01 00:00:00.

Secs

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] Print("%d/%d/%d"%(day,month,year))

#Get the local time and the values of year, month, and date

Result 13/10/2006

5.8.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 01 (2008–12–08)

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

5-195

M2000 iSStar User Guide

5 HFC Library Reference

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.8.3 Time Tuple.

t

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())) Print(MkTime(LocalTime()))

#According to the GMT time, obtain the difference (in second) between #According to the local time, obtain the difference (in second) betw

Result 1210213390.0 1210184590.0

5.8.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-196

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

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

Description

format

It is used to define the time format. For details, see the Time Format function.

t

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 01 (2008–12–08)

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

5-197

M2000 iSStar User Guide

5 HFC Library Reference

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.8.9 Function: StrpTime This function is used to convert the time string in a specified format into the time tuple.

Synopsis StrpTime(string,format=None)

Note None

Parameter Description Parameter

Description

string

It is a time string to be converted.

format

It is used to define the time format. For details, see the 5.8.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)

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-198

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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

5.8.11 Function: CTime This function enables you to obtain the string of the local time.

Synopsis CTime() Issue 01 (2008–12–08)

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

5-199

M2000 iSStar User Guide

5 HFC Library Reference

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

Parameter Description Parameter

t

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. 5-200

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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.9 Input and Output Function This section describes input and output functions and the function of setting the output mode. 5.9.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.9.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.9.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.9.4 Function: SetOutMode This function enables you to set the output mode of the Print function. 5.9.5 Function: SetOutFlag This function enables you to set the output switch of the Print function. 5.9.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.9.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.9.8 Function: GetOutputPath This function enables you to obtain the default output path of the task. 5.9.9 Function: NotifyProgress This function is used to view the execution progress of the task on the iSStar Task Manage Window progress bar. Issue 01 (2008–12–08)

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

5-201

M2000 iSStar User Guide

5 HFC Library Reference

5.9.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-17 lists the input and output functions provided by the iSStar. Table 5-17 List of input and output functions Function

Description

5.9.2 Function: UserInput

This function is used to obtain entered strings from the client.

5.9.4 Function: SetOutMode

This function is used to set the output mode of the Print function.

5.9.5 Function: SetOutFlag

This function is used to set the output switch of the Print function.

5.9.6 Function: SetOutFileName

This function is used to set the output file of the Print function.

5.9.7 Function: Print

This function is used to export the string information to the target object set by the SetOutMode function.

5.9.8 Function: GetOutputPath

This function is used to obtain the default output path of the task.

5.9.9 Function: NotifyProgress

This function is used to view the execution progress of the task on the iSStar Task Manage Window progress bar.

5.9.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().

5-202

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Description Parameter

Description

EventPropmt

EventPropmt is a string. It indicates the prompt of the user input on GUI.

EventType

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

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.

Return Value The string entered from the client is returned.

Error Handling If an error occurs, you can obtain the error information through 5.10.2 Function: GetLastError and 5.10.2 Function: GetLastError.

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.9.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]) Issue 01 (2008–12–08)

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

5-203

M2000 iSStar User Guide

5 HFC Library Reference

Note The function UserOutput() is equivalent to OutputText().

Parameter Description Parameter Name

Description

EventPropmt

EventPropmt is a string. It is the message entered by the user on the client.

EventType

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

Result This is a test text of UserOutput function.

5.9.4 Function: SetOutMode This function enables you to set the output mode of the Print function.

Synopsis SetOutMode(Mode)

Note None.

5-204

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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 If an error occurs, you can obtain the error information through GetLastError and GetErrorMsg functions.

Example SetOutMode('gui')

# Set the output mode to GUI

Print("Hello!")

# Print the string Hello! on the GUI

SetOutMode("file")

# Set the output mode to file

SetOutFileName("E:\\sample.txt")

# Set the output file name to E:\sample.txt.

Print("Hello world!")

# Save the string to the file E:\sample.txt.

Result Hello! (The string "Hello world!" is saved in the file E:\sample.txt.)

5.9.5 Function: SetOutFlag This function enables you to set the output switch of the Print function.

Synopsis SetOutFlag(Flag)

Note By default, the output switch is enabled.

Issue 01 (2008–12–08)

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

5-205

M2000 iSStar User Guide

5 HFC Library Reference

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 If an error occurs, you can obtain the error information through the GetLastError and GetErrorMsg functions.

Example SetOutFlag(False) Print("Hello world!") SetOutFlag(True) Print("Hello!")

# Set output to false # The strings cannot be printed on the GUI # Set output to true # The string can be printed on the GUI

Result Hello!

5.9.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) 5-206

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Note l

If the output file is not set, the output mode contains the file mode. The default output file is used.

l

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 If an error occurs, you can obtain the error information through 5.10.2 Function: GetLastError and 5.10.2 Function: GetLastError.

Example Print("Hello world") # Print the string on SetOutMode("file") # Set the output mode SetOutFileName("D:\\sample.txt") # Set the name of the Print("Hello!") # Print the string on the

the GUI to file output file GUI and 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 world

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

Synopsis Print(Msg)

Note None. Issue 01 (2008–12–08)

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

5-207

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Description Parameter Msg

Description Msg is a string. It indicates the information needed to be printed. For details of the string, see String.

Return Value If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling If an error occurs, you can obtain the error information through the GetLastError and GetErrorMsg functions.

Example Print("Hello world!")

# Print to the GUI

Result Hello world!

5.9.8 Function: GetOutputPath This function enables you to obtain the default output path of the task.

Synopsis GetOutputPath()

Note None.

Parameter Description None.

Return Value The return value is the default output file path of string type.

Error Handling If an error occurs, you can obtain the error information through GetLastError and GetErrorMsg functions. 5-208

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Example # Obtain the default output path returncode = GetOutputPath() Print('GetOutputPath() return: ' + returncode)

Result GetOutputPath() return: C:\Client\script\output\061028093234-sample

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

Description

Progress

Progress is an integer, ranging from 0 to 99. It indicates the progress of a task.

Description

Description is a string. It indicates the description of a task.

Return Value None

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.")

Issue 01 (2008–12–08)

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

5-209

M2000 iSStar User Guide

5 HFC Library Reference Sleep(10) NotifyProgress(99, "sample Sleep 5.")

5.10 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.10.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.10.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.10.3 Function: GetErrorMsg This function enables you to obtain the cause of the error according to the error code. 5.10.4 Examples of GetError Function This section describes how to use the GetError function through the following example.

5.10.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.10.2 Function: GetLastError function in the GetError function, and then parse the error code through 5.10.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-18. Table 5-18 List of GetError functions Function

Description

5.10.2 Function: GetLastError

This function enables you to obtain the last error information of the current task.

5.10.3 Function: GetErrorMsg

This function enables you to obtain the cause according to the error code.

5.10.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-210

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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

errID is the error code in integer type. The initial value is 0.

l

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.

l

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



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. Related Examples

5.10.3 Function: GetErrorMsg This function enables you to obtain the cause of the error according to the error code.

Synopsis GetErrorMsg(errID)

Note None.

Parameter Description Parameter errID

Issue 01 (2008–12–08)

Description The value of errID is a positive integer or zero. It indicates the error code.

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

5-211

M2000 iSStar User Guide

5 HFC Library Reference

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-19. Table 5-19 Description of error information Name

Meaning

ErrorCode

Indicates the error code represented by hex. For example, the error code can be 0x0.

ErrorLevel

Indicates the error level. For example, the first 0 in 0x0 represents the error level. For details, see Table 5-20.

ModuleID

Indicates the faulty module. For example, the second 0 in 0x0 represents the faulty module.

ErrorDescription

Describes the details of the error.

Table 5-20 Description of error level Level

Meaning

ERROR_LEV_OK

If the value of ERROR_LEV_OK is 0, it indicates that the error level is normal.

ERROR_LEV_NOTICE

If the value of ERROR_LEV_NOTICE is 1, it indicates that the error is of the notice level.

ERROR_LEV_WARNING

If the value of ERROR_LEV_WARNING is 2, it indicates that the error is of the warning level.

ERROR_LEV_ERROR

If the value of ERROR_LEV_ERROR is 3, it indicates that the error is of the critical level.

Error Handling None. Related Examples

5.10.4 Examples of GetError Function This section describes how to use the GetError function through the following example.

Example Print("No Error Occurred") errorlist = GetLastError()

5-212

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

# Get the error code

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference Print("errorlist: " + str(errorlist)) Print("error message: " + GetErrorMsg(errorlist[0]))

# Get the error information

Print("") Print("One Error Occurred") knownIp = "0.0.0.0" # an error occurred in login ftp result = LoginFTP( knownIp, "UserName", "Password") # Log in to the FTP server errorlist = GetLastError() # Get the error code Print("errorlist: " + str(errorlist)) Print("error message: " + GetErrorMsg(errorlist[0])) # Get the error information

Result No Error Occurred errorlist: (0, '', ('',0,'?')) error message: ErrorCode:0x0 ErrorLevel:0 ModuleID:0 ErrorDescription:Request has been successfully executed. One Error Occurred errorlist: (1879117828, '', ('...FTPOp.py', 126, 'LoginFTP')) error message: ErrorCode:0x70011004 ErrorLevel:3 ModuleID:1 ErrorDescription:Python exception.

5.11 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.11.1 Overview of Network Operation Function 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.11.2 Function: SetPassive This function enables you to set the transfer mode for the FTP server. 5.11.3 Function: LoginFTP This function enables you to log in to the FTP server. 5.11.4 Function: Upload This function enables you to upload the file to the connected FTP server. 5.11.5 Function: Download This function enables you to download specified files from the existing FTP server to target file path. 5.11.6 Function: GetFTPStatus This function enables you to obtain the current FTP connection status. 5.11.7 Function: LogoutFTP This function enables you to log out of the FTP server. 5.11.8 OpenTelnet Function This function enables you to remotely log in to the server and connect to the telnet. 5.11.9 ExecuteCmd Function Issue 01 (2008–12–08)

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

5-213

M2000 iSStar User Guide

5 HFC Library Reference

This function enables you to run commands through the telnet. 5.11.10 IsConnected Function This function enables you to identify the status of the telnet connection. 5.11.11 CloseTelnet Function This function enables you to disconnect from a specified telnet object. 5.11.12 Example 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.

5.11.1 Overview of Network Operation Function 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. The network operation functions provided by iSStar are of two categories: FTP functions and telnet functions, as shown in Table 5-21 and Table 5-22. Table 5-21 FTP function list Function

Description

5.11.2 Function: SetPassive

Set the transmission mode for the FTP server.

5.11.3 Function: LoginFTP

Log in to and connect to the FTP server.

5.11.4 Function: Upload

Upload the source file to the specified FTP server.

5.11.5 Function: Download

Download specified files from the existing FTP server to target folders.

5.11.6 Function: GetFTPStatus

Obtain the status of the current FTP connection.

5.11.7 Function: LogoutFTP

Log out of the FTP server.

Table 5-22 telnet function list

5-214

Function

Description

5.11.8 OpenTelnet Function

Remotely log in to the server and establish a telnet connection.

5.11.9 ExecuteCmd Function

Run commands through the telnet.

5.11.10 IsConnected Function

Identify the status of the telnet connection.

5.11.11 CloseTelnet Function

Disconnect from a specified telnet object.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference NOTE

You must connect to the server before uploading files, downloading files, or running commands remotely. Through the FTP functions or the telnet functions, you can create only one connection for each task at a time. If you create another connection, the previous connection is closed.

The procedure for uploading files through the FTP functions is as follows. For the instances, see 5.11.12 Example of Network Operation Function. 1.

Obtain the IP address of the FTP server, the login user name and the password.

2.

Upload files to the destination folder of the FTP server.

3.

Log in to and connect to the FTP server. For details, see 5.11.3 Function: LoginFTP.

4.

Upload files to a specified folder on the FTP server. For details, see 5.11.4 Function: Upload.

5.

Log out of the FTP server. For details, see 5.11.7 Function: LogoutFTP.

The procedure for downloading files through the FTP functions is as follows. For the examples, see 5.11.12 Example of Network Operation Function. 1.

Obtain the IP address of the FTP server, the login user name, and the password.

2.

Obtain the folder that contains the files to be downloaded.

3.

Log in to and connect to the FTP server. For details, see 5.11.3 Function: LoginFTP.

4.

Download files from the FTP server to the local PC. For details, see 5.11.5 Function: Download.

5.

Log out of the FTP server. For details, see 5.11.7 Function: LogoutFTP.

The procedure for running the command through the Telnet functions is as follows. For the instances, see 5.11.12 Example of Network Operation Function. 1.

Obtain the IP address and port number of the telnet server.

2.

Log in to and connect to the telnet server. For details, see 5.11.8 OpenTelnet Function.

3.

Run commands through the telnet. For details, see 5.11.9 ExecuteCmd Function.

4.

Disconnect from the telnet. For details, see 5.11.11 CloseTelnet Function.

5.11.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 01 (2008–12–08)

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

5-215

M2000 iSStar User Guide

5 HFC Library Reference

Return Value If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling None.

5.11.3 Function: LoginFTP This function enables you to log in to the FTP server.

Synopsis LoginFTP(Host, UserName, Password)

Note l

You need to call this function before performing other FTP operations.

l

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

Description

Host

Host is a string. It indicates the IP address of the FTP server to be logged in.

UserName

UserName is a string. It indicates the name of the login user.

Password

Password is a string. It indicates the password of the FTP server to be logged in.

Return Value If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling If an error occurs, you can obtain the error information through GetLastError and GetErroMsg functions. Related Examples

5.11.4 Function: Upload This function enables you to upload the file to the connected FTP server. 5-216

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Synopsis Upload(SrcFile, TargetFile)

Note l

You need to call the LoginFTP function to connect to the server before calling this function.

l

The source file path and target file path must exist. Otherwise uploading fails.

l

If a file with the name of the uploaded one exists in the target file path, overwrite the file.

l

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 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 /).

TargetFile

Return Value If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling If an error occurs, you can obtain the error information through GetLastError and GetErrorMsg functions. Related Examples

5.11.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 01 (2008–12–08)

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

5-217

M2000 iSStar User Guide

5 HFC Library Reference

Note l

You need to call the LoginFTP function to connect to the server before calling this function.

l

The source file path and target file path must exist. Otherwise downloading fails.

l

If a file with the name of the downloaded one exists in the target file path, overwrite the file.

l

You need to download the file in a binary mode.

Parameter Description Parameter Name

Description

SrcFile

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

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 /).

Return Value If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling If an error occurs, you can obtain the error information through GetLastError and GetErrorMsg functions. Related Examples

5.11.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-218

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Error Handling If an error occurs, you can obtain the error information through GetLastError and GetErrorMsg functions. Related Examples

5.11.7 Function: LogoutFTP This function enables you to log out of the FTP server.

Synopsis LogoutFTP()

Note l

After the operation of the FTP is complete, you must call this function to ensure that the existing FTP connection is disconnected.

l

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 If an error occurs, you can obtain the error information through GetLastError and GetErrorMsg functions. Related Examples

5.11.8 OpenTelnet Function This function enables you to remotely log in to the server and connect to the telnet.

Synopsis OpenTelnet(strHostIp, port = 23)

Important None. Issue 01 (2008–12–08)

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

5-219

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Description Parameter Name

Parameter Description

strHostIp

strHostIp is of the string type. It indicates the IP address of the remote PC to which you want to log in.

port

port is of the integer type. It indicates the port number of the remote PC to which you want to log in. By default, this parameter is set to 23.

Return Value The return value is an object. If the function calling succeeds, the telnet object is returned. Otherwise, "None" is returned.

Error Handling None.

Example tel = OpenTelnet('10.121.71.188') CloseTelnet(tel)

5.11.9 ExecuteCmd Function This function enables you to run commands through the telnet.

Synopsis ExecuteCmd (telnet, strCmd, [timeout])

Important None.

Parameter Description Parameter Name

5-220

Description

telnet

telnet is of the object type, which identifies a telnet object. It is the return value of 5.11.8 OpenTelnet Function.

strCmd

TargetDir is of the string type. It indicates the command to be executed.

timeout

Timeout is of the integer type. It indicates the timeout value of a command. By default, the timeout value is 60 seconds.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Return Value If the function is called successfully, 1 is returned. Otherwise, 0 is returned.

Error Handling None.

Example telrnc = OpenTelnet('10.161.196.246',6000) rernc = ExecuteCmd(telrnc, 'LGI:op="lmtlmtlmt",pwd="lmtlmtlmt";',5) CloseTelnet(telrnc)

5.11.10 IsConnected Function This function enables you to identify the status of the telnet connection.

Synopsis IsConnected (telnet)

Important None.

Parameter Description Parameter Name telnet

Description telnet is of the object type, which identifies a telnet object. It is the return value of 5.11.8 OpenTelnet Function.

Return Value If the function calling succeeds, 1 is returned. Otherwise, 0 is returned.

Error Handling None.

Example tel = OpenTelnet('10.121.71.188') Print(IsConnected(tel)) CloseTelnet(tel)

5.11.11 CloseTelnet Function This function enables you to disconnect from a specified telnet object. Issue 01 (2008–12–08)

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

5-221

M2000 iSStar User Guide

5 HFC Library Reference

Synopsis CloseTelnet (telnet)

Important None.

Parameter Description Parameter Name telnet

Parameter Description telnet is of the object type, which identifies a telnet object. It is the return value of 5.11.8 OpenTelnet Function.

Return Value None.

Error Handling None.

Example tel = OpenTelnet('10.121.71.188') CloseTelnet(tel)

5.11.12 Example 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

#Upload the local file ftpsample.txt in D:\ to the ftp server, and download the files on the serve 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!") else

5-222

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference Print("download failed!") Print(GetLastError()) end end # Log in serverIp userName password

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 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 OutputFileMML.txt kernel sbin

Issue 01 (2008–12–08)

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

5-223

M2000 iSStar User Guide

5 HFC Library Reference 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

+++ HW-BSC6800 O&M #874 %% LST OP:;%% RETCODE = 234915884 command. ---

2008-10-25 16:41:59

The operator didn't login, please login first and execute

END

5.12 Report Operation Function This describes the report operation functions. By using these functions, you can perform the related operations such as design, display, and manage reports. 5.12.1 Overview of Report Operation Function The iSStar provides report operation functions which enable you to operate reports. 5.12.2 Report Design Function This 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.12.3 Report Display Function This 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.12.4 Report Management Function This describes the report management function. This function enables you to import, create, and save report files, and export report model files. 5.12.5 Parameters for Operating Report This describes the values and meanings of the report operation parameters. The parameters are Color, FontType, and Type. 5.12.6 Examples of Report Operation Function 5-224

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

This gives the examples of the report operation function. You can better understand how to use report operation functions to perform routine maintenance.

5.12.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-23 lists the report operation functions. Table 5-23 Report operation function list Function

Description

Function: NewReport

Creates a report.

Function: AddSheet

Adds a sheet.

Function: AddTable

Adds a table.

Function: AddRange

Creates a range.

Function: SetRangeValue

Sets the range value.

Function: SetCellValue

Sets the cell-specified value.

Function: SetTableValue

Sets the values of multiple cells in the table.

Function: SetTableValueEx

Sets the contents of multiple cells in a table and specifies the display style.

Function: GetRowCount

Returns the number of rows in a table.

Function: GetRowData

Returns the data of a row in a table.

Function: InsertRow

Inserts a row of data in a table.

Function: RemoveRow

Deletes a row of data from a table.

Function: UpdateRow

Updates the contents of a row.

Function: Selector

Sets the display style of the data aggregate that meets the conditional expression.

Function: ReportStyle

Sets the cell display style.

Function: SetTableFont

Sets the table font.

Function: SetTableTitleFont

Sets the table title font.

Function: SetRangeFont

Sets the range font.

Function: SetCellFont

Sets the font of the specified cell.

Issue 01 (2008–12–08)

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

5-225

M2000 iSStar User Guide

5 HFC Library Reference

Function

Description

Function: SetTableBGColor

Sets the background color of a table.

Function: SetRangeBGColor

Sets the background color of a range.

Function: SetCellBGColor

Sets the background color of a cell.

Function: SetRangeAlign

Sets the alignment type of a range.

Function: SetCellAlign

Sets the alignment type of a cell.

Function: SetColumnWidth

Sets the column width.

Function: LoadReport

Imports a report object.

Function: SaveReportAs

Save the report.

Function: StoreReport

Exports the report model files.

5.12.6 Examples of Report Operation Function shows the examples. The procedure of report operations is as follows: 1.

Create a report object.

2.

Create a sheet.

3.

Create a table.

4.

Set the cell data and format.

5.

Save the report.

5.12.2 Report Design Function This 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.

Function: AddRange This 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

5-226

l

The range cannot overlap or include each other.

l

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.

l

Before calling this function, call Function: NewReport to create a report object, call Function: AddSheet to create a sheet, and call Function: AddTable to create a table. Huawei Proprietary and Confidential Copyright © Huawei Technologies Co., Ltd.

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Description Parameter

Description

TableHandle

TableHandle is a long integer. It is the unique identifier of a table.

RowFrom

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

RowTo is an integer. It indicates the end row number of the range in the table.

ColTo

ColTo is an integer. It indicates the end column number of the range in the table.

bMerged

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 Obtain the error information by using the 5.10.2 Function: GetLastError and the 5.10.3 Function: GetErrorMsg functions.

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",)

#Specifiy a range in the table. The range is from row 1 to row 3 and column 2 to column 5. Note tha range1 = AddRange(table1, 1, 2, 3, 5, 1) #Save the report as an .xls file. SaveReportAs("d:/exa04.xls")

Related Example Issue 01 (2008–12–08)

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

5-227

M2000 iSStar User Guide

5 HFC Library Reference

Function: AddSheet This describes the AddSheet function. This function enables you to add a sheet to the specified report.

Synopsis AddSheet(SheetName)

Note l

The total number of rows in the pages is 65535, and total number of columns is 255.

l

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.

l

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.

l

Before the function is called, call Function: NewReport to create a report.

Parameter Description Parameter SheetName

Description SheetName is a character string. It indicates the sheet name. The sheet name must be unique.

Return Value l

The return value is an integer.

l

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.

l

If the new sheet name exists in the report, the sheet cannot be created and 0 is returned.

Error Handling Obtain the error information by using the 5.10.2 Function: GetLastError and the 5.10.3 Function: GetErrorMsg functions.

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-228

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Function: AddTable This describes the AddTable function. This function enables you to add a table to the specified page.

Synopsis AddTable(SheetHandle, Row, Col, TableName = "")

Note l

The title of the generated table occupies one row.

l

If you add multiple tables to the same page, tables are separated by three blank rows.

l

The maximum row number is 65530, and the maximum of total column number is 255.

l

Before this function is called, you should call Function: NewReport to create a report and call Function: AddSheet to create a sheet.

Parameter Description Parameter

Description

SheetHandle

SheetHandle is a long integer. It indicates Handle of the page (the unique mark of the page).

Row

Row is an integer. It indicates the number of rows.

Col

Col is an integer. It indicates the number of columns.

TableName

TableName is a string. It indicates the table name. TableName cannot exceed 128 characters. If more 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.

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 Obtain the error information by using the 5.10.2 Function: GetLastError and the 5.10.3 Function: GetErrorMsg functions.

Example #Create a report object. NewReport() #Add a sheet named page one.

Issue 01 (2008–12–08)

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

5-229

M2000 iSStar User Guide

5 HFC Library Reference page1

= AddSheet("page one")

#Add a table with six rows and eight columns. The title is table. table1 = AddTable(page1, 6, 8, "table1") #Save the report as an .xls file. SaveReportAs("d:/exa03.xls")

Related Example

Function: GetRowCount This 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

Description

SheetName

Name of a sheet. This parameter is of string type.

TableNo

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.

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")

5-230

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Result 6

Related Example

Function: GetRowData This 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

Description

SheetName

Name of the sheet to be modified This parameter is of string type.

TableNo

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.

RowNo

Number of a row. his 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.

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")

Issue 01 (2008–12–08)

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

5-231

M2000 iSStar User Guide

5 HFC Library Reference 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

Function: InsertRow This 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

Description

SheetName

Name of a sheet. This parameter is of string type.

TableNo

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.

RowNo

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.

DataList

Data list. This parameter indicates the data to be inserted. This parameter is of string sequence type.

Return Value The return value is an integer. If this function is successfully called, 1 is returned. Otherwise, 0 is returned. 5-232

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

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 of data to the specified row in the specified table. InsertRow( sheetName, tableNo, rowNo, datalist ) SaveReportAs("result.xls")

Related Example

Function: RemoveRow This describes the RemoveRow function, which enables you to remove a row.

Synopsis RemoveRow(SheetName, TableNo, RowNo = -1)

Note None

Parameter Description Parameter

Parameter Description

SheetName

Name of a sheet. This parameter is of string type.

TableNo

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.

RowNo

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.

Return Value The return value is an integer. If row number is modified successfully called, 1 is returned. Otherwise, 0 is returned. Issue 01 (2008–12–08)

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

5-233

M2000 iSStar User Guide

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) #Delete the second row from table 0 in sheet1. ret = RemoveRow("sheet1", 0, 2) SaveReportAs("result.xls")

Related Example

Function: Selector This 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.

Parameter Description Parameter Exp

Description Exp is a string. It indicates a conditional expression. The keywords of the condition express are as follows: l

$X: indicates the x row.

l

:$Y: indicates the y column.

l

$$: indicates the whole table.

Table 5-24 describes the instances of the common conditional expressions supported by the iSStar. Default

5-234

Default is of integer type. It indicates the identifier of the display style. It is the return value of the Function: Selector function.

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

Issue 01 (2008–12–08)

M2000 iSStar User Guide

5 HFC Library Reference

Parameter Mode

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

Table 5-24 Example of Using Conditional Expressions Conditional Expression

Meaning

$1:$2 == 'Error' and $2:$1 == 'Unavailable'

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 50 and $2 50 and :$1 50 and :$2 50 and :$2