def delete_schedule(self, workflow): """Delete schedule config for a given workflow. Args: workflow: The workflow name where the job is defined. """ path = Path(workflow=workflow) self._delete_config(path.get_schedule_path())
def put_schedule(self, schedule_config): """Add or replace a workflow schedule. Args: schedule_config: The schedule config to add or replace. """ path = Path(workflow=schedule_config.workflow) schedule_config_json = Repository._json_pretty_print( schedule_config.format()) self._put_config(path.get_schedule_path(), schedule_config_json)
def get_schedule(self, workflow): """Retrieve schedule config for a given workflow. Args: workflow: The workflow name whose schedule should be retrieved. Returns: The schedule config. """ path = Path(workflow=workflow) schedule_json = self._get_config(path.get_schedule_path()) return WorkflowScheduleConfig.from_json(schedule_json)
def test_schedule_path(self): path = Path(workflow='some_workflow') self.assertEqual('/workflow/some_workflow/schedule', path.get_schedule_path())