Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduler update apis are not consistent with REST APIs #128

Closed
3coins opened this issue Oct 12, 2022 · 0 comments · Fixed by #131
Closed

Scheduler update apis are not consistent with REST APIs #128

3coins opened this issue Oct 12, 2022 · 0 comments · Fixed by #131
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@3coins
Copy link
Collaborator

3coins commented Oct 12, 2022

Problem

Scheduler update APIs are using models that require job_id or job_definition_id as required attributes. This means, that the payload from the REST call has to include these. This is inconsistent with the REST APIs, as the ids should be populated from the path query.

Proposed Solution

  • Remove job_id from UpdateJob model
  • Update definition of update_job in Scheduler.py to take job_id as one of the inputs
  • Remove job_definition_id from UpdateJobDefinition model
  • Update definition of update_job_definition in Scheduler.py to take job_definition_id as one of the inputs.

Additional context

class UpdateJob(BaseModel):
job_id: str
end_time: Optional[int] = None
status: Optional[Status] = None
status_message: Optional[str] = None
name: Optional[str] = None
compute_type: Optional[str] = None

class UpdateJobDefinition(BaseModel):
job_definition_id: str
input_uri: Optional[str]
output_prefix: Optional[str]
runtime_environment_name: Optional[str]
runtime_environment_parameters: Optional[Dict[str, EnvironmentParameterValues]]
output_formats: Optional[List[str]] = None
parameters: Optional[Dict[str, ParameterValues]] = None
tags: Optional[Tags] = None
name: Optional[str] = None
url: Optional[str] = None
schedule: Optional[str] = None
timezone: Optional[str] = None # Should be a timezone e.g., US/Eastern, Asia/Kolkata
output_filename_template: Optional[str] = OUTPUT_FILENAME_TEMPLATE
active: Optional[bool] = None

def update_job(self, model: UpdateJob):

def update_job_definition(self, model: UpdateJobDefinition):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant