Пример #1
0
    def stop_schedule(self, schedule_name: str):
        # Load details
        schedule_details = load_schedule_details(cluster_name=self.cluster_name, schedule_name=schedule_name)
        job_names = schedule_details['job_names']

        for job_name in job_names:
            # Load job details
            job_details = load_job_details(cluster_name=self.cluster_name, job_name=job_name)
            job_schedule_tag = job_details['tags']['schedule']

            # Remote stop job
            if job_schedule_tag == schedule_name:
                self.grass_executor.remote_create_killed_job_ticket(job_name=job_name)
                self.grass_executor.remote_delete_pending_job_ticket(job_name=job_name)
Пример #2
0
    def stop_schedule(self, schedule_name: str):
        # Load details
        schedule_details = load_schedule_details(cluster_name=self.cluster_name, schedule_name=schedule_name)
        job_names = schedule_details['job_names']

        for job_name in job_names:
            # Load job details
            job_details = load_job_details(cluster_name=self.cluster_name, job_name=job_name)
            job_schedule_tag = job_details['tags']['schedule']

            # Stop job
            if job_schedule_tag == schedule_name:
                self.stop_job(
                    job_name=job_name
                )