Examples of MML Message Parse Functions
Examples of MML Message Parse Functions
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.
Example
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
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
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
--- 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)
Result
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.
https://10.98.117.5:31943/hedex/sematic/Access_TaiShan_help_en.___MBBHelpService___.___212.275.11___/hedex/pages/omc/isstar/reference/m… 4/4