Skip to content

Commit

Permalink
add missing CronWorkflow message object
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciusdc committed Jan 12, 2024
1 parent c89b948 commit 896199c
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 31 deletions.
16 changes: 16 additions & 0 deletions protos/workflow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,22 @@ message Workflow {
Spec spec = 2;
}

message CronSpec {
string schedule = 1;
string timezone = 2;
optional string startingDeadlineSeconds = 3;
optional string concurrencyPolicy = 4;
optional string successfulJobsHistoryLimit = 5;
optional string failedJobsHistoryLimit = 6;
optional string suspend = 7;
Spec workflowSpec = 8;
}

message CronWorkflow {
Metadata metadata = 1;
CronSpec spec = 2;
}

/**
* Argo workflow CRUD resources
*/
Expand Down
25 changes: 25 additions & 0 deletions python/naas_models/pydantic/workflow_p2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,31 @@ class Workflow(BaseModel):



class CronSpec(BaseModel):

_one_of_dict = {"CronSpec._concurrencyPolicy": {"fields": {"concurrencyPolicy"}}, "CronSpec._failedJobsHistoryLimit": {"fields": {"failedJobsHistoryLimit"}}, "CronSpec._startingDeadlineSeconds": {"fields": {"startingDeadlineSeconds"}}, "CronSpec._successfulJobsHistoryLimit": {"fields": {"successfulJobsHistoryLimit"}}, "CronSpec._suspend": {"fields": {"suspend"}}}
_check_one_of = root_validator(pre=True, allow_reuse=True)(check_one_of)

schedule: str = FieldInfo(default="")
timezone: str = FieldInfo(default="")
startingDeadlineSeconds: str = FieldInfo(default="")
concurrencyPolicy: str = FieldInfo(default="")
successfulJobsHistoryLimit: str = FieldInfo(default="")
failedJobsHistoryLimit: str = FieldInfo(default="")
suspend: str = FieldInfo(default="")
workflowSpec: Spec = FieldInfo()




class CronWorkflow(BaseModel):

metadata: Metadata = FieldInfo()
spec: CronSpec = FieldInfo()




class WorkflowCreationRequest(BaseModel):

_one_of_dict = {"WorkflowCreationRequest._description": {"fields": {"description"}}, "WorkflowCreationRequest._name": {"fields": {"name"}}, "WorkflowCreationRequest._namespace": {"fields": {"namespace"}}, "WorkflowCreationRequest._serverDryRun": {"fields": {"serverDryRun"}}, "WorkflowCreationRequest._user_uid": {"fields": {"user_uid"}}, "WorkflowCreationRequest._workflow": {"fields": {"workflow"}}}
Expand Down
Loading

0 comments on commit 896199c

Please sign in to comment.