Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
100 views

Examples of MML Message Parse Functions

Huawei U2020 ISSTAR MML Parsing Function

Uploaded by

Mohamed Mostafa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views

Examples of MML Message Parse Functions

Huawei U2020 ISSTAR MML Parsing Function

Uploaded by

Mohamed Mostafa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

3/25/23, 3:20 PM Examples of MML Message Parse Functions

Examples of MML Message Parse Functions


Scenario

Procedure

Example

Result

Precautions

This topic describes the examples of the MML message parse functions and the method of using
some functions related to the MML message.

Scenario
In routine maintenance work, you always need to check the status of a subrack on a frame and
output the types and states of the boards on the slots of this subrack.

Procedure
1. Obtain the message returned by the MML command.

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

3. 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*************')


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

Frame information
-----------------
Frame Slot number Location

https://10.98.117.5:31943/hedex/sematic/Access_TaiShan_help_en.___MBBHelpService___.___212.275.11___/hedex/pages/omc/isstar/reference/m… 1/4
3/25/23, 3:20 PM Examples of MML Message Parse Functions

0 0 2

(Number of results = 2)

--- END
"""
parser = ParseMMLRpt(mml)

# If the MML message did not return success, the processing is stopped.
if not parser or GetResultCode(parser) != '0'
Print('The information about the subrack of the current NE is unavailable.exit.')
Exit(1)
end
if GetObjNum(parser) < 1
Print('The information about the subrack of the current NE is unavailable.exit.')
Exit(2)
end

# Get the subrack list.


frame_list = GetColumnByIndex(parser, 0, 0)

# Create a report and add a page about subrack information.


NewReport()
sId = AddSheet('subrack information')

# Searching for all the subrack information cyclically.


for frmNo in frame_list

mml = """
+++ NE 2007-11-29 16:42:12
O&M #230231
%%/*2621530*/DSP FRM: FN=0;%%
RETCODE = 0 Operation succeeded

Frame 0 Information
-------------------
Frame Slot FrontBrd FrontBrdState UpperPMC LowerPMC BackBrd BackBrdState

0 0 WCSU Main OK Normal Normal WEPI Normal


0 1 WCSU Main OK Uninstalled Uninstalled WEPI Normal

https://10.98.117.5:31943/hedex/sematic/Access_TaiShan_help_en.___MBBHelpService___.___212.275.11___/hedex/pages/omc/isstar/reference/m… 2/4
3/25/23, 3:20 PM Examples of MML Message Parse Functions

0 2 WCCU Main OK Uninstalled Uninstalled WBFI Uninstalled


0 3 WCSU Main OK Uninstalled Uninstalled WBFI Normal
1 4 WCSU Main OK Uninstalled Uninstalled WBFI Normal
(Number of results = 5)

--- END
"""
# Parse the returned message.
parser = ParseMMLRpt(mml)

# From the obtained parsing object, get the title and data information (a two-dimensional lis
t).
title, tb = GetDataFrmMMLRpt(parser, 0)
NewReport()
sId = AddSheet('frame sheet')
# 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

#Save the subrack information.


SaveReportAs('Subrackinfo.xls')
Print('*************The subrack status check ends*************')

Result

*************Subrack status check starts*************


*************The subrack status check ends*************

Precautions

https://10.98.117.5:31943/hedex/sematic/Access_TaiShan_help_en.___MBBHelpService___.___212.275.11___/hedex/pages/omc/isstar/reference/m… 3/4
3/25/23, 3:20 PM Examples of MML Message Parse Functions

The script of the previous task exports a report in .xls format to the output directory. Figure 1lists
the elements in the report.

Figure 1 Elements in the report

Copyright © Huawei Technologies Co., Ltd.

https://10.98.117.5:31943/hedex/sematic/Access_TaiShan_help_en.___MBBHelpService___.___212.275.11___/hedex/pages/omc/isstar/reference/m… 4/4

You might also like