Class Jobs

java.lang.Object
mindsdb.services.Jobs

public class Jobs extends Object
The Jobs class provides methods to list, get, create, and drop jobs in a project.
  • Constructor Details

    • Jobs

      public Jobs(Project project, RestAPI api)
      Constructs a new Jobs instance with the provided project and API.
      Parameters:
      project - The project associated with the jobs.
      api - The API instance used to interact with the backend.
  • Method Details

    • list

      public List<Job> list()
      Show list of jobs in project
      Returns:
      list of Job objects
    • get

      public Job get(String name)
      Get job by name
      Parameters:
      name - job name
      Returns:
      Job object
    • create

      public Job create(String name, String queryStr, LocalDateTime startAt, LocalDateTime endAt, String repeatStr, Integer repeatMin)
      Create job in project
      Parameters:
      name - name of the job
      queryStr - query string
      startAt - start time
      endAt - end time
      repeatStr - repeat string
      repeatMin - repeat minutes
      Returns:
      Job object
    • create

      public Job create(String name)
      Create job with only name
      Parameters:
      name - name of the job
      Returns:
      Job object
    • create

      public Job create(String name, LocalDateTime startAt, LocalDateTime endAt, String repeatStr, Integer repeatMin)
      Create job without query string
      Parameters:
      name - - name of the job
      startAt - - start time
      endAt - - end time
      repeatStr - - repeat string
      repeatMin - - repeat minutes
      Returns:
      Job object
    • create

      public Job create(String name, String queryStr)
      Create job with name and query string
      Parameters:
      name - name of the job
      queryStr - query string
      Returns:
      Job object
    • create

      public Job create(String name, String queryStr, LocalDateTime startAt, LocalDateTime endAt)
      Create job with name, query string, start time, and end time
      Parameters:
      name - name of the job
      queryStr - query string
      startAt - start time
      endAt - end time
      Returns:
      Job object
    • create

      public Job create(String name, String queryStr, LocalDateTime startAt, LocalDateTime endAt, String repeatStr)
      Create job with name, query string, start time, end time, and repeat string
      Parameters:
      name - name of the job
      queryStr - query string
      startAt - start time
      endAt - end time
      repeatStr - repeat string
      Returns:
      Job object
    • create

      public Job create(String name, List<String> queryStr)
      Create job with name and list of query strings
      Parameters:
      name - name of the job
      queryStr - list of query strings
      Returns:
      Job object
    • create

      public Job create(String name, List<String> queryStr, LocalDateTime startAt, LocalDateTime endAt)
      Create job with name, list of query strings, start time, and end time
      Parameters:
      name - name of the job
      queryStr - list of query strings
      startAt - start time
      endAt - end time
      Returns:
      Job object
    • create

      public Job create(String name, List<String> queryStr, LocalDateTime startAt, LocalDateTime endAt, String repeatStr)
      Create job with name, list of query strings, start time, end time, and repeat string
      Parameters:
      name - name of the job
      queryStr - list of query strings
      startAt - start time
      endAt - end time
      repeatStr - repeat string
      Returns:
      Job object
    • create

      public Job create(String name, List<String> queryStr, LocalDateTime startAt, LocalDateTime endAt, Integer repeatMin)
      Create job with name, list of query strings, start time, end time, and repeat minutes
      Parameters:
      name - name of the job
      queryStr - list of query strings
      startAt - start time
      endAt - end time
      repeatMin - repeat minutes
      Returns:
      Job object
    • drop

      public void drop(String name)
      Drop job from project
      Parameters:
      name - name of the job