{
    "Resources": [
        {
            "Uri": "/cli/v1/_/coolinglevel",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Set cooling device level",
                    "Usage": "ipmcset -d coolinglevel -v <devicetype> <level> [id]",
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "devicetype": {
                                "Type": "string",
                                "Required": false
                            },
                            "level": {
                                "Type": "integer",
                                "Required": false
                            },
                            "id": {
                                "Type": "integer",
                                "Required": false
                            }
                        }
                    },
                    "RspBody": {
                        "devicetype": "${ReqBody/devicetype}",
                        "level": "${ReqBody/level}",
                        "id": "${ReqBody/id}",
                        "CheckSetCoolingLevelReq": "${Statements/CheckSetCoolingLevelReq()}"
                    },
                    "Statements": {
                        "IsValidPath": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.utils.is_valid_path('/bmc/kepler/Systems/1/LiquidCoolingConfig')"
                                }
                            ]
                        },
                        "CheckSetCoolingLevelReq": {
                            "Steps": [
                                {
                                    "Type": "Script",
                                    "Formula": "check_set_cooling_level_req.lua"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "List",
                            "Path": "/bmc/kepler/Systems/1/Thermal/Fans",
                            "Destination": {
                                "Members": "FanList"
                            }
                        },
                        {
                            "Type": "List",
                            "Path": "/bmc/kepler/Systems/1/Thermal/Pumps",
                            "Destination": {
                                "Members": "PumpList"
                            }
                        },
                        {
                            "Type": "Property",
                            "Path": "/bmc/kepler/Systems/1/CoolingConfig",
                            "Interface": "bmc.kepler.Systems.CoolingConfig",
                            "Destination": {
                                "CtrlMode": "CtrlMode",
                                "LevelPercentRange": "LevelPercentRange",
                                "TimeOut": "TimeOut"
                            }
                        },
                        {
                            "Type": "Property",
                            "Path": "/bmc/kepler/Systems/1/LiquidCoolingConfig",
                            "Interface": "bmc.kepler.Systems.LiquidCoolingConfig",
                            "Destination": {
                                "CtrlMode": "CtrlMode",
                                "LevelPercentRange": "LevelPercentRange",
                                "TimeOut": "TimeOut"
                            },
                            "CallIf": {
                                "${Statements/IsValidPath()}": true
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Systems/1/CoolingConfig",
                            "Interface": "bmc.kepler.Systems.CoolingConfig",
                            "Name": "SetManualLevel",
                            "Params": [
                                "${Statements/CheckSetCoolingLevelReq()[2]}",
                                "${Statements/CheckSetCoolingLevelReq()[3]}"
                            ],
                            "CallIf": {
                                "${ReqBody/devicetype}": "fan",
                                "${Statements/CheckSetCoolingLevelReq()[1]}": true
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Systems/1/LiquidCoolingConfig",
                            "Interface": "bmc.kepler.Systems.LiquidCoolingConfig",
                            "Name": "SetManualLevel",
                            "Params": [
                                "${Statements/CheckSetCoolingLevelReq()[2]}",
                                "${Statements/CheckSetCoolingLevelReq()[3]}"
                            ],
                            "CallIf": {
                                "${ReqBody/devicetype}": "pump",
                                "${Statements/CheckSetCoolingLevelReq()[1]}": true
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcset/_coolinglevel",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/coolingmode",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Set cooling device mode, you can choose manual, auto or mixed",
                    "Usage": "ipmcset -d coolingmode -v <devicetype> <mode> [timeout]",
                    "ReqBody": {
                        "Type": "object",
                        "Required": false,
                        "Properties": {
                            "devicetype": {
                                "Required": false,
                                "Type": "string"
                            },
                            "mode": {
                                "Required": false,
                                "Type": "integer"
                            },
                            "timeout": {
                                "Type": "integer",
                                "Required": false
                            }
                        }
                    },
                    "RspBody": {
                        "devicetype": "${ReqBody/devicetype}",
                        "PumpSupported": "${Statements/PumpSupported()}",
                        "TimeoutIsValid": "${Statements/TimeoutIsValid()}",
                        "mode": "${ReqBody/mode}",
                        "timeout": "${ReqBody/timeout}",
                        "MixedModeSupported": "${ProcessingFlow[5]/Destination/MixedModeSupported}"
                    },
                    "Statements": {
                        "GetMode": {
                            "Input": "${ReqBody/mode}",
                            "Steps": [
                                {
                                    "Type": "Switch",
                                    "Formula": [
                                        {
                                            "Case": 0,
                                            "To": "Auto"
                                        },
                                        {
                                            "Case": 1,
                                            "To": "Manual"
                                        },
                                        {
                                            "Case": 2,
                                            "To": "Mixed"
                                        }
                                    ]
                                }
                            ]
                        },
                        "TimeoutIsValid": {
                            "Steps": [
                                {
                                    "Type": "Script",
                                    "Formula": "return type(ReqBody.timeout) == 'number' and ReqBody.timeout >= 0 and ReqBody.timeout <= 100000000"
                                }
                            ]
                        },
                        "PumpSupported": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.utils.is_valid_path('/bmc/kepler/Systems/1/LiquidCoolingConfig')"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Systems/1/CoolingConfig",
                            "Interface": "bmc.kepler.Systems.CoolingConfig",
                            "Name": "SetCtrlMode",
                            "Params": [
                                "${Statements/GetMode()}",
                                30
                            ],
                            "CallIf": {
                                "${ReqBody/devicetype}": "fan",
                                "${ReqBody/mode}": "#WITH",
                                "${ReqBody/timeout}": "#WITHOUT"
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Systems/1/CoolingConfig",
                            "Interface": "bmc.kepler.Systems.CoolingConfig",
                            "Name": "SetCtrlMode",
                            "Params": [
                                "Manual",
                                "${ReqBody/timeout}"
                            ],
                            "CallIf": {
                                "${ReqBody/devicetype}": "fan",
                                "${ReqBody/mode}": "#WITH",
                                "${Statements/TimeoutIsValid()}": true,
                                "${Statements/GetMode()}": "Manual"
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Systems/1/LiquidCoolingConfig",
                            "Interface": "bmc.kepler.Systems.LiquidCoolingConfig",
                            "Name": "SetCtrlMode",
                            "Params": [
                                "${Statements/GetMode()}",
                                30
                            ],
                            "CallIf": {
                                "${ReqBody/devicetype}": "pump",
                                "${ReqBody/mode}": "#WITH",
                                "${Statements/PumpSupported()}": true,
                                "${ReqBody/timeout}": "#WITHOUT"
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Systems/1/LiquidCoolingConfig",
                            "Interface": "bmc.kepler.Systems.LiquidCoolingConfig",
                            "Name": "SetCtrlMode",
                            "Params": [
                                "Manual",
                                "${ReqBody/timeout}"
                            ],
                            "CallIf": {
                                "${ReqBody/devicetype}": "pump",
                                "${ReqBody/mode}": "#WITH",
                                "${Statements/PumpSupported()}": true,
                                "${Statements/TimeoutIsValid()}": true,
                                "${Statements/GetMode()}": "Manual"
                            }
                        },
                        {
                            "Type": "Property",
                            "Path": "/bmc/kepler/Systems/1/CoolingConfig",
                            "Interface": "bmc.kepler.Systems.CoolingConfig",
                            "Destination": {
                                "MixedModeSupported": "MixedModeSupported"
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcset/_coolingmode",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/fanlevel",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Set fanlevel",
                    "Usage": "ipmcset -d fanlevel -v <value> [fanid]",
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "value": {
                                "Type": "integer",
                                "Required": false
                            },
                            "fanid": {
                                "Type": "integer",
                                "Required": false
                            }
                        }
                    },
                    "RspBody": {
                        "GetFanlevelParams": "${Statements/GetFanlevelParams()}"
                    },
                    "Statements": {
                        "GetCoolingFanList": {
                            "Input": "${ProcessingFlow[1]/Destination/CoolingFanList}",
                            "Steps": [
                                {
                                    "Type": "Expand"
                                }
                            ]
                        },
                        "GetFanlevelParams": {
                            "Input": "${Statements/GetCoolingFanList()}",
                            "Steps": [
                                {
                                    "Type": "Script",
                                    "Formula": "get_fanlevel_params.lua"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "List",
                            "Path": "/bmc/kepler/Systems/1/CoolingFan",
                            "Destination": {
                                "Members": "CoolingFanList"
                            }
                        },
                        {
                            "Type": "Property",
                            "Path": "/bmc/kepler/Systems/1/CoolingConfig",
                            "Interface": "bmc.kepler.Systems.CoolingConfig",
                            "Destination": {
                                "CtrlMode": "CtrlMode",
                                "LevelPercentRange": "LevelPercentRange",
                                "TimeOut": "TimeOut"
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Systems/1/CoolingConfig",
                            "Interface": "bmc.kepler.Systems.CoolingConfig",
                            "Name": "SetManualLevel",
                            "Params": [
                                "${Statements/GetFanlevelParams()[2]}",
                                "${Statements/GetFanlevelParams()[3]}"
                            ],
                            "CallIf": {
                                "${Statements/GetFanlevelParams()[1]}": true
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcset/_fanlevel",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/bmc/kepler/Systems/1/CoolingFan/:Id",
            "Interfaces": [
                {
                    "Type": "Get",
                    "RspBody": {
                        "FanId": "${ProcessingFlow[1]/Destination/FanId}",
                        "Level": "${ProcessingFlow[1]/Destination/Level}"
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Property",
                            "Path": "/bmc/kepler/Systems/1/CoolingFan/${Uri/Id}",
                            "Interface": "bmc.kepler.Systems.CoolingFan",
                            "Destination": {
                                "FanId": "FanId",
                                "Level": "Level"
                            }
                        }
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/identify",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Operate identify led",
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "time": {
                                "Type": [
                                    "string",
                                    "integer"
                                ],
                                "Required": false,
                                "Validator": [
                                    {
                                        "Type": "Range",
                                        "Formula": [
                                            0,
                                            255
                                        ]
                                    }
                                ],
                                "Description": "Usage: ipmcset -d identify [-v time | force]    0s<=time<=255s\n        0s means to turn off identify led."
                            }
                        }
                    },
                    "RspBody": {
                        "time_valid": "${Statements/time_valid()}",
                        "State": "${ProcessingFlow[2]/Destination/State}",
                        "OnDuration": "${ProcessingFlow[2]/Destination/OnDuration}",
                        "OffDuration": "${ProcessingFlow[2]/Destination/OffDuration}"
                    },
                    "Statements": {
                        "time_valid": {
                            "Steps": [
                                {
                                    "Type": "Script",
                                    "Formula": "if not ReqBody.time or ReqBody.time == 'force' or (tonumber(ReqBody.time) and tonumber(ReqBody.time) >= 0 and tonumber(ReqBody.time) <= 255) then return true else return false end"
                                }
                            ]
                        },
                        "state": {
                            "Steps": [
                                {
                                    "Type": "Script",
                                    "Formula": "get_identify_state.lua"
                                }
                            ]
                        },
                        "interval": {
                            "Steps": [
                                {
                                    "Type": "Script",
                                    "Formula": "get_identify_interval.lua"
                                }
                            ]
                        },
                        "GetUIDPath": {
                            "Steps": [
                                {
                                    "Type": "Script",
                                    "Formula": "for _, path in pairs(ProcessingFlow[1].Destination.led_list) do if string.match(path, 'UIDLed') then return path end end"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "List",
                            "Path": "/bmc/kepler/Systems/1/Leds",
                            "Destination": {
                                "Members": "led_list"
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "${Statements/GetUIDPath()}",
                            "Interface": "bmc.kepler.Systems.Led",
                            "Name": "SetState",
                            "Params": [
                                "${Statements/state()}",
                                "${Statements/interval()}"
                            ],
                            "CallIf": {
                                "${Statements/time_valid()}": true
                            },
                            "Destination": {
                                "State": "State",
                                "OnDuration": "OnDuration",
                                "OffDuration": "OffDuration"
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcset/_identify",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/fanmode",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Set fan mode,you can choose manual / auto or mixed",
                    "Usage": "ipmcset -d fanmode -v <mode> [timeout]",
                    "ReqBody": {
                        "Type": "object",
                        "Required": false,
                        "Properties": {
                            "mode": {
                                "Required": false,
                                "Type": "integer",
                                "Validator": [
                                    {
                                        "Type": "Enum",
                                        "Formula": [
                                            0,
                                            1,
                                            2
                                        ]
                                    }
                                ]
                            },
                            "timeout": {
                                "Type": "integer",
                                "Required": false
                            }
                        }
                    },
                    "RspBody": {
                        "mode": "${ReqBody/mode}",
                        "timeout": "${ReqBody/timeout}",
                        "GetTimeOutValid": "${Statements/GetTimeOutValid()}",
                        "MixedModeSupported": "${ProcessingFlow[3]/Destination/MixedModeSupported}"
                    },
                    "Statements": {
                        "GetMode": {
                            "Input": "${ReqBody/mode}",
                            "Steps": [
                                {
                                    "Type": "Switch",
                                    "Formula": [
                                        {
                                            "Case": 0,
                                            "To": "Auto"
                                        },
                                        {
                                            "Case": 1,
                                            "To": "Manual"
                                        },
                                        {
                                            "Case": 2,
                                            "To": "Mixed"
                                        }
                                    ]
                                }
                            ]
                        },
                        "GetTimeOutValid": {
                            "Steps": [
                                {
                                    "Type": "Script",
                                    "Formula": "local t = ReqBody.timeout return not t or(t >= 0 and t <= 100000000)"
                                }
                            ]
                        },
                        "GetTimeOut": {
                            "Steps": [
                                {
                                    "Type": "Script",
                                    "Formula": "return math.tointeger(ReqBody.timeout)"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Systems/1/CoolingConfig",
                            "Interface": "bmc.kepler.Systems.CoolingConfig",
                            "Name": "SetCtrlMode",
                            "Params": [
                                "${Statements/GetMode()}",
                                30
                            ],
                            "CallIf": {
                                "${ReqBody/mode}": "#WITH",
                                "${ReqBody/timeout}": "#WITHOUT"
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Systems/1/CoolingConfig",
                            "Interface": "bmc.kepler.Systems.CoolingConfig",
                            "Name": "SetCtrlMode",
                            "Params": [
                                "Manual",
                                "${Statements/GetTimeOut()}"
                            ],
                            "CallIf": {
                                "${ReqBody/mode}": "#WITH",
                                "${ReqBody/timeout}": "#WITH",
                                "${Statements/GetMode()}": "Manual",
                                "${Statements/GetTimeOutValid()}": true
                            }
                        },
                        {
                            "Type": "Property",
                            "Path": "/bmc/kepler/Systems/1/CoolingConfig",
                            "Interface": "bmc.kepler.Systems.CoolingConfig",
                            "Destination": {
                                "MixedModeSupported": "MixedModeSupported"
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcset/_fanmode",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/printscreen",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "LockdownAllow": true,
                    "Description": "Print current screen to {{SoftwareName}}",
                    "Usage": "ipmcset -d printscreen [-v wakeup]",
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "wakeup": {
                                "Validator": [
                                    {
                                        "Type": "Enum",
                                        "Formula": [
                                            "wakeup"
                                        ]
                                    }
                                ],
                                "Required": false
                            }
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Managers/1/GraphicalConsole",
                            "Interface": "bmc.kepler.Managers.GraphicalConsole",
                            "Name": "CaptureScreenshot",
                            "Params": [
                                1,
                                "/tmp"
                            ],
                            "CallIf": {
                                "${ReqBody/wakeup}": "wakeup"
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Managers/1/GraphicalConsole",
                            "Interface": "bmc.kepler.Managers.GraphicalConsole",
                            "Name": "CaptureScreenshot",
                            "Params": [
                                0,
                                "/tmp"
                            ],
                            "CallIf": {
                                "${ReqBody/wakeup}": "#WITHOUT"
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcset/_printscreen",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/psuworkmode",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Usage": "ipmcset -d psuworkmode -v <option> [active psuid|enabled/disabled]",
                    "Description": "Set PSU work mode",
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "value1": {
                                "Required": false
                            },
                            "value2": {
                                "Required": false
                            },
                            "value3": {
                                "Required": false
                            }
                        }
                    },
                    "RspBody": {
                        "value1": "${ReqBody/value1}",
                        "value2": "${ReqBody/value2}",
                        "value3": "${ReqBody/value3}",
                        "GetAllValueParamsValid": "${Statements/GetAllValueParamsValid()}",
                        "DeepSleepSupported": "${ProcessingFlow[1]/Destination/DeepSleepSupported}",
                        "NormalAndRedundancy": "${ProcessingFlow[1]/Destination/NormalAndRedundancy}",
                        "OnePowerList": "${ProcessingFlow[2]/Destination/OnePowerList}"
                    },
                    "Statements": {
                        "GetAllValueParamsValid": {
                            "Steps": [
                                {
                                    "Type": "Script",
                                    "Formula": "check_psuworkmode_params_valid.lua"
                                }
                            ]
                        },
                        "GetDeepSleepStatus": {
                            "Input": "${ReqBody/value2}",
                            "Steps": [
                                {
                                    "Type": "Switch",
                                    "Formula": [
                                        {
                                            "Case": "enabled",
                                            "To": "Enabled"
                                        },
                                        {
                                            "Case": "disabled",
                                            "To": "Disabled"
                                        }
                                    ]
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Property",
                            "Path": "/bmc/kepler/Systems/1/PowerStrategy",
                            "Interface": "bmc.kepler.Systems.PowerStrategy",
                            "Destination": {
                                "DeepSleepSupported": "DeepSleepSupported",
                                "NormalAndRedundancy": "NormalAndRedundancy"
                            }
                        },
                        {
                            "Type": "List",
                            "Path": "/bmc/kepler/Systems/1/PowerMgmt",
                            "Destination": {
                                "Members": "OnePowerList"
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Systems/1/PowerStrategy",
                            "Interface": "bmc.kepler.Systems.PowerStrategy",
                            "Name": "SetPowerWorkingMode",
                            "Params": [
                                "LoadBalancing",
                                {}
                            ],
                            "CallIf": {
                                "${Statements/GetAllValueParamsValid()}": true,
                                "${ReqBody/value1}": "0",
                                "${ReqBody/value2}": "#WITHOUT",
                                "${ProcessingFlow[1]/Destination/NormalAndRedundancy}": "Disabled"
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Systems/1/PowerStrategy",
                            "Interface": "bmc.kepler.Systems.PowerStrategy",
                            "Name": "SetPowerWorkingMode",
                            "Params": [
                                "Active/Standby",
                                [
                                    "${ReqBody/value2}"
                                ]
                            ],
                            "CallIf": {
                                "${Statements/GetAllValueParamsValid()}": true,
                                "${ReqBody/value1}": "1",
                                "${ReqBody/value2}": "#WITH",
                                "${ReqBody/value3}": "#WITHOUT",
                                "${ProcessingFlow[1]/Destination/NormalAndRedundancy}": "Disabled"
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Systems/1/PowerStrategy",
                            "Interface": "bmc.kepler.Systems.PowerStrategy",
                            "Name": "SetPowerWorkingMode",
                            "Params": [
                                "Active/Standby",
                                [
                                    "${ReqBody/value2}",
                                    "${ReqBody/value3}"
                                ]
                            ],
                            "CallIf": {
                                "${Statements/GetAllValueParamsValid()}": true,
                                "${ReqBody/value1}": "1",
                                "${ReqBody/value2}": "#WITH",
                                "${ReqBody/value3}": "#WITH",
                                "${ProcessingFlow[1]/Destination/NormalAndRedundancy}": "Disabled"
                            }
                        },
                        {
                            "Type": "Property",
                            "Path": "/bmc/kepler/Systems/1/PowerStrategy",
                            "Interface": "bmc.kepler.Systems.PowerStrategy",
                            "Source": {
                                "DeepSleep": "${Statements/GetDeepSleepStatus()}"
                            },
                            "CallIf": {
                                "${Statements/GetAllValueParamsValid()}": true,
                                "${ReqBody/value1}": "2",
                                "${ReqBody/value2}": "#WITH",
                                "${ReqBody/value3}": "#WITHOUT"
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcset/_psuworkmode",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/deluser",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Usage": "ipmcset -d deluser -v <username>",
                    "Description": "Delete user",
                    "Authentication": {
                        "Description": "Input your password:",
                        "Condition": true
                    },
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "username": {
                                "Type": "string",
                                "Required": true,
                                "Validator": [
                                    {
                                        "Type": "Regex",
                                        "Formula": "^(?!.*[<>&,'/\\%:\" ])(?=[A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|])(?!#)(?!\\+)(?!-)([A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|]{1,16})$"
                                    }
                                ],
                                "Description": "\n    Contain any digits, letters, or characters except (:,\\<>&\"'/%) and space.\n    User name's length is limitted to 1-16.\n    User name cannot start with character \"#\" \"+\" or \"-\".\r\n    User name cannot be just a dot (.) or two consecutive dots (..).\r\n"
                            }
                        }
                    },
                    "RspBody": {
                        "username": "${ReqBody/username}",
                        "Id": "${ProcessingFlow[1]/Destination/Id}"
                    },
                    "Statements": {
                        "is_allow_operate": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.account.is_allow_operate(ProcessingFlow[1].Destination.Id, ReqBody.username, true)"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/AccountService/Accounts",
                            "Interface": "bmc.kepler.AccountService.ManagerAccounts",
                            "Name": "GetIdByUserName",
                            "Params": [
                                "${ReqBody/username}"
                            ],
                            "Destination": {
                                "AccountId": "Id"
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/AccountService/Accounts/${ProcessingFlow[1]/Destination/Id}",
                            "Interface": "bmc.kepler.AccountService.ManagerAccount",
                            "Name": "Delete",
                            "CallIf": {
                                "${ProcessingFlow[1]/Destination/Id}": "#WITH",
                                "${Statements/is_allow_operate()}": true
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcset/_deluser",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/adduser",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Add user",
                    "Usage": "ipmcset -d adduser -v <username>",
                    "Authentication": {
                        "Description": "Input your password:",
                        "Condition": true
                    },
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "username": {
                                "Type": "string",
                                "Required": true,
                                "Validator": [
                                    {
                                        "Type": "Regex",
                                        "Formula": "^(?!.*[<>&,'/\\%:\" ])(?=[A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|])(?!#)(?!\\+)(?!-)([A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|]{1,16})$"
                                    }
                                ],
                                "Description": "\n    Contain any digits, letters, or characters except (:,\\<>&\"'/%) and space.\n    User name's length is limitted to 1-16.\n    User name cannot start with character \"#\" \"+\" or \"-\".\r\n    User name cannot be just a dot (.) or two consecutive dots (..).\r\n"
                            }
                        }
                    },
                    "RspBody": {
                        "PwdValid": "${Statements/GetPwd()}",
                        "AccountId": "${ProcessingFlow[1]/Destination/AccountId}"
                    },
                    "Statements": {
                        "GetPwd": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.account.get_pwd()"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/AccountService/Accounts",
                            "Interface": "bmc.kepler.AccountService.ManagerAccounts",
                            "Name": "New",
                            "Params": [
                                0,
                                "${ReqBody/username}",
                                "${Statements/GetPwd()[2]}",
                                0,
                                [
                                    1,
                                    2,
                                    4,
                                    8,
                                    16,
                                    64,
                                    128
                                ],
                                2
                            ],
                            "CallIf": {
                                "${Statements/GetPwd()[1]}": 0
                            },
                            "Destination": {
                                "AccountId": "AccountId"
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcset/_adduser"
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/password",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Modify user password",
                    "Usage": "ipmcset -d password -v <username>",
                    "Authentication": {
                        "Description": "You need to log in again after modifying your attributes.\n Input your password:",
                        "Condition": true
                    },
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "username": {
                                "Type": "string",
                                "Required": true,
                                "Validator": [
                                    {
                                        "Type": "Regex",
                                        "Formula": "^(?!.*[<>&,'/\\%:\" ])(?=[A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|])(?!#)(?!\\+)(?!-)([A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|]{1,16})$"
                                    },
                                    {
                                        "Type": "Script",
                                        "Formula": "local privilege = #Context.Privilege if privilege ~= 9 and Context.UserName ~= Input then error(base_messages.InsufficientPrivilege()) else return true end"
                                    }
                                ],
                                "Description": "\n    Contain any digits, letters, or characters except (:,\\<>&\"'/%) and space.\n    User name's length is limitted to 1-16.\n    User name cannot start with character \"#\" \"+\" or \"-\".\r\n    User name cannot be just a dot (.) or two consecutive dots (..).\r\n"
                            }
                        }
                    },
                    "RspBody": {
                        "UserName": "${ReqBody/username}",
                        "PwdValid": "${Statements/GetPwd()}",
                        "GetPathSuccess": "${Statements/GetPathSuccess()}"
                    },
                    "Statements": {
                        "GetPwd": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.account.get_pwd(true, ProcessingFlow[1].Destination.Path)"
                                }
                            ]
                        },
                        "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.AccountService.ManagerAccount",
                                {
                                    "UserName": "${ReqBody/username}"
                                },
                                false
                            ],
                            "Destination": {
                                "Path": "Path"
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "${ProcessingFlow[1]/Destination/Path}",
                            "Interface": "bmc.kepler.AccountService.ManagerAccount",
                            "Name": "ChangePwd",
                            "Params": [
                                "${Statements/GetPwd()[2]}"
                            ],
                            "CallIf": {
                                "${Statements/GetPathSuccess()}": true,
                                "${Statements/GetPwd()[1]}": 0
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcset/_password"
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/minimumpasswordage",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Set minimum password age configuration",
                    "Usage": "ipmcset -d minimumpasswordage -v <value>",
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "value": {
                                "Type": "integer",
                                "Required": true,
                                "Validator": [
                                    {
                                        "Type": "Range",
                                        "Formula": [
                                            0,
                                            365
                                        ]
                                    }
                                ],
                                "Description": "the range is 0 ~ 365."
                            }
                        }
                    },
                    "RspBody": {
                        "value": "${ReqBody/value}"
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Property",
                            "Path": "/bmc/kepler/AccountService",
                            "Interface": "bmc.kepler.AccountService",
                            "Source": {
                                "MinPasswordValidDays": "${ReqBody/value}"
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcset/_minimumpasswordage",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/emergencyuser",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Set emergencyuser",
                    "Usage": "ipmcset -d emergencyuser -v <username>",
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "username": {
                                "Required": true,
                                "Type": "string",
                                "Validator": [
                                    {
                                        "Type": "Regex",
                                        "Formula": "^(?!.*[<>&,'/\\%:\" ])(?=[A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|])(?!#)(?!\\+)(?!-)([A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|]{1,16})$"
                                    }
                                ],
                                "Description": "\n    Contain any digits, letters, or characters except (:,\\<>&\"'/%) and space.\n    User name's length is limitted to 1-16.\n    User name cannot start with character \"#\" \"+\" or \"-\".\r\n    User name cannot be just a dot (.) or two consecutive dots (..).\r\n"
                            }
                        }
                    },
                    "RspBody": {
                        "UserName": "${ReqBody/username}"
                    },
                    "Statements": {
                        "is_allow_operate": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.account.is_allow_operate(ProcessingFlow[1].Destination.EmergencyLoginAccountId, ReqBody.username, true)"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/AccountService/Accounts",
                            "Interface": "bmc.kepler.AccountService.ManagerAccounts",
                            "Name": "GetIdByUserName",
                            "Params": [
                                "${ReqBody/username}"
                            ],
                            "Destination": {
                                "AccountId": "EmergencyLoginAccountId"
                            }
                        },
                        {
                            "Type": "Property",
                            "Path": "/bmc/kepler/AccountService",
                            "Interface": "bmc.kepler.AccountService",
                            "Source": {
                                "EmergencyLoginAccountId": "${ProcessingFlow[1]/Destination/EmergencyLoginAccountId}"
                            },
                            "CallIf": {
                                "${ProcessingFlow[1]/Destination/EmergencyLoginAccountId}": "#WITH",
                                "${Statements/is_allow_operate()}": true
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcset/_emergencyuser",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/_/psuswitch",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Set psu switch",
                    "Usage": "ipmcset -d psuswitch -v psu<N> <value>",
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "N": {
                                "Type": "string",
                                "Required": true,
                                "Validator": [
                                    {
                                        "Type": "Regex",
                                        "Formula": "^psu([1-9]|[12][0-9]|30)$"
                                    }
                                ],
                                "Description": "\n    psu1 is the first power source\n    N is psuid, 1 <= N <= 30"
                            },
                            "value": {
                                "Type": "integer",
                                "Required": true,
                                "Validator": [
                                    {
                                        "Type": "Enum",
                                        "Formula": [
                                            2
                                        ]
                                    }
                                ],
                                "Description": "\n    2: Force reset"
                            }
                        }
                    },
                    "RspBody": {
                        "SlotNumber": "${Statements/GetSlotNumber()}",
                        "SetPsuSwitchResult": "${Statements/SetPsuSwitch()}"
                    },
                    "Statements": {
                        "GetSlotNumber": {
                            "Input": "${ReqBody/N}",
                            "Steps": [
                                {
                                    "Type": "Prefix-Trim",
                                    "Formula": "psu"
                                },
                                {
                                    "Type": "Convert",
                                    "Formula": "StringToNumber"
                                }
                            ]
                        },
                        "SetPsuSwitch": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.psuswitch.set_psu_switch(ProcessingFlow[1].Destination.Path, ReqBody.value)"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/MdbService",
                            "Interface": "bmc.kepler.Mdb",
                            "Name": "GetPath",
                            "Params": [
                                "bmc.kepler.Systems.PowerMgmt.OnePower",
                                {
                                    "SlotNumber": "${Statements/GetSlotNumber()}"
                                },
                                false
                            ],
                            "Destination": {
                                "Path": "Path"
                            }
                        }
                    ],
                    "Confirm": {
                        "Condition": true,
                        "Description": "WARNING: The operation may have many adverse effects.\nDo you want to continue? [Y/N]:"
                    },
                    "Echoes": [
                        "ipmcset/_psuswitch",
                        ""
                    ]
                }
            ]
        }
    ]
}