{
    "Resources": [
        {
            "Uri": "/cli/v1/config",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "Operate configuration"
                }
            ]
        },
        {
            "Uri": "/cli/v1/config/import",
            "Interfaces": [
                {
                    "Type": "Patch",
                    "Description": "import configuration",
                    "Usage": "ipmcset -t config -d import -v <localpath/URL>",
                    "Authentication": {
                        "Description": "Input your password:",
                        "Condition": true
                    },
                    "ReqBody": {
                        "Type": "object",
                        "Required": true,
                        "Properties": {
                            "value": {
                                "Required": true,
                                "Validator": [
                                    {
                                        "Type": "Regex",
                                        "Formula": "^((https|sftp|nfs|cifs|scp)://.{1,1000}|/tmp/.{1,246})\\.json$"
                                    }
                                ],
                                "Sensitive": true,
                                "Description": "\nLocalpath  e.g.: /tmp/config.json \nURL            : protocol://[username:password@]IP[:port]/directory/filename \n    The parameters in the URL are described as follows: \n        The protocol must be https,sftp,cifs,scp or nfs. \n        The URL can contain only letters, digits, and special characters. The directory or file name cannot contain @. \n        Use double quotation marks (\") to enclose the URL that contains a space or double quotation marks (\"). Escape the double quotation marks (\") and back slash (\\) contained in the URL. \n        For example, if you want to enter: \n        a b\\cd\" \n        Enter: \n        \"a b\\\\cd\\\"\" "
                            }
                        }
                    },
                    "Statements": {
                        "IsImportActionPermitted": {
                            "Steps": [
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.account.is_import_action_permitted(Context, ReqBody.value, 'rw')"
                                },
                                {
                                    "Type": "Plugin",
                                    "Formula": "orchestrator.configuration.check_path_and_permission(ReqBody.value, Input)"
                                }
                            ]
                        }
                    },
                    "ProcessingFlow": [
                        {
                            "Type": "Task",
                            "Path": "/bmc/kepler/Managers/1/Configurations",
                            "Interface": "bmc.kepler.Managers.Configurations",
                            "Name": "Import",
                            "Params": [
                                "${ReqBody/value}",
                                "configuration"
                            ],
                            "Destination": {
                                "TaskId": "TaskId"
                            },
                            "CallIf": {
                                "${Statements/IsImportActionPermitted()}": true
                            }
                        }
                    ],
                    "Echoes": [
                        "ipmcset/config_import",
                        ""
                    ]
                }
            ]
        }
    ]
}