Skip to content

Commit

Permalink
add the PUT request's body to schema
Browse files Browse the repository at this point in the history
  • Loading branch information
martenson committed Sep 27, 2023
1 parent 18b7807 commit 611f63d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 13 deletions.
35 changes: 26 additions & 9 deletions client/src/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6218,6 +6218,17 @@ export interface components {
/** Uninstalled */
uninstalled: boolean;
};
/**
* InvocationUpdatePayload
* @description Base model definition with common configuration used by all derived models.
*/
InvocationUpdatePayload: {
/**
* Action
* @description Whether to take action.
*/
action: boolean;
};
/**
* ItemTagsPayload
* @description Base model definition with common configuration used by all derived models.
Expand Down Expand Up @@ -14752,9 +14763,6 @@ export interface operations {
update_invocation_step_api_invocations__invocation_id__steps__step_id__put: {
/** Update state of running workflow step invocation - still very nebulous but this would be for stuff like confirming paused steps can proceed etc. */
parameters: {
query?: {
action?: boolean;
};
/** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */
header?: {
"run-as"?: string;
Expand All @@ -14766,6 +14774,11 @@ export interface operations {
step_id: string;
};
};
requestBody: {
content: {
"application/json": components["schemas"]["InvocationUpdatePayload"];
};
};
responses: {
/** @description Successful Response */
200: {
Expand Down Expand Up @@ -19065,9 +19078,6 @@ export interface operations {
* @description A wrapper for multiple API endpoints providing the same logic.
*/
parameters: {
query?: {
action?: boolean;
};
/** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */
header?: {
"run-as"?: string;
Expand All @@ -19081,6 +19091,11 @@ export interface operations {
step_id: string;
};
};
requestBody: {
content: {
"application/json": components["schemas"]["InvocationUpdatePayload"];
};
};
responses: {
/** @description Successful Response */
200: {
Expand Down Expand Up @@ -19366,9 +19381,6 @@ export interface operations {
* @description A wrapper for multiple API endpoints providing the same logic.
*/
parameters: {
query?: {
action?: boolean;
};
/** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */
header?: {
"run-as"?: string;
Expand All @@ -19382,6 +19394,11 @@ export interface operations {
step_id: string;
};
};
requestBody: {
content: {
"application/json": components["schemas"]["InvocationUpdatePayload"];
};
};
responses: {
/** @description Successful Response */
200: {
Expand Down
7 changes: 7 additions & 0 deletions lib/galaxy/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,13 @@ class JobIndexQueryPayload(Model):
offset: int = 0


class InvocationUpdatePayload(Model):
action: bool = Field(
title="Action",
description="Whether to take action.",
)


class InvocationSortByEnum(str, Enum):
create_time = "create_time"
update_time = "update_time"
Expand Down
9 changes: 5 additions & 4 deletions lib/galaxy/webapps/galaxy/api/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
from galaxy.schema.schema import (
AsyncFile,
AsyncTaskResultSummary,
InvocationUpdatePayload,
SetSlugPayload,
ShareWithPayload,
ShareWithStatus,
Expand Down Expand Up @@ -1419,9 +1420,9 @@ def update_invocation_step(
trans: ProvidesUserContext = DependsOnTrans,
invocation_id: DecodedDatabaseIdField = InvocationIDPathParam,
step_id: DecodedDatabaseIdField = WorkflowInvocationStepIDPathParam,
action: bool = True,
payload: InvocationUpdatePayload = Body(...),
):
return self.invocations_service.update_invocation_step(trans, step_id, action)
return self.invocations_service.update_invocation_step(trans, step_id, payload.action)

@router.put(
"/api/workflows/{workflow_id}/invocations/{invocation_id}/steps/{step_id}",
Expand All @@ -1438,10 +1439,10 @@ def update_workflow_invocation_step(
workflow_id: DecodedDatabaseIdField = StoredWorkflowIDPathParam,
invocation_id: DecodedDatabaseIdField = InvocationIDPathParam,
step_id: DecodedDatabaseIdField = WorkflowInvocationStepIDPathParam,
action: bool = True,
payload: InvocationUpdatePayload = Body(...),
):
"""A wrapper for multiple API endpoints providing the same logic."""
return self.update_invocation_step(trans, step_id=step_id, action=action)
return self.update_invocation_step(trans, step_id=step_id, payload=payload)

@router.get(
"/api/invocations/{invocation_id}/step_jobs_summary",
Expand Down

0 comments on commit 611f63d

Please sign in to comment.