{
    "Resources": [
        {
            "Uri": "/cli/v1/smbios",
            "Interfaces": [
                {
                    "Type": "Get",
                    "Description": "Get the information of smbios"
                }
            ]
        },
        {
            "Uri": "/cli/v1/smbios/serialnumber",
            "Interfaces": [
                {
                    "Type": "Get",
                    "Description": "Print serialnumber of smbios",
                    "Usage": "ipmcget -t smbios -d serialnumber",
                    "RspBody": {
                        "SerialNumber": "${ProcessingFlow[2]/Destination/SystemSerialNumber}",
                        "GetPathSuccess": "${Statements/GetPathSuccess()}"
                    },
                    "Statements": {
                        "GetPathSuccess": {
                            "Steps": [
                                {
                                    "Type": "Script",
                                    "Formula": "local path = ProcessingFlow[1].Destination.Path return type(path) == 'string' and #path > 0"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/MdbService",
                            "Interface": "bmc.kepler.Mdb",
                            "Name": "GetPath",
                            "Params": [
                                "bmc.kepler.Systems.FruData.Overview",
                                {
                                    "FruId": 0
                                },
                                false
                            ],
                            "Destination": {
                                "Path": "Path"
                            }
                        },
                        {
                            "Type": "Property",
                            "Path": "${ProcessingFlow[1]/Destination/Path}",
                            "Interface": "bmc.kepler.Systems.FruData.System",
                            "Destination": {
                                "SystemSerialNumber": "SystemSerialNumber"
                            },
                            "CallIf": {
                                "${Statements/GetPathSuccess()}": true
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcget/smbios_serialnumber"
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/serialnumber",
            "Interfaces": [
                {
                    "Type": "Get",
                    "Description": "Get system serial number",
                    "Usage": "ipmcget -d serialnumber",
                    "RspBody": {
                        "SerialNumber": "${ProcessingFlow[2]/Destination/SystemSerialNumber}",
                        "GetPathSuccess": "${Statements/GetPathSuccess()}"
                    },
                    "Statements": {
                        "GetPathSuccess": {
                            "Steps": [
                                {
                                    "Type": "Script",
                                    "Formula": "local path = ProcessingFlow[1].Destination.Path return type(path) == 'string' and #path > 0"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/MdbService",
                            "Interface": "bmc.kepler.Mdb",
                            "Name": "GetPath",
                            "Params": [
                                "bmc.kepler.Systems.FruData.Overview",
                                {
                                    "FruId": 0
                                },
                                false
                            ],
                            "Destination": {
                                "Path": "Path"
                            }
                        },
                        {
                            "Type": "Property",
                            "Path": "${ProcessingFlow[1]/Destination/Path}",
                            "Interface": "bmc.kepler.Systems.FruData.System",
                            "Destination": {
                                "SystemSerialNumber": "SystemSerialNumber"
                            },
                            "CallIf": {
                                "${Statements/GetPathSuccess()}": true
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcget/smbios_serialnumber"
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/smbios/systemname",
            "Interfaces": [
                {
                    "Type": "Get",
                    "Description": "Get system name",
                    "RspBody": {
                        "SystemProductName": "${Statements/GetProductName()}"
                    },
                    "Statements": {
                        "GetProductName": {
                            "Steps": [
                                {
                                    "Type": "Script",
                                    "Formula": "return ProcessingFlow[2].Destination.SystemProductName == '' and ProcessingFlow[4].Destination.ProductName or ProcessingFlow[2].Destination.SystemProductName"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/MdbService",
                            "Interface": "bmc.kepler.Mdb",
                            "Name": "GetPath",
                            "Params": [
                                "bmc.kepler.Systems.FruData.Overview",
                                {
                                    "FruId": 0
                                },
                                false
                            ],
                            "Destination": {
                                "Path": "Path"
                            }
                        },
                        {
                            "Type": "Property",
                            "Path": "${ProcessingFlow[1]/Destination/Path}",
                            "Interface": "bmc.kepler.Systems.FruData.System",
                            "Destination": {
                                "SystemProductName": "SystemProductName"
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/MdbService",
                            "Interface": "bmc.kepler.Mdb",
                            "Name": "GetPath",
                            "Params": [
                                "bmc.kepler.Systems.Product",
                                {},
                                false
                            ],
                            "Destination": {
                                "Path": "Path"
                            }
                        },
                        {
                            "Type": "Property",
                            "Path": "${ProcessingFlow[3]/Destination/Path}",
                            "Interface": "bmc.kepler.Systems.Product",
                            "Destination": {
                                "ProductName": "ProductName"
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcget/smbios_systemname"
                    ]
                }
            ]
        }
    ]
}