From 904cfa5b0b62d9b85d1f46d3eab28f73618b2cb1 Mon Sep 17 00:00:00 2001 From: Nathan Freeman Date: Thu, 12 Oct 2023 12:36:29 -0500 Subject: [PATCH] remove Event model and all associated endpoints --- CHANGELOG.md | 8 + .../src/CONTRIBUTORS.md => CONTRIBUTORS.md | 0 src/api/specs/WorkflowsAPI.yaml | 144 +- src/api/src/backend/models.py | 20 - .../backend/services/PipelineDispatcher.py | 2 + src/api/src/backend/urls.py | 9 +- src/api/src/backend/views/Events.py | 144 - src/api/src/backend/views/RunPipeline.py | 77 + .../src/backend/views/RunPipelineWebhook.py | 139 - src/api/src/backend/views/http/requests.py | 22 +- src/engine/src/CHANGELOG.md | 39 - src/shared/OWESpec.yaml | 3283 ----------------- 12 files changed, 100 insertions(+), 3787 deletions(-) rename src/engine/src/CONTRIBUTORS.md => CONTRIBUTORS.md (100%) delete mode 100644 src/api/src/backend/views/Events.py create mode 100644 src/api/src/backend/views/RunPipeline.py delete mode 100644 src/api/src/backend/views/RunPipelineWebhook.py delete mode 100644 src/engine/src/CHANGELOG.md delete mode 100644 src/shared/OWESpec.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 39fb88c8..a3c00b2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Breaking Changes - runPipeline request schema changed. 'params' was changed to 'args' +- runPipeline response schema change. Now returns a RespPipelineRun; previously return RespEvent +- runPipeline OpenAPI spec to reflect the change in the request and response schema - requires regenerating tapipy and tapis-typescript. Will break UI that depend on tapis-typescript +- removed the Event model and all associated endpoints, req/resp schemas, and req/resp models in the OpenAPI spec +- changed the endpoint of the runPipeline operation from `.../events` to `.../run` +- updated the OpenAPI spec to reflect the change in the url endpoint for the runPipeline operation +- removed the runPipelineWebhook endpoints, req/resp schemas, and req/resp models in the OpenAPI spec ### Features - Initial release of the owe-python-sdk. Used in both the workflow engine and Tapis Workflows API @@ -20,6 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Templating and Inheritence** - Introduced the template type task - Added pipeline and task inheritence via the 'uses' property on pipelines and tasks +- **Tapis ETL Pipeline** + - ### non-Breaking Changes - Refactored Tapis-specific logic from the workflow engine into a Plugin diff --git a/src/engine/src/CONTRIBUTORS.md b/CONTRIBUTORS.md similarity index 100% rename from src/engine/src/CONTRIBUTORS.md rename to CONTRIBUTORS.md diff --git a/src/api/specs/WorkflowsAPI.yaml b/src/api/specs/WorkflowsAPI.yaml index 093726f1..2e5a44b5 100644 --- a/src/api/specs/WorkflowsAPI.yaml +++ b/src/api/specs/WorkflowsAPI.yaml @@ -39,8 +39,6 @@ tags: description: Manage collections of tasks. Create, retrieve and delete. - name: Tasks description: Manage tasks to be executed as part of a workflow. Create, retrieve and delete. - - name: Events - description: Trigger workflows. Create and retrieve. - name: CI/CD description: Create CI/CD-specific workflows (Image builds and http requests). @@ -1345,40 +1343,6 @@ paths: schema: $ref: '#/components/schemas/RespError' - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/webhook': - post: - tags: - - Events - summary: Trigger a pipeline run - description: | - Trigger a pipeline run - operationId: runPipelineWebhook - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - requestBody: - required: true - description: A JSON object specifying information for the pipeline to be created. - content: - application/json: - schema: - $ref: '#/components/schemas/ReqWebhookEvent' - responses: - '200': - description: Events found. - content: - application/json: - schema: - $ref: '#/components/schemas/RespEvent' - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/tasks': post: tags: @@ -1773,35 +1737,10 @@ paths: schema: $ref: '#/components/schemas/RespTaskExecutionList' - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/events': - get: - tags: - - Events - summary: Retrieve Event details - description: | - Retrieve all events for a given pipeline - operationId: listEvents - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - responses: - '200': - description: Events found. - content: - application/json: - schema: - $ref: '#/components/schemas/RespEvent' + '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/run': post: tags: - - Events + - Pipelines summary: Trigger a pipeline run description: | Trigger a pipeline run @@ -1826,11 +1765,11 @@ paths: $ref: '#/components/schemas/ReqRunPipeline' responses: '200': - description: Events found. + description: Pipeline triggered successfully. content: application/json: schema: - $ref: '#/components/schemas/RespEvent' + $ref: '#/components/schemas/RespPipelineRun' # ------------------------------------------------------------------------------ # --- Components --------------------------------------------------------------- @@ -1855,6 +1794,10 @@ components: type: object additionalProperties: true + Args: + type: object + additionalProperties: true + ExecutionProfile: type: object properties: @@ -2249,38 +2192,6 @@ components: credentials: type: string - Event: - type: object - properties: - branch: - type: string - default: null - commit: - type: string - default: null - commit_sha: - type: string - default: null - context_url: - type: string - default: null - directives: - type: string - message: - type: string - pipeline: - type: string - source: - type: string - username: - $ref: '#/components/schemas/Username' - identity: - type: string - default: null - uuid: - type: string - format: uuid - GitRepository: type: object properties: @@ -2856,27 +2767,11 @@ components: ReqTapisJobDef: $ref: "https://raw.githubusercontent.com/tapis-project/tapis-client-java/prod/jobs-client/src/main/resources/JobsAPI.yaml#components/schemas/ReqSubmitJob" - ReqWebhookEvent: - type: object - properties: - branch: - type: string - commit: - type: string - commit_sha: - type: string - source: - $ref: '#/components/schemas/EnumContextType' - context_url: - type: string - username: - type: string - ReqRunPipeline: type: object properties: - params: - $ref: "#/components/schemas/Params" + args: + $ref: "#/components/schemas/Args" directives: type: array items: @@ -2913,7 +2808,6 @@ components: properties: logs: type: string - # ------------------------------------------------------------------------- # --- Response objects ---------------------------------------------------- @@ -3135,24 +3029,6 @@ components: items: $ref: '#/components/schemas/Task' - RespEvent: - allOf: - - $ref: '#/components/schemas/RespObject' - - type: object - properties: - result: - $ref: '#/components/schemas/Event' - - # RespEventList: - # allOf: - # - $ref: '#/components/schemas/RespList' - # - type: object - # properties: - # result: - # type: array - # items: - # $ref: '#/components/schemas/Event' - # ------------------------------------------------------------------------- # --- Enums --------------------------------------------------------------- # ------------------------------------------------------------------------- diff --git a/src/api/src/backend/models.py b/src/api/src/backend/models.py index 431c0431..5c84f6b3 100644 --- a/src/api/src/backend/models.py +++ b/src/api/src/backend/models.py @@ -309,26 +309,6 @@ class Destination(models.Model): uuid = models.UUIDField(primary_key=True, default=uuid.uuid4) identity = models.ForeignKey("backend.Identity", null=True, on_delete=models.CASCADE) -class Event(models.Model): - branch = models.CharField(max_length=255, null=True) - commit = models.TextField(max_length=255, null=True) - commit_sha = models.CharField(max_length=128, null=True) - context_url = models.CharField(max_length=128, null=True) - created_at = models.DateTimeField(auto_now_add=True) - cron = models.CharField(null=True, max_length=128) - directives = models.JSONField(null=True) - group = models.ForeignKey("backend.Group", related_name="events", null=True, on_delete=models.CASCADE) - message = models.TextField() - pipeline = models.ForeignKey("backend.Pipeline", related_name="events", null=True, on_delete=models.CASCADE) - source = models.CharField(max_length=255) - username = models.CharField(max_length=64, null=True) - uuid = models.UUIDField(primary_key=True, default=uuid.uuid4) - class Meta: - indexes = [ - models.Index(fields=["pipeline_id"]), - models.Index(fields=["username"]) - ] - class Group(models.Model): id = models.CharField(validators=[validate_id], max_length=128, unique=True) created_at = models.DateTimeField(auto_now_add=True) diff --git a/src/api/src/backend/services/PipelineDispatcher.py b/src/api/src/backend/services/PipelineDispatcher.py index 7296e81c..55405508 100644 --- a/src/api/src/backend/services/PipelineDispatcher.py +++ b/src/api/src/backend/services/PipelineDispatcher.py @@ -57,6 +57,8 @@ def dispatch(self, service_request: dict, pipeline): message = f"Failed publish the service request to the message broker: {e.__cause__}" logging.error(message) raise ServerError(message=message) + + return pipeline_run def _uuid_convert(self, obj): if isinstance(obj, UUID): diff --git a/src/api/src/backend/urls.py b/src/api/src/backend/urls.py index b9ef477d..f52da592 100644 --- a/src/api/src/backend/urls.py +++ b/src/api/src/backend/urls.py @@ -3,8 +3,7 @@ from backend.views.Tasks import Tasks from backend.views.Auth import Auth -from backend.views.RunPipelineWebhook import RunPipelineWebhook -from backend.views.Events import Events +from backend.views.RunPipeline import RunPipeline from backend.views.Groups import Groups from backend.views.HealthCheck import HealthCheck from backend.views.Identities import Identities @@ -63,11 +62,7 @@ path("groups//pipelines//archives/remove", RemovePipelineArchive.as_view(), name="removePipelineArchive"), # Trigger pipelines - path("groups//pipelines//webhook", RunPipelineWebhook.as_view(), name="runPipelineWebhook"), - path("groups//pipelines//events", Events.as_view(), name="events"), - - # Events - path("groups//pipelines//events/", Events.as_view(), name="event"), + path("groups//pipelines//run", RunPipeline.as_view(), name="runPipeline"), # Pipeline Runs path("groups//pipelines//runs", PipelineRuns.as_view(), name="pipelineRuns"), diff --git a/src/api/src/backend/views/Events.py b/src/api/src/backend/views/Events.py deleted file mode 100644 index 548af5af..00000000 --- a/src/api/src/backend/views/Events.py +++ /dev/null @@ -1,144 +0,0 @@ -from django.db import DatabaseError, IntegrityError, OperationalError - -from backend.views.RestrictedAPIView import RestrictedAPIView -from backend.views.http.requests import APIEvent -from backend.views.http.responses.models import ModelListResponse, ModelResponse -from backend.views.http.responses.errors import ( - ServerError as ServerErrorResp, - MethodNotAllowed, - Forbidden, - NotFound, - BadRequest -) -from backend.errors.api import ServerError -from backend.helpers.PipelineDispatchRequestBuilder import PipelineDispatchRequestBuilder -from backend.services.PipelineDispatcher import service as pipeline_dispatcher -from backend.services.GroupService import service as group_service -from backend.services.SecretService import service as secret_service -from backend.models import Event, Pipeline - - -request_builder = PipelineDispatchRequestBuilder(secret_service) - -class Events(RestrictedAPIView): - def post(self, request, group_id, pipeline_id, *_, **__): - prepared_request = self.prepare(APIEvent) - - if not prepared_request.is_valid: - return prepared_request.failure_view - - body = prepared_request.body - - # Get the group - group = group_service.get(group_id, request.tenant_id) - if group == None: - return NotFound(f"No group found with id '{group_id}'") - - # Check that the user belongs to the group - if not group_service.user_in_group(request.username, group_id, request.tenant_id): - return Forbidden(message="You do not have access to this group") - - # Find a pipeline that matches the request data - pipeline = Pipeline.objects.filter( - id=pipeline_id, - group=group - ).prefetch_related( - "group", - "archives", - "archives__archive", - "tasks", - "tasks__context", - "tasks__context__credentials", - "tasks__context__identity", - "tasks__destination", - "tasks__destination__credentials", - "tasks__destination__identity", - ).first() - - message = "No Pipeline found with details that match this event" - if pipeline != None: - # Check that the user belongs to the group that is attached - # to this pipline - message = f"Successfully triggered pipeline ({pipeline.id})" - - # Persist the event in the database - try: - event = Event.objects.create( - message=message, - pipeline=pipeline, - source="api", - username=request.username, - ) - except (IntegrityError, OperationalError, DatabaseError) as e: - return ServerErrorResp(message=e.__cause__) - - # Return the event if there is no pipeline matching the event - if pipeline == None: - return ModelResponse(event) - - - try: - # Build the pipeline dispatch request - pipeline_dispatch_request = request_builder.build( - request.base_url, - group, - pipeline, - event, - directives=body.directives, - params=body.params - ) - - # Dispatch the request - pipeline_dispatcher.dispatch(pipeline_dispatch_request, pipeline) - except ServerError as e: - return ServerErrorResp(message=str(e)) - except Exception as e: - print(str(e)) - return ServerErrorResp(message=str(e)) - - # Respond with the event - return ModelResponse(event) - - def get(self, request, group_id, pipeline_id, event_uuid=None): - # Get the group - group = group_service.get(group_id, request.tenant_id) - if group == None: - return NotFound(f"No group found with id '{group_id}'") - - # Check that the user belongs to the group - if not group_service.user_in_group(request.username, group_id, request.tenant_id): - return Forbidden(message="You do not have access to this group") - - # Get the pipline - pipeline = Pipeline.objects.filter( - group=group, - id=pipeline_id - ).first() - - # Return if BadRequest if no pipeline found - if pipeline == None: - return BadRequest(f"Pipline '{pipeline_id}' does not exist") - - # Return a list of events if uuid is not specified - if event_uuid == None: - return self.list(pipeline) - - event = Event.objects.filter(uuid=event_uuid).first() - - if event == None: - return NotFound(f"Event with uuid '{event_uuid}' not found in pipeline '{pipeline_id}'") - - return ModelResponse(event) - - def list(self, pipeline): - events = Event.objects.filter(pipeline=pipeline) - return ModelListResponse(events) - - def put(self, *args, **kwargs): - return MethodNotAllowed(message="Events cannot be updated") - - def patch(self, *args, **kwargs): - return MethodNotAllowed(message="Events cannot be updated") - - def delete(self, *args, **kwargs): - return MethodNotAllowed(message="Events cannot be deleted") \ No newline at end of file diff --git a/src/api/src/backend/views/RunPipeline.py b/src/api/src/backend/views/RunPipeline.py new file mode 100644 index 00000000..22c97d15 --- /dev/null +++ b/src/api/src/backend/views/RunPipeline.py @@ -0,0 +1,77 @@ +from django.db import DatabaseError, IntegrityError, OperationalError + +from backend.views.RestrictedAPIView import RestrictedAPIView +from backend.views.http.requests import ReqRunPipeline +from backend.views.http.responses.models import ModelListResponse, ModelResponse +from backend.views.http.responses.errors import ( + ServerError as ServerErrorResp, + MethodNotAllowed, + Forbidden, + NotFound, + BadRequest +) +from backend.errors.api import ServerError +from backend.helpers.PipelineDispatchRequestBuilder import PipelineDispatchRequestBuilder +from backend.services.PipelineDispatcher import service as pipeline_dispatcher +from backend.services.GroupService import service as group_service +from backend.services.SecretService import service as secret_service +from backend.models import Event, Pipeline + + +request_builder = PipelineDispatchRequestBuilder(secret_service) + +class RunPipeline(RestrictedAPIView): + def post(self, request, group_id, pipeline_id, *_, **__): + prepared_request = self.prepare(ReqRunPipeline) + + if not prepared_request.is_valid: + return prepared_request.failure_view + + body = prepared_request.body + + # Get the group + group = group_service.get(group_id, request.tenant_id) + if group == None: + return NotFound(f"No group found with id '{group_id}'") + + # Check that the user belongs to the group + if not group_service.user_in_group(request.username, group_id, request.tenant_id): + return Forbidden(message="You do not have access to this group") + + # Find a pipeline that matches the request data + pipeline = Pipeline.objects.filter( + id=pipeline_id, + group=group + ).prefetch_related( + "group", + "archives", + "archives__archive", + "tasks", + "tasks__context", + "tasks__context__credentials", + "tasks__context__identity", + "tasks__destination", + "tasks__destination__credentials", + "tasks__destination__identity", + ).first() + + + try: + # Build the pipeline dispatch request + pipeline_dispatch_request = request_builder.build( + request.base_url, + group, + pipeline, + directives=body.directives, + params=body.params + ) + + # Dispatch the request + pipeline_run = pipeline_dispatcher.dispatch(pipeline_dispatch_request, pipeline) + except ServerError as e: + return ServerErrorResp(message=str(e)) + except Exception as e: + return ServerErrorResp(message=str(e)) + + # Respond with the pipeline run + return ModelResponse(pipeline_run) \ No newline at end of file diff --git a/src/api/src/backend/views/RunPipelineWebhook.py b/src/api/src/backend/views/RunPipelineWebhook.py deleted file mode 100644 index f0ec7b0e..00000000 --- a/src/api/src/backend/views/RunPipelineWebhook.py +++ /dev/null @@ -1,139 +0,0 @@ -from django.db import IntegrityError, DatabaseError, OperationalError - -from backend.views.APIView import APIView -from backend.views.http.requests import WebhookEvent -from backend.views.http.responses.models import ModelResponse -from backend.views.http.responses.errors import ServerError as ServerErrorResp, NotFound -from backend.services.PipelineDispatcher import service as pipeline_dispatcher -from backend.services.SecretService import service as secret_service -from backend.services.GroupService import service as group_service -from backend.models import Identity, Event, Pipeline, GroupUser -from backend.helpers.PipelineDispatchRequestBuilder import PipelineDispatchRequestBuilder -from backend.errors.api import ServerError - - -WEBHOOK_SOURCE_GITHUB = "github" -WEBHOOK_SOURCE_GITLAB = "gitlab" -WEBHOOK_SOURCES = [WEBHOOK_SOURCE_GITHUB, WEBHOOK_SOURCE_GITLAB] - -request_builder = PipelineDispatchRequestBuilder(secret_service) - -class RunPipelineWebhook(APIView): - def post(self, request, group_id, pipeline_id): - prepared_request = self.prepare(WebhookEvent) - - if not prepared_request.is_valid: - return prepared_request.failure_view - - body = prepared_request.body - - # Get the group - group = group_service.get(group_id, request.tenant_id) - if group == None: - return NotFound(f"No group found with id '{group_id}'") - - # Find a pipeline that matches the request data - pipeline = Pipeline.objects.filter( - id=pipeline_id, - group=group - ).prefetch_related( - "group", - "archives", - "archives__archive", - "tasks", - "tasks__context", - "tasks__context__credentials", - "tasks__context__identity", - "tasks__destination", - "tasks__destination__credentials", - "tasks__destination__identity", - ).first() - - # Return event if pipeline does not exist - if pipeline == None: - return NotFound(f"No pipeline found with id '{pipeline_id}'") - - # Ensure the identity of the user triggering the pipeline is - # authorized to do so - group_users = GroupUser.objects.filter(group=group) - - identities = [] - for group_user in group_users: - identities = identities + list( - Identity.objects.filter( - owner=group_user.username, - tenant_id=request.tenant_id, - type=body.source - ).prefetch_related("credentials") - ) - - # If an identity is found with the username provided in the - # webhook notification, this pipeline can be dispatched - username = None - for identity in identities: - # Fetch the secret from SK - secret = secret_service.get_secret(identity.credentials.sk_id) - if secret == None: break - - # Get the username from the secret - identity_username = secret.get("username", None) - if identity_username == None: break - - if identity_username == body.username: - username = identity.owner - break - - if username == None: - event = self._create_event( - body, - group, - pipeline, - f"Pipeline failed to run. No identity found with type '{body.source}' and username '{body.username}'" - ) - return ModelResponse(event) - - # Create the event - try: - event = self._create_event( - body, - group, - pipeline, - f"Successfully triggered pipeline ({pipeline.id})", - username=username - ) - except ServerError as e: - return ServerErrorResp(message=e) - - # Build the pipeline dispatch request - pipeline_dispatch_request = request_builder.build( - request.base_url, - group, - pipeline, - event, - commit=body.commit - ) - - # Dispatch the request - pipeline_dispatcher.dispatch(pipeline_dispatch_request, pipeline) - - # Respond with the event - return ModelResponse(event) - - def _create_event(self, body, group, pipeline, message, username=None): - # Persist the event in the database - try: - event = Event.objects.create( - branch=body.branch, - commit=body.commit, - commit_sha=body.commit_sha, - context_url=body.context_url, - message=message, - group=group, - pipeline=pipeline, - source=body.source, - username=username - ) - except (IntegrityError, DatabaseError, OperationalError) as e: - raise ServerError(e.__cause__) - - return event \ No newline at end of file diff --git a/src/api/src/backend/views/http/requests.py b/src/api/src/backend/views/http/requests.py index 3eaca202..62d5b4a9 100644 --- a/src/api/src/backend/views/http/requests.py +++ b/src/api/src/backend/views/http/requests.py @@ -443,30 +443,10 @@ class LocalDestination(BaseDestination): type: Literal["local"] filename: str = None -# Events -class BaseEvent(BaseModel): - branch: str = None - directives: str = None - commit: str = None - commit_sha: str = None - context_url: str = None - pipeline_id: str = None - source: str = None - username: str = None - -class APIEvent(BaseEvent): +class ReqRunPipeline(BaseModel): args: Args = {} directives: List[str] = None -class WebhookEvent(BaseEvent): - branch: str - commit: str - commit_sha: str - source: str - context_url: str - username: str - tenant_id: str - # Groups and Users class GroupUserReq(BaseModel): username: str diff --git a/src/engine/src/CHANGELOG.md b/src/engine/src/CHANGELOG.md deleted file mode 100644 index 8ab556d2..00000000 --- a/src/engine/src/CHANGELOG.md +++ /dev/null @@ -1,39 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.3.1] - 2023-xx-xx - -### Features -- Function Task - Running arbitrary code a the specified language and runtime environment -- Tapis Actor Task - Execute an Abaco Actor. Includes all linked Actors -- Tapis Job Task - Submit jobs on TACC HPC systems via Tapis Jobs - -### Breaking Changes -- N/A - -### non-Breaking Changes -- Major refactor - Moved all Tapis-specific logic to the contrib directory - -### Fixed -- - -### Removed -- N/A - -## [v1.3.0] - 2022-12-15 - -### Breaking Changes -- N/A - -### non-Breaking Changes -- N/A - -### Fixed -- - -### Removed -- N/A - diff --git a/src/shared/OWESpec.yaml b/src/shared/OWESpec.yaml deleted file mode 100644 index 093726f1..00000000 --- a/src/shared/OWESpec.yaml +++ /dev/null @@ -1,3283 +0,0 @@ -openapi: 3.0.3 -info: - title: Tapis Workflows API - description: Create and manage pipelines - version: '1.2.0' - termsOfService: "https://tapis-project.org" - contact: - name: "Workflows API - CICSupport" - url: "https://tapis-project.org" - email: "cicsupport@tacc.utexas.edu" - license: - name: 3-Clause BSD License - url: 'https://opensource.org/licenses/BSD-3-Clause' -externalDocs: - description: Tapis Project - url: 'https://tapis-project.org' -servers: - - url: 'http://localhost:8000/' - description: Local test environment - variables: {} - - url: 'https://dev.develop.tapis.io/' - description: Development environment - variables: {} - - url: 'https://raw.githubusercontent.com' -security: - - TapisJWT: [] -tags: - - name: Workflows - description: Manage Pipeline and Task resources. Create, retrieve, update, etc. - - name: General - description: General service health and readiness - - name: Groups - description: Manage groups that have access to specific workflow resources. Create, retrieve, update, etc. - - name: Users - description: Manage users that belong to groups. Create, update, remove, etc. - - name: Identities - description: Manage external identities . Create, retrieve, delete. - - name: Pipelines - description: Manage collections of tasks. Create, retrieve and delete. - - name: Tasks - description: Manage tasks to be executed as part of a workflow. Create, retrieve and delete. - - name: Events - description: Trigger workflows. Create and retrieve. - - name: CI/CD - description: Create CI/CD-specific workflows (Image builds and http requests). - -# ------------------------------------------------------------------------------ -# --- Paths ------------------------------------------------------------------- -# ------------------------------------------------------------------------------ - -# -- Paths for groups --- -paths: - '/v3/workflows/healthcheck': - get: - tags: - - General - description: Health check. - operationId: healthCheck - responses: - '200': - description: Message received. - content: - application/json: - schema: - $ref: '#/components/schemas/RespObject' - '500': - description: Server error. - - # '/v3/workflows/readycheck': - # get: - # tags: - # - General - # description: Health check. - # operationId: readyCheck - # responses: - # '200': - # description: Message received. - # content: - # application/json: - # schema: - # $ref: '#/components/schemas/RespObject' - # '500': - # description: Server error. - - '/v3/workflows/groups': - get: - tags: - - Groups - summary: Retrieve groups - description: | - Retrieve all groups to which the user belongs - operationId: listGroups - responses: - '200': - description: List groups successful. - content: - application/json: - schema: - $ref: '#/components/schemas/RespGroupList' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - post: - tags: - - Groups - summary: Create a group - description: | - Create a group that perform CRUD operations on workflow resources. - - The owner of the group will be made an admin by default. If you want to set other users as admins, - you must use the '' endpoint. - operationId: createGroup - requestBody: - required: true - description: A JSON object specifying information for the pipeline to be created. - content: - application/json: - schema: - $ref: '#/components/schemas/ReqGroup' - responses: - '201': - description: Group created. - content: - application/json: - schema: - $ref: '#/components/schemas/RespResourceURL' - '400': - description: Bad request. Invalid JSON. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '409': - description: Conflict. Group with provided id already exists. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '415': - description: Unsupported media type. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - - '/v3/workflows/groups/{group_id}': - get: - tags: - - Groups - summary: Retrieve group details - description: | - Retrieve details for a given group id - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - operationId: getGroup - responses: - '200': - description: Get group successful. - content: - application/json: - schema: - $ref: '#/components/schemas/RespGroupDetail' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - - '/v3/workflows/groups/{group_id}/users': - get: - tags: - - Users - summary: List users - description: | - List users. - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - operationId: listGroupUsers - responses: - '200': - description: List Users successful. - content: - application/json: - schema: - $ref: '#/components/schemas/RespGroupUserList' - '400': - description: Bad request. Invalid JSON. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Cannot access resources for this Group. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '404': - description: Group does not exist. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - post: - tags: - - Users - summary: Add a user to a group - description: | - Add a user to a group. - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - operationId: addGroupUser - requestBody: - required: true - description: A JSON object specifying the group user to add. - content: - application/json: - schema: - $ref: '#/components/schemas/ReqGroupUser' - responses: - '201': - description: Users successfully added. - content: - application/json: - schema: - $ref: '#/components/schemas/RespResourceURL' - '400': - description: Bad request. Invalid JSON. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Cannot add a user to this group. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '404': - description: Group does not exist. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - - '/v3/workflows/groups/{group_id}/users/{username}': - get: - tags: - - Users - summary: Get group user - description: | - Get a user from a group - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: username - in: path - required: true - schema: - $ref: '#/components/schemas/Username' - operationId: getGroupUser - responses: - '200': - description: Get Group User successful. - content: - application/json: - schema: - $ref: '#/components/schemas/RespGroupUser' - '400': - description: Bad request. Invalid JSON. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Cannot access resources for this Group. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '404': - description: Group does not exist. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - patch: - tags: - - Users - summary: Update group user - description: | - Update a user for a specified group. Only group admins can perform this operation. - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: username - in: path - required: true - schema: - $ref: '#/components/schemas/Username' - requestBody: - required: true - description: A JSON object - content: - application/json: - schema: - $ref: '#/components/schemas/ReqUpdateGroupUser' - operationId: updateGroupUser - responses: - '200': - description: User updated. - content: - application/json: - schema: - $ref: '#/components/schemas/RespGroupUser' - '400': - description: Bad request. Invalid JSON. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Cannot update user permissions. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '404': - description: Group or user does not exist. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - delete: - tags: - - Users - summary: Remove user from group - description: | - Remove a user from a group. - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: username - in: path - required: true - schema: - $ref: '#/components/schemas/Username' - operationId: removeGroupUser - responses: - '200': - description: User removed. - content: - application/json: - schema: - $ref: '#/components/schemas/RespGroupUser' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Cannot remove a user to this group. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '404': - description: Group does not exist. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - - # --- Paths for identities --- - '/v3/workflows/identities': - post: - tags: - - Identities - summary: Create an identity - description: | - Create a mapping between a group user and an external identity. - - Users can only create identities for themselves. i.e., group admins and owners cannot - create identities for any user but themselves. - operationId: createIdentity - requestBody: - required: true - description: A JSON object specifying information for the pipeline to be created. - content: - application/json: - schema: - $ref: '#/components/schemas/ReqIdentity' - responses: - '201': - description: Identity created. - content: - application/json: - schema: - $ref: '#/components/schemas/RespResourceURL' - '400': - description: Bad request. Invalid JSON. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '409': - description: Conflict. An identity already exists for this group and type. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '415': - description: Unsupported media type. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - get: - tags: - - Identities - summary: List user identities for a given user - description: | - Retrieve identities for the requesting user - operationId: listIdentities - responses: - '200': - description: List identities successful. - content: - application/json: - schema: - $ref: '#/components/schemas/RespIdentityList' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Cannot access resources for this Group. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '404': - description: Group does not exist. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server Error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - - '/v3/workflows/identities/{identity_uuid}': - delete: - tags: - - Identities - summary: Delete an identity - description: | - Delete an identitiy - parameters: - - name: identity_uuid - in: path - required: true - schema: - type: string - format: uuid - operationId: deleteIdentity - responses: - '200': - description: Identity removed. - content: - application/json: - schema: - $ref: '#/components/schemas/RespString' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Cannot remove identities for users for this group. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '404': - description: Group does not exist. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - - get: - tags: - - Identities - summary: Get identity - description: | - Get a specific identity by its UUID - operationId: getIdentity - parameters: - - name: identity_uuid - in: path - required: true - schema: - type: string - format: uuid - responses: - '200': - description: List identities successful. - content: - application/json: - schema: - $ref: '#/components/schemas/RespIdentity' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Cannot access resources for this Group. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '404': - description: Group does not exist. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server Error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - - # --- Paths for ci pipelines ----------------------------------------------------- - '/v3/workflows/groups/{group_id}/ci': - post: - tags: - - CI/CD - summary: Create a CI/CD pipeline - description: | - Create a CI/CD pipeline using a request body. Pipeline id must be unique within a group and can be composed of - alphanumeric characters and the following special characters [-_.]. - - Note: When creating pipelines for the CI/CD use case(primarily building images), use this endpoint. It offers a simplified interface - for those who want to avoid the complexities of creating a standard workflow. This pipeline's - tasks may be modified later. - operationId: createCIPipeline - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - requestBody: - required: true - description: A JSON object specifying information for the pipeline to be created. - content: - application/json: - schema: - $ref: '#/components/schemas/ReqCIPipeline' - responses: - '201': - description: Pipeline created. - content: - application/json: - schema: - $ref: '#/components/schemas/RespResourceURL' - '400': - description: Bad request. Invalid JSON. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Cannot create a pipeline for specified group. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '405': - description: Method not allowed. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '409': - description: Conflict. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '415': - description: Unsupported media type. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '422': - description: Unprocessable entity. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - - # --- Paths for archives ------------------------------------------------------ - '/v3/workflows/groups/{group_id}/archives': - get: - tags: - - Archives - summary: Retrieve archives - description: Retrieve a list of archives for in group - operationId: listArchives - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - responses: - '200': - description: Success. - content: - application/json: - schema: - $ref: '#/components/schemas/RespArchiveList' - '400': - description: Bad request. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '401': - description: Not authorized. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Forbidden. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '404': - description: Not Found. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '405': - description: Method not allowed. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '415': - description: Unsupported media type. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '422': - description: Unprocessable entity. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - post: - tags: - - Archives - summary: Create an archive - description: | - Create an Archive. Archives are used to persist the results of a pipeline run - operationId: createArchive - parameters: - - name: group_id - in: path - required: true - schema: - $ref: "#/components/schemas/ID" - requestBody: - required: true - description: A JSON object specifying information for the archive to be created. - content: - application/json: - schema: - $ref: '#/components/schemas/ReqArchive' - responses: - '201': - description: successful - content: - application/json: - schema: - $ref: '#/components/schemas/RespResourceURL' - '400': - description: Bad request. Invalid JSON. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Cannot create an archive for this group. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '405': - description: Method not allowed. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '409': - description: Conflict. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '415': - description: Unsupported media type. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '422': - description: Unprocessable entity. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - - '/v3/workflows/groups/{group_id}/archives/{archive_id}': - get: - tags: - - Archives - summary: Retrieve an archive - description: Retrieve an archive - operationId: getArchive - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: archive_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - responses: - '200': - description: Success. - content: - application/json: - schema: - $ref: '#/components/schemas/RespArchive' - '400': - description: Bad request. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '401': - description: Not authorized. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Forbidden. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '404': - description: Not Found. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '405': - description: Method not allowed. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '415': - description: Unsupported media type. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '422': - description: Unprocessable entity. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - - - - # --- Paths for pipelines ----------------------------------------------------- - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/changeOwner/{username}': - patch: - tags: - - Pipelines - summary: Change pipeline owner - description: | - Change the owner of a pipeline. Requesting user must be the current owner - operationId: changePipelineOwner - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: username - in: path - required: true - schema: - $ref: '#/components/schemas/Username' - # requestBody: - # required: false - # description: Empty JSON object. - # content: - # application/json: - # schema: {} - responses: - '200': - description: successful - content: - application/json: - schema: - $ref: '#/components/schemas/RespObject' - - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/archives': - get: - tags: - - Pipeline Archives - summary: Retrieve pipeline archives - description: Retrieve a list of archives attached to a pipeline - operationId: listPipelineArchives - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - responses: - '200': - description: Success. - content: - application/json: - schema: - $ref: '#/components/schemas/RespArchiveList' - '401': - description: Not authorized. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Forbidden. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '404': - description: Not Found. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/archives/add': - post: - tags: - - Pipelines - summary: Add an archive to a pipeline - description: | - Add an archive to a pipeline. - operationId: addPipelineArchive - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - # requestBody: - # required: false - # description: Empty JSON object. - # content: - # application/json: - # schema: {} - responses: - '200': - description: Archive added - content: - application/json: - schema: - $ref: '#/components/schemas/RespObject' - - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/archives/remove': - delete: - tags: - - Pipelines - summary: Remove archive to a pipeline - description: | - Remove an archive to a pipeline. - operationId: removePipelineArchive - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - responses: - '200': - description: Archive added - content: - application/json: - schema: - $ref: '#/components/schemas/RespObject' - - '/v3/workflows/groups/{group_id}/pipelines': - get: - tags: - - Pipelines - summary: Retrieve pipelines - description: Retrieve a list of pipelines for all groups that the requesting user belongs to. - operationId: listPipelines - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - responses: - '200': - description: Success. - content: - application/json: - schema: - $ref: '#/components/schemas/RespPipelineList' - - '400': - description: Bad request. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '401': - description: Not authorized. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Forbidden. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '404': - description: Not Found. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '405': - description: Method not allowed. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '409': - description: Conflict. Pipeline already exists with provided id. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '415': - description: Unsupported media type. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '422': - description: Unprocessable entity. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - post: - tags: - - Pipelines - summary: Create a pipeline - description: | - Create a pipeline using a request body. Pipeline id must be unique within a group and can be composed of - alphanumeric characters and the following special characters [-_.]. - operationId: createPipeline - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - requestBody: - required: true - description: A JSON object specifying information for the pipeline to be created. - content: - application/json: - schema: - $ref: '#/components/schemas/ReqPipeline' - responses: - '201': - description: Pipeline created. - content: - application/json: - schema: - $ref: '#/components/schemas/RespResourceURL' - '400': - description: Bad request. Invalid JSON. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Cannot create a pipeline for specified group. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '405': - description: Method not allowed. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '409': - description: Conflict. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '415': - description: Unsupported media type. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '422': - description: Unprocessable entity. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}': - get: - tags: - - Pipelines - summary: Retrieve pipeline details - description: | - Retrieve information for a pipeline given the pipeline id - operationId: getPipeline - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - responses: - '200': - description: Pipeline found. - content: - application/json: - schema: - $ref: '#/components/schemas/RespPipeline' - '400': - description: Input error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '401': - description: Not authorized. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '404': - description: Pipeline not found. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '500': - description: Server error. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - - delete: - tags: - - Pipelines - summary: Delete a pipeline - description: | - Delete a pipeline - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - operationId: deletePipeline - responses: - '200': - description: Pipeline deleted. - content: - application/json: - schema: - $ref: '#/components/schemas/RespString' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Cannot remove identities for users for this group. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '404': - description: Group does not exist. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/webhook': - post: - tags: - - Events - summary: Trigger a pipeline run - description: | - Trigger a pipeline run - operationId: runPipelineWebhook - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - requestBody: - required: true - description: A JSON object specifying information for the pipeline to be created. - content: - application/json: - schema: - $ref: '#/components/schemas/ReqWebhookEvent' - responses: - '200': - description: Events found. - content: - application/json: - schema: - $ref: '#/components/schemas/RespEvent' - - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/tasks': - post: - tags: - - Tasks - summary: Create a task - description: | - Create a task for a pipeline - operationId: createTask - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - requestBody: - required: true - description: A JSON object specifying information for the task to be created. - content: - application/json: - schema: - $ref: "#/components/schemas/ReqTask" - responses: - '201': - description: Tasks created. - content: - application/json: - schema: - $ref: '#/components/schemas/RespResourceURL' - - get: - tags: - - Tasks - summary: List tasks - description: | - Retrieve all tasks for a given pipeline - operationId: listTasks - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - responses: - '200': - description: Tasks found. - content: - application/json: - schema: - $ref: '#/components/schemas/RespTaskList' - - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/tasks/{task_id}': - get: - tags: - - Tasks - summary: Retrieve task details - description: | - Retrieve task details for given pipeline id and task id - operationId: getTask - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: task_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - responses: - '200': - description: Task found. - content: - application/json: - schema: - $ref: '#/components/schemas/RespTask' - - delete: - tags: - - Tasks - summary: Delete a task - description: | - Delete a task - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: task_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - operationId: deleteTask - responses: - '200': - description: Task deleted. - content: - application/json: - schema: - $ref: '#/components/schemas/RespString' - '401': - description: Not authorized. Invalid or Expired Token. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '403': - description: Cannot delete task for this pipeline. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - '404': - description: Task not found. - content: - application/json: - schema: - $ref: '#/components/schemas/RespError' - - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/runs': - get: - tags: - - PipelineRuns - summary: Pipeline Runs - description: | - List runs for a pipeline - operationId: listPipelineRuns - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - responses: - '200': - description: Pipeline Run updated. - content: - application/json: - schema: - $ref: '#/components/schemas/RespPipelineRunList' - - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/runs/{pipeline_run_uuid}': - get: - tags: - - PipelineRuns - summary: Pipeline Runs - description: | - Get a pipeline run - operationId: getPipelineRun - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_run_uuid - in: path - required: true - schema: - type: string - format: uuid - responses: - '200': - description: Pipeline Run updated. - content: - application/json: - schema: - $ref: '#/components/schemas/RespPipelineRun' - - '/v3/workflows/executor/runs/{pipeline_run_uuid}/{status}': - patch: - tags: - - PipelineRuns - summary: Pipeline Runs - description: | - Endpoints that update pipeline runs are only accessible to the Workflow Executor - operationId: updatePipelineRunStatus - parameters: - - name: X-WORKFLOW-EXECUTOR-TOKEN - in: header - description: | - an authorization header that contains the token that authroizes the workflow executor to update the pipeline run status - required: true - schema: - type: string - - name: pipeline_run_uuid - in: path - required: true - schema: - type: string - format: uuid - - name: status - in: path - required: true - schema: - $ref: "#/components/schemas/EnumRunStatus" - requestBody: - required: false - description: Empty JSON object. - content: - application/json: - schema: - $ref: "#/components/schemas/ReqPatchPipelineRun" - responses: - '200': - description: Pipeline Run updated. - content: - application/json: - schema: - $ref: '#/components/schemas/RespString' - - '/v3/workflows/executor/executions/{task_execution_uuid}/{status}': - patch: - tags: - - TaskExecutions - summary: Task Executions - description: | - update a task execution status - operationId: updateTaskExecutionStatus - parameters: - - name: X-WORKFLOW-EXECUTOR-TOKEN - in: header - description: | - an authorization header that contains the token that authroizes the workflow executor to update the pipeline run status - required: true - schema: - type: string - - name: task_execution_uuid - in: path - required: true - schema: - type: string - format: uuid - - name: status - in: path - required: true - schema: - $ref: "#/components/schemas/EnumRunStatus" - requestBody: - required: false - description: Empty JSON object. - content: - application/json: - schema: - $ref: "#/components/schemas/ReqPatchTaskExecution" - responses: - '200': - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/RespString' - - '/v3/workflows/executor/runs/{pipeline_run_uuid}/executions': - post: - tags: - - TaskExecutions - summary: Task Executions - description: | - Create a task execution - operationId: createTaskExecution - parameters: - - name: X-WORKFLOW-EXECUTOR-TOKEN - in: header - description: | - an authorization header that contains the token that authroizes the workflow executor to create a task execution - required: true - schema: - type: string - - name: pipeline_run_uuid - in: path - required: true - schema: - type: string - format: uuid - requestBody: - required: true - description: A JSON object for the createTaskExecution operation. - content: - application/json: - schema: - $ref: '#/components/schemas/ReqCreateTaskExecution' - responses: - '200': - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/RespResourceURL' - - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/runs/{pipeline_run_uuid}/executions/{task_execution_uuid}': - get: - tags: - - TaskExecutions - summary: Task Executions - description: | - Get a Task Execution - operationId: getTaskExecution - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_run_uuid - in: path - required: true - schema: - type: string - format: uuid - - name: task_execution_uuid - in: path - required: true - schema: - type: string - format: uuid - responses: - '200': - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/RespTaskExecution' - - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/runs/{pipeline_run_uuid}/executions': - get: - tags: - - TaskExecutions - summary: Task Executions - description: | - List Task Executions for a pipeline run - operationId: listTaskExecutions - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_run_uuid - in: path - required: true - schema: - type: string - format: uuid - responses: - '200': - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/RespTaskExecutionList' - - '/v3/workflows/groups/{group_id}/pipelines/{pipeline_id}/events': - get: - tags: - - Events - summary: Retrieve Event details - description: | - Retrieve all events for a given pipeline - operationId: listEvents - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - responses: - '200': - description: Events found. - content: - application/json: - schema: - $ref: '#/components/schemas/RespEvent' - post: - tags: - - Events - summary: Trigger a pipeline run - description: | - Trigger a pipeline run - operationId: runPipeline - parameters: - - name: group_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - - name: pipeline_id - in: path - required: true - schema: - $ref: '#/components/schemas/ID' - requestBody: - required: true - description: A JSON object specifying information for the pipeline to be created. - content: - application/json: - schema: - $ref: '#/components/schemas/ReqRunPipeline' - responses: - '200': - description: Events found. - content: - application/json: - schema: - $ref: '#/components/schemas/RespEvent' - -# ------------------------------------------------------------------------------ -# --- Components --------------------------------------------------------------- -components: - securitySchemes: - TapisJWT: - type: apiKey - description: Tapis signed JWT token authentication - name: X-TAPIS-TOKEN - in: header - schemas: - # ------------------------------------------------------------------------------ - # --- Model objects ------------------------------------------------------------ - # ------------------------------------------------------------------------------ - - # --- Pipelines --- - Env: - type: object - additionalProperties: true - - Params: - type: object - additionalProperties: true - - ExecutionProfile: - type: object - properties: - duplicate_submission_policy: - $ref: '#/components/schemas/EnumDuplicateSubmissionPolicy' - flavor: - $ref: '#/components/schemas/EnumTaskFlavor' - invocation_mode: - $ref: '#/components/schemas/EnumInvocationMode' - max_retries: - type: integer - default: 0 - max_exec_time: - type: integer - default: 3600 - retry_policy: - $ref: '#/components/schemas/EnumRetryPolicy' - - BaseArchive: - type: object - required: - - type - - id - - group - - tenant_id - - owner - - archive_dir - properties: - id: - $ref: '#/components/schemas/ID' - type: - $ref: "#/components/schemas/EnumArchiveType" - group: - type: string - format: uuid - tenant_id: - $ref: '#/components/schemas/ID' - owner: - $ref: '#/components/schemas/Username' - uuid: - type: string - format: uuid - archive_dir: - type: string - - S3Archive: - allOf: - - $ref: '#/components/schemas/BaseArchive' - - type: object - required: - - endpoint - - bucket - - region - properties: - endpoint: - type: string - bucket: - type: string - region: - type: string - - TapisSystemArchive: - allOf: - - $ref: '#/components/schemas/BaseArchive' - - type: object - required: - - system_id - properties: - system_id: - $ref: '#/components/schemas/ID' - - Archive: - oneOf: - - $ref: '#/components/schemas/TapisSystemArchive' - - $ref: '#/components/schemas/S3Archive' - discriminator: - propertyName: type - mapping: - system: '#/components/schemas/TapisSystemArchive' - s3: '#/components/schemas/S3Archive' - - Pipeline: - type: object - properties: - id: - $ref: '#/components/schemas/ID' - env: - $ref: "#/components/schemas/Env" - params: - $ref: "#/components/schemas/Params" - group: - type: string - format: uuid - owner: - $ref: '#/components/schemas/Username' - uuid: - type: string - format: uuid - execution_profile: - $ref: '#/components/schemas/ExecutionProfile' - current_run: - type: string - format: uuid - last_run: - type: string - format: uuid - tasks: - type: array - items: - $ref: '#/components/schemas/Task' - - PipelineRun: - type: object - properties: - uuid: - type: string - format: uuid - pipeline: - type: string - format: uuid - status: - $ref: "#/components/schemas/EnumRunStatus" - started_at: - type: string - last_modified: - type: string - logs: - type: string - - TaskExecution: - type: object - properties: - uuid: - type: string - format: uuid - pipeline_run: - type: string - format: uuid - task_id: - type: string - status: - $ref: "#/components/schemas/EnumRunStatus" - started_at: - type: string - last_modified: - type: string - last_message: - type: string - stderr: - type: string - stdout: - type: string - - # --- Task --- - Task: - oneOf: - - $ref: '#/components/schemas/ImageBuildTask' - - $ref: '#/components/schemas/RequestTask' - - $ref: '#/components/schemas/ContainerRunTask' - - $ref: '#/components/schemas/TapisJobTask' - - $ref: '#/components/schemas/TapisActorTask' - - $ref: '#/components/schemas/FunctionTask' - discriminator: - propertyName: type - mapping: - image_build: "#/components/schemas/ImageBuildTask" - request: "#/components/schemas/RequestTask" - container_run: "#/components/schemas/ContainerRunTask" - tapis_job: "#/components/schemas/TapisJobTask" - tapis_actor: "#/components/schemas/TapisActorTask" - function: "#/components/schemas/FunctionTask" - - - BaseTask: - type: object - required: - - id - - type - properties: - id: - type: string - type: - $ref: '#/components/schemas/EnumTaskType' - depends_on: - type: array - items: - $ref: '#/components/schemas/TaskDependency' - description: - type: string - execution_profile: - $ref: '#/components/schemas/ExecutionProfile' - input: - type: object - additionalProperties: true - output: - type: object - additionalProperties: true - - ImageBuildTask: - allOf: - - $ref: '#/components/schemas/BaseTask' - - type: object - properties: - builder: - $ref: '#/components/schemas/EnumBuilder' - default: "kaniko" - cache: - type: boolean - default: true - context: - $ref: '#/components/schemas/Context' - destination: - $ref: '#/components/schemas/Destination' - - RequestTask: - allOf: - - $ref: '#/components/schemas/BaseTask' - - type: object - properties: - auth: - type: object - data: - type: object - headers: - type: object - http_method: - $ref: '#/components/schemas/EnumHTTPMethod' - query_params: - type: object - url: - type: string - - ContainerRunTask: - allOf: - - $ref: '#/components/schemas/BaseTask' - - type: object - properties: - image: - type: string - - TapisJobTask: - allOf: - - $ref: '#/components/schemas/BaseTask' - - type: object - properties: - poll: - type: boolean - default: true - tapis_job_def: - type: object - - TapisActorTask: - allOf: - - $ref: '#/components/schemas/BaseTask' - - type: object - properties: - poll: - type: boolean - default: true - tapis_actor_id: - type: string - tapis_actor_message: - nullable: true - type: string - - FunctionTask: - allOf: - - $ref: '#/components/schemas/BaseTask' - - type: object - properties: - git_repositories: - type: array - items: - $ref: "#/components/schemas/GitRepository" - runtime: - $ref: "#/components/schemas/EnumRuntimeEnvironment" - installer: - $ref: "#/components/schemas/EnumInstaller" - command: - type: string - code: - type: string - format: byte - packages: - type: array - items: - type: string - - # --- Task Dependency --- - TaskDependency: - type: object - properties: - id: - $ref: "#/components/schemas/ID" - can_fail: - type: boolean - - # --- Context --- - Context: - type: object - required: - - type - properties: - branch: - type: string - credentials: - default: null - build_file_path: - type: string - sub_path: - type: string - type: - $ref: "#/components/schemas/EnumContextType" - url: - type: string - visibility: - $ref: "#/components/schemas/EnumContextVisibility" - - # --- Destination --- - Destination: - type: object - properties: - credentials: - default: null - tag: - type: string - type: - $ref: '#/components/schemas/EnumDestinationType' - url: - type: string - - # --- Group and GroupUser --- - GroupDetail: - type: object - properties: - id: - $ref: "#/components/schemas/ID" - owner: - $ref: "#/components/schemas/Username" - tenant_id: - $ref: "#/components/schemas/ID" - uuid: - type: string - format: uuid - users: - type: array - items: - $ref: "#/components/schemas/GroupUser" - - Group: - type: object - properties: - id: - $ref: "#/components/schemas/ID" - owner: - $ref: "#/components/schemas/Username" - tenant_id: - $ref: "#/components/schemas/ID" - uuid: - type: string - format: uuid - - GroupUser: - type: object - properties: - group: - $ref: "#/components/schemas/ID" - username: - $ref: "#/components/schemas/Username" - is_admin: - type: boolean - uuid: - type: string - format: uuid - - Identity: - type: object - properties: - type: - $ref: "#/components/schemas/ID" - name: - type: string - description: - type: string - owner: - $ref: "#/components/schemas/Username" - tenant_id: - type: string - uuid: - type: string - format: uuid - credentials: - type: string - - Event: - type: object - properties: - branch: - type: string - default: null - commit: - type: string - default: null - commit_sha: - type: string - default: null - context_url: - type: string - default: null - directives: - type: string - message: - type: string - pipeline: - type: string - source: - type: string - username: - $ref: '#/components/schemas/Username' - identity: - type: string - default: null - uuid: - type: string - format: uuid - - GitRepository: - type: object - properties: - url: - type: string - branch: - type: string - directory: - type: string - - - # --- String types with constraints ------------------------------------ - ID: - type: string - minLength: 1 - maxLength: 128 - Username: - type: string - minLength: 1 - maxLength: 64 - DescriptionString: - type: string - maxLength: 2048 - - - # ------------------------------------------------------------------------- - # --- Request objects ----------------------------------------------------- - # ------------------------------------------------------------------------- - - ReqGroup: - type: object - required: - - id - properties: - id: - $ref: '#/components/schemas/ID' - users: - type: array - items: - type: object - properties: - username: - $ref: '#/components/schemas/Username' - is_admin: - default: false - type: boolean - - ReqGroupUser: - type: object - required: - - username - properties: - username: - $ref: '#/components/schemas/Username' - is_admin: - type: boolean - default: false - - ReqUpdateGroupUser: - type: object - required: - - is_admin - properties: - is_admin: - type: boolean - - ReqArchive: - oneOf: - - $ref: '#/components/schemas/ReqTapisSystemArchive' - - $ref: '#/components/schemas/ReqS3Archive' - discriminator: - propertyName: type - mapping: - system: '#/components/schemas/ReqTapisSystemArchive' - s3: '#/components/schemas/ReqS3Archive' - - ReqBaseArchive: - type: object - required: - - id - - type - properties: - id: - $ref: '#/components/schemas/ID' - type: - $ref: "#/components/schemas/EnumArchiveType" - archive_dir: - type: string - - ReqTapisSystemArchive: - allOf: - - $ref: "#/components/schemas/ReqBaseArchive" - - type: object - required: - - system_id - properties: - system_id: - $ref: '#/components/schemas/ID' - - ReqS3Archive: - allOf: - - $ref: "#/components/schemas/ReqBaseArchive" - - type: object - required: - - endpoint - - bucket - - region - oneOf: - - required: [credentials] - - required: [identity_uuid] - properties: - endpoint: - type: string - bucket: - type: string - region: - type: string - credentials: - $ref: "#/components/schemas/ReqS3Cred" - identity_uuid: - type: string - format: uuid - - - ReqIdentity: - oneOf: - - $ref: "#/components/schemas/ReqDockerhubIdentity" - - $ref: "#/components/schemas/ReqGithubIdentity" - discriminator: - propertyName: type - mapping: - dockerhub: "#/components/schemas/ReqDockerhubIdentity" - github: "#/components/schemas/ReqGithubIdentity" - - ReqBaseIdentity: - type: object - required: - - type - properties: - name: - type: string - description: - type: string - type: - $ref: '#/components/schemas/EnumIdentityType' - - ReqDockerhubIdentity: - allOf: - - $ref: "#/components/schemas/ReqBaseIdentity" - - type: object - properties: - credentials: - $ref: "#/components/schemas/ReqDockerhubCred" - - ReqGithubIdentity: - allOf: - - $ref: "#/components/schemas/ReqBaseIdentity" - - type: object - properties: - credentials: - $ref: "#/components/schemas/ReqGithubCred" - - ReqPipeline: - type: object - required: - - id - - type - properties: - id: - $ref: '#/components/schemas/ID' - archive_ids: - type: array - items: - $ref: "#/components/schemas/ID" - description: - $ref: '#/components/schemas/DescriptionString' - env: - $ref: "#/components/schemas/Env" - params: - $ref: "#/components/schemas/Params" - type: - $ref: '#/components/schemas/EnumPipelineType' - execution_profile: - $ref: '#/components/schemas/ExecutionProfile' - tasks: - type: array - items: - $ref: "#/components/schemas/ReqTask" - - ReqBaseTask: - type: object - required: - - id - - type - properties: - id: - type: string - type: - $ref: '#/components/schemas/EnumTaskType' - depends_on: - type: array - items: - $ref: '#/components/schemas/TaskDependency' - description: - type: string - execution_profile: - $ref: "#/components/schemas/ExecutionProfile" - input: - type: object - additionalProperties: true - output: - type: object - additionalProperties: true - - ReqImageBuildTask: - allOf: - - $ref: '#/components/schemas/ReqBaseTask' - - type: object - required: - - context - - destination - - builder - properties: - builder: - $ref: '#/components/schemas/EnumBuilder' - default: "kaniko" - cache: - type: boolean - default: true - context: - $ref: '#/components/schemas/ReqContext' - destination: - $ref: '#/components/schemas/ReqDestination' - - ReqRequestTask: - allOf: - - $ref: '#/components/schemas/ReqBaseTask' - - type: object - required: - - http_method - - url - properties: - auth: - type: object - data: - type: object - headers: - type: object - http_method: - $ref: '#/components/schemas/EnumHTTPMethod' - query_params: - type: object - url: - type: string - - ReqContainerRunTask: - allOf: - - $ref: '#/components/schemas/ReqBaseTask' - - type: object - required: - - image - properties: - image: - type: string - - ReqTapisJobTask: - allOf: - - $ref: '#/components/schemas/ReqBaseTask' - - type: object - required: - - tapis_job_def - properties: - poll: - type: boolean - default: true - tapis_job_def: - $ref: '#/components/schemas/ReqTapisJobDef' - - ReqTapisActorTask: - allOf: - - $ref: '#/components/schemas/ReqBaseTask' - - type: object - required: - - tapis_actor_id - properties: - poll: - type: boolean - default: true - tapis_actor_id: - type: string - tapis_actor_message: - nullable: true - type: string - - - ReqFunctionTask: - allOf: - - $ref: '#/components/schemas/ReqBaseTask' - - type: object - required: - - runtime - - installer - - code - properties: - git_repositories: - type: array - items: - $ref: "#/components/schemas/ReqGitRepository" - runtime: - $ref: "#/components/schemas/EnumRuntimeEnvironment" - installer: - $ref: "#/components/schemas/EnumInstaller" - command: - type: string - code: - type: string - format: byte - packages: - type: array - items: - type: string - - ReqGitRepository: - type: object - properties: - url: - type: string - branch: - type: string - default: null - directory: - type: string - default: "/" - - ReqTask: - oneOf: - - $ref: '#/components/schemas/ReqImageBuildTask' - - $ref: '#/components/schemas/ReqRequestTask' - - $ref: '#/components/schemas/ReqContainerRunTask' - - $ref: '#/components/schemas/ReqTapisJobTask' - - $ref: '#/components/schemas/ReqTapisActorTask' - - $ref: '#/components/schemas/ReqFunctionTask' - discriminator: - propertyName: type - mapping: - image_build: "#/components/schemas/ReqImageBuildTask" - request: "#/components/schemas/ReqRequestTask" - container_run: "#/components/schemas/ReqContainerRunTask" - tapis_job: "#/components/schemas/ReqTapisJobTask" - tapis_actor: "#/components/schemas/ReqTapisActorTask" - function: "#/components/schemas/ReqFunctionTask" - - ReqCIPipeline: - type: object - required: - - id - - type - - context - - destination - properties: - id: - $ref: '#/components/schemas/ID' - description: - $ref: '#/components/schemas/DescriptionString' - archive_ids: - type: array - items: - $ref: '#/components/schemas/ID' - builder: - $ref: '#/components/schemas/EnumBuilder' - type: - $ref: '#/components/schemas/EnumPipelineType' - context: - $ref: '#/components/schemas/ReqContext' - destination: - $ref: '#/components/schemas/ReqDestination' - - # --- Context Request --- - ReqBaseContext: - type: object - required: - - type - properties: - type: - $ref: "#/components/schemas/EnumContextType" - - ReqLocalContext: - allOf: - - $ref: "#/components/schemas/ReqBaseContext" - - type: object - required: - - filename - properties: - filename: - type: string - - ReqNonLocalContext: - allOf: - - $ref: "#/components/schemas/ReqBaseContext" - - type: object - required: - - visibility - - url - properties: - visibility: - $ref: "#/components/schemas/EnumContextVisibility" - url: - type: string - oneOf: - - required: [credentials] - - required: [identity_uuid] - - ReqRegistryContext: - allOf: - - $ref: "#/components/schemas/ReqNonLocalContext" - - type: object - properties: - tag: - type: string - default: latest - - ReqRepoContext: - allOf: - - $ref: "#/components/schemas/ReqNonLocalContext" - - type: object - required: - - branch - - build_file_path - properties: - branch: - type: string - build_file_path: - type: string - sub_path: - type: string - - ReqGithubContext: - allOf: - - $ref: "#/components/schemas/ReqBaseContext" - - $ref: "#/components/schemas/ReqRepoContext" - - type: object - properties: - credentials: - $ref: '#/components/schemas/ReqGithubCred' - identity_uuid: - type: string - format: uuid - - ReqGitlabContext: - allOf: - - $ref: "#/components/schemas/ReqBaseContext" - - $ref: "#/components/schemas/ReqRepoContext" - - type: object - properties: - credentials: - $ref: '#/components/schemas/ReqGitlabCred' - identity_uuid: - type: string - format: uuid - - ReqDockerhubContext: - allOf: - - $ref: "#/components/schemas/ReqBaseContext" - - $ref: "#/components/schemas/ReqRegistryContext" - - type: object - properties: - credentials: - $ref: '#/components/schemas/ReqDockerhubCred' - identity_uuid: - type: string - format: uuid - - ReqContext: - oneOf: - - $ref: "#/components/schemas/ReqGithubContext" - - $ref: "#/components/schemas/ReqGitlabContext" - - $ref: "#/components/schemas/ReqDockerhubContext" - - $ref: "#/components/schemas/ReqLocalContext" - discriminator: - propertyName: type - mapping: - github: "#/components/schemas/ReqGithubContext" - gitlab: "#/components/schemas/ReqGitlabContext" - dockerhub: "#/components/schemas/ReqDockerhubContext" - local: "#/components/schemas/ReqLocalContext" - - # --- Credentials --- - ReqS3Cred: - type: object - properties: - access_key: - type: string - access_secret: - type: string - - ReqDockerhubCred: - type: object - properties: - token: - type: string - username: - type: string - - ReqGitlabCred: - type: object - properties: - token: - type: string - username: - type: string - - ReqGithubCred: - type: object - properties: - personal_access_token: - type: string - username: - type: string - - # --- Destination --- - ReqBaseDestination: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/EnumDestinationType' - - ReqLocalDestination: - allOf: - - $ref: "#/components/schemas/ReqBaseDestination" - - type: object - properties: - filename: - type: string - - ReqRegistryDestination: - allOf: - - $ref: "#/components/schemas/ReqBaseDestination" - - type: object - required: - - url - properties: - credentials: - $ref: '#/components/schemas/ReqDockerhubCred' - identity_uuid: - type: string - format: uuid - tag: - type: string - url: - type: string - # Mutual exclusion. credentials or identity uuid - oneOf: - - required: [credentials] - - required: [identity_uuid] - - ReqDockerhubDestination: - allOf: - - $ref: '#/components/schemas/ReqBaseDestination' - - $ref: '#/components/schemas/ReqRegistryDestination' - - ReqDestination: - oneOf: - - $ref: '#/components/schemas/ReqDockerhubDestination' - - $ref: '#/components/schemas/ReqLocalDestination' - discriminator: - propertyName: type - mapping: - dockerhub: "#/components/schemas/ReqDockerhubDestination" - local: "#/components/schemas/ReqLocalDestination" - - ReqTapisJobDef: - $ref: "https://raw.githubusercontent.com/tapis-project/tapis-client-java/prod/jobs-client/src/main/resources/JobsAPI.yaml#components/schemas/ReqSubmitJob" - - ReqWebhookEvent: - type: object - properties: - branch: - type: string - commit: - type: string - commit_sha: - type: string - source: - $ref: '#/components/schemas/EnumContextType' - context_url: - type: string - username: - type: string - - ReqRunPipeline: - type: object - properties: - params: - $ref: "#/components/schemas/Params" - directives: - type: array - items: - type: string - - ReqCreateTaskExecution: - type: object - required: - - task_id - - uuid - properties: - task_id: - $ref: "#/components/schemas/ID" - started_at: - type: string - last_modified: - type: string - uuid: - type: string - format: uuid - - ReqPatchTaskExecution: - type: object - properties: - last_message: - type: string - stdout: - type: string - stderr: - type: string - - ReqPatchPipelineRun: - type: object - properties: - logs: - type: string - - - # ------------------------------------------------------------------------- - # --- Response objects ---------------------------------------------------- - # ------------------------------------------------------------------------- - RespBase: - type: object - required: - - status - - message - - result - - version - - metadata - properties: - status: - type: string - default: success - message: - type: string - default: success - result: - type: object - version: - type: string - metadata: - type: object - default: {} - - RespResourceURL: - allOf: - - $ref: "#/components/schemas/RespBase" - - type: object - properties: - message: - type: string - default: 'created' - result: - $ref: '#/components/schemas/ResourceURLResult' - - ResourceURLResult: - type: object - properties: - url: - type: string - - RespString: - allOf: - - $ref: "#/components/schemas/RespBase" - - type: object - properties: - result: - type: string - - RespObject: - $ref: "#/components/schemas/RespBase" - - RespList: - allOf: - - $ref: "#/components/schemas/RespBase" - - type: object - properties: - result: - type: array - items: - type: object - - RespError: - allOf: - - $ref: "#/components/schemas/RespBase" - - type: object - properties: - status: - type: string - default: error - message: - type: string - default: error - - RespGroupDetail: - allOf: - - $ref: '#/components/schemas/RespObject' - - type: object - properties: - result: - $ref: '#/components/schemas/GroupDetail' - - RespGroupUser: - allOf: - - $ref: '#/components/schemas/RespObject' - - type: object - properties: - result: - $ref: '#/components/schemas/GroupUser' - - RespGroupUserList: - allOf: - - $ref: '#/components/schemas/RespList' - - type: object - properties: - result: - type: array - items: - $ref: '#/components/schemas/GroupUser' - - RespGroupList: - allOf: - - $ref: '#/components/schemas/RespList' - - type: object - properties: - result: - type: array - items: - $ref: '#/components/schemas/Group' - - RespIdentity: - allOf: - - $ref: '#/components/schemas/RespObject' - - type: object - properties: - result: - $ref: '#/components/schemas/Identity' - - RespIdentityList: - allOf: - - $ref: '#/components/schemas/RespList' - - type: object - properties: - result: - type: array - items: - $ref: '#/components/schemas/Identity' - - RespArchive: - allOf: - - $ref: '#/components/schemas/RespObject' - - type: object - properties: - result: - $ref: '#/components/schemas/Archive' - - RespArchiveList: - allOf: - - $ref: '#/components/schemas/RespList' - - type: object - properties: - result: - type: array - items: - $ref: '#/components/schemas/Archive' - - RespPipeline: - allOf: - - $ref: '#/components/schemas/RespObject' - - type: object - properties: - result: - $ref: '#/components/schemas/Pipeline' - - RespPipelineList: - allOf: - - $ref: '#/components/schemas/RespList' - - type: object - properties: - result: - type: array - items: - $ref: '#/components/schemas/Pipeline' - - RespPipelineRun: - allOf: - - $ref: '#/components/schemas/RespObject' - - type: object - properties: - result: - $ref: '#/components/schemas/PipelineRun' - - RespPipelineRunList: - allOf: - - $ref: '#/components/schemas/RespList' - - type: object - properties: - result: - type: array - items: - $ref: '#/components/schemas/PipelineRun' - - RespTaskExecution: - allOf: - - $ref: '#/components/schemas/RespObject' - - type: object - properties: - result: - $ref: '#/components/schemas/TaskExecution' - - RespTaskExecutionList: - allOf: - - $ref: '#/components/schemas/RespList' - - type: object - properties: - result: - type: array - items: - $ref: '#/components/schemas/TaskExecution' - - RespTask: - allOf: - - $ref: '#/components/schemas/RespObject' - - type: object - properties: - result: - $ref: '#/components/schemas/Task' - - RespTaskList: - allOf: - - $ref: '#/components/schemas/RespList' - - type: object - properties: - result: - type: array - items: - $ref: '#/components/schemas/Task' - - RespEvent: - allOf: - - $ref: '#/components/schemas/RespObject' - - type: object - properties: - result: - $ref: '#/components/schemas/Event' - - # RespEventList: - # allOf: - # - $ref: '#/components/schemas/RespList' - # - type: object - # properties: - # result: - # type: array - # items: - # $ref: '#/components/schemas/Event' - - # ------------------------------------------------------------------------- - # --- Enums --------------------------------------------------------------- - # ------------------------------------------------------------------------- - EnumArchiveType: - type: string - enum: - - system - - s3 - - EnumPipelineType: - type: string - enum: - - workflow - - ci - - EnumRunStatus: - type: string - enum: - - active - - submitted - - pending - - backoff - - completed - - failed - - suspended - - archiving - - terminated - - terminating - - skipped - - EnumInvocationMode: - type: string - enum: - - async - - sync - - EnumRetryPolicy: - type: string - enum: - - exponential_backoff - - EnumDuplicateSubmissionPolicy: - type: string - enum: - - allow - - deny - - terminate - - EnumTaskType: - type: string - enum: - - image_build - - container_run - - request - - tapis_job - - tapis_actor - - function - - EnumTaskFlavor: - type: string - enum: - - c1sml - - c1med - - c1lrg - - c1xlrg - - c1xxlrg - - g1nvdsml - - g1nvdmed - - g1nvdlrg - - EnumBuilder: - type: string - enum: - - kaniko - - singularity - - EnumContextVisibility: - type: string - enum: - - private - - public - - EnumContextType: - type: string - enum: - - github - - gitlab - - dockerhub - - local - - EnumDestinationType: - type: string - enum: - - dockerhub - - local - - EnumHTTPMethod: - type: string - enum: - - get - - post - - put - - patch - - delete - - EnumIdentityType: - type: string - enum: - - github - - dockerhub - - EnumInputType: - type: string - enum: - - string - - int - - float - - EnumInstaller: - type: string - enum: - - pip - - EnumRuntimeEnvironment: - type: string - enum: - - python:3.9 - - tapis/workflows-python-singularity:0.1.0 \ No newline at end of file