Skip to content

Commit

Permalink
update openai yaml and method linked to use body with post instead of…
Browse files Browse the repository at this point in the history
… query params (#93)
  • Loading branch information
scrowley-Datirium authored Oct 17, 2023
1 parent 2937fde commit 4597176
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
8 changes: 7 additions & 1 deletion cwl_airflow/components/api/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,13 @@ def post_dag_runs(self, dag_id, run_id=None, conf=None):
return run_workflow_execution_simulation(self.suite_data, dag_id, run_id)


def post_dags_dag_runs(self, dag_id, run_id, conf=None):
def post_dags_dag_runs(self, body: dict):
workflow_content = None if body['workflow_content'] is None else body['workflow_content']
workflow_data = None if body['workflow_data'] is None else body['workflow_data']
dag_id = None if workflow_data['dag_id'] is None else workflow_data['dag_id']
run_id = None if workflow_data['run_id'] is None else workflow_data['run_id']
project_id = None if run_data['proj_id'] is None else run_data['proj_id']
conf = None if run_data['conf'] is None else run_data['conf']
logging.info(f"Call post_dags_dag_runs with dag_id={dag_id}, run_id={run_id}, conf={conf}")
conf = "{\"job\":{}}" if conf is None else conf # safety measure if conf wasn't provided
if not self.simulation_mode:
Expand Down
44 changes: 18 additions & 26 deletions cwl_airflow/components/api/openapi/swagger_configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ paths:
- removing outdated dags for the same cwlid if no running dag_runs were found for them
3. Creates new dag_run for dag_id with run_id and optional conf
operationId: post_dags_dag_runs
consumes:
- multipart/form-data
responses:
"200":
description: Reference information about created dag and dag_run.
Expand All @@ -232,31 +230,12 @@ paths:
schema:
$ref: "#/definitions/ErrorResponse"
parameters:
- name: dag_id
description: Dag identifier, follow the naming rule "cwlid-commitsha"
in: query
required: true
type: string
- name: run_id
description: Run identifier
in: query
- name: body
description: request body
in: body
required: true
type: string
- name: conf
description: Run configuration (JSON-formatted string)
in: query
required: false
type: string
- name: workflow
description: CWL workflow file with embedded tools and all other dependencies
in: formData
required: false
type: file
- name: workflow_content
description: base64 encoded gzip compressed workflow content
in: formData
required: false
type: string
schema:
$ref: "#/definitions/ReqBody"
tags:
- Airflow

Expand Down Expand Up @@ -603,6 +582,19 @@ paths:


definitions:

ReqBody:
type: object
required:
- workflow_content
- workflow_data
properties:
workflow_content:
type: string
workflow_data:
type: object
description: object with packed workflow_content, and stringified sample config


GetDagsResponse:
type: object
Expand Down

0 comments on commit 4597176

Please sign in to comment.