{
    "Resources": [
        {
            "Uri": "/cli/v1/maintenance",
            "Interfaces": [
                {
                    "Type": "Get",
                    "Description": "Get maintenance information"
                }
            ]
        },
        {
            "Uri": "/cli/v1/maintenance/biosprint",
            "Interfaces": [
                {
                    "Type": "Get",
                    "Description": "Show BIOS print switch information",
                    "Usage": "ipmcget -t maintenance -d biosprint",
                    "RspBody": {
                        "GetBiosPrintState": "${ProcessingFlow[1]/Destination/BiosLogPrintEnabled}"
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Property",
                            "Path": "/bmc/kepler/Systems/1/Bios",
                            "Interface": "bmc.kepler.Systems.Bios",
                            "Destination": {
                                "BiosLogPrintEnabled": "BiosLogPrintEnabled"
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcget/maintenance_biosprint",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/maintenance/poweronlock",
            "Interfaces": [
                {
                    "Type": "Get",
                    "Description": "Get power on lock information",
                    "Usage": "ipmcget -t maintenance -d poweronlock [-s <systemid>]",
                    "ReqHeader": {
                        "SystemId": []
                    },
                    "RspBody": {
                        "HostType": "${Statements/GetHostType()}",
                        "PowerOnLockState": "${Statements/GetPowerOnLockState()}"
                    },
                    "Statements": {
                        "GetPowerOnLockState": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fructrl.get_power_onlock(ReqHeader.SystemId)"
                                }
                            ]
                        },
                        "GetHostType": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fructrl.get_hosttype()"
                                }
                            ]
                        }
                    },
                    "Echoes": [
                        "ipmcget/maintenance_poweronlock"
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/maintenance/ipinfo",
            "Interfaces": [
                {
                    "Type": "Get",
                    "Description": "Get the maintenance IP information of dedicated port",
                    "Usage": "ipmcget -t maintenance -d ipinfo",
                    "RspBody": {
                        "IpAddr": "${Statements/GetMaintIpInfo()/IpAddr}",
                        "SubnetMask": "${Statements/GetMaintIpInfo()/SubnetMask}"
                    },
                    "Statements": {
                        "GetMaintIpInfo": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.bmc_network.get_maint_ip_info(ProcessingFlow[1].Destination.group_list)"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "List",
                            "Path": "/bmc/kepler/Managers/1/EthernetInterfaces/EthGroup",
                            "Interface": "bmc.kepler.Managers.EthernetInterfaces.EthGroup",
                            "Destination": {
                                "Members": "group_list"
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcget/maintenance_ipinfo",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/maintenance/retiresystem",
            "Interfaces": [
                {
                    "Type": "Get",
                    "Description": "Get retirement status",
                    "Usage": "ipmcget -t maintenance -d retiresystem",
                    "Example": [
                        "ipmcget -t maintenance -d retiresystem"
                    ],
                    "RspBody": {
                        "Status": "${ProcessingFlow[1]/Destination/Status}",
                        "Progress": "${ProcessingFlow[1]/Destination/Progress}",
                        "Details": "${ProcessingFlow[1]/Destination/Details}"
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Systems/1/Product",
                            "Interface": "bmc.kepler.Systems.Product",
                            "Name": "GetRetirementStatus",
                            "Destination": {
                                "Status": "Status",
                                "Progress": "Progress",
                                "Details": "Details"
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcget/maintenance_retiresystem"
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/maintenance/loglist",
            "Interfaces": [
                {
                    "Type": "Get",
                    "Usage": "ipmcget -t maintenance -d loglist",
                    "Description": "Get the list of logs that can be viewed.",
                    "RspBody": {
                        "Error": "${ProcessingFlow[1]/Errors}",
                        "LogList": "${ProcessingFlow[1]/Destination/LogList}"
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Managers/1/LogServices",
                            "Interface": "bmc.kepler.Managers.LogServices",
                            "Name": "GetLogList",
                            "Destination": {
                                "LogList": "LogList"
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcget/maintenance_loglist",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/maintenance/catlog",
            "Interfaces": [
                {
                    "Type": "Get",
                    "Usage": "ipmcget -t maintenance -d catlog -v <logname> <logcnt> [filter]",
                    "Description": "Show log of a specified type.",
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "logname": {
                                "Type": "string",
                                "Required": true
                            },
                            "logcnt": {
                                "Type": "string",
                                "Required": true
                            },
                            "filter": {
                                "Type": "string",
                                "Required": false
                            }
                        }
                    },
                    "RspBody": {
                        "Error": "${ProcessingFlow[1]/Errors}",
                        "LogInfo": "${ProcessingFlow[1]/Destination/LogInfo}"
                    },
                    "Statements": {
                        "GetFilter": {
                            "Input": "${ReqBody/filter}",
                            "Steps": [
                                {
                                    "Type": "Switch",
                                    "Formula": [
                                        {
                                            "Case": null,
                                            "To": ""
                                        },
                                        {
                                            "To": "${ReqBody/filter}"
                                        }
                                    ]
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Managers/1/LogServices",
                            "Interface": "bmc.kepler.Managers.LogServices",
                            "Name": "GetLogInfo",
                            "Params": [
                                "${ReqBody/logname}",
                                "${ReqBody/logcnt}",
                                "${Statements/GetFilter()}"
                            ],
                            "Destination": {
                                "LogInfo": "LogInfo"
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcget/maintenance_catlog",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/maintenance/dumpdfxlog",
            "Interfaces": [
                {
                    "Type": "Get",
                    "Description": "Dump DFX log",
                    "Usage": "ipmcget -t maintenance -d dumpdfxlog -v <option> [-s <systemid>]",
                    "Example": [
                        "ipmcget -t maintenance -d dumpdfxlog -v 0",
                        "ipmcget -t maintenance -d dumpdfxlog -v 3"
                    ],
                    "ReqHeader": {
                        "SystemId": [1]
                    },
                    "Confirm": {
                        "Condition": true,
                        "Description": "WARNING: The operation may have many adverse effects.\nDo you want to continue?[Y/N]:"
                    },
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "option": {
                                "Required": true,
                                "Type": "integer",
                                "Validator": [
                                    {
                                        "Type": "Range",
                                        "Formula": [
                                            0,
                                            8
                                        ]
                                    }
                                ],
                                "Description": "\n    0    Dump CPU DFX log\n    1~8  Dump NPU DFX log"
                            }
                        }
                    },
                    "RspBody": {
                        "TaskId": "${ProcessingFlow[1]/Destination/TaskId}",
                        "ServiceAvailable":"${Statements/ServiceAvailable()}"
                    },
                    "Statements": {
                        "ServiceAvailable": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fault_diagnosis.service_available(ReqHeader.SystemId[1])"
                                }
                            ]
                        },
                        "CertificatePath": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fault_diagnosis.check_fdmdomain_exist(ReqHeader.SystemId[1])"
                                }
                            ]
                        },
                        "GetFDMDomainPath": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fault_diagnosis.get_system_fdmdomain(ReqHeader.SystemId[1], ReqBody.option)"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Task",
                            "Path": "${Statements/GetFDMDomainPath()}",
                            "Interface": "bmc.kepler.Systems.ExceptionInfo",
                            "Name": "DumpProcessorLog",
                            "Params": [
                                "DFX",
                                ""
                            ],
                            "Destination": {
                                "TaskId": "TaskId"
                            },
                            "CallIf": {
                                "${Statements/CertificatePath()}": true
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcget/maintenance_dumpdfxlog"
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/maintenance/listcsr",
            "Interfaces": [
                {
                    "Type": "Get",
                    "Usage": "ipmcget -t maintenance -d listcsr",
                    "Description": "Get the list of csr.",
                    "RspBody": {
                        "ConnectorList": "${Statements/GetConnectorList()}"
                    },
                    "Statements": {
                        "GetConnectorList": {
                            "Input": "${ProcessingFlow[1]/Destination/ConnectorList}",
                            "Steps": [
                                {
                                    "Type": "Expand"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "List",
                            "Path": "/bmc/kepler/Connector",
                            "Interface": "bmc.kepler.Connector",
                            "Destination": {
                                "Members": "ConnectorList"
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcget/maintenance_importcsr",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/bmc/kepler/Connector/:connector_id",
            "Interfaces": [
                {
                    "Type": "Get",
                    "RspBody": {
                        "IdentifyMode": "${ProcessingFlow[1]/Destination/IdentifyMode}",
                        "Type": "${ProcessingFlow[1]/Destination/Type}",
                        "SilkText": "${ProcessingFlow[1]/Destination/SilkText}",
                        "Slot": "${ProcessingFlow[1]/Destination/Slot}",
                        "Presence": "${ProcessingFlow[1]/Destination/Presence}",
                        "LoadStatus": "${ProcessingFlow[1]/Destination/LoadStatus}",
                        "ConnectorName": "${Uri/connector_id}"
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Property",
                            "Path": "/bmc/kepler/Connector/${Uri/connector_id}",
                            "Interface": "bmc.kepler.Connector",
                            "Destination": {
                                "IdentifyMode": "IdentifyMode",
                                "Type": "Type",
                                "SilkText": "SilkText",
                                "Slot": "Slot",
                                "Presence": "Presence",
                                "LoadStatus": "LoadStatus"
                            }
                        }
                    ]
                }
            ]
        }
    ]
}