Ejemplo n.º 1
0
    def project(
        self,
        *,
        project: str,
        name: str,
        build: Optional[str] = None,
        all_jobs: Optional[bool] = False,
    ) -> None:
        job_state = JobState.available()
        if all_jobs:
            job_state = [x for x in JobState]

        for job in self.onefuzz.jobs.list(job_state=job_state):
            if job.config.project != project:
                continue
            if job.config.name != name:
                continue
            if build is not None and job.config.build != build:
                continue

            self.job(job.job_id)
Ejemplo n.º 2
0
    def search_expired(cls) -> List["Job"]:
        time_filter = "end_time lt datetime'%s'" % datetime.utcnow().isoformat(
        )

        return cls.search(query={"state": JobState.available()},
                          raw_unchecked_filter=time_filter)