{
    "Resources": [
        {
            "Uri": "/cli/v1/fru0",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Operate with fru0"
                }
            ]
        },
        {
            "Uri": "/cli/v1/fru0/frucontrol",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "LockdownAllow": true,
                    "Description": "Control fru0",
                    "Usage": "ipmcset -d frucontrol -v <option> [-s <systemid>]",
                    "ReqHeader": {
                        "SystemId": []
                    },
                    "Confirm": {
                        "Condition": true,
                        "Description": "${Statements/EchoDescription()}"
                    },
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "option": {
                                "Required": true,
                                "Type": "integer",
                                "Validator": [
                                    {
                                        "Type": "Enum",
                                        "Formula": [
                                            0,
                                            2
                                        ]
                                    }
                                ],
                                "Description": "\n    0    Forced System Reset\n    2    Forced Power Cycle"
                            }
                        }
                    },
                    "RspBody": {
                        "option": "${ReqBody/option}",
                        "HostType": "${Statements/GetHostType()}",
                        "IdList": "${Statements/SetFruControl()}"
                    },
                    "Statements": {
                        "option_str": {
                            "Input": "${ReqBody/option}",
                            "Steps": [
                                {
                                    "Type": "Switch",
                                    "Formula": [
                                        {
                                            "Case": 0,
                                            "To": "ForceRestart"
                                        },
                                        {
                                            "Case": 2,
                                            "To": "ForcePowerCycle"
                                        }
                                    ]
                                }
                            ]
                        },
                        "GetHostType": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fructrl.get_hosttype()"
                                }
                            ]
                        },
                        "SetFruControl": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fructrl.set_frucontrol(ReqHeader.SystemId, ReqBody.option)"
                                }
                            ]
                        },
                        "EchoDescription": {
                            "Input": "${ReqBody/option}",
                            "Steps": [
                                {
                                    "Type": "Switch",
                                    "Formula": [
                                        {
                                            "Case": 0,
                                            "To": "WARNING: A forced restart may damage programs or unsaved data of the server.\r\nDo you want to continue?[Y/N]:"
                                        },
                                        {
                                            "Case": 2,
                                            "To": "WARNING: A forced power cycle may damage programs or unsaved data of the server.\r\nDo you want to continue?[Y/N]:"
                                        }
                                    ]
                                }
                            ]
                        }
                    },
                    "Echoes": [
                        "ipmcset/fru0_frucontrol"
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/frucontrol",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "LockdownAllow": true,
                    "Description": "Fru control",
                    "Usage": "ipmcset -d frucontrol -v <option> [-s <systemid>]",
                    "ReqHeader": {
                        "SystemId": []
                    },
                    "Confirm": {
                        "Condition": true,
                        "Description": "${Statements/EchoDescription()}"
                    },
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "option": {
                                "Type": "integer",
                                "Required": true,
                                "Validator": [
                                    {
                                        "Type": "Enum",
                                        "Formula": [
                                            0,
                                            2
                                        ]
                                    }
                                ],
                                "Description": "\n    0    Forced System Reset\n    2    Forced Power Cycle"
                            }
                        }
                    },
                    "RspBody": {
                        "option": "${ReqBody/option}",
                        "HostType": "${Statements/GetHostType()}",
                        "IdList": "${Statements/SetFruControl()}"
                    },
                    "Statements": {
                        "option_str": {
                            "Input": "${ReqBody/option}",
                            "Steps": [
                                {
                                    "Type": "Switch",
                                    "Formula": [
                                        {
                                            "Case": 0,
                                            "To": "ForceRestart"
                                        },
                                        {
                                            "Case": 2,
                                            "To": "ForcePowerCycle"
                                        }
                                    ]
                                }
                            ]
                        },
                        "GetHostType": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fructrl.get_hosttype()"
                                }
                            ]
                        },
                        "SetFruControl": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fructrl.set_frucontrol(ReqHeader.SystemId, ReqBody.option)"
                                }
                            ]
                        },
                        "EchoDescription": {
                            "Input": "${ReqBody/option}",
                            "Steps": [
                                {
                                    "Type": "Switch",
                                    "Formula": [
                                        {
                                            "Case": 0,
                                            "To": "WARNING: A forced restart may damage programs or unsaved data of the server.\r\nDo you want to continue?[Y/N]:"
                                        },
                                        {
                                            "Case": 2,
                                            "To": "WARNING: A forced power cycle may damage programs or unsaved data of the server.\r\nDo you want to continue?[Y/N]:"
                                        }
                                    ]
                                }
                            ]
                        }
                    },
                    "Echoes": [
                        "ipmcset/fru0_frucontrol"
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/fru0/powerstate",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "LockdownAllow": true,
                    "Description": "Set fru0 power state",
                    "Usage": "ipmcset -d powerstate -v <option> [-s <systemid>]",
                    "ReqHeader": {
                        "SystemId": []
                    },
                    "Confirm": {
                        "Condition": true,
                        "Description": "${Statements/EchoDescription()}"
                    },
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "option": {
                                "Type": "integer",
                                "Required": true,
                                "Validator": [
                                    {
                                        "Type": "Enum",
                                        "Formula": [
                                            0,
                                            1,
                                            2
                                        ]
                                    }
                                ],
                                "Description": "\n    0    Normal Power Off, deactivate FRU\n    1    Power on, activate FRU\n    2    Forced Power Off, deactivate FRU"
                            }
                        }
                    },
                    "RspBody": {
                        "option": "${ReqBody/option}",
                        "HostType": "${Statements/GetHostType()}",
                        "IdList": "${Statements/SetPowerControl()}"
                    },
                    "Statements": {
                        "option_str": {
                            "Input": "${ReqBody/option}",
                            "Steps": [
                                {
                                    "Type": "Switch",
                                    "Formula": [
                                        {
                                            "Case": 0,
                                            "To": "GracefulShutdown"
                                        },
                                        {
                                            "Case": 1,
                                            "To": "On"
                                        },
                                        {
                                            "Case": 2,
                                            "To": "ForceOff"
                                        }
                                    ]
                                }
                            ]
                        },
                        "GetHostType": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fructrl.get_hosttype()"
                                }
                            ]
                        },
                        "SetPowerControl": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fructrl.set_powerstate(ReqHeader.SystemId, ReqBody.option)"
                                }
                            ]
                        },
                        "EchoDescription": {
                            "Input": "${ReqBody/option}",
                            "Steps": [
                                {
                                    "Type": "Switch",
                                    "Formula": [
                                        {
                                            "Case": 0,
                                            "To": "WARNING: The operation may have many adverse effects.\r\nDo you want to continue?[Y/N]:"
                                        },
                                        {
                                            "Case": 1,
                                            "To": "WARNING: The operation may have many adverse effects.\r\nDo you want to continue?[Y/N]:"
                                        },
                                        {
                                            "Case": 2,
                                            "To": "WARNING: A forced power-off may damage programs or unsaved data of the server.\r\nDo you want to continue?[Y/N]:"
                                        }
                                    ]
                                }
                            ]
                        }
                    },
                    "Echoes": [
                        "ipmcset/fru0_powerstate"
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/powerstate",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "LockdownAllow": true,
                    "Description": "Set power state",
                    "Usage": "ipmcset -d powerstate -v <option> [-s <systemid>]",
                    "ReqHeader": {
                        "SystemId": []
                    },
                    "Confirm": {
                        "Condition": true,
                        "Description": "${Statements/EchoDescription()}"
                    },
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "option": {
                                "Type": "integer",
                                "Required": true,
                                "Validator": [
                                    {
                                        "Type": "Enum",
                                        "Formula": [
                                            0,
                                            1,
                                            2
                                        ]
                                    }
                                ],
                                "Description": "\n    0    Normal Power Off, deactivate FRU\n    1    Power on, activate FRU\n    2    Forced Power Off, deactivate FRU"
                            }
                        }
                    },
                    "RspBody": {
                        "option": "${ReqBody/option}",
                        "HostType": "${Statements/GetHostType()}",
                        "IdList": "${Statements/SetPowerControl()}"
                    },
                    "Statements": {
                        "option_str": {
                            "Input": "${ReqBody/option}",
                            "Steps": [
                                {
                                    "Type": "Switch",
                                    "Formula": [
                                        {
                                            "Case": 0,
                                            "To": "GracefulShutdown"
                                        },
                                        {
                                            "Case": 1,
                                            "To": "On"
                                        },
                                        {
                                            "Case": 2,
                                            "To": "ForceOff"
                                        }
                                    ]
                                }
                            ]
                        },
                        "GetHostType": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fructrl.get_hosttype()"
                                }
                            ]
                        },
                        "SetPowerControl": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fructrl.set_powerstate(ReqHeader.SystemId, ReqBody.option)"
                                }
                            ]
                        },
                        "EchoDescription": {
                            "Input": "${ReqBody/option}",
                            "Steps": [
                                {
                                    "Type": "Switch",
                                    "Formula": [
                                        {
                                            "Case": 0,
                                            "To": "WARNING: The operation may have many adverse effects.\r\nDo you want to continue?[Y/N]:"
                                        },
                                        {
                                            "Case": 1,
                                            "To": "WARNING: The operation may have many adverse effects.\r\nDo you want to continue?[Y/N]:"
                                        },
                                        {
                                            "Case": 2,
                                            "To": "WARNING: A forced power-off may damage programs or unsaved data of the server.\r\nDo you want to continue?[Y/N]:"
                                        }
                                    ]
                                }
                            ]
                        }
                    },
                    "Echoes": [
                        "ipmcset/fru0_powerstate"
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/fru0/sel",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Clear SEL",
                    "Usage": "ipmcset -d sel -v clear",
                    "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": {
                            "clear": {
                                "Type": "string",
                                "Required": true,
                                "Validator": [
                                    {
                                        "Type": "Enum",
                                        "Formula": [
                                            "clear"
                                        ]
                                    }
                                ]
                            }
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Systems/1/Events",
                            "Interface": "bmc.kepler.Systems.Events",
                            "Name": "ClearEventList"
                        }
                    ],
                    "Echoes": [
                        "ipmcset/fru0_sel",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/sel",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Clear SEL",
                    "Usage": "ipmcset -d sel -v clear",
                    "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": {
                            "clear": {
                                "Type": "string",
                                "Required": true,
                                "Validator": [
                                    {
                                        "Type": "Enum",
                                        "Formula": [
                                            "clear"
                                        ]
                                    }
                                ]
                            }
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Systems/1/Events",
                            "Interface": "bmc.kepler.Systems.Events",
                            "Name": "ClearEventList"
                        }
                    ],
                    "Echoes": [
                        "ipmcset/fru0_sel",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/fru0/shutdowntimeout",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Set graceful shutdown timeout state and value",
                    "Usage": "ipmcset -t fru0 -d shutdowntimeout -v <time> [-s <systemid>]",
                    "ReqHeader": {
                        "SystemId": []
                    },
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "time": {
                                "Required": true,
                                "Type": "integer",
                                "Validator": [
                                    {
                                        "Type": "Script",
                                        "Formula": "if not (Input == 0 or (Input >= 10 and Input <= 6000)) then error(base_messages.PropertyValueNotInList(Input, PropertyName)) end"
                                    }
                                ],
                                "Description": "\n    0       : Disabled shutdown timeout state\n    Others  : Enabled shutdown timeout state, timeout range <10 s -- 6000 s>"
                            }
                        }
                    },
                    "RspBody": {
                        "HostType": "${Statements/GetHostType()}",
                        "IdList": "${Statements/SetTimeOut()}"
                    },
                    "Statements": {
                        "GetHostType": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fructrl.get_hosttype()"
                                }
                            ]
                        },
                        "SetTimeOut": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fructrl.set_shutdowntimeout(ReqHeader.SystemId, ReqBody.time)"
                                }
                            ]
                        }
                    },
                    "Echoes": [
                        "ipmcset/fru0_shutdowntimeout"
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/shutdowntimeout",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Set graceful shutdown timeout state and value",
                    "Usage": "ipmcset -d shutdowntimeout -v <time> [-s <systemid>]",
                    "ReqHeader": {
                        "SystemId": []
                    },
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "time": {
                                "Required": true,
                                "Type": "integer",
                                "Validator": [
                                    {
                                        "Type": "Script",
                                        "Formula": "if not (Input == 0 or (Input >= 10 and Input <= 6000)) then error(base_messages.PropertyValueNotInList(Input, PropertyName)) end"
                                    }
                                ],
                                "Description": "\n    0       : Disabled shutdown timeout state\n    Others  : Enabled shutdown timeout state, timeout range <10 s -- 6000 s>"
                            }
                        }
                    },
                    "RspBody": {
                        "HostType": "${Statements/GetHostType()}",
                        "IdList": "${Statements/SetTimeOut()}"
                    },
                    "Statements": {
                        "GetHostType": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fructrl.get_hosttype()"
                                }
                            ]
                        },
                        "SetTimeOut": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.fructrl.set_shutdowntimeout(ReqHeader.SystemId, ReqBody.time)"
                                }
                            ]
                        }
                    },
                    "Echoes": [
                        "ipmcset/fru0_shutdowntimeout"
                    ]
                }
            ]
        }
    ]
}