{
    "Resources": [
        {
            "Uri": "/cli/v1/sensor",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Operate with sensor"
                }
            ]
        },
        {
            "Uri": "/cli/v1/sensor/test",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Sensor test",
                    "Usage": "ipmcset -t sensor -d test -v <sensorname/stopall> [value/stop]",
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "Command": {
                                "Required": true,
                                "Type": "string",
                                "Validator": [
                                    {
                                        "Type": "Script",
                                        "Formula": "sensor_test.lua"
                                    }
                                ],
                                "Description": "\n  sensorname   sensor name for test\r\n  stopall      stop all sensor test\r\n"
                            },
                            "Parameter": {
                                "Type": "string",
                                "Description": "\n  value        start test and set the current value\r\n  stop         stop sensor test\r\n"
                            }
                        }
                    },
                    "RspBody": {
                        "Enabled": "${Statements/Enabled()}"
                    },
                    "Statements": {
                        "Enabled": {
                            "Input": "${ReqBody/Command}",
                            "Steps": [
                                {
                                    "Type": "Switch",
                                    "Formula": [
                                        {
                                            "Case": "stopall",
                                            "To": 0
                                        },
                                        {
                                            "To": 1
                                        }
                                    ]
                                }
                            ]
                        },
                        "SensorName": {
                            "Input": "${ReqBody/Command}",
                            "Steps": [
                                {
                                    "Type": "Switch",
                                    "Formula": [
                                        {
                                            "Case": "stopall",
                                            "To": ""
                                        }
                                    ]
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Chassis/1/Sensors",
                            "Interface": "bmc.kepler.Chassis.Sensors",
                            "Name": "MockSensor",
                            "Params": [
                                "${Statements/Enabled()}",
                                "${Statements/SensorName()}",
                                "${ReqBody/Parameter}"
                            ],
                            "CallIf": {
                                "${ReqBody/Parameter}": "#WITH"
                            }
                        },
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Chassis/1/Sensors",
                            "Interface": "bmc.kepler.Chassis.Sensors",
                            "Name": "MockSensor",
                            "Params": [
                                "${Statements/Enabled()}",
                                "${Statements/SensorName()}",
                                " "
                            ],
                            "CallIf": {
                                "${ReqBody/Parameter}": "#WITHOUT"
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcset/sensor_test",
                        ""
                    ]
                }
            ]
        },
        {
            "Uri": "/cli/v1/sensor/state",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Sensor state",
                    "Usage": "ipmcset -t sensor -d state -v <sensorname> <enabled|disabled>",
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "Command": {
                                "Required": true,
                                "Type": "string",
                                "Description": "\n  sensorname   sensor name\r\n"
                            },
                            "Parameter": {
                                "Required": true,
                                "Type": "string",
                                "Validator": [
                                    {
                                        "Type": "Enum",
                                        "Formula": [
                                            "enabled",
                                            "disabled"
                                        ]
                                    }
                                ],
                                "Description": "\n  enabled      enable  sensor\r\n  disabled     disable sensor"
                            }
                        }
                    },
                    "RspBody": {
                        "Enabled": "${Statements/Enable()}"
                    },
                    "Statements": {
                        "Enable": {
                            "Input": "${ReqBody/Parameter}",
                            "Steps": [
                                {
                                    "Type": "Switch",
                                    "Formula": [
                                        {
                                            "Case": "enabled",
                                            "To": 1
                                        },
                                        {
                                            "Case": "disabled",
                                            "To": 0
                                        }
                                    ]
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Chassis/1/Sensors",
                            "Interface": "bmc.kepler.Chassis.Sensors",
                            "Name": "SetSensorStatus",
                            "Params": [
                                "${ReqBody/Command}",
                                "${ReqBody/Parameter}"
                            ]
                        }
                    ],
                    "Echoes": [
                        "ipmcset/sensor_state",
                        ""
                    ]
                }
            ]
        }
    ]
}