{
    "swagger": "2.0",
    "info": {
        "description": "The Batch Launch Plugin API functions provide access to XNAT processing workflows for monitoring purposes.",
        "version": "0.4.0",
        "title": "Batch Launch Plugin API",
        "termsOfService": "http://www.xnat.org/download",
        "contact": {
            "name": "XNAT",
            "url": "http://www.xnat.org",
            "email": "info@xnat.org"
        },
        "license": {
            "name": "Simplified 2-Clause BSD",
            "url": "https://opensource.org/licenses/BSD-2-Clause"
        }
    },
    "host": "10.1.10.17",
    "basePath": "/xapi",
    "tags": [
        {
            "name": "workflow-monitor-api",
            "description": "Workflow Monitor Api"
        }
    ],
    "paths": {
        "/workflows": {
            "post": {
                "tags": [
                    "workflow-monitor-api"
                ],
                "summary": "Returns a map of workflow models.",
                "operationId": "getWorkflowsUsingPOST",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "in": "body",
                        "name": "workflowPaginatedRequest",
                        "description": "workflowPaginatedRequest",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/WorkflowPaginatedRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Workflows successfully retrieved.",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "array",
                                "items": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "Created"
                    },
                    "400": {
                        "description": "Invalid request."
                    },
                    "401": {
                        "description": "Must be authenticated to access the XNAT REST API."
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not Found"
                    },
                    "500": {
                        "description": "Unexpected error"
                    }
                },
                "deprecated": false
            }
        },
        "/workflows/{containerName}/killactive": {
            "post": {
                "tags": [
                    "workflow-monitor-api"
                ],
                "summary": "Kill all running *containerName* container processes for a list of sessions IDs.",
                "operationId": "killActiveUsingPOST",
                "consumes": [
                    "application/json",
                    "application/x-www-form-urlencoded"
                ],
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "name": "containerName",
                        "in": "path",
                        "description": "containerName",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "elements[]",
                        "in": "formData",
                        "description": "elements[]",
                        "required": true,
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Containers successfully terminated.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "201": {
                        "description": "Created"
                    },
                    "401": {
                        "description": "Must be authenticated to access the XNAT REST API."
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not Found"
                    },
                    "500": {
                        "description": "Unexpected error"
                    }
                },
                "deprecated": false
            }
        },
        "/workflows/{wfid}": {
            "get": {
                "tags": [
                    "workflow-monitor-api"
                ],
                "summary": "Returns workflow model.",
                "operationId": "getWorkflowStatusUsingGET",
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "name": "wfid",
                        "in": "path",
                        "description": "wfid",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Workflow successfully retrieved.",
                        "schema": {
                            "$ref": "#/definitions/Workflow"
                        }
                    },
                    "401": {
                        "description": "Must be authenticated to access the XNAT REST API."
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not Found"
                    },
                    "500": {
                        "description": "Unexpected error"
                    }
                },
                "deprecated": false
            }
        },
        "/workflows/{wfid}/build_dir": {
            "get": {
                "tags": [
                    "workflow-monitor-api"
                ],
                "summary": "Returns json representation of build directory.",
                "operationId": "getBuildDirJsonUsingGET",
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "name": "wfid",
                        "in": "path",
                        "description": "wfid",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Build directory contents successfully retrieved.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "401": {
                        "description": "Must be authenticated to access the XNAT REST API."
                    },
                    "403": {
                        "description": "User account does not have access to requested data."
                    },
                    "404": {
                        "description": "Not Found"
                    },
                    "422": {
                        "description": "Not a pipeline or container or no build directory."
                    },
                    "500": {
                        "description": "Unexpected error"
                    }
                },
                "deprecated": false
            }
        },
        "/workflows/{wfid}/build_dir_contd": {
            "get": {
                "tags": [
                    "workflow-monitor-api"
                ],
                "summary": "Returns json representation of build directory, continued from path.",
                "operationId": "getBuildDirJsonContinuedUsingGET",
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "name": "inputPath",
                        "in": "query",
                        "description": "inputPath",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "wfid",
                        "in": "path",
                        "description": "wfid",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Build directory contents successfully retrieved.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "401": {
                        "description": "Must be authenticated to access the XNAT REST API."
                    },
                    "403": {
                        "description": "User account does not have access to requested data."
                    },
                    "404": {
                        "description": "Not Found"
                    },
                    "422": {
                        "description": "Not a pipeline or container or no build directory."
                    },
                    "500": {
                        "description": "Unexpected error"
                    }
                },
                "deprecated": false
            }
        },
        "/workflows/{wfid}/get_file": {
            "get": {
                "tags": [
                    "workflow-monitor-api"
                ],
                "summary": "Returns requested file.",
                "operationId": "getBuildDirFileUsingGET",
                "produces": [
                    "application/octet-stream"
                ],
                "parameters": [
                    {
                        "name": "path",
                        "in": "query",
                        "description": "path",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "wfid",
                        "in": "path",
                        "description": "wfid",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not Found"
                    }
                },
                "deprecated": false
            }
        },
        "/workflows/{wfid}/get_zip": {
            "post": {
                "tags": [
                    "workflow-monitor-api"
                ],
                "summary": "Returns requested files.",
                "operationId": "getBuildDirZipUsingPOST",
                "consumes": [
                    "application/json",
                    "application/x-www-form-urlencoded"
                ],
                "produces": [
                    "application/octet-stream"
                ],
                "parameters": [
                    {
                        "name": "inputPaths",
                        "in": "formData",
                        "description": "inputPaths",
                        "required": true,
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi"
                    },
                    {
                        "name": "wfid",
                        "in": "path",
                        "description": "wfid",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "201": {
                        "description": "Created"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not Found"
                    }
                },
                "deprecated": false
            }
        },
        "/workflows/{workflowId}/kill": {
            "post": {
                "tags": [
                    "workflow-monitor-api"
                ],
                "summary": "Kill Process",
                "operationId": "killUsingPOST_2",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "*/*"
                ],
                "parameters": [
                    {
                        "name": "workflowId",
                        "in": "path",
                        "description": "workflowId",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "201": {
                        "description": "Created"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not Found"
                    }
                },
                "deprecated": false
            }
        },
        "/workflows/{workflowid}/container": {
            "get": {
                "tags": [
                    "workflow-monitor-api"
                ],
                "summary": "Gets the container/service ID from a workflow",
                "operationId": "getContainerOrServiceIdUsingGET",
                "produces": [
                    "text/plain"
                ],
                "parameters": [
                    {
                        "name": "workflowid",
                        "in": "path",
                        "description": "workflowid",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not Found"
                    },
                    "500": {
                        "description": "Unexpected error"
                    }
                },
                "deprecated": false
            }
        },
        "/workflows/{workflowid}/logs/{file}": {
            "get": {
                "tags": [
                    "workflow-monitor-api"
                ],
                "summary": "Gets the log file for a given workflow",
                "operationId": "getFileUsingGET",
                "produces": [
                    "text/plain"
                ],
                "parameters": [
                    {
                        "name": "file",
                        "in": "path",
                        "description": "file",
                        "required": false,
                        "type": "string",
                        "enum": [
                            "stdout",
                            "stderr"
                        ]
                    },
                    {
                        "name": "workflowid",
                        "in": "path",
                        "description": "workflowid",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not Found"
                    },
                    "500": {
                        "description": "Unexpected error"
                    }
                },
                "deprecated": false
            }
        }
    }
}