{
    "Resources": [
        {
            "Uri": "/cli/v1/envvar",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Operate environment variable"
                }
            ]
        },
        {
            "Uri": "/cli/v1/envvar/hostgmac",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "LockdownAllow": false,
                    "Description": "Set host GMAC address",
                    "Usage": "ipmcset -t envvar -d hostgmac -v <gmacindex> <macaddr>",
                    "Example": [
                        "ipmcset -t envvar -d hostgmac -v 2 20:22:01:88:AB:48"
                    ],
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "gmacindex": {
                                "Required": true,
                                "Type": "string",
                                "Validator": [
                                    {
                                        "Type": "Enum",
                                        "Formula": [
                                            "2",
                                            "3"
                                        ]
                                    }
                                ],
                                "Description": "\n    2    host GMAC2\n    3    host GMAC3"
                            },
                            "macaddr": {
                                "Required": true,
                                "Type": "string"
                            }
                        }
                    },
                    "RspBody": {
                        "MacAddr": "${ReqBody/macaddr}",
                        "ParseMacAddrRes": "${Statements/ParseMacAddr()}"
                    },
                    "Statements": {
                        "GMACIndex": {
                            "Input": "${ReqBody/gmacindex}",
                            "Steps": [
                                {
                                    "Type": "Convert",
                                    "Formula": "StringToNumber"
                                }
                            ]
                        },
                        "ParseMacAddr": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.envvar.parse_mac_addr(ReqBody.macaddr)"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Method",
                            "Path": "/bmc/kepler/Managers/1/SOC/Env",
                            "Interface": "bmc.kepler.Managers.SOC.GMAC",
                            "Name": "SetMacAddr",
                            "Params": [
                                "${Statements/GMACIndex()}",
                                "${Statements/ParseMacAddr()[2]}"
                            ],
                            "CallIf": {
                                "${ReqBody/gmacindex}": "#WITH",
                                "${ReqBody/macaddr}": "#WITH",
                                "${Statements/ParseMacAddr()[1]}": true
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcset/set_gmac_macaddr",
                        ""
                    ]
                }
            ]
        }
    ]
}