Example 3: Patch an Oracle Database Server(s) with Input Parametrization

In this V2.0 syntax example we patch an Oracle Database server using input parametrization. This is achieved by listing the host name, host credentials and script path within the declaration section of the workflow.

{   "name": "Oracle Database Patch Workflow",
    "version": "3.0.1",
    "description": "This is an example of a workflow used to patch an Oracle database server",
    "source": "Custom",
    "plan": {
        "declaration": {
            "input": {
                "required": [
                    "HostName",
                    "HostCredential",
                    "ScriptPath"
                ],
                "properties": {
                    "HostName": {
                        "type": "string",
                        "maxLength": 30,
                        "description": "The name of the Host"
                    },
                    "HostCredential": {
                        "type": "string",
                        "maxLength": 40,
                        "description": "Credential required to access the host"
                    },
                    "ScriptPath": {
                        "type": "string",
                        "minLength": 1,
                        "description": "Full path to the script on the Oracle database server"
                    }
                }
            }
        },
        "steps": [
            {
                "name": "Patch",
                "operation": {
                    "type": "ENTITY",
                    "parameters": {
                        "entity": {
                            "entityByName": {
                               "name": "${workflow.vars.HostName}",
                                "type": "omc_host_linux"
                            }
                        },
                        "command": "sh",
                        "arguments": [
                            "${workflow.vars.ScriptPath}"
                        ],
                        "credential": "${workflow.vars.HostCredential}"
                    }
                }
            }
        ]
    },
    "input": {
        "vars": {
            "HostName": "",
            "HostCredential": "",
            "ScriptPath": ""
        }
    }
}