{
    "basePath":"/grid/cmd/v1",
    "definitions":{
        "cmd":{
            "allOf":[
                {
                    "properties":{
                        "exec":{
                            "$ref":"#/definitions/exec"
                        },
                        "homes":{
                            "$ref":"#/definitions/homes"
                        },
                        "jobs":{
                            "$ref":"#/definitions/jobs"
                        },
                        "name":{
                            "type":"string"
                        }
                    }
                },
                {
                    "$ref":"#/definitions/singularResource"
                }
            ]
        },
        "exec":{
            "allOf":[
                {
                    "$ref":"#/definitions/singularResource"
                }
            ]
        },
        "homes":{
            "properties":{
                "homeName":{
                    "type":"string"
                },
                "path":{
                    "type":"string"
                }
            }
        },
        "jobs":{
            "allOf":[
                {
                    "properties":{
                        "items":{
                            "items":{
                                "$ref":"#/definitions/job"
                            },
                            "type":"array"
                        }
                    }
                },
                {
                    "$ref":"#/definitions/collectionBaseResource"
                }
            ]
        },
        "job":{
            "allOf":[
                {
                    "$ref":"#/definitions/jobCommon"
                },
                {
                    "properties":{
                        "jobId":{
                            "type":"string",
                            "readOnly":true
                        },
                        "status":{
                            "type":"string",
                            "enum":[
                                "Scheduled",
                                "Running",
                                "Completed",
                                "Failed",
                                "Unknown"
                            ],
                            "readOnly":true
                        },
                        "output":{
                            "type":"array",
                            "items":{
                                "type":"string"
                            },
                            "readOnly":true
                        },
                        "outputFile":{
                            "allOf":[
                                {
                                    "$ref":"#/definitions/singularResource"
                                }
                            ],
                            "readOnly":true
                        },
                        "processId":{
                            "type":"integer",
                            "readOnly":true
                        },
                        "processStatus":{
                            "type":"integer",
                            "readOnly":true
                        },
                        "timeStart":{
                            "type":"string",
                            "readOnly":true
                        },
                        "timeFinish":{
                            "type":"string",
                            "readOnly":true
                        }
                    },
                    "required":[
                        "jobId"
                    ]
                },
                {
                    "$ref":"#/definitions/singularResource"
                }
            ]
        },
        "execReq":{
            "allOf":[
                {
                    "$ref":"#/definitions/jobCommon"
                },
                {
                    "properties":{
                        "userPassword":{
                            "type":"string"
                        }
                    },
                    "required":[
                        "userPassword"
                    ]
                }
            ]
        },
        "jobCommon":{
            "properties":{
                "command":{
                    "type":"array",
                    "items":{
                        "type":"string"
                    }
                },
                "flags":{
                    "type":"array",
                    "items":{
                        "type":"string",
                        "enum":[
                            "outputDiscard"
                        ]
                    }
                },
                "homeName":{
                    "type":"string"
                },
                "jobExpiry":{
                    "type":"integer"
                },
                "nodeName":{
                    "type":"string"
                },
                "runAsUser":{
                    "type":"string"
                }
            },
            "required":[
                "command",
                "runAsUser"
            ]
        },
        "singularResource":{
            "description":"Oracle base singular resource schema definition.",
            "properties":{
                "links":{
                    "items":{
                        "$ref":"#/definitions/instanceLink"
                    },
                    "type":"array"
                }
            },
            "title":"Singular Resource",
            "type":"object"
        },
        "collectionBaseResource":{
            "allOf":[
                {
                    "$ref":"#/definitions/singularResource"
                },
                {
                    "description":"Oracle base collection resource schema definition. ",
                    "properties":{
                        "items":{
                            "items":{
                                "type":"object"
                            },
                            "type":"array"
                        }
                    },
                    "title":" Collection Resource"
                }
            ]
        },
        "instanceLink":{
            "description":"Metadata describing link description objects that MAY appear in the JSON instance representation.",
            "properties":{
                "href":{
                    "description":"URI [RFC3986] or URI Template [RFC6570]. If the value is set to URI Template, then the \"templated\" property must be set to true.",
                    "type":"string"
                },
                "mediaType":{
                    "description":"Media type, as defined by RFC 2046, describing the link target.",
                    "type":"string"
                },
                "rel":{
                    "description":"Name of the link relation that, in addition to the type property, can be used to retrieve link details. For example, href or profile ",
                    "type":"string"
                }
            }
        }
    },
    "info":{
        "title":"REST APIs for Clusterware",
        "version":"2024.04.30",
        "description":"The REST APIs for Oracle Clusterware enable you to remotely run commands on your cluster in the Oracle Cloud, at remote physical locations or locally provisioned. With the remote processing of REST interface commands, you can retrieve information about that processing, including output, error codes, and processing duration. In some cases, a command generates a file as output. In such cases, the REST interface also provides a Uniform Resource Identifier (URI) to retrieve the file. The REST interface provides secure support for Oracle Clusterware CLUVFY, CRSCTL, and SRVCTL command line interfaces (CLIs).",
        "x-summary":"The REST APIs for Oracle Clusterware enable you to remotely run commands on your cluster in the Oracle Cloud, at remote physical locations or locally provisioned."
    },
    "parameters":{
        "expandQueryParam":{
            "description":"Expand the child Resources",
            "in":"query",
            "name":"expand",
            "type":"string"
        },
        "fieldsQueryParam":{
            "collectionFormat":"csv",
            "description":"Fetch only specific fields",
            "in":"query",
            "items":{
                "type":"string"
            },
            "name":"fields",
            "type":"array"
        }
    },
    "paths":{
        "/cmd":{
            "get":{
                "tags":[
                    "Clusterware CLIs"
                ],
                "summary":"Top-level URL",
                "description":"Returns the Command Resource",
                "parameters":[
                    {
                        "$ref":"#/parameters/expandQueryParam"
                    },
                    {
                        "$ref":"#/parameters/fieldsQueryParam"
                    }
                ],
                "produces":[
                    "application/vnd.oracle.resource+json;type=singular",
                    "text/plain"
                ],
                "responses":{
                    "200":{
                        "description":"Success",
                        "headers":{
                            "Content-Type":{
                                "description":"The content-type \"application/vnd.oracle.resource+json;type=singular\"",
                                "type":"string"
                            }
                        },
                        "schema":{
                            "$ref":"#/definitions/cmd"
                        }
                    },
                    "400":{
                        "$ref":"#/responses/BadRequest"
                    },
                    "401":{
                        "$ref":"#/responses/NotAuthorized"
                    },
                    "404":{
                        "$ref":"#/responses/NotFound"
                    },
                    "500":{
                        "$ref":"#/responses/InternalServer"
                    }
                },
                "x-internal-id":"cmd-get",
                "x-filename-id":"cmd-get"
            }
        },
        "/cmd/exec":{
            "post":{
                "tags":[
                    "Clusterware CLIs"
                ],
                "summary":"Execute a CLI",
                "description":"Executes a CLI with the provided arguments, as a Job",
                "parameters":[
                    {
                        "description":"POST request to execute the CLI",
                        "in":"body",
                        "name":"request",
                        "required":true,
                        "schema":{
                            "$ref":"#/definitions/execReq"
                        }
                    }
                ],
                "consumes":[
                    "application/vnd.oracle.resource+json;type=singular"
                ],
                "responses":{
                    "201":{
                        "description":"Created",
                        "headers":{
                            "Content-Type":{
                                "description":"The content-type\"application/vnd.oracle.resource+json;type=singular\"",
                                "type":"string"
                            }
                        },
                        "schema":{
                            "$ref":"#/definitions/job"
                        }
                    },
                    "400":{
                        "$ref":"#/responses/BadRequest"
                    },
                    "401":{
                        "$ref":"#/responses/NotAuthorized"
                    },
                    "404":{
                        "$ref":"#/responses/NotFound"
                    },
                    "500":{
                        "$ref":"#/responses/InternalServer"
                    }
                },
                "x-internal-id":"cmd-exec-post",
                "x-filename-id":"cmd-exec-post"
            }
        },
        "/cmd/jobs":{
            "get":{
                "tags":[
                    "Clusterware CLIs"
                ],
                "summary":"Show all Jobs",
                "description":"Returns a list of the Job Resources present in the cluster",
                "produces":[
                    "application/vnd.oracle.resource+json;type=collection",
                    "text/plain"
                ],
                "responses":{
                    "200":{
                        "description":"Success",
                        "headers":{
                            "Content-Type":{
                                "description":"The content-type\"application/vnd.oracle.resource+json;type=collection\"",
                                "type":"string"
                            }
                        },
                        "schema":{
                            "$ref":"#/definitions/jobs"
                        }
                    },
                    "400":{
                        "$ref":"#/responses/BadRequest"
                    },
                    "401":{
                        "$ref":"#/responses/NotAuthorized"
                    },
                    "404":{
                        "$ref":"#/responses/NotFound"
                    },
                    "500":{
                        "$ref":"#/responses/InternalServer"
                    }
                },
                "x-internal-id":"cmd-jobs-get",
                "x-filename-id":"cmd-jobs-get"
            }
        },
        "/cmd/jobs/{jobId}":{
            "parameters":[
                {
                    "description":"jobId which is being queried",
                    "in":"path",
                    "name":"jobId",
                    "required":true,
                    "type":"string"
                }
            ],
            "get":{
                "tags":[
                    "Clusterware CLIs"
                ],
                "summary":"Get a Job",
                "description":"The status of the current Job Resource and the output of a CLI execution",
                "produces":[
                    "application/vnd.oracle.resource+json;type=singular",
                    "text/plain"
                ],
                "responses":{
                    "200":{
                        "description":"Success",
                        "headers":{
                            "Content-Type":{
                                "description":"The content-type \"application/vnd.oracle.resource+json;type=singular\"",
                                "type":"string"
                            }
                        },
                        "schema":{
                            "$ref":"#/definitions/job"
                        }
                    },
                    "400":{
                        "$ref":"#/responses/BadRequest"
                    },
                    "401":{
                        "$ref":"#/responses/NotAuthorized"
                    },
                    "404":{
                        "$ref":"#/responses/NotFound"
                    },
                    "500":{
                        "$ref":"#/responses/InternalServer"
                    }
                },
                "x-internal-id":"cmd-jobs-{jobId}-get",
                "x-filename-id":"cmd-jobs-jobid-get"
            },
            "delete":{
                "tags":[
                    "Clusterware CLIs"
                ],
                "summary":"Delete a Job",
                "description":"Delete the specified Job Resource",
                "produces":[
                    "application/vnd.oracle.resource+json;type=singular",
                    "text/plain"
                ],
                "responses":{
                    "204":{
                        "description":"No Content",
                        "headers":{
                            "Content-Type":{
                                "description":"The content-type \"application/vnd.oracle.resource+json;type=singular\"",
                                "type":"string"
                            }
                        }
                    },
                    "400":{
                        "$ref":"#/responses/BadRequest"
                    },
                    "401":{
                        "$ref":"#/responses/NotAuthorized"
                    },
                    "404":{
                        "$ref":"#/responses/NotFound"
                    },
                    "500":{
                        "$ref":"#/responses/InternalServer"
                    }
                },
                "x-internal-id":"cmd-jobs-{jobId}-delete",
                "x-filename-id":"cmd-jobs-jobid-delete"
            }
        },
        "/cmd/jobs/{jobId}/outputFile":{
            "parameters":[
                {
                    "description":"jobId which is being queried",
                    "in":"path",
                    "name":"jobId",
                    "required":true,
                    "type":"string"
                }
            ],
            "get":{
                "tags":[
                    "Clusterware CLIs"
                ],
                "summary":"Get a Job's output file",
                "description":"The output file of the current Job Resource",
                "produces":[
                    "text/plain"
                ],
                "responses":{
                    "200":{
                        "description":"Success",
                        "schema":{
                            "type":"file"
                        }
                    },
                    "400":{
                        "$ref":"#/responses/BadRequest"
                    },
                    "401":{
                        "$ref":"#/responses/NotAuthorized"
                    },
                    "404":{
                        "$ref":"#/responses/NotFound"
                    },
                    "500":{
                        "$ref":"#/responses/InternalServer"
                    }
                },
                "x-internal-id":"cmd-jobs-{jobId}-outputFile-get",
                "x-filename-id":"cmd-jobs-jobid-outputfile-get"
            }
        }
    },
    "responses":{
        "BadRequest":{
            "description":"Bad Request",
            "headers":{
                "Content-Type":{
                    "description":"The content-type \"text/plain\"",
                    "type":"string"
                }
            }
        },
        "InternalServer":{
            "description":"Internal Server Error",
            "headers":{
                "Content-Type":{
                    "description":"The content-type \"text/plain\"",
                    "type":"string"
                }
            }
        },
        "NotAuthorized":{
            "description":"Not Authorized",
            "headers":{
                "Content-Type":{
                    "description":"The content-type \"text/plain\"",
                    "type":"string"
                }
            }
        },
        "NotFound":{
            "description":"Not Found",
            "headers":{
                "Content-Type":{
                    "description":"The content-type \"text/plain\"",
                    "type":"string"
                }
            }
        }
    },
    "schemes":[
        "https",
        "http"
    ],
    "security":[
        {
            "login":[
            ]
        }
    ],
    "securityDefinitions":{
        "login":{
            "description":"Basic authentication",
            "type":"basic"
        }
    },
    "swagger":"2.0",
    "tags":[
        {
            "name":"Clusterware CLIs",
            "description":"The operations from the Clusterware CLIs category."
        }
    ]
}