diff --git a/azure-hdinsight-job/pom.xml b/azure-hdinsight-job/pom.xml new file mode 100644 index 000000000000..5a08f99f7fe9 --- /dev/null +++ b/azure-hdinsight-job/pom.xml @@ -0,0 +1,115 @@ + + + 4.0.0 + com.microsoft.azure + azure- + 1.7.1-SNAPSHOT + jar + Microsoft Azure SDK for + This package contains Microsoft SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + 1.5.3 + + + junit + junit + 4.12 + test + + + com.microsoft.azure + azure-client-authentication + 1.5.3 + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/HDInsightJobClient.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/HDInsightJobClient.java new file mode 100644 index 000000000000..dbe351584b34 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/HDInsightJobClient.java @@ -0,0 +1,119 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for HDInsightJobClient class. + */ +public interface HDInsightJobClient { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets The cluster endpoint, for example https://clustername.azurehdinsight.net.. + * + * @return the endpoint value. + */ + String endpoint(); + + /** + * Sets The cluster endpoint, for example https://clustername.azurehdinsight.net.. + * + * @param endpoint the endpoint value. + * @return the service client itself + */ + HDInsightJobClient withEndpoint(String endpoint); + + /** + * Gets The user name used for running job.. + * + * @return the username value. + */ + String username(); + + /** + * Sets The user name used for running job.. + * + * @param username the username value. + * @return the service client itself + */ + HDInsightJobClient withUsername(String username); + + /** + * Gets The preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets The preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + HDInsightJobClient withAcceptLanguage(String acceptLanguage); + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + HDInsightJobClient withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + HDInsightJobClient withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the Jobs object to access its operations. + * @return the Jobs object. + */ + Jobs jobs(); + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/Jobs.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/Jobs.java new file mode 100644 index 000000000000..5fac4318ee60 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/Jobs.java @@ -0,0 +1,1546 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job; + +import com.microsoft.azure.CloudException; +import com.microsoft.azure.hdinsight.job.models.AppState; +import com.microsoft.azure.hdinsight.job.models.JobDetailRootJsonObject; +import com.microsoft.azure.hdinsight.job.models.JobListJsonObject; +import com.microsoft.azure.hdinsight.job.models.JobOperationsErrorResponseException; +import com.microsoft.azure.hdinsight.job.models.JobSubmissionJsonResponse; +import com.microsoft.azure.hdinsight.job.models.SparkBatchJob; +import com.microsoft.azure.hdinsight.job.models.SparkBatchJobCollection; +import com.microsoft.azure.hdinsight.job.models.SparkBatchJobRequest; +import com.microsoft.azure.hdinsight.job.models.SparkJobDeletedResult; +import com.microsoft.azure.hdinsight.job.models.SparkJobLog; +import com.microsoft.azure.hdinsight.job.models.SparkJobState; +import com.microsoft.azure.hdinsight.job.models.SparkSessionCollection; +import com.microsoft.azure.hdinsight.job.models.SparkSessionJob; +import com.microsoft.azure.hdinsight.job.models.SparkSessionJobRequest; +import com.microsoft.azure.hdinsight.job.models.SparkStatement; +import com.microsoft.azure.hdinsight.job.models.SparkStatementCancellationResult; +import com.microsoft.azure.hdinsight.job.models.SparkStatementCollection; +import com.microsoft.azure.hdinsight.job.models.SparkStatementRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Jobs. + */ +public interface Jobs { + /** + * Gets job details from the specified HDInsight cluster. + * + * @param jobId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobDetailRootJsonObject object if successful. + */ + JobDetailRootJsonObject get(String jobId); + + /** + * Gets job details from the specified HDInsight cluster. + * + * @param jobId The id of the job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getAsync(String jobId, final ServiceCallback serviceCallback); + + /** + * Gets job details from the specified HDInsight cluster. + * + * @param jobId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDetailRootJsonObject object + */ + Observable getAsync(String jobId); + + /** + * Gets job details from the specified HDInsight cluster. + * + * @param jobId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDetailRootJsonObject object + */ + Observable> getWithServiceResponseAsync(String jobId); + + /** + * Initiates cancel on given running job in the specified HDInsight. + * + * @param jobId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobDetailRootJsonObject object if successful. + */ + JobDetailRootJsonObject kill(String jobId); + + /** + * Initiates cancel on given running job in the specified HDInsight. + * + * @param jobId The id of the job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture killAsync(String jobId, final ServiceCallback serviceCallback); + + /** + * Initiates cancel on given running job in the specified HDInsight. + * + * @param jobId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDetailRootJsonObject object + */ + Observable killAsync(String jobId); + + /** + * Initiates cancel on given running job in the specified HDInsight. + * + * @param jobId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDetailRootJsonObject object + */ + Observable> killWithServiceResponseAsync(String jobId); + + /** + * Gets the list of jobs from the specified HDInsight cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<JobListJsonObject> object if successful. + */ + List list(); + + /** + * Gets the list of jobs from the specified HDInsight cluster. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listAsync(final ServiceCallback> serviceCallback); + + /** + * Gets the list of jobs from the specified HDInsight cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<JobListJsonObject> object + */ + Observable> listAsync(); + + /** + * Gets the list of jobs from the specified HDInsight cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<JobListJsonObject> object + */ + Observable>> listWithServiceResponseAsync(); + + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<JobListJsonObject> object if successful. + */ + List listAfterJobId(); + + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listAfterJobIdAsync(final ServiceCallback> serviceCallback); + + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<JobListJsonObject> object + */ + Observable> listAfterJobIdAsync(); + + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<JobListJsonObject> object + */ + Observable>> listAfterJobIdWithServiceResponseAsync(); + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @param jobid JobId from where to list jobs. + * @param numrecords Number of jobs to fetch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<JobListJsonObject> object if successful. + */ + List listAfterJobId(String jobid, Integer numrecords); + + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @param jobid JobId from where to list jobs. + * @param numrecords Number of jobs to fetch. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listAfterJobIdAsync(String jobid, Integer numrecords, final ServiceCallback> serviceCallback); + + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @param jobid JobId from where to list jobs. + * @param numrecords Number of jobs to fetch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<JobListJsonObject> object + */ + Observable> listAfterJobIdAsync(String jobid, Integer numrecords); + + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @param jobid JobId from where to list jobs. + * @param numrecords Number of jobs to fetch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<JobListJsonObject> object + */ + Observable>> listAfterJobIdWithServiceResponseAsync(String jobid, Integer numrecords); + + /** + * Submits a Hive job to an HDInsight cluster. + * + * @param content The content of the Hive job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobSubmissionJsonResponse object if successful. + */ + JobSubmissionJsonResponse submitHiveJob(byte[] content); + + /** + * Submits a Hive job to an HDInsight cluster. + * + * @param content The content of the Hive job request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture submitHiveJobAsync(byte[] content, final ServiceCallback serviceCallback); + + /** + * Submits a Hive job to an HDInsight cluster. + * + * @param content The content of the Hive job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + Observable submitHiveJobAsync(byte[] content); + + /** + * Submits a Hive job to an HDInsight cluster. + * + * @param content The content of the Hive job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + Observable> submitHiveJobWithServiceResponseAsync(byte[] content); + + /** + * Submits a MapReduce job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobSubmissionJsonResponse object if successful. + */ + JobSubmissionJsonResponse submitMapReduceJob(byte[] content); + + /** + * Submits a MapReduce job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture submitMapReduceJobAsync(byte[] content, final ServiceCallback serviceCallback); + + /** + * Submits a MapReduce job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + Observable submitMapReduceJobAsync(byte[] content); + + /** + * Submits a MapReduce job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + Observable> submitMapReduceJobWithServiceResponseAsync(byte[] content); + + /** + * Submits a MapReduce streaming job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobSubmissionJsonResponse object if successful. + */ + JobSubmissionJsonResponse submitMapReduceStreamingJob(byte[] content); + + /** + * Submits a MapReduce streaming job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture submitMapReduceStreamingJobAsync(byte[] content, final ServiceCallback serviceCallback); + + /** + * Submits a MapReduce streaming job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + Observable submitMapReduceStreamingJobAsync(byte[] content); + + /** + * Submits a MapReduce streaming job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + Observable> submitMapReduceStreamingJobWithServiceResponseAsync(byte[] content); + + /** + * Submits a Pig job to an HDInsight cluster. + * + * @param content The content of the Pig job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobSubmissionJsonResponse object if successful. + */ + JobSubmissionJsonResponse submitPigJob(byte[] content); + + /** + * Submits a Pig job to an HDInsight cluster. + * + * @param content The content of the Pig job request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture submitPigJobAsync(byte[] content, final ServiceCallback serviceCallback); + + /** + * Submits a Pig job to an HDInsight cluster. + * + * @param content The content of the Pig job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + Observable submitPigJobAsync(byte[] content); + + /** + * Submits a Pig job to an HDInsight cluster. + * + * @param content The content of the Pig job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + Observable> submitPigJobWithServiceResponseAsync(byte[] content); + + /** + * Submits a Sqoop job to an HDInsight cluster. + * + * @param content The content of the Sqoop job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobSubmissionJsonResponse object if successful. + */ + JobSubmissionJsonResponse submitSqoopJob(byte[] content); + + /** + * Submits a Sqoop job to an HDInsight cluster. + * + * @param content The content of the Sqoop job request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture submitSqoopJobAsync(byte[] content, final ServiceCallback serviceCallback); + + /** + * Submits a Sqoop job to an HDInsight cluster. + * + * @param content The content of the Sqoop job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + Observable submitSqoopJobAsync(byte[] content); + + /** + * Submits a Sqoop job to an HDInsight cluster. + * + * @param content The content of the Sqoop job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + Observable> submitSqoopJobWithServiceResponseAsync(byte[] content); + + /** + * Gets application state from the specified HDInsight cluster. + * + * @param appId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AppState object if successful. + */ + AppState getAppState(String appId); + + /** + * Gets application state from the specified HDInsight cluster. + * + * @param appId The id of the job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getAppStateAsync(String appId, final ServiceCallback serviceCallback); + + /** + * Gets application state from the specified HDInsight cluster. + * + * @param appId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppState object + */ + Observable getAppStateAsync(String appId); + + /** + * Gets application state from the specified HDInsight cluster. + * + * @param appId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppState object + */ + Observable> getAppStateWithServiceResponseAsync(String appId); + + /** + * List all spark batch jobs. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkBatchJobCollection object if successful. + */ + SparkBatchJobCollection listSparkBatchJob(); + + /** + * List all spark batch jobs. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture listSparkBatchJobAsync(final ServiceCallback serviceCallback); + + /** + * List all spark batch jobs. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJobCollection object + */ + Observable listSparkBatchJobAsync(); + + /** + * List all spark batch jobs. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJobCollection object + */ + Observable> listSparkBatchJobWithServiceResponseAsync(); + /** + * List all spark batch jobs. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkBatchJobCollection object if successful. + */ + SparkBatchJobCollection listSparkBatchJob(Integer from, Integer size); + + /** + * List all spark batch jobs. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture listSparkBatchJobAsync(Integer from, Integer size, final ServiceCallback serviceCallback); + + /** + * List all spark batch jobs. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJobCollection object + */ + Observable listSparkBatchJobAsync(Integer from, Integer size); + + /** + * List all spark batch jobs. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJobCollection object + */ + Observable> listSparkBatchJobWithServiceResponseAsync(Integer from, Integer size); + + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkBatchJob object if successful. + */ + SparkBatchJob submitSparkBatchJob(SparkBatchJobRequest sparkBatchJobRequest); + + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture submitSparkBatchJobAsync(SparkBatchJobRequest sparkBatchJobRequest, final ServiceCallback serviceCallback); + + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJob object + */ + Observable submitSparkBatchJobAsync(SparkBatchJobRequest sparkBatchJobRequest); + + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJob object + */ + Observable> submitSparkBatchJobWithServiceResponseAsync(SparkBatchJobRequest sparkBatchJobRequest); + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkBatchJob object if successful. + */ + SparkBatchJob submitSparkBatchJob(SparkBatchJobRequest sparkBatchJobRequest, String requestedBy); + + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture submitSparkBatchJobAsync(SparkBatchJobRequest sparkBatchJobRequest, String requestedBy, final ServiceCallback serviceCallback); + + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJob object + */ + Observable submitSparkBatchJobAsync(SparkBatchJobRequest sparkBatchJobRequest, String requestedBy); + + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJob object + */ + Observable> submitSparkBatchJobWithServiceResponseAsync(SparkBatchJobRequest sparkBatchJobRequest, String requestedBy); + + /** + * Gets a single spark batch job. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkBatchJob object if successful. + */ + SparkBatchJob getSparkBatchJob(int batchId); + + /** + * Gets a single spark batch job. + * + * @param batchId Identifier for the batch job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSparkBatchJobAsync(int batchId, final ServiceCallback serviceCallback); + + /** + * Gets a single spark batch job. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJob object + */ + Observable getSparkBatchJobAsync(int batchId); + + /** + * Gets a single spark batch job. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJob object + */ + Observable> getSparkBatchJobWithServiceResponseAsync(int batchId); + + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobDeletedResult object if successful. + */ + SparkJobDeletedResult deleteSparkBatch(int batchId); + + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteSparkBatchAsync(int batchId, final ServiceCallback serviceCallback); + + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + Observable deleteSparkBatchAsync(int batchId); + + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + Observable> deleteSparkBatchWithServiceResponseAsync(int batchId); + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobDeletedResult object if successful. + */ + SparkJobDeletedResult deleteSparkBatch(int batchId, String requestedBy); + + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @param requestedBy Add default value for X-Requested-By in header. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteSparkBatchAsync(int batchId, String requestedBy, final ServiceCallback serviceCallback); + + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + Observable deleteSparkBatchAsync(int batchId, String requestedBy); + + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + Observable> deleteSparkBatchWithServiceResponseAsync(int batchId, String requestedBy); + + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobLog object if successful. + */ + SparkJobLog getSparkBatchLog(int batchId); + + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSparkBatchLogAsync(int batchId, final ServiceCallback serviceCallback); + + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + Observable getSparkBatchLogAsync(int batchId); + + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + Observable> getSparkBatchLogWithServiceResponseAsync(int batchId); + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobLog object if successful. + */ + SparkJobLog getSparkBatchLog(int batchId, Integer from, Integer size); + + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSparkBatchLogAsync(int batchId, Integer from, Integer size, final ServiceCallback serviceCallback); + + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + Observable getSparkBatchLogAsync(int batchId, Integer from, Integer size); + + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + Observable> getSparkBatchLogWithServiceResponseAsync(int batchId, Integer from, Integer size); + + /** + * Gets a single spark batch state. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobState object if successful. + */ + SparkJobState getSparkBatchState(int batchId); + + /** + * Gets a single spark batch state. + * + * @param batchId Identifier for the batch job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSparkBatchStateAsync(int batchId, final ServiceCallback serviceCallback); + + /** + * Gets a single spark batch state. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobState object + */ + Observable getSparkBatchStateAsync(int batchId); + + /** + * Gets a single spark batch state. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobState object + */ + Observable> getSparkBatchStateWithServiceResponseAsync(int batchId); + + /** + * List all spark sessions. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkSessionCollection object if successful. + */ + SparkSessionCollection listSparkSessionJob(); + + /** + * List all spark sessions. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture listSparkSessionJobAsync(final ServiceCallback serviceCallback); + + /** + * List all spark sessions. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionCollection object + */ + Observable listSparkSessionJobAsync(); + + /** + * List all spark sessions. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionCollection object + */ + Observable> listSparkSessionJobWithServiceResponseAsync(); + /** + * List all spark sessions. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkSessionCollection object if successful. + */ + SparkSessionCollection listSparkSessionJob(Integer from, Integer size); + + /** + * List all spark sessions. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture listSparkSessionJobAsync(Integer from, Integer size, final ServiceCallback serviceCallback); + + /** + * List all spark sessions. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionCollection object + */ + Observable listSparkSessionJobAsync(Integer from, Integer size); + + /** + * List all spark sessions. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionCollection object + */ + Observable> listSparkSessionJobWithServiceResponseAsync(Integer from, Integer size); + + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkSessionJob object if successful. + */ + SparkSessionJob submitSparkSessionJob(SparkSessionJobRequest sparkSessionJobRequest); + + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture submitSparkSessionJobAsync(SparkSessionJobRequest sparkSessionJobRequest, final ServiceCallback serviceCallback); + + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionJob object + */ + Observable submitSparkSessionJobAsync(SparkSessionJobRequest sparkSessionJobRequest); + + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionJob object + */ + Observable> submitSparkSessionJobWithServiceResponseAsync(SparkSessionJobRequest sparkSessionJobRequest); + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkSessionJob object if successful. + */ + SparkSessionJob submitSparkSessionJob(SparkSessionJobRequest sparkSessionJobRequest, String requestedBy); + + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture submitSparkSessionJobAsync(SparkSessionJobRequest sparkSessionJobRequest, String requestedBy, final ServiceCallback serviceCallback); + + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionJob object + */ + Observable submitSparkSessionJobAsync(SparkSessionJobRequest sparkSessionJobRequest, String requestedBy); + + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionJob object + */ + Observable> submitSparkSessionJobWithServiceResponseAsync(SparkSessionJobRequest sparkSessionJobRequest, String requestedBy); + + /** + * Gets a single spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkSessionJob object if successful. + */ + SparkSessionJob getSparkSessionJob(int sessionId); + + /** + * Gets a single spark session. + * + * @param sessionId Identifier for the session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSparkSessionJobAsync(int sessionId, final ServiceCallback serviceCallback); + + /** + * Gets a single spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionJob object + */ + Observable getSparkSessionJobAsync(int sessionId); + + /** + * Gets a single spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionJob object + */ + Observable> getSparkSessionJobWithServiceResponseAsync(int sessionId); + + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobDeletedResult object if successful. + */ + SparkJobDeletedResult deleteSparkSessionJob(int sessionId); + + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteSparkSessionJobAsync(int sessionId, final ServiceCallback serviceCallback); + + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + Observable deleteSparkSessionJobAsync(int sessionId); + + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + Observable> deleteSparkSessionJobWithServiceResponseAsync(int sessionId); + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobDeletedResult object if successful. + */ + SparkJobDeletedResult deleteSparkSessionJob(int sessionId, String requestedBy); + + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @param requestedBy Add default value for X-Requested-By in header. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteSparkSessionJobAsync(int sessionId, String requestedBy, final ServiceCallback serviceCallback); + + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + Observable deleteSparkSessionJobAsync(int sessionId, String requestedBy); + + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + Observable> deleteSparkSessionJobWithServiceResponseAsync(int sessionId, String requestedBy); + + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobLog object if successful. + */ + SparkJobLog getSparkSessionLog(int sessionId); + + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSparkSessionLogAsync(int sessionId, final ServiceCallback serviceCallback); + + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + Observable getSparkSessionLogAsync(int sessionId); + + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + Observable> getSparkSessionLogWithServiceResponseAsync(int sessionId); + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobLog object if successful. + */ + SparkJobLog getSparkSessionLog(int sessionId, Integer from, Integer size); + + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSparkSessionLogAsync(int sessionId, Integer from, Integer size, final ServiceCallback serviceCallback); + + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + Observable getSparkSessionLogAsync(int sessionId, Integer from, Integer size); + + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + Observable> getSparkSessionLogWithServiceResponseAsync(int sessionId, Integer from, Integer size); + + /** + * Gets a single spark session job state. + * + * @param sessionId Identifier for the session job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobState object if successful. + */ + SparkJobState getSparkSessionState(int sessionId); + + /** + * Gets a single spark session job state. + * + * @param sessionId Identifier for the session job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSparkSessionStateAsync(int sessionId, final ServiceCallback serviceCallback); + + /** + * Gets a single spark session job state. + * + * @param sessionId Identifier for the session job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobState object + */ + Observable getSparkSessionStateAsync(int sessionId); + + /** + * Gets a single spark session job state. + * + * @param sessionId Identifier for the session job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobState object + */ + Observable> getSparkSessionStateWithServiceResponseAsync(int sessionId); + + /** + * Gets a list of statements within a spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkStatementCollection object if successful. + */ + SparkStatementCollection listSparkStatementJob(int sessionId); + + /** + * Gets a list of statements within a spark session. + * + * @param sessionId Identifier for the session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture listSparkStatementJobAsync(int sessionId, final ServiceCallback serviceCallback); + + /** + * Gets a list of statements within a spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatementCollection object + */ + Observable listSparkStatementJobAsync(int sessionId); + + /** + * Gets a list of statements within a spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatementCollection object + */ + Observable> listSparkStatementJobWithServiceResponseAsync(int sessionId); + + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkStatement object if successful. + */ + SparkStatement submitSparkStatementJob(int sessionId, SparkStatementRequest sparkStatementRequest); + + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture submitSparkStatementJobAsync(int sessionId, SparkStatementRequest sparkStatementRequest, final ServiceCallback serviceCallback); + + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatement object + */ + Observable submitSparkStatementJobAsync(int sessionId, SparkStatementRequest sparkStatementRequest); + + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatement object + */ + Observable> submitSparkStatementJobWithServiceResponseAsync(int sessionId, SparkStatementRequest sparkStatementRequest); + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkStatement object if successful. + */ + SparkStatement submitSparkStatementJob(int sessionId, SparkStatementRequest sparkStatementRequest, String requestedBy); + + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture submitSparkStatementJobAsync(int sessionId, SparkStatementRequest sparkStatementRequest, String requestedBy, final ServiceCallback serviceCallback); + + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatement object + */ + Observable submitSparkStatementJobAsync(int sessionId, SparkStatementRequest sparkStatementRequest, String requestedBy); + + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatement object + */ + Observable> submitSparkStatementJobWithServiceResponseAsync(int sessionId, SparkStatementRequest sparkStatementRequest, String requestedBy); + + /** + * Gets a single statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkStatement object if successful. + */ + SparkStatement getSparkStatementJob(int sessionId, int statementId); + + /** + * Gets a single statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSparkStatementJobAsync(int sessionId, int statementId, final ServiceCallback serviceCallback); + + /** + * Gets a single statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatement object + */ + Observable getSparkStatementJobAsync(int sessionId, int statementId); + + /** + * Gets a single statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatement object + */ + Observable> getSparkStatementJobWithServiceResponseAsync(int sessionId, int statementId); + + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkStatementCancellationResult object if successful. + */ + SparkStatementCancellationResult deleteSparkStatementJob(int sessionId, int statementId); + + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteSparkStatementJobAsync(int sessionId, int statementId, final ServiceCallback serviceCallback); + + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatementCancellationResult object + */ + Observable deleteSparkStatementJobAsync(int sessionId, int statementId); + + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatementCancellationResult object + */ + Observable> deleteSparkStatementJobWithServiceResponseAsync(int sessionId, int statementId); + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkStatementCancellationResult object if successful. + */ + SparkStatementCancellationResult deleteSparkStatementJob(int sessionId, int statementId, String requestedBy); + + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @param requestedBy Add default value for X-Requested-By in header. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteSparkStatementJobAsync(int sessionId, int statementId, String requestedBy, final ServiceCallback serviceCallback); + + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatementCancellationResult object + */ + Observable deleteSparkStatementJobAsync(int sessionId, int statementId, String requestedBy); + + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatementCancellationResult object + */ + Observable> deleteSparkStatementJobWithServiceResponseAsync(int sessionId, int statementId, String requestedBy); + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/implementation/HDInsightJobClientImpl.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/implementation/HDInsightJobClientImpl.java new file mode 100644 index 000000000000..f4edcad83a08 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/implementation/HDInsightJobClientImpl.java @@ -0,0 +1,208 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.hdinsight.job.HDInsightJobClient; +import com.microsoft.azure.hdinsight.job.Jobs; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the HDInsightJobClientImpl class. + */ +public class HDInsightJobClientImpl extends AzureServiceClient implements HDInsightJobClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The cluster endpoint, for example https://clustername.azurehdinsight.net. */ + private String endpoint; + + /** + * Gets The cluster endpoint, for example https://clustername.azurehdinsight.net. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Sets The cluster endpoint, for example https://clustername.azurehdinsight.net. + * + * @param endpoint the endpoint value. + * @return the service client itself + */ + public HDInsightJobClientImpl withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** The user name used for running job. */ + private String username; + + /** + * Gets The user name used for running job. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Sets The user name used for running job. + * + * @param username the username value. + * @return the service client itself + */ + public HDInsightJobClientImpl withUsername(String username) { + this.username = username; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public HDInsightJobClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public HDInsightJobClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public HDInsightJobClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The Jobs object to access its operations. + */ + private Jobs jobs; + + /** + * Gets the Jobs object to access its operations. + * @return the Jobs object. + */ + public Jobs jobs() { + return this.jobs; + } + + /** + * Initializes an instance of HDInsightJobClient client. + * + * @param credentials the management credentials for Azure + */ + public HDInsightJobClientImpl(ServiceClientCredentials credentials) { + this("https://{endpoint}", credentials); + } + + /** + * Initializes an instance of HDInsightJobClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + private HDInsightJobClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of HDInsightJobClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public HDInsightJobClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.jobs = new JobsImpl(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "HDInsightJobClient", "2018-11-01-preview"); + } +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/implementation/JobsImpl.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/implementation/JobsImpl.java new file mode 100644 index 000000000000..c7475fadecc2 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/implementation/JobsImpl.java @@ -0,0 +1,3027 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.implementation; + +import retrofit2.Retrofit; +import com.microsoft.azure.hdinsight.job.Jobs; +import com.google.common.base.Joiner; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.hdinsight.job.models.AppState; +import com.microsoft.azure.hdinsight.job.models.JobDetailRootJsonObject; +import com.microsoft.azure.hdinsight.job.models.JobListJsonObject; +import com.microsoft.azure.hdinsight.job.models.JobOperationsErrorResponseException; +import com.microsoft.azure.hdinsight.job.models.JobSubmissionJsonResponse; +import com.microsoft.azure.hdinsight.job.models.SparkBatchJob; +import com.microsoft.azure.hdinsight.job.models.SparkBatchJobCollection; +import com.microsoft.azure.hdinsight.job.models.SparkBatchJobRequest; +import com.microsoft.azure.hdinsight.job.models.SparkJobDeletedResult; +import com.microsoft.azure.hdinsight.job.models.SparkJobLog; +import com.microsoft.azure.hdinsight.job.models.SparkJobState; +import com.microsoft.azure.hdinsight.job.models.SparkSessionCollection; +import com.microsoft.azure.hdinsight.job.models.SparkSessionJob; +import com.microsoft.azure.hdinsight.job.models.SparkSessionJobRequest; +import com.microsoft.azure.hdinsight.job.models.SparkStatement; +import com.microsoft.azure.hdinsight.job.models.SparkStatementCancellationResult; +import com.microsoft.azure.hdinsight.job.models.SparkStatementCollection; +import com.microsoft.azure.hdinsight.job.models.SparkStatementRequest; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.InputStream; +import java.io.IOException; +import java.util.List; +import okhttp3.MediaType; +import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Jobs. + */ +public class JobsImpl implements Jobs { + /** The Retrofit service to perform REST calls. */ + private JobsService service; + /** The service client containing this operation class. */ + private HDInsightJobClientImpl client; + + /** + * Initializes an instance of JobsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public JobsImpl(Retrofit retrofit, HDInsightJobClientImpl client) { + this.service = retrofit.create(JobsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Jobs to be + * used by Retrofit to perform actually REST calls. + */ + interface JobsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs get" }) + @GET("templeton/v1/jobs/{jobId}") + Observable> get(@Path("jobId") String jobId, @Query("user.name") String username, @Query("fields") String fields, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs kill" }) + @HTTP(path = "templeton/v1/jobs/{jobId}", method = "DELETE", hasBody = true) + Observable> kill(@Path("jobId") String jobId, @Query("user.name") String username, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs list" }) + @GET("templeton/v1/jobs") + Observable> list(@Query("user.name") String username, @Query("showall") String showall, @Query("fields") String fields, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs listAfterJobId" }) + @GET("templeton/v1/jobs") + Observable> listAfterJobId(@Query("user.name") String username, @Query("jobid") String jobid, @Query("numrecords") Integer numrecords, @Query("showall") String showall, @Query("fields") String fields, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/text", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitHiveJob" }) + @POST("templeton/v1/hive") + Observable> submitHiveJob(@Query("user.name") String username, @Body RequestBody content, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: text/plain", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitMapReduceJob" }) + @POST("templeton/v1/mapreduce/jar") + Observable> submitMapReduceJob(@Query("user.name") String username, @Body RequestBody content, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: text/plain", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitMapReduceStreamingJob" }) + @POST("templeton/v1/mapreduce/streaming") + Observable> submitMapReduceStreamingJob(@Query("user.name") String username, @Body RequestBody content, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: text/plain", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitPigJob" }) + @POST("templeton/v1/pig") + Observable> submitPigJob(@Query("user.name") String username, @Body RequestBody content, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: text/plain", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitSqoopJob" }) + @POST("templeton/v1/sqoop") + Observable> submitSqoopJob(@Query("user.name") String username, @Body RequestBody content, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getAppState" }) + @GET("ws/v1/cluster/apps/{appId}/state") + Observable> getAppState(@Path("appId") String appId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs listSparkBatchJob" }) + @GET("livy/batches") + Observable> listSparkBatchJob(@Query("from") Integer from, @Query("size") Integer size, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitSparkBatchJob" }) + @POST("livy/batches") + Observable> submitSparkBatchJob(@Header("X-Requested-By") String requestedBy, @Body SparkBatchJobRequest sparkBatchJobRequest, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getSparkBatchJob" }) + @GET("livy/batches/{batchId}") + Observable> getSparkBatchJob(@Path("batchId") int batchId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs deleteSparkBatch" }) + @HTTP(path = "livy/batches/{batchId}", method = "DELETE", hasBody = true) + Observable> deleteSparkBatch(@Path("batchId") int batchId, @Header("X-Requested-By") String requestedBy, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getSparkBatchLog" }) + @GET("livy/batches/{batchId}/log") + Observable> getSparkBatchLog(@Path("batchId") int batchId, @Query("from") Integer from, @Query("size") Integer size, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getSparkBatchState" }) + @GET("livy/batches/{batchId}/state") + Observable> getSparkBatchState(@Path("batchId") int batchId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs listSparkSessionJob" }) + @GET("livy/sessions") + Observable> listSparkSessionJob(@Query("from") Integer from, @Query("size") Integer size, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitSparkSessionJob" }) + @POST("livy/sessions") + Observable> submitSparkSessionJob(@Header("X-Requested-By") String requestedBy, @Body SparkSessionJobRequest sparkSessionJobRequest, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getSparkSessionJob" }) + @GET("livy/sessions/{sessionId}") + Observable> getSparkSessionJob(@Path("sessionId") int sessionId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs deleteSparkSessionJob" }) + @HTTP(path = "livy/sessions/{sessionId}", method = "DELETE", hasBody = true) + Observable> deleteSparkSessionJob(@Path("sessionId") int sessionId, @Header("X-Requested-By") String requestedBy, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getSparkSessionLog" }) + @GET("livy/sessions/{sessionId}/log") + Observable> getSparkSessionLog(@Path("sessionId") int sessionId, @Query("from") Integer from, @Query("size") Integer size, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getSparkSessionState" }) + @GET("livy/sessions/{sessionId}/state") + Observable> getSparkSessionState(@Path("sessionId") int sessionId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs listSparkStatementJob" }) + @GET("livy/sessions/{sessionId}/statements") + Observable> listSparkStatementJob(@Path("sessionId") int sessionId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitSparkStatementJob" }) + @POST("livy/sessions/{sessionId}/statements") + Observable> submitSparkStatementJob(@Path("sessionId") int sessionId, @Header("X-Requested-By") String requestedBy, @Body SparkStatementRequest sparkStatementRequest, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getSparkStatementJob" }) + @GET("livy/sessions/{sessionId}/statements/{statementId}") + Observable> getSparkStatementJob(@Path("sessionId") int sessionId, @Path("statementId") int statementId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs deleteSparkStatementJob" }) + @POST("livy/sessions/{sessionId}/statements/{statementId}/cancel") + Observable> deleteSparkStatementJob(@Path("sessionId") int sessionId, @Path("statementId") int statementId, @Header("X-Requested-By") String requestedBy, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + } + + /** + * Gets job details from the specified HDInsight cluster. + * + * @param jobId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobDetailRootJsonObject object if successful. + */ + public JobDetailRootJsonObject get(String jobId) { + return getWithServiceResponseAsync(jobId).toBlocking().single().body(); + } + + /** + * Gets job details from the specified HDInsight cluster. + * + * @param jobId The id of the job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String jobId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(jobId), serviceCallback); + } + + /** + * Gets job details from the specified HDInsight cluster. + * + * @param jobId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDetailRootJsonObject object + */ + public Observable getAsync(String jobId) { + return getWithServiceResponseAsync(jobId).map(new Func1, JobDetailRootJsonObject>() { + @Override + public JobDetailRootJsonObject call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets job details from the specified HDInsight cluster. + * + * @param jobId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDetailRootJsonObject object + */ + public Observable> getWithServiceResponseAsync(String jobId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (jobId == null) { + throw new IllegalArgumentException("Parameter jobId is required and cannot be null."); + } + if (this.client.username() == null) { + throw new IllegalArgumentException("Parameter this.client.username() is required and cannot be null."); + } + final String fields = "*"; + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.get(jobId, this.client.username(), fields, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws JobOperationsErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(JobOperationsErrorResponseException.class) + .build(response); + } + + /** + * Initiates cancel on given running job in the specified HDInsight. + * + * @param jobId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobDetailRootJsonObject object if successful. + */ + public JobDetailRootJsonObject kill(String jobId) { + return killWithServiceResponseAsync(jobId).toBlocking().single().body(); + } + + /** + * Initiates cancel on given running job in the specified HDInsight. + * + * @param jobId The id of the job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture killAsync(String jobId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(killWithServiceResponseAsync(jobId), serviceCallback); + } + + /** + * Initiates cancel on given running job in the specified HDInsight. + * + * @param jobId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDetailRootJsonObject object + */ + public Observable killAsync(String jobId) { + return killWithServiceResponseAsync(jobId).map(new Func1, JobDetailRootJsonObject>() { + @Override + public JobDetailRootJsonObject call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Initiates cancel on given running job in the specified HDInsight. + * + * @param jobId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDetailRootJsonObject object + */ + public Observable> killWithServiceResponseAsync(String jobId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (jobId == null) { + throw new IllegalArgumentException("Parameter jobId is required and cannot be null."); + } + if (this.client.username() == null) { + throw new IllegalArgumentException("Parameter this.client.username() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.kill(jobId, this.client.username(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = killDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse killDelegate(Response response) throws JobOperationsErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(JobOperationsErrorResponseException.class) + .build(response); + } + + /** + * Gets the list of jobs from the specified HDInsight cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<JobListJsonObject> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Gets the list of jobs from the specified HDInsight cluster. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets the list of jobs from the specified HDInsight cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<JobListJsonObject> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the list of jobs from the specified HDInsight cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<JobListJsonObject> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (this.client.username() == null) { + throw new IllegalArgumentException("Parameter this.client.username() is required and cannot be null."); + } + final String showall = "true"; + final String fields = "*"; + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.list(this.client.username(), showall, fields, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws JobOperationsErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., JobOperationsErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(JobOperationsErrorResponseException.class) + .build(response); + } + + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<JobListJsonObject> object if successful. + */ + public List listAfterJobId() { + return listAfterJobIdWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAfterJobIdAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listAfterJobIdWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<JobListJsonObject> object + */ + public Observable> listAfterJobIdAsync() { + return listAfterJobIdWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<JobListJsonObject> object + */ + public Observable>> listAfterJobIdWithServiceResponseAsync() { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (this.client.username() == null) { + throw new IllegalArgumentException("Parameter this.client.username() is required and cannot be null."); + } + final String showall = "true"; + final String fields = "*"; + final String jobid = null; + final Integer numrecords = null; + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.listAfterJobId(this.client.username(), jobid, numrecords, showall, fields, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = listAfterJobIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @param jobid JobId from where to list jobs. + * @param numrecords Number of jobs to fetch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<JobListJsonObject> object if successful. + */ + public List listAfterJobId(String jobid, Integer numrecords) { + return listAfterJobIdWithServiceResponseAsync(jobid, numrecords).toBlocking().single().body(); + } + + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @param jobid JobId from where to list jobs. + * @param numrecords Number of jobs to fetch. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAfterJobIdAsync(String jobid, Integer numrecords, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listAfterJobIdWithServiceResponseAsync(jobid, numrecords), serviceCallback); + } + + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @param jobid JobId from where to list jobs. + * @param numrecords Number of jobs to fetch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<JobListJsonObject> object + */ + public Observable> listAfterJobIdAsync(String jobid, Integer numrecords) { + return listAfterJobIdWithServiceResponseAsync(jobid, numrecords).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster. + * + * @param jobid JobId from where to list jobs. + * @param numrecords Number of jobs to fetch. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<JobListJsonObject> object + */ + public Observable>> listAfterJobIdWithServiceResponseAsync(String jobid, Integer numrecords) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (this.client.username() == null) { + throw new IllegalArgumentException("Parameter this.client.username() is required and cannot be null."); + } + final String showall = "true"; + final String fields = "*"; + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.listAfterJobId(this.client.username(), jobid, numrecords, showall, fields, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = listAfterJobIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listAfterJobIdDelegate(Response response) throws JobOperationsErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., JobOperationsErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(JobOperationsErrorResponseException.class) + .build(response); + } + + /** + * Submits a Hive job to an HDInsight cluster. + * + * @param content The content of the Hive job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobSubmissionJsonResponse object if successful. + */ + public JobSubmissionJsonResponse submitHiveJob(byte[] content) { + return submitHiveJobWithServiceResponseAsync(content).toBlocking().single().body(); + } + + /** + * Submits a Hive job to an HDInsight cluster. + * + * @param content The content of the Hive job request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture submitHiveJobAsync(byte[] content, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(submitHiveJobWithServiceResponseAsync(content), serviceCallback); + } + + /** + * Submits a Hive job to an HDInsight cluster. + * + * @param content The content of the Hive job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + public Observable submitHiveJobAsync(byte[] content) { + return submitHiveJobWithServiceResponseAsync(content).map(new Func1, JobSubmissionJsonResponse>() { + @Override + public JobSubmissionJsonResponse call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Submits a Hive job to an HDInsight cluster. + * + * @param content The content of the Hive job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + public Observable> submitHiveJobWithServiceResponseAsync(byte[] content) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (this.client.username() == null) { + throw new IllegalArgumentException("Parameter this.client.username() is required and cannot be null."); + } + if (content == null) { + throw new IllegalArgumentException("Parameter content is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + RequestBody contentConverted = RequestBody.create(MediaType.parse("application/text"), content); + return service.submitHiveJob(this.client.username(), contentConverted, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = submitHiveJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse submitHiveJobDelegate(Response response) throws JobOperationsErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(JobOperationsErrorResponseException.class) + .build(response); + } + + /** + * Submits a MapReduce job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobSubmissionJsonResponse object if successful. + */ + public JobSubmissionJsonResponse submitMapReduceJob(byte[] content) { + return submitMapReduceJobWithServiceResponseAsync(content).toBlocking().single().body(); + } + + /** + * Submits a MapReduce job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture submitMapReduceJobAsync(byte[] content, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(submitMapReduceJobWithServiceResponseAsync(content), serviceCallback); + } + + /** + * Submits a MapReduce job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + public Observable submitMapReduceJobAsync(byte[] content) { + return submitMapReduceJobWithServiceResponseAsync(content).map(new Func1, JobSubmissionJsonResponse>() { + @Override + public JobSubmissionJsonResponse call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Submits a MapReduce job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + public Observable> submitMapReduceJobWithServiceResponseAsync(byte[] content) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (this.client.username() == null) { + throw new IllegalArgumentException("Parameter this.client.username() is required and cannot be null."); + } + if (content == null) { + throw new IllegalArgumentException("Parameter content is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + RequestBody contentConverted = RequestBody.create(MediaType.parse("text/plain"), content); + return service.submitMapReduceJob(this.client.username(), contentConverted, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = submitMapReduceJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse submitMapReduceJobDelegate(Response response) throws JobOperationsErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(JobOperationsErrorResponseException.class) + .build(response); + } + + /** + * Submits a MapReduce streaming job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobSubmissionJsonResponse object if successful. + */ + public JobSubmissionJsonResponse submitMapReduceStreamingJob(byte[] content) { + return submitMapReduceStreamingJobWithServiceResponseAsync(content).toBlocking().single().body(); + } + + /** + * Submits a MapReduce streaming job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture submitMapReduceStreamingJobAsync(byte[] content, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(submitMapReduceStreamingJobWithServiceResponseAsync(content), serviceCallback); + } + + /** + * Submits a MapReduce streaming job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + public Observable submitMapReduceStreamingJobAsync(byte[] content) { + return submitMapReduceStreamingJobWithServiceResponseAsync(content).map(new Func1, JobSubmissionJsonResponse>() { + @Override + public JobSubmissionJsonResponse call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Submits a MapReduce streaming job to an HDInsight cluster. + * + * @param content The content of the MapReduce job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + public Observable> submitMapReduceStreamingJobWithServiceResponseAsync(byte[] content) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (this.client.username() == null) { + throw new IllegalArgumentException("Parameter this.client.username() is required and cannot be null."); + } + if (content == null) { + throw new IllegalArgumentException("Parameter content is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + RequestBody contentConverted = RequestBody.create(MediaType.parse("text/plain"), content); + return service.submitMapReduceStreamingJob(this.client.username(), contentConverted, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = submitMapReduceStreamingJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse submitMapReduceStreamingJobDelegate(Response response) throws JobOperationsErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(JobOperationsErrorResponseException.class) + .build(response); + } + + /** + * Submits a Pig job to an HDInsight cluster. + * + * @param content The content of the Pig job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobSubmissionJsonResponse object if successful. + */ + public JobSubmissionJsonResponse submitPigJob(byte[] content) { + return submitPigJobWithServiceResponseAsync(content).toBlocking().single().body(); + } + + /** + * Submits a Pig job to an HDInsight cluster. + * + * @param content The content of the Pig job request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture submitPigJobAsync(byte[] content, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(submitPigJobWithServiceResponseAsync(content), serviceCallback); + } + + /** + * Submits a Pig job to an HDInsight cluster. + * + * @param content The content of the Pig job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + public Observable submitPigJobAsync(byte[] content) { + return submitPigJobWithServiceResponseAsync(content).map(new Func1, JobSubmissionJsonResponse>() { + @Override + public JobSubmissionJsonResponse call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Submits a Pig job to an HDInsight cluster. + * + * @param content The content of the Pig job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + public Observable> submitPigJobWithServiceResponseAsync(byte[] content) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (this.client.username() == null) { + throw new IllegalArgumentException("Parameter this.client.username() is required and cannot be null."); + } + if (content == null) { + throw new IllegalArgumentException("Parameter content is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + RequestBody contentConverted = RequestBody.create(MediaType.parse("text/plain"), content); + return service.submitPigJob(this.client.username(), contentConverted, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = submitPigJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse submitPigJobDelegate(Response response) throws JobOperationsErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(JobOperationsErrorResponseException.class) + .build(response); + } + + /** + * Submits a Sqoop job to an HDInsight cluster. + * + * @param content The content of the Sqoop job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobSubmissionJsonResponse object if successful. + */ + public JobSubmissionJsonResponse submitSqoopJob(byte[] content) { + return submitSqoopJobWithServiceResponseAsync(content).toBlocking().single().body(); + } + + /** + * Submits a Sqoop job to an HDInsight cluster. + * + * @param content The content of the Sqoop job request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture submitSqoopJobAsync(byte[] content, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(submitSqoopJobWithServiceResponseAsync(content), serviceCallback); + } + + /** + * Submits a Sqoop job to an HDInsight cluster. + * + * @param content The content of the Sqoop job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + public Observable submitSqoopJobAsync(byte[] content) { + return submitSqoopJobWithServiceResponseAsync(content).map(new Func1, JobSubmissionJsonResponse>() { + @Override + public JobSubmissionJsonResponse call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Submits a Sqoop job to an HDInsight cluster. + * + * @param content The content of the Sqoop job request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobSubmissionJsonResponse object + */ + public Observable> submitSqoopJobWithServiceResponseAsync(byte[] content) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (this.client.username() == null) { + throw new IllegalArgumentException("Parameter this.client.username() is required and cannot be null."); + } + if (content == null) { + throw new IllegalArgumentException("Parameter content is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + RequestBody contentConverted = RequestBody.create(MediaType.parse("text/plain"), content); + return service.submitSqoopJob(this.client.username(), contentConverted, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = submitSqoopJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse submitSqoopJobDelegate(Response response) throws JobOperationsErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(JobOperationsErrorResponseException.class) + .build(response); + } + + /** + * Gets application state from the specified HDInsight cluster. + * + * @param appId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws JobOperationsErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AppState object if successful. + */ + public AppState getAppState(String appId) { + return getAppStateWithServiceResponseAsync(appId).toBlocking().single().body(); + } + + /** + * Gets application state from the specified HDInsight cluster. + * + * @param appId The id of the job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAppStateAsync(String appId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAppStateWithServiceResponseAsync(appId), serviceCallback); + } + + /** + * Gets application state from the specified HDInsight cluster. + * + * @param appId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppState object + */ + public Observable getAppStateAsync(String appId) { + return getAppStateWithServiceResponseAsync(appId).map(new Func1, AppState>() { + @Override + public AppState call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets application state from the specified HDInsight cluster. + * + * @param appId The id of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AppState object + */ + public Observable> getAppStateWithServiceResponseAsync(String appId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (appId == null) { + throw new IllegalArgumentException("Parameter appId is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.getAppState(appId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAppStateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAppStateDelegate(Response response) throws JobOperationsErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(JobOperationsErrorResponseException.class) + .build(response); + } + + /** + * List all spark batch jobs. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkBatchJobCollection object if successful. + */ + public SparkBatchJobCollection listSparkBatchJob() { + return listSparkBatchJobWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List all spark batch jobs. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listSparkBatchJobAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listSparkBatchJobWithServiceResponseAsync(), serviceCallback); + } + + /** + * List all spark batch jobs. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJobCollection object + */ + public Observable listSparkBatchJobAsync() { + return listSparkBatchJobWithServiceResponseAsync().map(new Func1, SparkBatchJobCollection>() { + @Override + public SparkBatchJobCollection call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List all spark batch jobs. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJobCollection object + */ + public Observable> listSparkBatchJobWithServiceResponseAsync() { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + final Integer from = null; + final Integer size = null; + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.listSparkBatchJob(from, size, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listSparkBatchJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all spark batch jobs. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkBatchJobCollection object if successful. + */ + public SparkBatchJobCollection listSparkBatchJob(Integer from, Integer size) { + return listSparkBatchJobWithServiceResponseAsync(from, size).toBlocking().single().body(); + } + + /** + * List all spark batch jobs. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listSparkBatchJobAsync(Integer from, Integer size, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listSparkBatchJobWithServiceResponseAsync(from, size), serviceCallback); + } + + /** + * List all spark batch jobs. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJobCollection object + */ + public Observable listSparkBatchJobAsync(Integer from, Integer size) { + return listSparkBatchJobWithServiceResponseAsync(from, size).map(new Func1, SparkBatchJobCollection>() { + @Override + public SparkBatchJobCollection call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List all spark batch jobs. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJobCollection object + */ + public Observable> listSparkBatchJobWithServiceResponseAsync(Integer from, Integer size) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.listSparkBatchJob(from, size, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listSparkBatchJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listSparkBatchJobDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkBatchJob object if successful. + */ + public SparkBatchJob submitSparkBatchJob(SparkBatchJobRequest sparkBatchJobRequest) { + return submitSparkBatchJobWithServiceResponseAsync(sparkBatchJobRequest).toBlocking().single().body(); + } + + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture submitSparkBatchJobAsync(SparkBatchJobRequest sparkBatchJobRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(submitSparkBatchJobWithServiceResponseAsync(sparkBatchJobRequest), serviceCallback); + } + + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJob object + */ + public Observable submitSparkBatchJobAsync(SparkBatchJobRequest sparkBatchJobRequest) { + return submitSparkBatchJobWithServiceResponseAsync(sparkBatchJobRequest).map(new Func1, SparkBatchJob>() { + @Override + public SparkBatchJob call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJob object + */ + public Observable> submitSparkBatchJobWithServiceResponseAsync(SparkBatchJobRequest sparkBatchJobRequest) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (sparkBatchJobRequest == null) { + throw new IllegalArgumentException("Parameter sparkBatchJobRequest is required and cannot be null."); + } + Validator.validate(sparkBatchJobRequest); + final String requestedBy = null; + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.submitSparkBatchJob(requestedBy, sparkBatchJobRequest, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = submitSparkBatchJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkBatchJob object if successful. + */ + public SparkBatchJob submitSparkBatchJob(SparkBatchJobRequest sparkBatchJobRequest, String requestedBy) { + return submitSparkBatchJobWithServiceResponseAsync(sparkBatchJobRequest, requestedBy).toBlocking().single().body(); + } + + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture submitSparkBatchJobAsync(SparkBatchJobRequest sparkBatchJobRequest, String requestedBy, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(submitSparkBatchJobWithServiceResponseAsync(sparkBatchJobRequest, requestedBy), serviceCallback); + } + + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJob object + */ + public Observable submitSparkBatchJobAsync(SparkBatchJobRequest sparkBatchJobRequest, String requestedBy) { + return submitSparkBatchJobWithServiceResponseAsync(sparkBatchJobRequest, requestedBy).map(new Func1, SparkBatchJob>() { + @Override + public SparkBatchJob call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new spark batch job. + * + * @param sparkBatchJobRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJob object + */ + public Observable> submitSparkBatchJobWithServiceResponseAsync(SparkBatchJobRequest sparkBatchJobRequest, String requestedBy) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (sparkBatchJobRequest == null) { + throw new IllegalArgumentException("Parameter sparkBatchJobRequest is required and cannot be null."); + } + Validator.validate(sparkBatchJobRequest); + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.submitSparkBatchJob(requestedBy, sparkBatchJobRequest, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = submitSparkBatchJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse submitSparkBatchJobDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a single spark batch job. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkBatchJob object if successful. + */ + public SparkBatchJob getSparkBatchJob(int batchId) { + return getSparkBatchJobWithServiceResponseAsync(batchId).toBlocking().single().body(); + } + + /** + * Gets a single spark batch job. + * + * @param batchId Identifier for the batch job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSparkBatchJobAsync(int batchId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSparkBatchJobWithServiceResponseAsync(batchId), serviceCallback); + } + + /** + * Gets a single spark batch job. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJob object + */ + public Observable getSparkBatchJobAsync(int batchId) { + return getSparkBatchJobWithServiceResponseAsync(batchId).map(new Func1, SparkBatchJob>() { + @Override + public SparkBatchJob call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a single spark batch job. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkBatchJob object + */ + public Observable> getSparkBatchJobWithServiceResponseAsync(int batchId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.getSparkBatchJob(batchId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSparkBatchJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSparkBatchJobDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobDeletedResult object if successful. + */ + public SparkJobDeletedResult deleteSparkBatch(int batchId) { + return deleteSparkBatchWithServiceResponseAsync(batchId).toBlocking().single().body(); + } + + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteSparkBatchAsync(int batchId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSparkBatchWithServiceResponseAsync(batchId), serviceCallback); + } + + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + public Observable deleteSparkBatchAsync(int batchId) { + return deleteSparkBatchWithServiceResponseAsync(batchId).map(new Func1, SparkJobDeletedResult>() { + @Override + public SparkJobDeletedResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + public Observable> deleteSparkBatchWithServiceResponseAsync(int batchId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + final String requestedBy = null; + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.deleteSparkBatch(batchId, requestedBy, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteSparkBatchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobDeletedResult object if successful. + */ + public SparkJobDeletedResult deleteSparkBatch(int batchId, String requestedBy) { + return deleteSparkBatchWithServiceResponseAsync(batchId, requestedBy).toBlocking().single().body(); + } + + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @param requestedBy Add default value for X-Requested-By in header. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteSparkBatchAsync(int batchId, String requestedBy, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSparkBatchWithServiceResponseAsync(batchId, requestedBy), serviceCallback); + } + + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + public Observable deleteSparkBatchAsync(int batchId, String requestedBy) { + return deleteSparkBatchWithServiceResponseAsync(batchId, requestedBy).map(new Func1, SparkJobDeletedResult>() { + @Override + public SparkJobDeletedResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancels a running spark batch job. + * + * @param batchId Identifier for the batch job. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + public Observable> deleteSparkBatchWithServiceResponseAsync(int batchId, String requestedBy) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.deleteSparkBatch(batchId, requestedBy, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteSparkBatchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteSparkBatchDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobLog object if successful. + */ + public SparkJobLog getSparkBatchLog(int batchId) { + return getSparkBatchLogWithServiceResponseAsync(batchId).toBlocking().single().body(); + } + + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSparkBatchLogAsync(int batchId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSparkBatchLogWithServiceResponseAsync(batchId), serviceCallback); + } + + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + public Observable getSparkBatchLogAsync(int batchId) { + return getSparkBatchLogWithServiceResponseAsync(batchId).map(new Func1, SparkJobLog>() { + @Override + public SparkJobLog call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + public Observable> getSparkBatchLogWithServiceResponseAsync(int batchId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + final Integer from = null; + final Integer size = null; + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.getSparkBatchLog(batchId, from, size, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSparkBatchLogDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobLog object if successful. + */ + public SparkJobLog getSparkBatchLog(int batchId, Integer from, Integer size) { + return getSparkBatchLogWithServiceResponseAsync(batchId, from, size).toBlocking().single().body(); + } + + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSparkBatchLogAsync(int batchId, Integer from, Integer size, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSparkBatchLogWithServiceResponseAsync(batchId, from, size), serviceCallback); + } + + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + public Observable getSparkBatchLogAsync(int batchId, Integer from, Integer size) { + return getSparkBatchLogWithServiceResponseAsync(batchId, from, size).map(new Func1, SparkJobLog>() { + @Override + public SparkJobLog call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a single spark batch job logs. + * + * @param batchId Identifier for the batch job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + public Observable> getSparkBatchLogWithServiceResponseAsync(int batchId, Integer from, Integer size) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.getSparkBatchLog(batchId, from, size, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSparkBatchLogDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSparkBatchLogDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a single spark batch state. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobState object if successful. + */ + public SparkJobState getSparkBatchState(int batchId) { + return getSparkBatchStateWithServiceResponseAsync(batchId).toBlocking().single().body(); + } + + /** + * Gets a single spark batch state. + * + * @param batchId Identifier for the batch job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSparkBatchStateAsync(int batchId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSparkBatchStateWithServiceResponseAsync(batchId), serviceCallback); + } + + /** + * Gets a single spark batch state. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobState object + */ + public Observable getSparkBatchStateAsync(int batchId) { + return getSparkBatchStateWithServiceResponseAsync(batchId).map(new Func1, SparkJobState>() { + @Override + public SparkJobState call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a single spark batch state. + * + * @param batchId Identifier for the batch job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobState object + */ + public Observable> getSparkBatchStateWithServiceResponseAsync(int batchId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.getSparkBatchState(batchId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSparkBatchStateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSparkBatchStateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all spark sessions. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkSessionCollection object if successful. + */ + public SparkSessionCollection listSparkSessionJob() { + return listSparkSessionJobWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * List all spark sessions. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listSparkSessionJobAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listSparkSessionJobWithServiceResponseAsync(), serviceCallback); + } + + /** + * List all spark sessions. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionCollection object + */ + public Observable listSparkSessionJobAsync() { + return listSparkSessionJobWithServiceResponseAsync().map(new Func1, SparkSessionCollection>() { + @Override + public SparkSessionCollection call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List all spark sessions. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionCollection object + */ + public Observable> listSparkSessionJobWithServiceResponseAsync() { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + final Integer from = null; + final Integer size = null; + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.listSparkSessionJob(from, size, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listSparkSessionJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * List all spark sessions. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkSessionCollection object if successful. + */ + public SparkSessionCollection listSparkSessionJob(Integer from, Integer size) { + return listSparkSessionJobWithServiceResponseAsync(from, size).toBlocking().single().body(); + } + + /** + * List all spark sessions. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listSparkSessionJobAsync(Integer from, Integer size, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listSparkSessionJobWithServiceResponseAsync(from, size), serviceCallback); + } + + /** + * List all spark sessions. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionCollection object + */ + public Observable listSparkSessionJobAsync(Integer from, Integer size) { + return listSparkSessionJobWithServiceResponseAsync(from, size).map(new Func1, SparkSessionCollection>() { + @Override + public SparkSessionCollection call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List all spark sessions. + * + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionCollection object + */ + public Observable> listSparkSessionJobWithServiceResponseAsync(Integer from, Integer size) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.listSparkSessionJob(from, size, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listSparkSessionJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listSparkSessionJobDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkSessionJob object if successful. + */ + public SparkSessionJob submitSparkSessionJob(SparkSessionJobRequest sparkSessionJobRequest) { + return submitSparkSessionJobWithServiceResponseAsync(sparkSessionJobRequest).toBlocking().single().body(); + } + + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture submitSparkSessionJobAsync(SparkSessionJobRequest sparkSessionJobRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(submitSparkSessionJobWithServiceResponseAsync(sparkSessionJobRequest), serviceCallback); + } + + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionJob object + */ + public Observable submitSparkSessionJobAsync(SparkSessionJobRequest sparkSessionJobRequest) { + return submitSparkSessionJobWithServiceResponseAsync(sparkSessionJobRequest).map(new Func1, SparkSessionJob>() { + @Override + public SparkSessionJob call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionJob object + */ + public Observable> submitSparkSessionJobWithServiceResponseAsync(SparkSessionJobRequest sparkSessionJobRequest) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (sparkSessionJobRequest == null) { + throw new IllegalArgumentException("Parameter sparkSessionJobRequest is required and cannot be null."); + } + Validator.validate(sparkSessionJobRequest); + final String requestedBy = null; + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.submitSparkSessionJob(requestedBy, sparkSessionJobRequest, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = submitSparkSessionJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkSessionJob object if successful. + */ + public SparkSessionJob submitSparkSessionJob(SparkSessionJobRequest sparkSessionJobRequest, String requestedBy) { + return submitSparkSessionJobWithServiceResponseAsync(sparkSessionJobRequest, requestedBy).toBlocking().single().body(); + } + + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture submitSparkSessionJobAsync(SparkSessionJobRequest sparkSessionJobRequest, String requestedBy, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(submitSparkSessionJobWithServiceResponseAsync(sparkSessionJobRequest, requestedBy), serviceCallback); + } + + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionJob object + */ + public Observable submitSparkSessionJobAsync(SparkSessionJobRequest sparkSessionJobRequest, String requestedBy) { + return submitSparkSessionJobWithServiceResponseAsync(sparkSessionJobRequest, requestedBy).map(new Func1, SparkSessionJob>() { + @Override + public SparkSessionJob call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new spark session. + * + * @param sparkSessionJobRequest Livy compatible session job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionJob object + */ + public Observable> submitSparkSessionJobWithServiceResponseAsync(SparkSessionJobRequest sparkSessionJobRequest, String requestedBy) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (sparkSessionJobRequest == null) { + throw new IllegalArgumentException("Parameter sparkSessionJobRequest is required and cannot be null."); + } + Validator.validate(sparkSessionJobRequest); + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.submitSparkSessionJob(requestedBy, sparkSessionJobRequest, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = submitSparkSessionJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse submitSparkSessionJobDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a single spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkSessionJob object if successful. + */ + public SparkSessionJob getSparkSessionJob(int sessionId) { + return getSparkSessionJobWithServiceResponseAsync(sessionId).toBlocking().single().body(); + } + + /** + * Gets a single spark session. + * + * @param sessionId Identifier for the session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSparkSessionJobAsync(int sessionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSparkSessionJobWithServiceResponseAsync(sessionId), serviceCallback); + } + + /** + * Gets a single spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionJob object + */ + public Observable getSparkSessionJobAsync(int sessionId) { + return getSparkSessionJobWithServiceResponseAsync(sessionId).map(new Func1, SparkSessionJob>() { + @Override + public SparkSessionJob call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a single spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkSessionJob object + */ + public Observable> getSparkSessionJobWithServiceResponseAsync(int sessionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.getSparkSessionJob(sessionId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSparkSessionJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSparkSessionJobDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobDeletedResult object if successful. + */ + public SparkJobDeletedResult deleteSparkSessionJob(int sessionId) { + return deleteSparkSessionJobWithServiceResponseAsync(sessionId).toBlocking().single().body(); + } + + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteSparkSessionJobAsync(int sessionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSparkSessionJobWithServiceResponseAsync(sessionId), serviceCallback); + } + + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + public Observable deleteSparkSessionJobAsync(int sessionId) { + return deleteSparkSessionJobWithServiceResponseAsync(sessionId).map(new Func1, SparkJobDeletedResult>() { + @Override + public SparkJobDeletedResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + public Observable> deleteSparkSessionJobWithServiceResponseAsync(int sessionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + final String requestedBy = null; + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.deleteSparkSessionJob(sessionId, requestedBy, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteSparkSessionJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobDeletedResult object if successful. + */ + public SparkJobDeletedResult deleteSparkSessionJob(int sessionId, String requestedBy) { + return deleteSparkSessionJobWithServiceResponseAsync(sessionId, requestedBy).toBlocking().single().body(); + } + + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @param requestedBy Add default value for X-Requested-By in header. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteSparkSessionJobAsync(int sessionId, String requestedBy, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSparkSessionJobWithServiceResponseAsync(sessionId, requestedBy), serviceCallback); + } + + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + public Observable deleteSparkSessionJobAsync(int sessionId, String requestedBy) { + return deleteSparkSessionJobWithServiceResponseAsync(sessionId, requestedBy).map(new Func1, SparkJobDeletedResult>() { + @Override + public SparkJobDeletedResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancels a running spark session. + * + * @param sessionId Identifier for the session. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobDeletedResult object + */ + public Observable> deleteSparkSessionJobWithServiceResponseAsync(int sessionId, String requestedBy) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.deleteSparkSessionJob(sessionId, requestedBy, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteSparkSessionJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteSparkSessionJobDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobLog object if successful. + */ + public SparkJobLog getSparkSessionLog(int sessionId) { + return getSparkSessionLogWithServiceResponseAsync(sessionId).toBlocking().single().body(); + } + + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSparkSessionLogAsync(int sessionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSparkSessionLogWithServiceResponseAsync(sessionId), serviceCallback); + } + + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + public Observable getSparkSessionLogAsync(int sessionId) { + return getSparkSessionLogWithServiceResponseAsync(sessionId).map(new Func1, SparkJobLog>() { + @Override + public SparkJobLog call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + public Observable> getSparkSessionLogWithServiceResponseAsync(int sessionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + final Integer from = null; + final Integer size = null; + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.getSparkSessionLog(sessionId, from, size, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSparkSessionLogDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobLog object if successful. + */ + public SparkJobLog getSparkSessionLog(int sessionId, Integer from, Integer size) { + return getSparkSessionLogWithServiceResponseAsync(sessionId, from, size).toBlocking().single().body(); + } + + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSparkSessionLogAsync(int sessionId, Integer from, Integer size, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSparkSessionLogWithServiceResponseAsync(sessionId, from, size), serviceCallback); + } + + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + public Observable getSparkSessionLogAsync(int sessionId, Integer from, Integer size) { + return getSparkSessionLogWithServiceResponseAsync(sessionId, from, size).map(new Func1, SparkJobLog>() { + @Override + public SparkJobLog call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a single spark session job logs. + * + * @param sessionId Identifier for the session job. + * @param from Optional param specifying which index the list should begin from. + * @param size Optional param specifying the size of the returned list. + By default it is 20 and that is the maximum. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobLog object + */ + public Observable> getSparkSessionLogWithServiceResponseAsync(int sessionId, Integer from, Integer size) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.getSparkSessionLog(sessionId, from, size, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSparkSessionLogDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSparkSessionLogDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a single spark session job state. + * + * @param sessionId Identifier for the session job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkJobState object if successful. + */ + public SparkJobState getSparkSessionState(int sessionId) { + return getSparkSessionStateWithServiceResponseAsync(sessionId).toBlocking().single().body(); + } + + /** + * Gets a single spark session job state. + * + * @param sessionId Identifier for the session job. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSparkSessionStateAsync(int sessionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSparkSessionStateWithServiceResponseAsync(sessionId), serviceCallback); + } + + /** + * Gets a single spark session job state. + * + * @param sessionId Identifier for the session job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobState object + */ + public Observable getSparkSessionStateAsync(int sessionId) { + return getSparkSessionStateWithServiceResponseAsync(sessionId).map(new Func1, SparkJobState>() { + @Override + public SparkJobState call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a single spark session job state. + * + * @param sessionId Identifier for the session job. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkJobState object + */ + public Observable> getSparkSessionStateWithServiceResponseAsync(int sessionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.getSparkSessionState(sessionId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSparkSessionStateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSparkSessionStateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of statements within a spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkStatementCollection object if successful. + */ + public SparkStatementCollection listSparkStatementJob(int sessionId) { + return listSparkStatementJobWithServiceResponseAsync(sessionId).toBlocking().single().body(); + } + + /** + * Gets a list of statements within a spark session. + * + * @param sessionId Identifier for the session. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listSparkStatementJobAsync(int sessionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listSparkStatementJobWithServiceResponseAsync(sessionId), serviceCallback); + } + + /** + * Gets a list of statements within a spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatementCollection object + */ + public Observable listSparkStatementJobAsync(int sessionId) { + return listSparkStatementJobWithServiceResponseAsync(sessionId).map(new Func1, SparkStatementCollection>() { + @Override + public SparkStatementCollection call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a list of statements within a spark session. + * + * @param sessionId Identifier for the session. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatementCollection object + */ + public Observable> listSparkStatementJobWithServiceResponseAsync(int sessionId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.listSparkStatementJob(sessionId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listSparkStatementJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listSparkStatementJobDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkStatement object if successful. + */ + public SparkStatement submitSparkStatementJob(int sessionId, SparkStatementRequest sparkStatementRequest) { + return submitSparkStatementJobWithServiceResponseAsync(sessionId, sparkStatementRequest).toBlocking().single().body(); + } + + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture submitSparkStatementJobAsync(int sessionId, SparkStatementRequest sparkStatementRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(submitSparkStatementJobWithServiceResponseAsync(sessionId, sparkStatementRequest), serviceCallback); + } + + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatement object + */ + public Observable submitSparkStatementJobAsync(int sessionId, SparkStatementRequest sparkStatementRequest) { + return submitSparkStatementJobWithServiceResponseAsync(sessionId, sparkStatementRequest).map(new Func1, SparkStatement>() { + @Override + public SparkStatement call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatement object + */ + public Observable> submitSparkStatementJobWithServiceResponseAsync(int sessionId, SparkStatementRequest sparkStatementRequest) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (sparkStatementRequest == null) { + throw new IllegalArgumentException("Parameter sparkStatementRequest is required and cannot be null."); + } + Validator.validate(sparkStatementRequest); + final String requestedBy = null; + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.submitSparkStatementJob(sessionId, requestedBy, sparkStatementRequest, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = submitSparkStatementJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkStatement object if successful. + */ + public SparkStatement submitSparkStatementJob(int sessionId, SparkStatementRequest sparkStatementRequest, String requestedBy) { + return submitSparkStatementJobWithServiceResponseAsync(sessionId, sparkStatementRequest, requestedBy).toBlocking().single().body(); + } + + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture submitSparkStatementJobAsync(int sessionId, SparkStatementRequest sparkStatementRequest, String requestedBy, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(submitSparkStatementJobWithServiceResponseAsync(sessionId, sparkStatementRequest, requestedBy), serviceCallback); + } + + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatement object + */ + public Observable submitSparkStatementJobAsync(int sessionId, SparkStatementRequest sparkStatementRequest, String requestedBy) { + return submitSparkStatementJobWithServiceResponseAsync(sessionId, sparkStatementRequest, requestedBy).map(new Func1, SparkStatement>() { + @Override + public SparkStatement call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param sparkStatementRequest Livy compatible batch job request payload. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatement object + */ + public Observable> submitSparkStatementJobWithServiceResponseAsync(int sessionId, SparkStatementRequest sparkStatementRequest, String requestedBy) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (sparkStatementRequest == null) { + throw new IllegalArgumentException("Parameter sparkStatementRequest is required and cannot be null."); + } + Validator.validate(sparkStatementRequest); + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.submitSparkStatementJob(sessionId, requestedBy, sparkStatementRequest, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = submitSparkStatementJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse submitSparkStatementJobDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a single statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkStatement object if successful. + */ + public SparkStatement getSparkStatementJob(int sessionId, int statementId) { + return getSparkStatementJobWithServiceResponseAsync(sessionId, statementId).toBlocking().single().body(); + } + + /** + * Gets a single statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSparkStatementJobAsync(int sessionId, int statementId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSparkStatementJobWithServiceResponseAsync(sessionId, statementId), serviceCallback); + } + + /** + * Gets a single statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatement object + */ + public Observable getSparkStatementJobAsync(int sessionId, int statementId) { + return getSparkStatementJobWithServiceResponseAsync(sessionId, statementId).map(new Func1, SparkStatement>() { + @Override + public SparkStatement call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a single statement within a spark session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatement object + */ + public Observable> getSparkStatementJobWithServiceResponseAsync(int sessionId, int statementId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.getSparkStatementJob(sessionId, statementId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSparkStatementJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSparkStatementJobDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkStatementCancellationResult object if successful. + */ + public SparkStatementCancellationResult deleteSparkStatementJob(int sessionId, int statementId) { + return deleteSparkStatementJobWithServiceResponseAsync(sessionId, statementId).toBlocking().single().body(); + } + + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteSparkStatementJobAsync(int sessionId, int statementId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSparkStatementJobWithServiceResponseAsync(sessionId, statementId), serviceCallback); + } + + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatementCancellationResult object + */ + public Observable deleteSparkStatementJobAsync(int sessionId, int statementId) { + return deleteSparkStatementJobWithServiceResponseAsync(sessionId, statementId).map(new Func1, SparkStatementCancellationResult>() { + @Override + public SparkStatementCancellationResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatementCancellationResult object + */ + public Observable> deleteSparkStatementJobWithServiceResponseAsync(int sessionId, int statementId) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + final String requestedBy = null; + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.deleteSparkStatementJob(sessionId, statementId, requestedBy, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteSparkStatementJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SparkStatementCancellationResult object if successful. + */ + public SparkStatementCancellationResult deleteSparkStatementJob(int sessionId, int statementId, String requestedBy) { + return deleteSparkStatementJobWithServiceResponseAsync(sessionId, statementId, requestedBy).toBlocking().single().body(); + } + + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @param requestedBy Add default value for X-Requested-By in header. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteSparkStatementJobAsync(int sessionId, int statementId, String requestedBy, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSparkStatementJobWithServiceResponseAsync(sessionId, statementId, requestedBy), serviceCallback); + } + + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatementCancellationResult object + */ + public Observable deleteSparkStatementJobAsync(int sessionId, int statementId, String requestedBy) { + return deleteSparkStatementJobWithServiceResponseAsync(sessionId, statementId, requestedBy).map(new Func1, SparkStatementCancellationResult>() { + @Override + public SparkStatementCancellationResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Kill a statement within a session. + * + * @param sessionId Identifier for the session. + * @param statementId Identifier for the statement. + * @param requestedBy Add default value for X-Requested-By in header. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SparkStatementCancellationResult object + */ + public Observable> deleteSparkStatementJobWithServiceResponseAsync(int sessionId, int statementId, String requestedBy) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint()); + return service.deleteSparkStatementJob(sessionId, statementId, requestedBy, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteSparkStatementJobDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteSparkStatementJobDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/implementation/package-info.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/implementation/package-info.java new file mode 100644 index 000000000000..f75cc23a1ae9 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for HDInsightJobClient. + * The HDInsight Job Client. + */ +package com.microsoft.azure.hdinsight.job.implementation; diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/AppState.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/AppState.java new file mode 100644 index 000000000000..8b61e73d8821 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/AppState.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The State of the application. + */ +public class AppState { + /** + * The State of the application. Possible values include: 'NEW', + * 'NEW_SAVING', 'SUBMITTED', 'ACCEPTED', 'RUNNING', 'FINISHED', + * 'FINISHING', 'FAILED', 'KILLED'. + */ + @JsonProperty(value = "state") + private ApplicationState state; + + /** + * Get the State of the application. Possible values include: 'NEW', 'NEW_SAVING', 'SUBMITTED', 'ACCEPTED', 'RUNNING', 'FINISHED', 'FINISHING', 'FAILED', 'KILLED'. + * + * @return the state value + */ + public ApplicationState state() { + return this.state; + } + + /** + * Set the State of the application. Possible values include: 'NEW', 'NEW_SAVING', 'SUBMITTED', 'ACCEPTED', 'RUNNING', 'FINISHED', 'FINISHING', 'FAILED', 'KILLED'. + * + * @param state the state value to set + * @return the AppState object itself. + */ + public AppState withState(ApplicationState state) { + this.state = state; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/ApplicationState.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/ApplicationState.java new file mode 100644 index 000000000000..2a752e96b569 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/ApplicationState.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ApplicationState. + */ +public enum ApplicationState { + /** Enum value NEW. */ + NEW("NEW"), + + /** Enum value NEW_SAVING. */ + NEW_SAVING("NEW_SAVING"), + + /** Enum value SUBMITTED. */ + SUBMITTED("SUBMITTED"), + + /** Enum value ACCEPTED. */ + ACCEPTED("ACCEPTED"), + + /** Enum value RUNNING. */ + RUNNING("RUNNING"), + + /** Enum value FINISHED. */ + FINISHED("FINISHED"), + + /** Enum value FINISHING. */ + FINISHING("FINISHING"), + + /** Enum value FAILED. */ + FAILED("FAILED"), + + /** Enum value KILLED. */ + KILLED("KILLED"); + + /** The actual serialized value for a ApplicationState instance. */ + private String value; + + ApplicationState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ApplicationState instance. + * + * @param value the serialized value to parse. + * @return the parsed ApplicationState object, or null if unable to parse. + */ + @JsonCreator + public static ApplicationState fromString(String value) { + ApplicationState[] items = ApplicationState.values(); + for (ApplicationState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobDetailRootJsonObject.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobDetailRootJsonObject.java new file mode 100644 index 000000000000..a5b05296ce65 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobDetailRootJsonObject.java @@ -0,0 +1,303 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object containing the job details. + */ +public class JobDetailRootJsonObject { + /** + * The callback URL, if any. + */ + @JsonProperty(value = "callback") + private Object callback; + + /** + * The string representing completed status, for example 'done'. + */ + @JsonProperty(value = "completed") + private String completed; + + /** + * The job's exit value. + */ + @JsonProperty(value = "exitValue") + private Integer exitValue; + + /** + * The job ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The message returned. + */ + @JsonProperty(value = "msg") + private Object msg; + + /** + * The parent job ID. + */ + @JsonProperty(value = "parentId") + private String parentId; + + /** + * The job completion percentage, for example '75% complete'. + */ + @JsonProperty(value = "percentComplete") + private String percentComplete; + + /** + * The object containing the job profile information. + */ + @JsonProperty(value = "profile") + private Profile profile; + + /** + * The object containing the job status information. + */ + @JsonProperty(value = "status") + private Status status; + + /** + * The user name of the job creator. + */ + @JsonProperty(value = "user") + private String user; + + /** + * The arguments passed in by the user. + */ + @JsonProperty(value = "userargs") + private Userargs userargs; + + /** + * Get the callback URL, if any. + * + * @return the callback value + */ + public Object callback() { + return this.callback; + } + + /** + * Set the callback URL, if any. + * + * @param callback the callback value to set + * @return the JobDetailRootJsonObject object itself. + */ + public JobDetailRootJsonObject withCallback(Object callback) { + this.callback = callback; + return this; + } + + /** + * Get the string representing completed status, for example 'done'. + * + * @return the completed value + */ + public String completed() { + return this.completed; + } + + /** + * Set the string representing completed status, for example 'done'. + * + * @param completed the completed value to set + * @return the JobDetailRootJsonObject object itself. + */ + public JobDetailRootJsonObject withCompleted(String completed) { + this.completed = completed; + return this; + } + + /** + * Get the job's exit value. + * + * @return the exitValue value + */ + public Integer exitValue() { + return this.exitValue; + } + + /** + * Set the job's exit value. + * + * @param exitValue the exitValue value to set + * @return the JobDetailRootJsonObject object itself. + */ + public JobDetailRootJsonObject withExitValue(Integer exitValue) { + this.exitValue = exitValue; + return this; + } + + /** + * Get the job ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the job ID. + * + * @param id the id value to set + * @return the JobDetailRootJsonObject object itself. + */ + public JobDetailRootJsonObject withId(String id) { + this.id = id; + return this; + } + + /** + * Get the message returned. + * + * @return the msg value + */ + public Object msg() { + return this.msg; + } + + /** + * Set the message returned. + * + * @param msg the msg value to set + * @return the JobDetailRootJsonObject object itself. + */ + public JobDetailRootJsonObject withMsg(Object msg) { + this.msg = msg; + return this; + } + + /** + * Get the parent job ID. + * + * @return the parentId value + */ + public String parentId() { + return this.parentId; + } + + /** + * Set the parent job ID. + * + * @param parentId the parentId value to set + * @return the JobDetailRootJsonObject object itself. + */ + public JobDetailRootJsonObject withParentId(String parentId) { + this.parentId = parentId; + return this; + } + + /** + * Get the job completion percentage, for example '75% complete'. + * + * @return the percentComplete value + */ + public String percentComplete() { + return this.percentComplete; + } + + /** + * Set the job completion percentage, for example '75% complete'. + * + * @param percentComplete the percentComplete value to set + * @return the JobDetailRootJsonObject object itself. + */ + public JobDetailRootJsonObject withPercentComplete(String percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + /** + * Get the object containing the job profile information. + * + * @return the profile value + */ + public Profile profile() { + return this.profile; + } + + /** + * Set the object containing the job profile information. + * + * @param profile the profile value to set + * @return the JobDetailRootJsonObject object itself. + */ + public JobDetailRootJsonObject withProfile(Profile profile) { + this.profile = profile; + return this; + } + + /** + * Get the object containing the job status information. + * + * @return the status value + */ + public Status status() { + return this.status; + } + + /** + * Set the object containing the job status information. + * + * @param status the status value to set + * @return the JobDetailRootJsonObject object itself. + */ + public JobDetailRootJsonObject withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the user name of the job creator. + * + * @return the user value + */ + public String user() { + return this.user; + } + + /** + * Set the user name of the job creator. + * + * @param user the user value to set + * @return the JobDetailRootJsonObject object itself. + */ + public JobDetailRootJsonObject withUser(String user) { + this.user = user; + return this; + } + + /** + * Get the arguments passed in by the user. + * + * @return the userargs value + */ + public Userargs userargs() { + return this.userargs; + } + + /** + * Set the arguments passed in by the user. + * + * @param userargs the userargs value to set + * @return the JobDetailRootJsonObject object itself. + */ + public JobDetailRootJsonObject withUserargs(Userargs userargs) { + this.userargs = userargs; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobID.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobID.java new file mode 100644 index 000000000000..4899d5e84a66 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobID.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object with the Job ID. + */ +public class JobID { + /** + * The job number. + */ + @JsonProperty(value = "id") + private Long id; + + /** + * The jobTracker identifier. + */ + @JsonProperty(value = "jtIdentifier") + private String jtIdentifier; + + /** + * Get the job number. + * + * @return the id value + */ + public Long id() { + return this.id; + } + + /** + * Set the job number. + * + * @param id the id value to set + * @return the JobID object itself. + */ + public JobID withId(Long id) { + this.id = id; + return this; + } + + /** + * Get the jobTracker identifier. + * + * @return the jtIdentifier value + */ + public String jtIdentifier() { + return this.jtIdentifier; + } + + /** + * Set the jobTracker identifier. + * + * @param jtIdentifier the jtIdentifier value to set + * @return the JobID object itself. + */ + public JobID withJtIdentifier(String jtIdentifier) { + this.jtIdentifier = jtIdentifier; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobListJsonObject.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobListJsonObject.java new file mode 100644 index 000000000000..0235c42f1e6a --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobListJsonObject.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The List Job operation response. + */ +public class JobListJsonObject { + /** + * The detail of the job. + */ + @JsonProperty(value = "detail") + private JobDetailRootJsonObject detail; + + /** + * The Id of the job. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the detail of the job. + * + * @return the detail value + */ + public JobDetailRootJsonObject detail() { + return this.detail; + } + + /** + * Set the detail of the job. + * + * @param detail the detail value to set + * @return the JobListJsonObject object itself. + */ + public JobListJsonObject withDetail(JobDetailRootJsonObject detail) { + this.detail = detail; + return this; + } + + /** + * Get the Id of the job. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the Id of the job. + * + * @param id the id value to set + * @return the JobListJsonObject object itself. + */ + public JobListJsonObject withId(String id) { + this.id = id; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobOperationsErrorResponse.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobOperationsErrorResponse.java new file mode 100644 index 000000000000..e6a80261c269 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobOperationsErrorResponse.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the format of Error response. + */ +public class JobOperationsErrorResponse { + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "error") + private String error; + + /** + * Get error message indicating why the operation failed. + * + * @return the error value + */ + public String error() { + return this.error; + } + + /** + * Set error message indicating why the operation failed. + * + * @param error the error value to set + * @return the JobOperationsErrorResponse object itself. + */ + public JobOperationsErrorResponse withError(String error) { + this.error = error; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobOperationsErrorResponseException.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobOperationsErrorResponseException.java new file mode 100644 index 000000000000..d4b21246cf0a --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobOperationsErrorResponseException.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with JobOperationsErrorResponse + * information. + */ +public class JobOperationsErrorResponseException extends RestException { + /** + * Initializes a new instance of the JobOperationsErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public JobOperationsErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the JobOperationsErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public JobOperationsErrorResponseException(final String message, final Response response, final JobOperationsErrorResponse body) { + super(message, response, body); + } + + @Override + public JobOperationsErrorResponse body() { + return (JobOperationsErrorResponse) super.body(); + } +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobSubmissionJsonResponse.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobSubmissionJsonResponse.java new file mode 100644 index 000000000000..189a97753f50 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/JobSubmissionJsonResponse.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The job submission json response. + */ +public class JobSubmissionJsonResponse { + /** + * The Id of the created job. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the Id of the created job. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the Id of the created job. + * + * @param id the id value to set + * @return the JobSubmissionJsonResponse object itself. + */ + public JobSubmissionJsonResponse withId(String id) { + this.id = id; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/Profile.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/Profile.java new file mode 100644 index 000000000000..e3e055c2907e --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/Profile.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object containing the job profile information. + */ +public class Profile { + /** + * The job configuration file. + */ + @JsonProperty(value = "jobFile") + private String jobFile; + + /** + * The full ID of the job. + */ + @JsonProperty(value = "jobId") + private String jobId; + + /** + * The ID of the job. + */ + @JsonProperty(value = "jobID") + private JobID jobID; + + /** + * The user-specified job name. + */ + @JsonProperty(value = "jobName") + private String jobName; + + /** + * The name of the queue to which the job is submitted. + */ + @JsonProperty(value = "queueName") + private String queueName; + + /** + * The link to the web-ui for details of the job. + */ + @JsonProperty(value = "url") + private String url; + + /** + * The userid of the person who submitted the job. + */ + @JsonProperty(value = "user") + private String user; + + /** + * Get the job configuration file. + * + * @return the jobFile value + */ + public String jobFile() { + return this.jobFile; + } + + /** + * Set the job configuration file. + * + * @param jobFile the jobFile value to set + * @return the Profile object itself. + */ + public Profile withJobFile(String jobFile) { + this.jobFile = jobFile; + return this; + } + + /** + * Get the full ID of the job. + * + * @return the jobId value + */ + public String jobId() { + return this.jobId; + } + + /** + * Set the full ID of the job. + * + * @param jobId the jobId value to set + * @return the Profile object itself. + */ + public Profile withJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Get the ID of the job. + * + * @return the jobID value + */ + public JobID jobID() { + return this.jobID; + } + + /** + * Set the ID of the job. + * + * @param jobID the jobID value to set + * @return the Profile object itself. + */ + public Profile withJobID(JobID jobID) { + this.jobID = jobID; + return this; + } + + /** + * Get the user-specified job name. + * + * @return the jobName value + */ + public String jobName() { + return this.jobName; + } + + /** + * Set the user-specified job name. + * + * @param jobName the jobName value to set + * @return the Profile object itself. + */ + public Profile withJobName(String jobName) { + this.jobName = jobName; + return this; + } + + /** + * Get the name of the queue to which the job is submitted. + * + * @return the queueName value + */ + public String queueName() { + return this.queueName; + } + + /** + * Set the name of the queue to which the job is submitted. + * + * @param queueName the queueName value to set + * @return the Profile object itself. + */ + public Profile withQueueName(String queueName) { + this.queueName = queueName; + return this; + } + + /** + * Get the link to the web-ui for details of the job. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set the link to the web-ui for details of the job. + * + * @param url the url value to set + * @return the Profile object itself. + */ + public Profile withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the userid of the person who submitted the job. + * + * @return the user value + */ + public String user() { + return this.user; + } + + /** + * Set the userid of the person who submitted the job. + * + * @param user the user value to set + * @return the Profile object itself. + */ + public Profile withUser(String user) { + this.user = user; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SessionJobKind.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SessionJobKind.java new file mode 100644 index 000000000000..221a01113ff4 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SessionJobKind.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SessionJobKind. + */ +public final class SessionJobKind extends ExpandableStringEnum { + /** Static value spark for SessionJobKind. */ + public static final SessionJobKind SPARK = fromString("spark"); + + /** Static value pyspark for SessionJobKind. */ + public static final SessionJobKind PYSPARK = fromString("pyspark"); + + /** Static value sparkr for SessionJobKind. */ + public static final SessionJobKind SPARKR = fromString("sparkr"); + + /** Static value sql for SessionJobKind. */ + public static final SessionJobKind SQL = fromString("sql"); + + /** + * Creates or finds a SessionJobKind from its string representation. + * @param name a name to look for + * @return the corresponding SessionJobKind + */ + @JsonCreator + public static SessionJobKind fromString(String name) { + return fromString(name, SessionJobKind.class); + } + + /** + * @return known SessionJobKind values + */ + public static Collection values() { + return values(SessionJobKind.class); + } +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkBatchJob.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkBatchJob.java new file mode 100644 index 000000000000..925a073c8b76 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkBatchJob.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SparkBatchJob model. + */ +public class SparkBatchJob { + /** + * The id property. + */ + @JsonProperty(value = "id") + private Integer id; + + /** + * The appId property. + */ + @JsonProperty(value = "appId") + private String appId; + + /** + * The appInfo property. + */ + @JsonProperty(value = "appInfo") + private Map appInfo; + + /** + * The state property. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The logLines property. + */ + @JsonProperty(value = "log") + private List logLines; + + /** + * Get the id value. + * + * @return the id value + */ + public Integer id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the SparkBatchJob object itself. + */ + public SparkBatchJob withId(Integer id) { + this.id = id; + return this; + } + + /** + * Get the appId value. + * + * @return the appId value + */ + public String appId() { + return this.appId; + } + + /** + * Set the appId value. + * + * @param appId the appId value to set + * @return the SparkBatchJob object itself. + */ + public SparkBatchJob withAppId(String appId) { + this.appId = appId; + return this; + } + + /** + * Get the appInfo value. + * + * @return the appInfo value + */ + public Map appInfo() { + return this.appInfo; + } + + /** + * Set the appInfo value. + * + * @param appInfo the appInfo value to set + * @return the SparkBatchJob object itself. + */ + public SparkBatchJob withAppInfo(Map appInfo) { + this.appInfo = appInfo; + return this; + } + + /** + * Get the state value. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state value. + * + * @param state the state value to set + * @return the SparkBatchJob object itself. + */ + public SparkBatchJob withState(String state) { + this.state = state; + return this; + } + + /** + * Get the logLines value. + * + * @return the logLines value + */ + public List logLines() { + return this.logLines; + } + + /** + * Set the logLines value. + * + * @param logLines the logLines value to set + * @return the SparkBatchJob object itself. + */ + public SparkBatchJob withLogLines(List logLines) { + this.logLines = logLines; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkBatchJobCollection.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkBatchJobCollection.java new file mode 100644 index 000000000000..402aed091275 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkBatchJobCollection.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SparkBatchJobCollection model. + */ +public class SparkBatchJobCollection { + /** + * The from property. + */ + @JsonProperty(value = "from") + private Integer from; + + /** + * The total property. + */ + @JsonProperty(value = "total") + private Integer total; + + /** + * The sessions property. + */ + @JsonProperty(value = "sessions") + private List sessions; + + /** + * Get the from value. + * + * @return the from value + */ + public Integer from() { + return this.from; + } + + /** + * Set the from value. + * + * @param from the from value to set + * @return the SparkBatchJobCollection object itself. + */ + public SparkBatchJobCollection withFrom(Integer from) { + this.from = from; + return this; + } + + /** + * Get the total value. + * + * @return the total value + */ + public Integer total() { + return this.total; + } + + /** + * Set the total value. + * + * @param total the total value to set + * @return the SparkBatchJobCollection object itself. + */ + public SparkBatchJobCollection withTotal(Integer total) { + this.total = total; + return this; + } + + /** + * Get the sessions value. + * + * @return the sessions value + */ + public List sessions() { + return this.sessions; + } + + /** + * Set the sessions value. + * + * @param sessions the sessions value to set + * @return the SparkBatchJobCollection object itself. + */ + public SparkBatchJobCollection withSessions(List sessions) { + this.sessions = sessions; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkBatchJobRequest.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkBatchJobRequest.java new file mode 100644 index 000000000000..8e6e3ee72558 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkBatchJobRequest.java @@ -0,0 +1,435 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SparkBatchJobRequest model. + */ +public class SparkBatchJobRequest { + /** + * The file property. + */ + @JsonProperty(value = "file") + private String file; + + /** + * The proxyUser property. + */ + @JsonProperty(value = "proxyUser") + private String proxyUser; + + /** + * The className property. + */ + @JsonProperty(value = "className") + private String className; + + /** + * The arguments property. + */ + @JsonProperty(value = "args") + private List arguments; + + /** + * The jars property. + */ + @JsonProperty(value = "jars") + private List jars; + + /** + * The pythonFiles property. + */ + @JsonProperty(value = "pyFiles") + private List pythonFiles; + + /** + * The files property. + */ + @JsonProperty(value = "files") + private List files; + + /** + * The driverMemory property. + */ + @JsonProperty(value = "driverMemory") + private String driverMemory; + + /** + * The driverCores property. + */ + @JsonProperty(value = "driverCores") + private Integer driverCores; + + /** + * The executorMemory property. + */ + @JsonProperty(value = "executorMemory") + private String executorMemory; + + /** + * The executorCores property. + */ + @JsonProperty(value = "executorCores") + private Integer executorCores; + + /** + * The executorCount property. + */ + @JsonProperty(value = "numExecutors") + private Integer executorCount; + + /** + * The archives property. + */ + @JsonProperty(value = "archives") + private List archives; + + /** + * The queue property. + */ + @JsonProperty(value = "queue") + private String queue; + + /** + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The configuration property. + */ + @JsonProperty(value = "conf") + private Map configuration; + + /** + * Get the file value. + * + * @return the file value + */ + public String file() { + return this.file; + } + + /** + * Set the file value. + * + * @param file the file value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withFile(String file) { + this.file = file; + return this; + } + + /** + * Get the proxyUser value. + * + * @return the proxyUser value + */ + public String proxyUser() { + return this.proxyUser; + } + + /** + * Set the proxyUser value. + * + * @param proxyUser the proxyUser value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withProxyUser(String proxyUser) { + this.proxyUser = proxyUser; + return this; + } + + /** + * Get the className value. + * + * @return the className value + */ + public String className() { + return this.className; + } + + /** + * Set the className value. + * + * @param className the className value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withClassName(String className) { + this.className = className; + return this; + } + + /** + * Get the arguments value. + * + * @return the arguments value + */ + public List arguments() { + return this.arguments; + } + + /** + * Set the arguments value. + * + * @param arguments the arguments value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withArguments(List arguments) { + this.arguments = arguments; + return this; + } + + /** + * Get the jars value. + * + * @return the jars value + */ + public List jars() { + return this.jars; + } + + /** + * Set the jars value. + * + * @param jars the jars value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withJars(List jars) { + this.jars = jars; + return this; + } + + /** + * Get the pythonFiles value. + * + * @return the pythonFiles value + */ + public List pythonFiles() { + return this.pythonFiles; + } + + /** + * Set the pythonFiles value. + * + * @param pythonFiles the pythonFiles value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withPythonFiles(List pythonFiles) { + this.pythonFiles = pythonFiles; + return this; + } + + /** + * Get the files value. + * + * @return the files value + */ + public List files() { + return this.files; + } + + /** + * Set the files value. + * + * @param files the files value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withFiles(List files) { + this.files = files; + return this; + } + + /** + * Get the driverMemory value. + * + * @return the driverMemory value + */ + public String driverMemory() { + return this.driverMemory; + } + + /** + * Set the driverMemory value. + * + * @param driverMemory the driverMemory value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withDriverMemory(String driverMemory) { + this.driverMemory = driverMemory; + return this; + } + + /** + * Get the driverCores value. + * + * @return the driverCores value + */ + public Integer driverCores() { + return this.driverCores; + } + + /** + * Set the driverCores value. + * + * @param driverCores the driverCores value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withDriverCores(Integer driverCores) { + this.driverCores = driverCores; + return this; + } + + /** + * Get the executorMemory value. + * + * @return the executorMemory value + */ + public String executorMemory() { + return this.executorMemory; + } + + /** + * Set the executorMemory value. + * + * @param executorMemory the executorMemory value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withExecutorMemory(String executorMemory) { + this.executorMemory = executorMemory; + return this; + } + + /** + * Get the executorCores value. + * + * @return the executorCores value + */ + public Integer executorCores() { + return this.executorCores; + } + + /** + * Set the executorCores value. + * + * @param executorCores the executorCores value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withExecutorCores(Integer executorCores) { + this.executorCores = executorCores; + return this; + } + + /** + * Get the executorCount value. + * + * @return the executorCount value + */ + public Integer executorCount() { + return this.executorCount; + } + + /** + * Set the executorCount value. + * + * @param executorCount the executorCount value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withExecutorCount(Integer executorCount) { + this.executorCount = executorCount; + return this; + } + + /** + * Get the archives value. + * + * @return the archives value + */ + public List archives() { + return this.archives; + } + + /** + * Set the archives value. + * + * @param archives the archives value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withArchives(List archives) { + this.archives = archives; + return this; + } + + /** + * Get the queue value. + * + * @return the queue value + */ + public String queue() { + return this.queue; + } + + /** + * Set the queue value. + * + * @param queue the queue value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withQueue(String queue) { + this.queue = queue; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the configuration value. + * + * @return the configuration value + */ + public Map configuration() { + return this.configuration; + } + + /** + * Set the configuration value. + * + * @param configuration the configuration value to set + * @return the SparkBatchJobRequest object itself. + */ + public SparkBatchJobRequest withConfiguration(Map configuration) { + this.configuration = configuration; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkJobDeletedResult.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkJobDeletedResult.java new file mode 100644 index 000000000000..0b7f03b03fb8 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkJobDeletedResult.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SparkJobDeletedResult model. + */ +public class SparkJobDeletedResult { + /** + * The deletedMessage property. + */ + @JsonProperty(value = "msg") + private String deletedMessage; + + /** + * Get the deletedMessage value. + * + * @return the deletedMessage value + */ + public String deletedMessage() { + return this.deletedMessage; + } + + /** + * Set the deletedMessage value. + * + * @param deletedMessage the deletedMessage value to set + * @return the SparkJobDeletedResult object itself. + */ + public SparkJobDeletedResult withDeletedMessage(String deletedMessage) { + this.deletedMessage = deletedMessage; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkJobLog.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkJobLog.java new file mode 100644 index 000000000000..f0cf89393a52 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkJobLog.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SparkJobLog model. + */ +public class SparkJobLog { + /** + * The id property. + */ + @JsonProperty(value = "id") + private Integer id; + + /** + * The from property. + */ + @JsonProperty(value = "from") + private Integer from; + + /** + * The size property. + */ + @JsonProperty(value = "size") + private Integer size; + + /** + * The total property. + */ + @JsonProperty(value = "total") + private Long total; + + /** + * The logLines property. + */ + @JsonProperty(value = "log") + private List logLines; + + /** + * Get the id value. + * + * @return the id value + */ + public Integer id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the SparkJobLog object itself. + */ + public SparkJobLog withId(Integer id) { + this.id = id; + return this; + } + + /** + * Get the from value. + * + * @return the from value + */ + public Integer from() { + return this.from; + } + + /** + * Set the from value. + * + * @param from the from value to set + * @return the SparkJobLog object itself. + */ + public SparkJobLog withFrom(Integer from) { + this.from = from; + return this; + } + + /** + * Get the size value. + * + * @return the size value + */ + public Integer size() { + return this.size; + } + + /** + * Set the size value. + * + * @param size the size value to set + * @return the SparkJobLog object itself. + */ + public SparkJobLog withSize(Integer size) { + this.size = size; + return this; + } + + /** + * Get the total value. + * + * @return the total value + */ + public Long total() { + return this.total; + } + + /** + * Set the total value. + * + * @param total the total value to set + * @return the SparkJobLog object itself. + */ + public SparkJobLog withTotal(Long total) { + this.total = total; + return this; + } + + /** + * Get the logLines value. + * + * @return the logLines value + */ + public List logLines() { + return this.logLines; + } + + /** + * Set the logLines value. + * + * @param logLines the logLines value to set + * @return the SparkJobLog object itself. + */ + public SparkJobLog withLogLines(List logLines) { + this.logLines = logLines; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkJobState.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkJobState.java new file mode 100644 index 000000000000..c7d25df6fa5d --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkJobState.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SparkJobState model. + */ +public class SparkJobState { + /** + * The id property. + */ + @JsonProperty(value = "id") + private Integer id; + + /** + * The state property. + */ + @JsonProperty(value = "state") + private String state; + + /** + * Get the id value. + * + * @return the id value + */ + public Integer id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the SparkJobState object itself. + */ + public SparkJobState withId(Integer id) { + this.id = id; + return this; + } + + /** + * Get the state value. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state value. + * + * @param state the state value to set + * @return the SparkJobState object itself. + */ + public SparkJobState withState(String state) { + this.state = state; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkSessionCollection.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkSessionCollection.java new file mode 100644 index 000000000000..3a1dd83fa38d --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkSessionCollection.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SparkSessionCollection model. + */ +public class SparkSessionCollection { + /** + * The from property. + */ + @JsonProperty(value = "from") + private Integer from; + + /** + * The total property. + */ + @JsonProperty(value = "total") + private Integer total; + + /** + * The sessions property. + */ + @JsonProperty(value = "sessions") + private List sessions; + + /** + * Get the from value. + * + * @return the from value + */ + public Integer from() { + return this.from; + } + + /** + * Set the from value. + * + * @param from the from value to set + * @return the SparkSessionCollection object itself. + */ + public SparkSessionCollection withFrom(Integer from) { + this.from = from; + return this; + } + + /** + * Get the total value. + * + * @return the total value + */ + public Integer total() { + return this.total; + } + + /** + * Set the total value. + * + * @param total the total value to set + * @return the SparkSessionCollection object itself. + */ + public SparkSessionCollection withTotal(Integer total) { + this.total = total; + return this; + } + + /** + * Get the sessions value. + * + * @return the sessions value + */ + public List sessions() { + return this.sessions; + } + + /** + * Set the sessions value. + * + * @param sessions the sessions value to set + * @return the SparkSessionCollection object itself. + */ + public SparkSessionCollection withSessions(List sessions) { + this.sessions = sessions; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkSessionJob.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkSessionJob.java new file mode 100644 index 000000000000..f7475fa4da98 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkSessionJob.java @@ -0,0 +1,227 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SparkSessionJob model. + */ +public class SparkSessionJob { + /** + * The id property. + */ + @JsonProperty(value = "id") + private Integer id; + + /** + * The appId property. + */ + @JsonProperty(value = "appId") + private String appId; + + /** + * The owner property. + */ + @JsonProperty(value = "owner") + private String owner; + + /** + * The proxyUser property. + */ + @JsonProperty(value = "proxyUser") + private String proxyUser; + + /** + * The kind property. + */ + @JsonProperty(value = "kind") + private String kind; + + /** + * The logLines property. + */ + @JsonProperty(value = "log") + private List logLines; + + /** + * The state property. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The appInfo property. + */ + @JsonProperty(value = "appInfo") + private Map appInfo; + + /** + * Get the id value. + * + * @return the id value + */ + public Integer id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the SparkSessionJob object itself. + */ + public SparkSessionJob withId(Integer id) { + this.id = id; + return this; + } + + /** + * Get the appId value. + * + * @return the appId value + */ + public String appId() { + return this.appId; + } + + /** + * Set the appId value. + * + * @param appId the appId value to set + * @return the SparkSessionJob object itself. + */ + public SparkSessionJob withAppId(String appId) { + this.appId = appId; + return this; + } + + /** + * Get the owner value. + * + * @return the owner value + */ + public String owner() { + return this.owner; + } + + /** + * Set the owner value. + * + * @param owner the owner value to set + * @return the SparkSessionJob object itself. + */ + public SparkSessionJob withOwner(String owner) { + this.owner = owner; + return this; + } + + /** + * Get the proxyUser value. + * + * @return the proxyUser value + */ + public String proxyUser() { + return this.proxyUser; + } + + /** + * Set the proxyUser value. + * + * @param proxyUser the proxyUser value to set + * @return the SparkSessionJob object itself. + */ + public SparkSessionJob withProxyUser(String proxyUser) { + this.proxyUser = proxyUser; + return this; + } + + /** + * Get the kind value. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind value. + * + * @param kind the kind value to set + * @return the SparkSessionJob object itself. + */ + public SparkSessionJob withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the logLines value. + * + * @return the logLines value + */ + public List logLines() { + return this.logLines; + } + + /** + * Set the logLines value. + * + * @param logLines the logLines value to set + * @return the SparkSessionJob object itself. + */ + public SparkSessionJob withLogLines(List logLines) { + this.logLines = logLines; + return this; + } + + /** + * Get the state value. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state value. + * + * @param state the state value to set + * @return the SparkSessionJob object itself. + */ + public SparkSessionJob withState(String state) { + this.state = state; + return this; + } + + /** + * Get the appInfo value. + * + * @return the appInfo value + */ + public Map appInfo() { + return this.appInfo; + } + + /** + * Set the appInfo value. + * + * @param appInfo the appInfo value to set + * @return the SparkSessionJob object itself. + */ + public SparkSessionJob withAppInfo(Map appInfo) { + this.appInfo = appInfo; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkSessionJobRequest.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkSessionJobRequest.java new file mode 100644 index 000000000000..b0c85ceb40e1 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkSessionJobRequest.java @@ -0,0 +1,409 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SparkSessionJobRequest model. + */ +public class SparkSessionJobRequest { + /** + * Possible values include: 'spark', 'pyspark', 'sparkr', 'sql'. + */ + @JsonProperty(value = "kind") + private SessionJobKind kind; + + /** + * The proxyUser property. + */ + @JsonProperty(value = "proxyUser") + private String proxyUser; + + /** + * The jars property. + */ + @JsonProperty(value = "jars") + private List jars; + + /** + * The pythonFiles property. + */ + @JsonProperty(value = "pyFiles") + private List pythonFiles; + + /** + * The files property. + */ + @JsonProperty(value = "files") + private List files; + + /** + * The driverMemory property. + */ + @JsonProperty(value = "driverMemory") + private String driverMemory; + + /** + * The driverCores property. + */ + @JsonProperty(value = "driverCores") + private Integer driverCores; + + /** + * The executorMemory property. + */ + @JsonProperty(value = "executorMemory") + private String executorMemory; + + /** + * The executorCores property. + */ + @JsonProperty(value = "executorCores") + private Integer executorCores; + + /** + * The executorCount property. + */ + @JsonProperty(value = "numExecutors") + private Integer executorCount; + + /** + * The archives property. + */ + @JsonProperty(value = "archives") + private List archives; + + /** + * The queue property. + */ + @JsonProperty(value = "queue") + private String queue; + + /** + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The configuration property. + */ + @JsonProperty(value = "conf") + private Map configuration; + + /** + * The heartbeatTimeoutInSecond property. + */ + @JsonProperty(value = "heartbeatTimeoutInSecond") + private Integer heartbeatTimeoutInSecond; + + /** + * Get possible values include: 'spark', 'pyspark', 'sparkr', 'sql'. + * + * @return the kind value + */ + public SessionJobKind kind() { + return this.kind; + } + + /** + * Set possible values include: 'spark', 'pyspark', 'sparkr', 'sql'. + * + * @param kind the kind value to set + * @return the SparkSessionJobRequest object itself. + */ + public SparkSessionJobRequest withKind(SessionJobKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the proxyUser value. + * + * @return the proxyUser value + */ + public String proxyUser() { + return this.proxyUser; + } + + /** + * Set the proxyUser value. + * + * @param proxyUser the proxyUser value to set + * @return the SparkSessionJobRequest object itself. + */ + public SparkSessionJobRequest withProxyUser(String proxyUser) { + this.proxyUser = proxyUser; + return this; + } + + /** + * Get the jars value. + * + * @return the jars value + */ + public List jars() { + return this.jars; + } + + /** + * Set the jars value. + * + * @param jars the jars value to set + * @return the SparkSessionJobRequest object itself. + */ + public SparkSessionJobRequest withJars(List jars) { + this.jars = jars; + return this; + } + + /** + * Get the pythonFiles value. + * + * @return the pythonFiles value + */ + public List pythonFiles() { + return this.pythonFiles; + } + + /** + * Set the pythonFiles value. + * + * @param pythonFiles the pythonFiles value to set + * @return the SparkSessionJobRequest object itself. + */ + public SparkSessionJobRequest withPythonFiles(List pythonFiles) { + this.pythonFiles = pythonFiles; + return this; + } + + /** + * Get the files value. + * + * @return the files value + */ + public List files() { + return this.files; + } + + /** + * Set the files value. + * + * @param files the files value to set + * @return the SparkSessionJobRequest object itself. + */ + public SparkSessionJobRequest withFiles(List files) { + this.files = files; + return this; + } + + /** + * Get the driverMemory value. + * + * @return the driverMemory value + */ + public String driverMemory() { + return this.driverMemory; + } + + /** + * Set the driverMemory value. + * + * @param driverMemory the driverMemory value to set + * @return the SparkSessionJobRequest object itself. + */ + public SparkSessionJobRequest withDriverMemory(String driverMemory) { + this.driverMemory = driverMemory; + return this; + } + + /** + * Get the driverCores value. + * + * @return the driverCores value + */ + public Integer driverCores() { + return this.driverCores; + } + + /** + * Set the driverCores value. + * + * @param driverCores the driverCores value to set + * @return the SparkSessionJobRequest object itself. + */ + public SparkSessionJobRequest withDriverCores(Integer driverCores) { + this.driverCores = driverCores; + return this; + } + + /** + * Get the executorMemory value. + * + * @return the executorMemory value + */ + public String executorMemory() { + return this.executorMemory; + } + + /** + * Set the executorMemory value. + * + * @param executorMemory the executorMemory value to set + * @return the SparkSessionJobRequest object itself. + */ + public SparkSessionJobRequest withExecutorMemory(String executorMemory) { + this.executorMemory = executorMemory; + return this; + } + + /** + * Get the executorCores value. + * + * @return the executorCores value + */ + public Integer executorCores() { + return this.executorCores; + } + + /** + * Set the executorCores value. + * + * @param executorCores the executorCores value to set + * @return the SparkSessionJobRequest object itself. + */ + public SparkSessionJobRequest withExecutorCores(Integer executorCores) { + this.executorCores = executorCores; + return this; + } + + /** + * Get the executorCount value. + * + * @return the executorCount value + */ + public Integer executorCount() { + return this.executorCount; + } + + /** + * Set the executorCount value. + * + * @param executorCount the executorCount value to set + * @return the SparkSessionJobRequest object itself. + */ + public SparkSessionJobRequest withExecutorCount(Integer executorCount) { + this.executorCount = executorCount; + return this; + } + + /** + * Get the archives value. + * + * @return the archives value + */ + public List archives() { + return this.archives; + } + + /** + * Set the archives value. + * + * @param archives the archives value to set + * @return the SparkSessionJobRequest object itself. + */ + public SparkSessionJobRequest withArchives(List archives) { + this.archives = archives; + return this; + } + + /** + * Get the queue value. + * + * @return the queue value + */ + public String queue() { + return this.queue; + } + + /** + * Set the queue value. + * + * @param queue the queue value to set + * @return the SparkSessionJobRequest object itself. + */ + public SparkSessionJobRequest withQueue(String queue) { + this.queue = queue; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the SparkSessionJobRequest object itself. + */ + public SparkSessionJobRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the configuration value. + * + * @return the configuration value + */ + public Map configuration() { + return this.configuration; + } + + /** + * Set the configuration value. + * + * @param configuration the configuration value to set + * @return the SparkSessionJobRequest object itself. + */ + public SparkSessionJobRequest withConfiguration(Map configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the heartbeatTimeoutInSecond value. + * + * @return the heartbeatTimeoutInSecond value + */ + public Integer heartbeatTimeoutInSecond() { + return this.heartbeatTimeoutInSecond; + } + + /** + * Set the heartbeatTimeoutInSecond value. + * + * @param heartbeatTimeoutInSecond the heartbeatTimeoutInSecond value to set + * @return the SparkSessionJobRequest object itself. + */ + public SparkSessionJobRequest withHeartbeatTimeoutInSecond(Integer heartbeatTimeoutInSecond) { + this.heartbeatTimeoutInSecond = heartbeatTimeoutInSecond; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkStatement.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkStatement.java new file mode 100644 index 000000000000..d69df9b66823 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkStatement.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SparkStatement model. + */ +public class SparkStatement { + /** + * The id property. + */ + @JsonProperty(value = "id") + private Integer id; + + /** + * The code property. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The state property. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The output property. + */ + @JsonProperty(value = "output") + private SparkStatementOutput output; + + /** + * The progress property. + */ + @JsonProperty(value = "progress") + private Double progress; + + /** + * Get the id value. + * + * @return the id value + */ + public Integer id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the SparkStatement object itself. + */ + public SparkStatement withId(Integer id) { + this.id = id; + return this; + } + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the SparkStatement object itself. + */ + public SparkStatement withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the state value. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state value. + * + * @param state the state value to set + * @return the SparkStatement object itself. + */ + public SparkStatement withState(String state) { + this.state = state; + return this; + } + + /** + * Get the output value. + * + * @return the output value + */ + public SparkStatementOutput output() { + return this.output; + } + + /** + * Set the output value. + * + * @param output the output value to set + * @return the SparkStatement object itself. + */ + public SparkStatement withOutput(SparkStatementOutput output) { + this.output = output; + return this; + } + + /** + * Get the progress value. + * + * @return the progress value + */ + public Double progress() { + return this.progress; + } + + /** + * Set the progress value. + * + * @param progress the progress value to set + * @return the SparkStatement object itself. + */ + public SparkStatement withProgress(Double progress) { + this.progress = progress; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkStatementCancellationResult.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkStatementCancellationResult.java new file mode 100644 index 000000000000..a167d6f3b28d --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkStatementCancellationResult.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SparkStatementCancellationResult model. + */ +public class SparkStatementCancellationResult { + /** + * The cancelMessage property. + */ + @JsonProperty(value = "msg") + private String cancelMessage; + + /** + * Get the cancelMessage value. + * + * @return the cancelMessage value + */ + public String cancelMessage() { + return this.cancelMessage; + } + + /** + * Set the cancelMessage value. + * + * @param cancelMessage the cancelMessage value to set + * @return the SparkStatementCancellationResult object itself. + */ + public SparkStatementCancellationResult withCancelMessage(String cancelMessage) { + this.cancelMessage = cancelMessage; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkStatementCollection.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkStatementCollection.java new file mode 100644 index 000000000000..16fea1ae8c72 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkStatementCollection.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SparkStatementCollection model. + */ +public class SparkStatementCollection { + /** + * The statements property. + */ + @JsonProperty(value = "statements") + private List statements; + + /** + * Get the statements value. + * + * @return the statements value + */ + public List statements() { + return this.statements; + } + + /** + * Set the statements value. + * + * @param statements the statements value to set + * @return the SparkStatementCollection object itself. + */ + public SparkStatementCollection withStatements(List statements) { + this.statements = statements; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkStatementOutput.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkStatementOutput.java new file mode 100644 index 000000000000..a116e0d57357 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkStatementOutput.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SparkStatementOutput model. + */ +public class SparkStatementOutput { + /** + * The status property. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The executionCount property. + */ + @JsonProperty(value = "execution_count") + private Integer executionCount; + + /** + * The data property. + */ + @JsonProperty(value = "data") + private Object data; + + /** + * Get the status value. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the SparkStatementOutput object itself. + */ + public SparkStatementOutput withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the executionCount value. + * + * @return the executionCount value + */ + public Integer executionCount() { + return this.executionCount; + } + + /** + * Set the executionCount value. + * + * @param executionCount the executionCount value to set + * @return the SparkStatementOutput object itself. + */ + public SparkStatementOutput withExecutionCount(Integer executionCount) { + this.executionCount = executionCount; + return this; + } + + /** + * Get the data value. + * + * @return the data value + */ + public Object data() { + return this.data; + } + + /** + * Set the data value. + * + * @param data the data value to set + * @return the SparkStatementOutput object itself. + */ + public SparkStatementOutput withData(Object data) { + this.data = data; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkStatementRequest.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkStatementRequest.java new file mode 100644 index 000000000000..1c9441c41bdc --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/SparkStatementRequest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SparkStatementRequest model. + */ +public class SparkStatementRequest { + /** + * The code property. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The kind property. + */ + @JsonProperty(value = "kind") + private String kind; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the SparkStatementRequest object itself. + */ + public SparkStatementRequest withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the kind value. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind value. + * + * @param kind the kind value to set + * @return the SparkStatementRequest object itself. + */ + public SparkStatementRequest withKind(String kind) { + this.kind = kind; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/Status.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/Status.java new file mode 100644 index 000000000000..6dc9653e58ad --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/Status.java @@ -0,0 +1,773 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gets or sets the object containing the job status information. + */ +public class Status { + /** + * The progress made on the cleanup. + */ + @JsonProperty(value = "cleanupProgress") + private Double cleanupProgress; + + /** + * The information about any failures that have occurred. + */ + @JsonProperty(value = "failureInfo") + private String failureInfo; + + /** + * The time at which the job completed. It is an integer in milliseconds, + * as a Unix timestamp relative to 1/1/1970 00:00:00. + */ + @JsonProperty(value = "finishTime") + private Long finishTime; + + /** + * The history file of the job. + */ + @JsonProperty(value = "historyFile") + private String historyFile; + + /** + * The ACLs of the job. + */ + @JsonProperty(value = "jobACLs") + private Object jobACLs; + + /** + * Whether or not the job has completed. + */ + @JsonProperty(value = "jobComplete") + private Boolean jobComplete; + + /** + * The job configuration file. + */ + @JsonProperty(value = "jobFile") + private String jobFile; + + /** + * The full ID of the job. + */ + @JsonProperty(value = "jobId") + private String jobId; + + /** + * The ID of the job. + */ + @JsonProperty(value = "jobID") + private JobID jobID; + + /** + * The user-specified job name. + */ + @JsonProperty(value = "jobName") + private String jobName; + + /** + * The priority of the job. + */ + @JsonProperty(value = "jobPriority") + private String jobPriority; + + /** + * The progress made on the maps. + */ + @JsonProperty(value = "mapProgress") + private Double mapProgress; + + /** + * The amount of memory needed for the job. + */ + @JsonProperty(value = "neededMem") + private Long neededMem; + + /** + * The number of slots reserved. + */ + @JsonProperty(value = "numReservedSlots") + private Integer numReservedSlots; + + /** + * The number of slots used for the job. + */ + @JsonProperty(value = "numUsedSlots") + private Integer numUsedSlots; + + /** + * The priority of the job. + */ + @JsonProperty(value = "priority") + private String priority; + + /** + * The job queue name. + */ + @JsonProperty(value = "queue") + private String queue; + + /** + * The progress made on the reduces. + */ + @JsonProperty(value = "reduceProgress") + private Double reduceProgress; + + /** + * The amount of memory reserved for the job. + */ + @JsonProperty(value = "reservedMem") + private Long reservedMem; + + /** + * Whether or not the job has been retired. + */ + @JsonProperty(value = "retired") + private Boolean retired; + + /** + * The current state of the job. + */ + @JsonProperty(value = "runState") + private Integer runState; + + /** + * The information about the scheduling of the job. + */ + @JsonProperty(value = "schedulingInfo") + private String schedulingInfo; + + /** + * The progress made on the setup. + */ + @JsonProperty(value = "setupProgress") + private Double setupProgress; + + /** + * The time at which the job started. It is an integer in milliseconds, as + * a Unix timestamp relative to 1/1/1970 00:00:00. + */ + @JsonProperty(value = "startTime") + private Long startTime; + + /** + * The state of the job. + */ + @JsonProperty(value = "state") + private String state; + + /** + * The link to the web-ui for details of the job. + */ + @JsonProperty(value = "trackingUrl") + private String trackingUrl; + + /** + * Whether job running in uber mode. + */ + @JsonProperty(value = "uber") + private Boolean uber; + + /** + * The amount of memory used by the job. + */ + @JsonProperty(value = "usedMem") + private Long usedMem; + + /** + * The userid of the person who submitted the job. + */ + @JsonProperty(value = "username") + private String username; + + /** + * Get the progress made on the cleanup. + * + * @return the cleanupProgress value + */ + public Double cleanupProgress() { + return this.cleanupProgress; + } + + /** + * Set the progress made on the cleanup. + * + * @param cleanupProgress the cleanupProgress value to set + * @return the Status object itself. + */ + public Status withCleanupProgress(Double cleanupProgress) { + this.cleanupProgress = cleanupProgress; + return this; + } + + /** + * Get the information about any failures that have occurred. + * + * @return the failureInfo value + */ + public String failureInfo() { + return this.failureInfo; + } + + /** + * Set the information about any failures that have occurred. + * + * @param failureInfo the failureInfo value to set + * @return the Status object itself. + */ + public Status withFailureInfo(String failureInfo) { + this.failureInfo = failureInfo; + return this; + } + + /** + * Get the time at which the job completed. It is an integer in milliseconds, as a Unix timestamp relative to 1/1/1970 00:00:00. + * + * @return the finishTime value + */ + public Long finishTime() { + return this.finishTime; + } + + /** + * Set the time at which the job completed. It is an integer in milliseconds, as a Unix timestamp relative to 1/1/1970 00:00:00. + * + * @param finishTime the finishTime value to set + * @return the Status object itself. + */ + public Status withFinishTime(Long finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the history file of the job. + * + * @return the historyFile value + */ + public String historyFile() { + return this.historyFile; + } + + /** + * Set the history file of the job. + * + * @param historyFile the historyFile value to set + * @return the Status object itself. + */ + public Status withHistoryFile(String historyFile) { + this.historyFile = historyFile; + return this; + } + + /** + * Get the ACLs of the job. + * + * @return the jobACLs value + */ + public Object jobACLs() { + return this.jobACLs; + } + + /** + * Set the ACLs of the job. + * + * @param jobACLs the jobACLs value to set + * @return the Status object itself. + */ + public Status withJobACLs(Object jobACLs) { + this.jobACLs = jobACLs; + return this; + } + + /** + * Get whether or not the job has completed. + * + * @return the jobComplete value + */ + public Boolean jobComplete() { + return this.jobComplete; + } + + /** + * Set whether or not the job has completed. + * + * @param jobComplete the jobComplete value to set + * @return the Status object itself. + */ + public Status withJobComplete(Boolean jobComplete) { + this.jobComplete = jobComplete; + return this; + } + + /** + * Get the job configuration file. + * + * @return the jobFile value + */ + public String jobFile() { + return this.jobFile; + } + + /** + * Set the job configuration file. + * + * @param jobFile the jobFile value to set + * @return the Status object itself. + */ + public Status withJobFile(String jobFile) { + this.jobFile = jobFile; + return this; + } + + /** + * Get the full ID of the job. + * + * @return the jobId value + */ + public String jobId() { + return this.jobId; + } + + /** + * Set the full ID of the job. + * + * @param jobId the jobId value to set + * @return the Status object itself. + */ + public Status withJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * Get the ID of the job. + * + * @return the jobID value + */ + public JobID jobID() { + return this.jobID; + } + + /** + * Set the ID of the job. + * + * @param jobID the jobID value to set + * @return the Status object itself. + */ + public Status withJobID(JobID jobID) { + this.jobID = jobID; + return this; + } + + /** + * Get the user-specified job name. + * + * @return the jobName value + */ + public String jobName() { + return this.jobName; + } + + /** + * Set the user-specified job name. + * + * @param jobName the jobName value to set + * @return the Status object itself. + */ + public Status withJobName(String jobName) { + this.jobName = jobName; + return this; + } + + /** + * Get the priority of the job. + * + * @return the jobPriority value + */ + public String jobPriority() { + return this.jobPriority; + } + + /** + * Set the priority of the job. + * + * @param jobPriority the jobPriority value to set + * @return the Status object itself. + */ + public Status withJobPriority(String jobPriority) { + this.jobPriority = jobPriority; + return this; + } + + /** + * Get the progress made on the maps. + * + * @return the mapProgress value + */ + public Double mapProgress() { + return this.mapProgress; + } + + /** + * Set the progress made on the maps. + * + * @param mapProgress the mapProgress value to set + * @return the Status object itself. + */ + public Status withMapProgress(Double mapProgress) { + this.mapProgress = mapProgress; + return this; + } + + /** + * Get the amount of memory needed for the job. + * + * @return the neededMem value + */ + public Long neededMem() { + return this.neededMem; + } + + /** + * Set the amount of memory needed for the job. + * + * @param neededMem the neededMem value to set + * @return the Status object itself. + */ + public Status withNeededMem(Long neededMem) { + this.neededMem = neededMem; + return this; + } + + /** + * Get the number of slots reserved. + * + * @return the numReservedSlots value + */ + public Integer numReservedSlots() { + return this.numReservedSlots; + } + + /** + * Set the number of slots reserved. + * + * @param numReservedSlots the numReservedSlots value to set + * @return the Status object itself. + */ + public Status withNumReservedSlots(Integer numReservedSlots) { + this.numReservedSlots = numReservedSlots; + return this; + } + + /** + * Get the number of slots used for the job. + * + * @return the numUsedSlots value + */ + public Integer numUsedSlots() { + return this.numUsedSlots; + } + + /** + * Set the number of slots used for the job. + * + * @param numUsedSlots the numUsedSlots value to set + * @return the Status object itself. + */ + public Status withNumUsedSlots(Integer numUsedSlots) { + this.numUsedSlots = numUsedSlots; + return this; + } + + /** + * Get the priority of the job. + * + * @return the priority value + */ + public String priority() { + return this.priority; + } + + /** + * Set the priority of the job. + * + * @param priority the priority value to set + * @return the Status object itself. + */ + public Status withPriority(String priority) { + this.priority = priority; + return this; + } + + /** + * Get the job queue name. + * + * @return the queue value + */ + public String queue() { + return this.queue; + } + + /** + * Set the job queue name. + * + * @param queue the queue value to set + * @return the Status object itself. + */ + public Status withQueue(String queue) { + this.queue = queue; + return this; + } + + /** + * Get the progress made on the reduces. + * + * @return the reduceProgress value + */ + public Double reduceProgress() { + return this.reduceProgress; + } + + /** + * Set the progress made on the reduces. + * + * @param reduceProgress the reduceProgress value to set + * @return the Status object itself. + */ + public Status withReduceProgress(Double reduceProgress) { + this.reduceProgress = reduceProgress; + return this; + } + + /** + * Get the amount of memory reserved for the job. + * + * @return the reservedMem value + */ + public Long reservedMem() { + return this.reservedMem; + } + + /** + * Set the amount of memory reserved for the job. + * + * @param reservedMem the reservedMem value to set + * @return the Status object itself. + */ + public Status withReservedMem(Long reservedMem) { + this.reservedMem = reservedMem; + return this; + } + + /** + * Get whether or not the job has been retired. + * + * @return the retired value + */ + public Boolean retired() { + return this.retired; + } + + /** + * Set whether or not the job has been retired. + * + * @param retired the retired value to set + * @return the Status object itself. + */ + public Status withRetired(Boolean retired) { + this.retired = retired; + return this; + } + + /** + * Get the current state of the job. + * + * @return the runState value + */ + public Integer runState() { + return this.runState; + } + + /** + * Set the current state of the job. + * + * @param runState the runState value to set + * @return the Status object itself. + */ + public Status withRunState(Integer runState) { + this.runState = runState; + return this; + } + + /** + * Get the information about the scheduling of the job. + * + * @return the schedulingInfo value + */ + public String schedulingInfo() { + return this.schedulingInfo; + } + + /** + * Set the information about the scheduling of the job. + * + * @param schedulingInfo the schedulingInfo value to set + * @return the Status object itself. + */ + public Status withSchedulingInfo(String schedulingInfo) { + this.schedulingInfo = schedulingInfo; + return this; + } + + /** + * Get the progress made on the setup. + * + * @return the setupProgress value + */ + public Double setupProgress() { + return this.setupProgress; + } + + /** + * Set the progress made on the setup. + * + * @param setupProgress the setupProgress value to set + * @return the Status object itself. + */ + public Status withSetupProgress(Double setupProgress) { + this.setupProgress = setupProgress; + return this; + } + + /** + * Get the time at which the job started. It is an integer in milliseconds, as a Unix timestamp relative to 1/1/1970 00:00:00. + * + * @return the startTime value + */ + public Long startTime() { + return this.startTime; + } + + /** + * Set the time at which the job started. It is an integer in milliseconds, as a Unix timestamp relative to 1/1/1970 00:00:00. + * + * @param startTime the startTime value to set + * @return the Status object itself. + */ + public Status withStartTime(Long startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the state of the job. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state of the job. + * + * @param state the state value to set + * @return the Status object itself. + */ + public Status withState(String state) { + this.state = state; + return this; + } + + /** + * Get the link to the web-ui for details of the job. + * + * @return the trackingUrl value + */ + public String trackingUrl() { + return this.trackingUrl; + } + + /** + * Set the link to the web-ui for details of the job. + * + * @param trackingUrl the trackingUrl value to set + * @return the Status object itself. + */ + public Status withTrackingUrl(String trackingUrl) { + this.trackingUrl = trackingUrl; + return this; + } + + /** + * Get whether job running in uber mode. + * + * @return the uber value + */ + public Boolean uber() { + return this.uber; + } + + /** + * Set whether job running in uber mode. + * + * @param uber the uber value to set + * @return the Status object itself. + */ + public Status withUber(Boolean uber) { + this.uber = uber; + return this; + } + + /** + * Get the amount of memory used by the job. + * + * @return the usedMem value + */ + public Long usedMem() { + return this.usedMem; + } + + /** + * Set the amount of memory used by the job. + * + * @param usedMem the usedMem value to set + * @return the Status object itself. + */ + public Status withUsedMem(Long usedMem) { + this.usedMem = usedMem; + return this; + } + + /** + * Get the userid of the person who submitted the job. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the userid of the person who submitted the job. + * + * @param username the username value to set + * @return the Status object itself. + */ + public Status withUsername(String username) { + this.username = username; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/Userargs.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/Userargs.java new file mode 100644 index 000000000000..66aebdbf626d --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/Userargs.java @@ -0,0 +1,230 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.hdinsight.job.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gets or sets the object containing the user arguments. + */ +public class Userargs { + /** + * The list of args defined by the user. + */ + @JsonProperty(value = "arg", access = JsonProperty.Access.WRITE_ONLY) + private List arg; + + /** + * The callback URL, if any. + */ + @JsonProperty(value = "callback") + private Object callback; + + /** + * The define properties defined by the user. + */ + @JsonProperty(value = "define", access = JsonProperty.Access.WRITE_ONLY) + private List define; + + /** + * Whether or not the user enabled logs. + */ + @JsonProperty(value = "enablelog") + private String enablelog; + + /** + * The query defined by the user. + */ + @JsonProperty(value = "execute") + private String execute; + + /** + * The query file provided by the user. + */ + @JsonProperty(value = "file") + private Object file; + + /** + * The files defined by the user. + */ + @JsonProperty(value = "files") + private Object files; + + /** + * The JAR file provided by the user. + */ + @JsonProperty(value = "jar") + private String jar; + + /** + * The status directory defined by the user. + */ + @JsonProperty(value = "statusdir") + private Object statusdir; + + /** + * Get the list of args defined by the user. + * + * @return the arg value + */ + public List arg() { + return this.arg; + } + + /** + * Get the callback URL, if any. + * + * @return the callback value + */ + public Object callback() { + return this.callback; + } + + /** + * Set the callback URL, if any. + * + * @param callback the callback value to set + * @return the Userargs object itself. + */ + public Userargs withCallback(Object callback) { + this.callback = callback; + return this; + } + + /** + * Get the define properties defined by the user. + * + * @return the define value + */ + public List define() { + return this.define; + } + + /** + * Get whether or not the user enabled logs. + * + * @return the enablelog value + */ + public String enablelog() { + return this.enablelog; + } + + /** + * Set whether or not the user enabled logs. + * + * @param enablelog the enablelog value to set + * @return the Userargs object itself. + */ + public Userargs withEnablelog(String enablelog) { + this.enablelog = enablelog; + return this; + } + + /** + * Get the query defined by the user. + * + * @return the execute value + */ + public String execute() { + return this.execute; + } + + /** + * Set the query defined by the user. + * + * @param execute the execute value to set + * @return the Userargs object itself. + */ + public Userargs withExecute(String execute) { + this.execute = execute; + return this; + } + + /** + * Get the query file provided by the user. + * + * @return the file value + */ + public Object file() { + return this.file; + } + + /** + * Set the query file provided by the user. + * + * @param file the file value to set + * @return the Userargs object itself. + */ + public Userargs withFile(Object file) { + this.file = file; + return this; + } + + /** + * Get the files defined by the user. + * + * @return the files value + */ + public Object files() { + return this.files; + } + + /** + * Set the files defined by the user. + * + * @param files the files value to set + * @return the Userargs object itself. + */ + public Userargs withFiles(Object files) { + this.files = files; + return this; + } + + /** + * Get the JAR file provided by the user. + * + * @return the jar value + */ + public String jar() { + return this.jar; + } + + /** + * Set the JAR file provided by the user. + * + * @param jar the jar value to set + * @return the Userargs object itself. + */ + public Userargs withJar(String jar) { + this.jar = jar; + return this; + } + + /** + * Get the status directory defined by the user. + * + * @return the statusdir value + */ + public Object statusdir() { + return this.statusdir; + } + + /** + * Set the status directory defined by the user. + * + * @param statusdir the statusdir value to set + * @return the Userargs object itself. + */ + public Userargs withStatusdir(Object statusdir) { + this.statusdir = statusdir; + return this; + } + +} diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/package-info.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/package-info.java new file mode 100644 index 000000000000..4e6ae1ad9255 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/models/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the models classes for HDInsightJobClient. + * The HDInsight Job Client. + */ +package com.microsoft.azure.hdinsight.job.models; diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/package-info.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/package-info.java new file mode 100644 index 000000000000..225da6fda309 --- /dev/null +++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for HDInsightJobClient. + * The HDInsight Job Client. + */ +package com.microsoft.azure.hdinsight.job;