Skip to content
Snippets Groups Projects
swagger-schema.yaml 37.9 KiB
Newer Older
swagger: "2.0"
info:
  description: "Capability service for the SSA Workspaces project"
  version: "1.0.0"
  title: "Capability Service"
  contact:
    email: "dms-ssa@nrao.edu"
host: "ws-dev.nrao.edu"
tags:
  - name: "capabilities"
    description: "Access capabilities and create requests"
  - name: "requests"
    description: "Access and submit capability requests"
  - name: "workflows"
    description: "Access and submit workflow requests"
  /capabilities:
    get:
      tags:
        - "capabilities"
      summary: "View enabled capabilities"
      description: ""
      operationId: "view_enabled_capabilities"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/CapabilityList"
  /capabilities/available_qa_staff:
    get:
      tags:
        - "capabilities"
      summary: "View available QA staff"
      description: ""
      operationId: "retrieve_available_qa_staff_in_group"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: query
          name: "group"
          description: ""
          required: true
          type: "string"
      responses:
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/QaStaffList"
        "404":
          description: "no staff found"
  /capabilities/analyst_email:
    get:
      tags:
        - "capabilities"
      summary: "Get workspaces analyst email address"
      description: ""
      operationId: "get_analyst_email"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/AnalystEmail"
        "404":
          description: "No email address found"
  /capability/create:
    post:
      tags:
        - "capabilities"
      summary: "Create a new capability"
      description: ""
      operationId: "create_capability"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "400":
          description: "Invalid name supplied"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/Capability"
  /capability/{name}:
      - $ref: "#/parameters/capability-name"
    get:
      tags:
        - "capabilities"
      summary: "View the named capability"
      description: ""
      operationId: "view_capability"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "400":
          description: "Invalid name supplied"
        "404":
          description: "Capability not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/Capability"
    post:
      tags:
        - "capabilities"
      summary: "Update an existing capability"
      description: ""
      operationId: "edit_capability"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "body"
          description: "Capability object that needs to be added to the system"
          required: true
          schema:
            $ref: "#/definitions/Capability"
      responses:
        "400":
          description: "Invalid name supplied"
        "404":
          description: "Capability not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/Capability"
  /capability/{name}/enable:
    post:
      tags:
        - "capabilities"
      summary: "Enable a capability"
      operationId: "enable_capability"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - $ref: "#/parameters/capability-name"
      responses:
        "400":
          description: "Invalid name supplied"
        "404":
          description: "Capability not found"
  /capability/{name}/disable:
    post:
      tags:
        - "capabilities"
      summary: "Disable a capability"
      operationId: "disable_capability"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - $ref: "#/parameters/capability-name"
      responses:
        "400":
          description: "Invalid name supplied"
        "404":
          description: "Capability not found"
  /capability/{name}/request:
      - $ref: "#/parameters/capability-name"
    get:
      tags:
        - "requests"
      summary: "View the active capability requests"
      description: ""
      operationId: "view_active_capability_requests"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "400":
          description: "Invalid capability name or request ID supplied"
        "404":
          description: "Capability request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/CapabilityRequest"
  /capability/{name}/request/create:
    parameters:
      - $ref: "#/parameters/capability-name"
    post:
      tags:
        - "requests"
      summary: "Create a capability request"
      description: ""
      operationId: "create_capability_request"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "400":
          description: "Invalid capability name or request ID supplied"
        "404":
          description: "Capability request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/CapabilityRequest"
  /capability/request/{id}/followon/{followon_type}:
    parameters:
      - $ref: "#/parameters/capability-request-id"
      - in: path
        name: "followon_type"
        description: "name of capability for follow-on"
        required: true
        type: "string"
    post:
      tags:
        - "requests"
      summary: "Create a follow-on capability request"
      description: ""
      operationId: "create_followon_capability_request"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "400":
          description: "Invalid capability name or request ID supplied"
        "404":
          description: "Capability request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/CapabilityRequest"
  /capability/{name}/created-requests:
    parameters:
      - $ref: "#/parameters/capability-name"
    get:
      tags:
        - "requests"
      summary: "View the created capability requests"
      description: ""
      operationId: "view_created_capability_requests"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "400":
          description: "Invalid capability name or request ID supplied"
        "404":
          description: "Capability request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/CapabilityRequest"
  /capability/request/{id}:
    parameters:
      - $ref: "#/parameters/capability-request-id"
    get:
      tags:
        - "requests"
      summary: "View the identified capability request"
      description: ""
      operationId: "view_capability_request"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "400":
          description: "Invalid capability name or request ID supplied"
        "404":
          description: "Capability request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/CapabilityRequest"
    post:
      tags:
        - "requests"
      summary: "Update an existing capability request"
      description: ""
      operationId: "edit_capability_request"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - in: "body"
          name: "body"
          description: "Capability object that needs to be added to the system"
          required: true
          schema:
            $ref: "#/definitions/Capability"
      responses:
        "400":
          description: "Invalid name supplied"
        "404":
          description: "Capability not found"
    delete:
      tags:
        - "requests"
      summary: "Delete a capability request"
      description: ""
      operationId: "delete_capability_request"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "400":
          description: "Invalid name supplied"
        "403":
          description: "Permission denied; capability request already executed"
        "404":
          description: "Capability not found"
  /capability/request/{id}/submit:
    post:
      tags:
        - "requests"
      summary: "Submit a capability request for execution"
      description: ""
      operationId: "submit_capability_request"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - $ref: "#/parameters/capability-request-id"
      responses:
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/CapabilityExecution"
        "400":
          description: "Invalid name supplied"
        "404":
          description: "Capability not found"
  /capability/request/{id}/create-and-submit:
    post:
      tags:
        - "requests"
      summary: "Create and submit a capability request for execution in one step"
      description: "Mirror image of the workflow functionality of the same name."
      operationId: "create_and_submit_capability_request"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - $ref: "#/parameters/capability-request-id"
      responses:
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/CapabilityExecution"
        "400":
          description: "Invalid name supplied"
        "404":
          description: "Capability not found"
  /capability/request/{id}/close:
    post:
      tags:
        - "requests"
      summary: "Close a failed capability request."
      description: "Sets a capability request to sealed."
      operationId: "close_capability_request"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - $ref: '#/parameters/capability-request-id'
      responses:
        "404":
          description:
            "Capability request not found"
        "200":
          description: "successful operation"
          schema:
            type: string
  /capability/request/{id}/cancel:
    post:
      tags:
        - "requests"
      summary: "Cancel a capability request"
      description: ""
      operationId: "cancel_capability_request"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      parameters:
        - $ref: "#/parameters/capability-request-id"
      responses:
        "400":
          description: "Invalid name supplied"
        "404":
          description: "Capability not found"
  /capability/request/{id}/version/latest:
    parameters:
      - $ref: "#/parameters/capability-request-id"
    get:
      tags:
        - "requests"
      summary: "View the latest version of this capability request"
      description: ""
      operationId: "view_latest_version"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "400":
          description: "Invalid capability name or request ID supplied"
        "404":
          description: "Capability request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/CapabilityRequest"
  /capability/request/{id}/version/create:
    parameters:
      - $ref: "#/parameters/capability-request-id"
    post:
      tags:
        - "requests"
      summary: "Create a new version of this capability request"
      description: ""
      operationId: "create_capability_version"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "400":
          description: "Invalid capability name or request ID supplied"
        "404":
          description: "Capability request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/CapabilityRequest"
  /capability/request/{id}/version/{version_id}/internal_notes:
    parameters:
      - $ref: "#/parameters/capability-request-id"
      - $ref: "#/parameters/capability-version-id"
    get:
      tags:
        - "requests"
      summary: "Update the data analyst notes for this version"
      description: ""
      operationId: "view_internal_notes"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "412":
          description: "Invalid capability name or request ID supplied"
        "404":
          description: "Capability request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/Notes"
    post:
      tags:
        - "requests"
      summary: "Update the data analyst notes for this version"
      description: ""
      operationId: "update_internal_notes"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "412":
          description: "Invalid capability name or request ID supplied"
        "404":
          description: "Capability request not found"
        "200":
          description: "successful operation"
          schema:
            type: string
  /capability/request/{id}/version/{version_id}/workflow_metadata:
    parameters:
      - $ref: "#/parameters/capability-request-id"
      - $ref: "#/parameters/capability-version-id"
    get:
      tags:
        - "requests"
      summary: "Get the workflow metadata for this version"
      description: ""
      operationId: "view_version_metadata"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "200":
          description: "successful operation"
        "404":
          description: "Capability request not found"
    post:
      tags:
        - "requests"
      summary: "Edit the workflow metadata for this version"
      description: ""
      operationId: "edit_version_metadata"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "200":
          description: "successful operation"
        "404":
          description: "Capability request not found"
  /capability/request/{id}/version/srdp_compatible:
    parameters:
      - $ref: "#/parameters/capability-request-id"
      - $ref: "#/parameters/capability-version-id"
    post:
      tags:
        - "requests"
      summary: "Set the SRDP compatibility flag"
      description: ""
      operationId: "change_srdp_compatibility_version_metadata"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "200":
          description: "successful operation"
        "404":
          description: "Capability request not found"
        "500":
          description: "Unable to update"
        "400":
          description: "No metadata associated with this capability request version"
  /capability/request/{id}/version/latest/files/{filename}:
    parameters:
      - $ref: "#/parameters/capability-request-id"
      - $ref: "#/parameters/filename"
    put:
      tags:
        - "requests"
      summary: "Files in the latest version of this capability request"
      description: ""
      operationId: "update_file_for_latest"
      responses:
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/CapabilityVersionFile"
        "412":
          description: "No versions exist for this capability request"
        "404":
          description: "Capability request not found"
  /capability/request/execution/{request_id}:
    parameters:
        - $ref: "#/parameters/workflow-request-id"
    get:
      tags:
        - "requests"
      summary: "Get the execution for this workflow request ID"
      description: ""
      operationId: "get_execution_from_workflow_id"
      responses:
        412:
          description: "No capability exists for this workflow ID"
        200:
          description: "successful operation"
          schema:
            $ref: "#/definitions/CapabilityExecution"
  /capability/request/{id}/version/{version_id}/execution:
    parameters:
      - $ref: "#/parameters/capability-request-id"
      - $ref: "#/parameters/capability-version-id"
    get:
      tags:
        - "requests"
      summary: "Get the execution under this request and version"
      description: ""
      operationId: "get_execution_by_version"
      responses:
        412:
          description: "No capability exists for this workflow ID"
        200:
          description: "successful operation"
          schema:
            $ref: "#/definitions/CapabilityExecution"
  /capability/request/execution/{request_id}/create_version:
    parameters:
      - $ref: "#/parameters/workflow-request-id"
    post:
      tags:
        - "requests"
      summary: "Create a new capability version based on the supplied workflow request ID"
      description: ""
      operationId: "create_version_from_previous_execution_script"
      responses:
        412:
          description: "No capability exists for this workflow ID"
        200:
          description: "successful operation"
          schema:
            type: integer
  /workflows:
    get:
      tags:
        - "workflows"
      summary: "View the list of workflows"
      description: ""
      operationId: "Workflows.list_workflows"
      produces:
        - "application/json"
      responses:
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/WorkflowList"
  /workflows/{name}:
    get:
      tags:
        - "workflows"
      summary: "View the named workflow"
      description: ""
      operationId: "Workflows.get_workflow"
      parameters:
        - $ref: '#/parameters/workflow-name'
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "404":
          description:
            "Workflow not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/Workflow"
  /workflows/{name}/requests/create:
    post:
      tags:
        - "workflows"
      summary: "Create a workflow request"
      description: ""
      operationId: "WorkflowRequestRestService.create_workflow_request"
      parameters:
        - $ref: '#/parameters/workflow-name'
        - name: "body"
          in: "body"
          description: "Argument to the workflow"
          schema:
            type: "object"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "404":
          description:
            "Workflow not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/WorkflowRequest"
  /workflows/{name}/requests/create-and-submit:
    post:
      tags:
        - "workflows"
      summary: "Create and submit a workflow request"
      description: ""
      operationId: "WorkflowRequestRestService.create_and_submit_workflow_request"
      parameters:
        - $ref: '#/parameters/workflow-name'
        - name: "body"
          in: "body"
          description: "Argument to the workflow"
          schema:
            type: "object"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "404":
          description:
            "Workflow not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/WorkflowRequest"
  /workflows/{name}/requests/{request_id}:
    get:
      tags:
        - "workflows"
      summary: "View the workflow request with this ID"
      description: ""
      operationId: "WorkflowRequestRestService.get_workflow_request"
      parameters:
        - $ref: '#/parameters/workflow-name'
        - $ref: '#/parameters/workflow-request-id'
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "404":
          description:
            "Workflow request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/WorkflowRequest"
  /workflows/{name}/requests/{request_id}/dir/{*paths}:
    get:
      tags:
        - "workflows"
      summary: "View files in the working directory for the workflow request with this ID"
      description: ""
      operationId: "WorkflowWorkingDirRestService.show_workdir_content"
        - $ref: '#/parameters/workflow-name'
        - $ref: '#/parameters/workflow-request-id'
        - name: "*paths"
          description: "path to the file under this workflow request"
          required: true
          type: "string"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "404":
          description:
            "Workflow request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/WorkflowRequest"
  /workflows/{name}/requests/{request_id}/weblog:
    get:
      tags:
        - "workflows"
      summary: "View the weblog under this workflow request"
      description: ""
      operationId: "WorkflowWorkingDirRestService.serve_weblog"
      parameters:
        - $ref: '#/parameters/workflow-name'
        - $ref: '#/parameters/workflow-request-id'
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "404":
          description:
            "Workflow request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/WorkflowRequest"
  /workflows/{name}/requests/{request_id}/qa_notes:
    get:
      tags:
        - "workflows"
      summary: "View the QA notes under this workflow request"
      description: ""
      operationId: "WorkflowWorkingDirRestService.get_qa_notes"
      parameters:
        - $ref: '#/parameters/workflow-name'
        - $ref: '#/parameters/workflow-request-id'
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "404":
          description:
            "Workflow request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/Notes"
    post:
      tags:
        - "workflows"
      summary: "Save the QA notes for this workflow request"
      description: ""
      operationId: "WorkflowWorkingDirRestService.save_qa_notes"
      parameters:
        - $ref: '#/parameters/workflow-name'
        - $ref: '#/parameters/workflow-request-id'
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "404":
          description:
            "Workflow request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/Notes"
  /workflows/{name}/requests/{request_id}/html:
    get:
      tags:
        - "workflows"
      summary: "Access a CARTA instance"
      description: ""
      operationId: "WorkflowWorkingDirRestService.serve_carta_wrapper"
      parameters:
        - $ref: '#/parameters/workflow-name'
        - $ref: '#/parameters/workflow-request-id'
      produces:
        - "text/html"
      responses:
        200:
          description: "successful operation"
  /workflows/{name}/requests/{request_id}/htcondor_id:
    get:
      tags:
        - "workflows"
      summary: "Get the HTCondor ID for this request"
      description: ""
      operationId: "WorkflowRequestRestService.get_request_htcondor_id"
      parameters:
        - $ref: '#/parameters/workflow-name'
        - $ref: '#/parameters/workflow-request-id'
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "successful operation"
          schema:
            $ref: "#/definitions/HtCondorId"
  /workflows/requests/stale/{days}:
    get:
      tags:
        - "workflows"
      summary: "Get a list of stale requests"
      description: ""
      operationId: "WorkflowRequestRestService.get_stale_requests"
      parameters:
        - in: path
          name: days
          type: integer
          required: true
          description: "days back to look"
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        200:
          description: "successful operation"
          schema:
            $ref: "#/definitions/StaleDirectories"
  /workflows/{name}/requests/{request_id}/files:
    get:
      tags:
        - "workflows"
      summary: "See the files under this workflow request"
      description: ""
      operationId: "WorkflowFilesRestService.get_file"
      parameters:
        - $ref: '#/parameters/workflow-name'
        - $ref: '#/parameters/workflow-request-id'
      consumes:
        - "application/octet-stream"
      produces:
        - "application/json"
      responses:
        "400":
          description: "File already exists"
        "404":
          description:
            "Workflow request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/WorkflowRequestFile"
  /workflows/{name}/requests/{request_id}/files/{filename}:
    put:
      tags:
        - "workflows"
      summary: "Add a file to this workflow request"
      description: ""
      operationId: "WorkflowFilesRestService.add_file"
      parameters:
        - $ref: '#/parameters/workflow-name'
        - $ref: '#/parameters/workflow-request-id'
        - name: "filename"
          in: "path"
          description: "filename to add"
          type: "string"
          required: true
      consumes:
        - "application/octet-stream"
      produces:
        - "application/json"
      responses:
        "400":
          description: "File already exists"
        "404":
          description:
            "Workflow request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/WorkflowRequestFile"
  /workflows/{name}/requests/{request_id}/submit:
    post:
      tags:
        - "workflows"
      summary: "Submit the workflow request for execution"
      description: ""
      operationId: "WorkflowRequestRestService.submit_workflow"
      parameters:
        - $ref: '#/parameters/workflow-name'
        - $ref: '#/parameters/workflow-request-id'
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "404":
          description:
            "Workflow request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/WorkflowRequest"
  /workflows/{name}/requests/{request_id}/ingest:
    post:
      tags:
        - "workflows"
      summary: "Ingest the result of this workflow"
      description: ""
      operationId: "WorkflowRequestRestService.ingest"
      parameters:
        - $ref: '#/parameters/workflow-name'
        - $ref: '#/parameters/workflow-request-id'
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "404":
          description:
            "Workflow request not found"
        "200":
          description: "successful operation"
          schema:
            $ref: "#/definitions/WorkflowRequest"
  /workflows/requests/{request_id}/abort:
      summary: "Abort the execution of this running workflow"
      operationId: "WorkflowRequestRestService.abort"
      parameters:
        - $ref: '#/parameters/workflow-request-id'
      consumes:
        - "application/json"
      produces:
        - "application/json"
      responses:
        "404":
          description:
            "Workflow request not found"
        "200":
          description: "successful operation"
          schema:
            type: string