Package com.netflix.genie.client.apis
Interface JobService
public interface JobService
An interface that provides all methods needed for the Genie job client implementation.
- Since:
- 3.0.0
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionretrofit2.Call<Job>
Method to fetch a single job from Genie.retrofit2.Call<List<Application>>
getJobApplications
(String jobId) Method to get the Applications for a job.retrofit2.Call<Cluster>
getJobCluster
(String jobId) Method to get the cluster information on which a job is run.retrofit2.Call<Command>
getJobCommand
(String jobId) Method to get the command information on which a job is run.retrofit2.Call<JobExecution>
getJobExecution
(String jobId) Method to get the execution information for a job.retrofit2.Call<JobMetadata>
getJobMetadata
(String jobId) Method to get the metadata information for a job.retrofit2.Call<okhttp3.ResponseBody>
getJobOutputFile
(String jobId, String outputFilePath) Method to fetch an output file for a job from Genie.retrofit2.Call<okhttp3.ResponseBody>
getJobOutputFile
(String jobId, String outputFilePath, String range) Method to fetch partial output file for a job from Genie.retrofit2.Call<JobRequest>
getJobRequest
(String jobId) Method to get the JobRequest for a job.retrofit2.Call<com.fasterxml.jackson.databind.JsonNode>
getJobs
(String id, String name, String user, Set<String> statuses, Set<String> tags, String clusterName, String clusterId, String commandName, String commandId, Long minStarted, Long maxStarted, Long minFinished, Long maxFinished, String grouping, String groupingInstance, Integer size, String sort, Integer page) Method to get all jobs from Genie.retrofit2.Call<com.fasterxml.jackson.databind.JsonNode>
getJobStatus
(String jobId) Method to get Job status.retrofit2.Call<Void>
Method to send a job kill request to Genie.retrofit2.Call<Void>
submitJob
(JobRequest request) Method to submit a job to Genie.retrofit2.Call<Void>
submitJob
(Map<String, String> customHeaders, JobRequest request) Method to submit a job to Genie with user defined custom headers.retrofit2.Call<Void>
submitJobWithAttachments
(JobRequest request, List<okhttp3.MultipartBody.Part> attachments) Submit a job with attachments.retrofit2.Call<Void>
submitJobWithAttachments
(Map<String, String> customHeaders, JobRequest request, List<okhttp3.MultipartBody.Part> attachments) Submit a job with attachments and custom headers.
-
Field Details
-
JOBS_URL_SUFFIX
Path to Jobs.- See Also:
-
-
Method Details
-
submitJob
Method to submit a job to Genie.- Parameters:
request
- The request object containing all the- Returns:
- A callable object.
-
submitJob
@POST("/api/v3/jobs") retrofit2.Call<Void> submitJob(@HeaderMap Map<String, String> customHeaders, @Body JobRequest request) Method to submit a job to Genie with user defined custom headers.- Parameters:
customHeaders
- client defined custom headers.request
- The request object containing all the- Returns:
- A callable object.
-
submitJobWithAttachments
@Multipart @POST("/api/v3/jobs") retrofit2.Call<Void> submitJobWithAttachments(@Part("request") JobRequest request, @Part List<okhttp3.MultipartBody.Part> attachments) Submit a job with attachments.- Parameters:
request
- A JobRequest object containing all the details needed to run the job.attachments
- A list of all the attachment files to be sent to the server.- Returns:
- A callable object.
-
submitJobWithAttachments
@Multipart @POST("/api/v3/jobs") retrofit2.Call<Void> submitJobWithAttachments(@HeaderMap Map<String, String> customHeaders, @Part("request") JobRequest request, @Part List<okhttp3.MultipartBody.Part> attachments) Submit a job with attachments and custom headers.- Parameters:
customHeaders
- client defined custom headers.request
- A JobRequest object containing all the details needed to run the job.attachments
- A list of all the attachment files to be sent to the server.- Returns:
- A callable object.
-
getJobs
@GET("/api/v3/jobs") retrofit2.Call<com.fasterxml.jackson.databind.JsonNode> getJobs(@Query("id") String id, @Query("name") String name, @Query("user") String user, @Query("status") Set<String> statuses, @Query("tag") Set<String> tags, @Query("clusterName") String clusterName, @Query("clusterId") String clusterId, @Query("commandName") String commandName, @Query("commandId") String commandId, @Query("minStarted") Long minStarted, @Query("maxStarted") Long maxStarted, @Query("minFinished") Long minFinished, @Query("maxFinished") Long maxFinished, @Query("grouping") String grouping, @Query("groupingInstance") String groupingInstance, @Query("size") Integer size, @Query("sort") String sort, @Query("page") Integer page) Method to get all jobs from Genie.- Parameters:
id
- id for jobname
- name of job (can be a SQL-style pattern such as HIVE%)user
- user who submitted jobstatuses
- statuses of jobs to findtags
- tags for the jobclusterName
- the name of the clusterclusterId
- the id of the clustercommandName
- the name of the command run by the jobcommandId
- the id of the command run by the jobminStarted
- The time which the job had to start after in order to be return (inclusive)maxStarted
- The time which the job had to start before in order to be returned (exclusive)minFinished
- The time which the job had to finish after in order to be return (inclusive)maxFinished
- The time which the job had to finish before in order to be returned (exclusive)grouping
- The grouping the job should be a member ofgroupingInstance
- The grouping instance the job should be a member ofsize
- The maximum number of results in the pagesort
- The sort orderpage
- The page index- Returns:
- A callable object.
-
getJob
Method to fetch a single job from Genie.- Parameters:
jobId
- The id of the job to get.- Returns:
- A callable object.
-
getJobOutputFile
@Streaming @GET("/api/v3/jobs/{id}/output/{path}") retrofit2.Call<okhttp3.ResponseBody> getJobOutputFile(@Path("id") String jobId, @Path(value="path",encoded=true) String outputFilePath) Method to fetch an output file for a job from Genie.NOTE: If the specified outputFilePath is a directory, then the directory manifest is returned.
- Parameters:
jobId
- The id of the job whose output file is desired.outputFilePath
- The path to the file within output directory.- Returns:
- A callable object.
-
getJobOutputFile
@Streaming @GET("/api/v3/jobs/{id}/output/{path}") retrofit2.Call<okhttp3.ResponseBody> getJobOutputFile(@Path("id") String jobId, @Path(value="path",encoded=true) String outputFilePath, @Header("Range") String range) Method to fetch partial output file for a job from Genie.NOTE: If the specified outputFilePath is a directory, then the directory manifest is returned.
- Parameters:
jobId
- The id of the job whose output file is desired.outputFilePath
- The path to the file within output directory.range
- The range header value- Returns:
- A callable object.
-
getJobStatus
@GET("/api/v3/jobs/{id}/status") retrofit2.Call<com.fasterxml.jackson.databind.JsonNode> getJobStatus(@Path("id") String jobId) Method to get Job status.- Parameters:
jobId
- The id of the job whose status is desired.- Returns:
- A callable object.
-
getJobCluster
Method to get the cluster information on which a job is run.- Parameters:
jobId
- The id of the job.- Returns:
- A callable object.
-
getJobCommand
Method to get the command information on which a job is run.- Parameters:
jobId
- The id of the job.- Returns:
- A callable object.
-
getJobRequest
@GET("/api/v3/jobs/{id}/request") retrofit2.Call<JobRequest> getJobRequest(@Path("id") String jobId) Method to get the JobRequest for a job.- Parameters:
jobId
- The id of the job.- Returns:
- A callable object.
-
getJobExecution
@GET("/api/v3/jobs/{id}/execution") retrofit2.Call<JobExecution> getJobExecution(@Path("id") String jobId) Method to get the execution information for a job.- Parameters:
jobId
- The id of the job.- Returns:
- A callable object.
-
getJobMetadata
@GET("/api/v3/jobs/{id}/metadata") retrofit2.Call<JobMetadata> getJobMetadata(@Path("id") String jobId) Method to get the metadata information for a job.- Parameters:
jobId
- The id of the job.- Returns:
- A callable object.
-
getJobApplications
@GET("/api/v3/jobs/{id}/applications") retrofit2.Call<List<Application>> getJobApplications(@Path("id") String jobId) Method to get the Applications for a job.- Parameters:
jobId
- The id of the job.- Returns:
- A callable object.
-
killJob
Method to send a job kill request to Genie.- Parameters:
jobId
- The id of the job.- Returns:
- A callable object.
-