From 5d8fb4c3d8be332dff57fece94f1ab5a17890f5c Mon Sep 17 00:00:00 2001 From: Neha Singla Date: Mon, 24 Jun 2024 14:13:43 -0700 Subject: [PATCH] Adding workflow openapi.yaml --- api/openapi.yaml | 1434 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1434 insertions(+) create mode 100644 api/openapi.yaml diff --git a/api/openapi.yaml b/api/openapi.yaml new file mode 100644 index 00000000..16753fcb --- /dev/null +++ b/api/openapi.yaml @@ -0,0 +1,1434 @@ +openapi: 3.0.0 +info: + title: Jupyter Workflow API + version: 2.7.1 + description: API for Jupyter Workdflow, a JupyterLab extension for running notebook jobs. +servers: + - url: /scheduler +security: + - JupyterServerAuthHeader: [] + - JupyterServerAuthToken: [] +paths: + /jobs: + get: + summary: List jobs + operationId: listJobs + parameters: + - in: query + name: limit + schema: + type: integer + - in: query + name: offset + schema: + type: integer + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/DSListJobsResponse' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /jobs/{job_id}: + get: + summary: Get details of a specific job + parameters: + - name: job_id + in: path + required: true + schema: + type: string + responses: + '200': + description: Successfully retrieved job details. + content: + application/json: + schema: + $ref: '#/components/schemas/DSDescribeJob' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /job_definitions: + get: + summary: List job definitions + operationId: listJobDefinitions + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/DSListJobDefinitionsResponse' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + post: + summary: Create a new job definition + requestBody: + description: Payload to create a new job definition + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DSCreateJobDefinition' + responses: + '200': + description: Successfully created the job definition. + content: + application/json: + schema: + type: object + properties: + job_definition_id: + type: string + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /job_definitions/{job_definition_id}: + get: + summary: Get details of a specific job definition + parameters: + - name: job_definition_id + in: path + required: true + schema: + type: string + responses: + '200': + description: Successfully retrieved job definition details. + content: + application/json: + schema: + $ref: '#/components/schemas/DSDescribeJobDefinition' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + patch: + summary: Update a specific job definition + parameters: + - name: job_definition_id + in: path + required: true + schema: + type: string + requestBody: + description: Data for updating the job definition + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DSUpdateJobDefinition' + responses: + '204': + description: Job definition updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/DSDescribeJobDefinition' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + delete: + summary: Delete a specific job definition + parameters: + - name: job_definition_id + in: path + required: true + schema: + type: string + responses: + '204': + description: Successfully deleted the job definition. + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /job_definitions/{job_definition_id}/jobs: + post: + summary: Create a job from a job definition + parameters: + - name: job_definition_id + in: path + required: true + schema: + type: string + requestBody: + description: Parameters needed to create a job from this job definition + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateJobFromDefinition' + responses: + '200': + description: Successfully created the job from the job definition. + content: + application/json: + schema: + type: object + properties: + job_id: + type: string + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /v2/job_definitions/: + post: + summary: Create a new V2 job definition + requestBody: + description: Payload to create a new V2 job definition + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DSCreateJobDefinition' + responses: + '200': + description: Successfully created the job definition. + content: + application/json: + schema: + type: object + properties: + job_definition_id: + type: string + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + + /v2/job_definitions/{job_definition_id}: + get: + summary: Get details of a specific job definition + parameters: + - name: job_definition_id + in: path + required: true + schema: + type: string + responses: + '200': + description: Successfully retrieved job definition details. + content: + application/json: + schema: + $ref: '#/components/schemas/DSDescribeJobDefinition' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + patch: + summary: Update a specific job definition + parameters: + - name: job_definition_id + in: path + required: true + schema: + type: string + requestBody: + description: Data for updating the job definition + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DSUpdateJobDefinition' + responses: + '204': + description: Job definition updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/DSDescribeJobDefinition' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + summary: Delete a specific job definition + parameters: + - name: job_definition_id + in: path + required: true + schema: + type: string + responses: + '204': + description: Successfully deleted the job definition. + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /v2/job_definitions/{job_definition_id}/deploy: + post: + summary: Deploy a specific job definition + parameters: + - name: job_definition_id + in: path + required: true + schema: + type: string + responses: + '204': + description: Successfully deployed the job definition. + '500': + description: Server error + + /v2/job_definitions/{job_definition_id}/tasks: + get: + summary: Get list of tasks + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DSTask' + post: + summary: Create a new task + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DSTask' + responses: + '201': + description: Task created + + /v2/job_definitions/{job_definition_id}/tasks/{task_id}: + patch: + summary: Update a specific task in a job definition + parameters: + - name: job_definition_id + in: path + required: true + schema: + type: string + - name: task_id + in: path + required: true + schema: + type: string + requestBody: + description: Data for updating the task + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DSTask' + responses: + '200': + description: Job definition updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/DSDescribeJobDefinition' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + delete: + summary: Delete a specific task from job definition + parameters: + - name: job_definition_id + in: path + required: true + schema: + type: string + - name: task_id + in: path + required: true + schema: + type: string + responses: + '204': + description: Successfully deleted the task from job definition. + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /v2/scheduler/jobs: + get: + summary: List V2 jobs + operationId: lv2 istJobs + parameters: + - in: query + name: limit + schema: + type: integer + - in: query + name: offset + schema: + type: integer + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/DSListJobsResponse' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /v2/scheduler/jobs/{job_id}: + post: + summary: Manual Run a specific job + parameters: + - name: job_id + in: path + required: true + schema: + type: string + responses: + '200': + description: Successfully ran the job. + '500': + description: Server error + + get: + summary: Get details of a specific job + parameters: + - name: job_id + in: path + required: true + schema: + type: string + responses: + '200': + description: Successfully retrieved job details. + content: + application/json: + schema: + $ref: '#/components/schemas/DSDescribeJob' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /v2/scheduler/jobs/{job_id}/task_runs/{task_id}/download_files: + get: + summary: Download job files + parameters: + - name: job_id + in: path + required: true + schema: + type: string + - name: redownload + in: query + schema: + type: boolean + default: false + responses: + '204': + description: Files successfully downloaded or copied. + '500': + description: Error downloading files + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /v2/scheduler/job_definitions/{job_definition_id}/jobs: + post: + summary: Create a job from a job definition + parameters: + - name: job_definition_id + in: path + required: true + schema: + type: string + requestBody: + description: Parameters needed to create a job from this job definition + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateJobFromDefinition' + responses: + '200': + description: Successfully created the job from the job definition. + content: + application/json: + schema: + type: object + properties: + job_id: + type: string + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + + /jobs/{job_id}/download_files: + get: + summary: Download job files + parameters: + - name: job_id + in: path + required: true + schema: + type: string + - name: redownload + in: query + schema: + type: boolean + default: false + responses: + '204': + description: Files successfully downloaded or copied. + '500': + description: Error downloading files + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /jobs/count: + get: + summary: Count jobs based on status + parameters: + - name: status + in: query + schema: + $ref: '#/components/schemas/Status' + responses: + '200': + description: Successfully counted jobs. + content: + application/json: + schema: + type: object + properties: + count: + type: integer + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /runtime_environments: + get: + summary: List available runtime environments + responses: + '200': + description: Successfully listed runtime environments. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RuntimeEnvironment' + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /config: + get: + summary: Get configuration details + responses: + '200': + description: Successfully retrieved configuration details. + content: + application/json: + schema: + type: object + properties: + supported_features: + type: array + items: + type: string + manage_environments_command: + type: string + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /batch/jobs: + delete: + summary: Batch delete jobs + parameters: + - name: job_id + in: query + schema: + type: array + items: + type: string + responses: + '204': + description: Successfully deleted the specified jobs. + '500': + description: Server error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /files: + get: + summary: Get list of files + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DSFile' + post: + summary: Create a new file + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DSFile' + responses: + '201': + description: File created + + /files/{fileId}: + get: + summary: Get a file by ID + parameters: + - name: fileId + in: path + required: true + schema: + type: string + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/DSFile' + put: + summary: Update a file by ID + parameters: + - name: fileId + in: path + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DSFile' + responses: + '200': + description: File updated + delete: + summary: Delete a file by ID + parameters: + - name: fileId + in: path + required: true + schema: + type: string + responses: + '204': + description: File deleted + + /namespaces: + get: + summary: Get list of namespaces + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DSNamespace' + post: + summary: Create a new namespace + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DSNamespace' + responses: + '201': + description: Namespace created + + /namespaces/{namespaceId}: + get: + summary: Get a namespace by ID + parameters: + - name: namespaceId + in: path + required: true + schema: + type: string + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/DSNamespace' + put: + summary: Update a namespace by ID + parameters: + - name: namespaceId + in: path + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DSNamespace' + responses: + '200': + description: Namespace updated + delete: + summary: Delete a namespace by ID + parameters: + - name: namespaceId + in: path + required: true + schema: + type: string + responses: + '204': + description: Namespace deleted + +components: + securitySchemes: + JupyterServerAuthHeader: + type: apiKey + in: header + name: Authorization + description: "Authentication managed by the Jupyter Server using a token provided in the Authorization header. See Jupyter Server documentation for more details." + JupyterServerAuthToken: + type: apiKey + in: query + name: token + description: "Authentication managed by the Jupyter Server using a token provided as a query parameter. See Jupyter Server documentation for more details." + + schemas: + Error: + type: object + properties: + message: + type: string + Status: + type: string + enum: [CREATED, QUEUED, IN_PROGRESS, COMPLETED, FAILED, STOPPING, STOPPED] + SortField: + type: object + properties: + name: + type: string + direction: + type: string + enum: [asc, desc] + DSDescribeJob: + type: object + properties: + job_id: + type: string + input_filename: + type: string + runtime_environment_name: + type: string + runtimeProperties: + type: object + additionalProperties: + type: string + runtime_environment_parameters: + type: object + additionalProperties: + type: string + idempotency_token: + type: string + job_definition_id: + type: string + parameters: + type: object + additionalProperties: + type: string + tags: + type: array + items: + type: string + name: + type: string + output_filename_template: + type: string + compute_type: + type: string + job_id: + type: string + job_files: + type: array + items: + $ref: '#/components/schemas/JobFile' + url: + type: string + create_time: + type: integer + update_time: + type: integer + start_time: + type: integer + end_time: + type: integer + status: + $ref: '#/components/schemas/Status' + status_message: + type: string + downloaded: + type: boolean + notificationEvents: + type: array + items: + type: string + notificationEmails: + type: array + items: + type: string + externalLinks: + type: array + items: + type: string + input_file_id: + type: string + output_file_id: + type: string + outputPreviewLink: + type: string + output_formats: + type: array + items: + type: string + slackChannel: + type: string + scheduleStartDate: + type: string + taskTimeout: + type: string + showOutputInEmail: + type: boolean + task_runs: + type: array + items: + $ref: '#/components/schemas/DSDescribeJobTask' + tasks: + type: array + items: + $ref: '#/components/schemas/DSDesribeJobfinitionTask' + runId: + type: string + DSDescribeJobTask: + type: object + properties: + job_id: + type: string + input_filename: + type: string + runtime_environment_name: + type: string + runtimeProperties: + type: object + additionalProperties: + type: string + runtime_environment_parameters: + type: object + additionalProperties: + type: string + idempotency_token: + type: string + job_definition_id: + type: string + parameters: + type: object + additionalProperties: + type: string + tags: + type: array + items: + type: string + name: + type: string + output_filename_template: + type: string + compute_type: + type: string + job_id: + type: string + job_files: + type: array + items: + $ref: '#/components/schemas/JobFile' + url: + type: string + create_time: + type: integer + update_time: + type: integer + start_time: + type: integer + end_time: + type: integer + status: + $ref: '#/components/schemas/Status' + status_message: + type: string + downloaded: + type: boolean + notificationEvents: + type: array + items: + type: string + notificationEmails: + type: array + items: + type: string + externalLinks: + type: array + items: + type: string + input_file_id: + type: string + output_file_id: + type: string + outputPreviewLink: + type: string + output_formats: + type: array + items: + type: string + slackChannel: + type: string + scheduleStartDate: + type: string + taskTimeout: + type: string + showOutputInEmail: + type: boolean + task_runs: + type: array + items: + $ref: '#/components/schemas/DSDescribeJobTask' + tasks: + type: array + items: + $ref: '#/components/schemas/DSDesribeJobfinitionTask' + runId: + type: string + run_count: + type: integer + taskId: + type: string + dependsOn: + type: array + items: + type: string + DSListJobsResponse: + type: object + properties: + jobs: + type: array + items: + $ref: '#/components/schemas/DSDescribeJob' + total_count: + type: integer + next_token: + type: string + DSCreateJobDefinition: + type: object + properties: + input_uri: + type: string + input_filename: + type: string + runtime_environment_name: + type: string + runtime_environment_parameters: + type: object + additionalProperties: + type: string + output_formats: + type: array + items: + type: string + runtimeProperties: + type: object + additionalProperties: + type: string + parameters: + type: object + additionalProperties: + type: string + tags: + type: array + items: + type: string + name: + type: string + output_filename_template: + type: string + compute_type: + type: string + schedule: + type: string + timezone: + type: string + kernelSpecId: + type: string + namespaceId: + type: string + notificationEvents: + type: array + items: + type: string + notificationEmails: + type: array + items: + type: string + slackChannel: + type: string + scheduleStartDate: + type: string + taskTimeout: + type: string + showOutputInEmail: + type: boolean + tasks: + type: array + items: + $ref: '#/components/schemas/DSTask' + notebookParameters: + type: object + additionalProperties: + type: string + DSDescribeJobDefinition: + type: object + properties: + input_filename: + type: string + id: + type: string + name: + type: string + kernelSpecId: + type: string + namespaceId: + type: string + kernelSpecVersion: + type: string + kernelProfileId: + type: string + kernelProfileVersion: + type: string + namespaceId: + type: string + runtimeProperties: + type: object + additionalProperties: + type: string + notificationEvents: + type: array + items: + type: string + notificationEmails: + type: array + items: + type: string + notebookParameters: + type: object + additionalProperties: + type: string + slackChannel: + type: string + scheduleStartDate: + type: string + taskTimeout: + type: string + showOutputInEmail: + type: boolean + output_formats: + type: array + items: + type: string + inputFiles: + type: array + items: + $ref: '#/components/schemas/DSFile' + taskTimeout: + type: string + runtime_environment_name: + type: string + runtime_environment_parameters: + type: object + additionalProperties: + type: string + input_file_id: + type: string + active: + type: boolean + status: + type: string + statusMessage: + type: string + input_file_path: + type: string + externalLinks: + type: array + items: + type: string + timezone: + type: string + job_definition_id: + type: string + parameters: + type: object + additionalProperties: + type: string + version: + type: string + deploy_time: + type: integer + create_time: + type: integer + update_time: + type: integer + tasks: + type: array + items: + $ref: '#/components/schemas/DSDesribeJobfinitionTask' + tags: + type: array + items: + type: string + schedule: + type: string + timezone: + type: string + DSUpdateJobDefinition: + type: object + properties: + runtime_environment_name: + type: string + runtimeProperties: + type: object + additionalProperties: + type: string + output_formats: + type: array + items: + type: string + parameters: + type: object + additionalProperties: + type: string + tags: + type: array + items: + type: string + name: + type: string + url: + type: string + schedule: + type: string + timezone: + type: string + output_filename_template: + type: string + active: + type: boolean + compute_type: + type: string + input_uri: + type: string + kernelSpecId: + type: string + notificationEvents: + type: array + items: + type: string + notificationEmails: + type: array + items: + type: string + input_file_id: + type: string + slackChannel: + type: string + scheduleStartDate: + type: string + taskTimeout: + type: string + showOutputInEmail: + type: boolean + tasks: + type: array + items: + $ref: '#/components/schemas/DSTask' + DSDescribeJob: + type: object + properties: + job_id: + type: string + name: + type: string + status: + type: string + create_time: + type: integer + update_time: + type: integer + start_time: + type: integer + end_time: + type: integer + task_runs: + type: array + items: + $ref: '#/components/schemas/DSDescribeJobTask' + DSListJobsResponse: + type: object + properties: + jobs: + type: array + items: + $ref: '#/components/schemas/DSDescribeJob' + total_count: + type: integer + next_token: + type: string + DSListJobDefinitionsResponse: + type: object + properties: + job_definitions: + type: array + items: + $ref: '#/components/schemas/DSDescribeJobDefinition' + total_count: + type: integer + next_token: + type: string + DSTask: + type: object + properties: + id: + type: string + nodeId: + type: string + name: + type: string + kernelSpecId: + type: string + kernelSpecVersion: + type: string + kernelProfileId: + type: string + kernelProfileVersion: + type: string + namespaceId: + type: string + runtimeProperties: + type: object + additionalProperties: + type: string + notebookParameters: + type: object + additionalProperties: + type: string + outputFormats: + type: array + items: + type: string + inputFiles: + type: array + items: + $ref: '#/components/schemas/DSFile' + taskTimeout: + type: string + showOutputInEmail: + type: boolean + slackChannel: + type: string + input_uri: + type: string + input_filename: + type: string + triggerRule: + type: string + dependsOn: + type: array + items: + type: string + createdAt: + type: string + lastModifiedAt: + type: string + status: + type: string + statusMessage: + type: string + input_file_id: + type: string + DSDesribeJobfinitionTask: + type: object + properties: + id: + type: string + nodeId: + type: string + name: + type: string + kernelSpecId: + type: string + namespaceId: + type: string + kernelSpecVersion: + type: string + kernelProfileId: + type: string + kernelProfileVersion: + type: string + status: + type: string + status_message: + type: string + create_time: + type: string + update_time: + type: string + runtimeProperties: + type: object + additionalProperties: + type: string + inputFiles: + type: array + items: + $ref: '#/components/schemas/DSFile' + taskTimeout: + type: string + showOutputInEmail: + type: boolean + slackChannel: + type: string + input_uri: + type: string + input_filename: + type: string + triggerRule: + type: string + dependsOn: + type: array + items: + type: string + output_formats: + type: array + items: + type: string + parameters: + type: object + additionalProperties: + type: string + create_time: + type: string + update_time: + type: string + status: + type: string + statusMessage: + type: string + input_file_id: + type: string + notebookParameters: + type: object + additionalProperties: + type: string + notificationEmails: + type: object + additionalProperties: + type: string + DSFile: + type: object + properties: + id: + type: string + name: + type: string