Search in sources :

Example 46 with DateTimeRfc1123

use of com.microsoft.rest.DateTimeRfc1123 in project azure-sdk-for-java by Azure.

the class JobsImpl method patch.

/**
     * Updates the properties of a job.
     *
     * @param jobId The id of the job whose properties you want to update.
     * @param jobPatchParameter The parameters for the request.
     * @param jobPatchOptions Additional parameters for the operation
     * @throws BatchErrorException exception thrown from REST call
     * @throws IOException exception thrown from serialization/deserialization
     * @throws IllegalArgumentException exception thrown from invalid parameters
     * @return the {@link ServiceResponseWithHeaders} object if successful.
     */
public ServiceResponseWithHeaders<Void, JobPatchHeaders> patch(String jobId, JobPatchParameter jobPatchParameter, JobPatchOptions jobPatchOptions) throws BatchErrorException, IOException, IllegalArgumentException {
    if (jobId == null) {
        throw new IllegalArgumentException("Parameter jobId is required and cannot be null.");
    }
    if (jobPatchParameter == null) {
        throw new IllegalArgumentException("Parameter jobPatchParameter is required and cannot be null.");
    }
    if (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    Validator.validate(jobPatchParameter);
    Validator.validate(jobPatchOptions);
    Integer timeout = null;
    if (jobPatchOptions != null) {
        timeout = jobPatchOptions.timeout();
    }
    String clientRequestId = null;
    if (jobPatchOptions != null) {
        clientRequestId = jobPatchOptions.clientRequestId();
    }
    Boolean returnClientRequestId = null;
    if (jobPatchOptions != null) {
        returnClientRequestId = jobPatchOptions.returnClientRequestId();
    }
    DateTime ocpDate = null;
    if (jobPatchOptions != null) {
        ocpDate = jobPatchOptions.ocpDate();
    }
    String ifMatch = null;
    if (jobPatchOptions != null) {
        ifMatch = jobPatchOptions.ifMatch();
    }
    String ifNoneMatch = null;
    if (jobPatchOptions != null) {
        ifNoneMatch = jobPatchOptions.ifNoneMatch();
    }
    DateTime ifModifiedSince = null;
    if (jobPatchOptions != null) {
        ifModifiedSince = jobPatchOptions.ifModifiedSince();
    }
    DateTime ifUnmodifiedSince = null;
    if (jobPatchOptions != null) {
        ifUnmodifiedSince = jobPatchOptions.ifUnmodifiedSince();
    }
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    DateTimeRfc1123 ifModifiedSinceConverted = null;
    if (ifModifiedSince != null) {
        ifModifiedSinceConverted = new DateTimeRfc1123(ifModifiedSince);
    }
    DateTimeRfc1123 ifUnmodifiedSinceConverted = null;
    if (ifUnmodifiedSince != null) {
        ifUnmodifiedSinceConverted = new DateTimeRfc1123(ifUnmodifiedSince);
    }
    Call<ResponseBody> call = service.patch(jobId, jobPatchParameter, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.userAgent());
    return patchDelegate(call.execute());
}
Also used : DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Example 47 with DateTimeRfc1123

use of com.microsoft.rest.DateTimeRfc1123 in project azure-sdk-for-java by Azure.

the class JobsImpl method listPreparationAndReleaseTaskStatusNext.

/**
     * Lists the execution status of the Job Preparation and Job Release task for the specified job across the compute nodes where the job has run.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @throws BatchErrorException exception thrown from REST call
     * @throws IOException exception thrown from serialization/deserialization
     * @throws IllegalArgumentException exception thrown from invalid parameters
     * @return the List&lt;JobPreparationAndReleaseTaskExecutionInformation&gt; object wrapped in {@link ServiceResponseWithHeaders} if successful.
     */
public ServiceResponseWithHeaders<PageImpl<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders> listPreparationAndReleaseTaskStatusNext(final String nextPageLink) throws BatchErrorException, IOException, IllegalArgumentException {
    if (nextPageLink == null) {
        throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
    }
    final JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions = null;
    String clientRequestId = null;
    Boolean returnClientRequestId = null;
    DateTime ocpDate = null;
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    Call<ResponseBody> call = service.listPreparationAndReleaseTaskStatusNext(nextPageLink, this.client.acceptLanguage(), clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    return listPreparationAndReleaseTaskStatusNextDelegate(call.execute());
}
Also used : DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) JobListPreparationAndReleaseTaskStatusNextOptions(com.microsoft.azure.batch.protocol.models.JobListPreparationAndReleaseTaskStatusNextOptions) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Example 48 with DateTimeRfc1123

use of com.microsoft.rest.DateTimeRfc1123 in project azure-sdk-for-java by Azure.

the class JobsImpl method enable.

/**
     * Enables the specified job, allowing new tasks to run.
     *
     * @param jobId The id of the job to enable.
     * @param jobEnableOptions Additional parameters for the operation
     * @throws BatchErrorException exception thrown from REST call
     * @throws IOException exception thrown from serialization/deserialization
     * @throws IllegalArgumentException exception thrown from invalid parameters
     * @return the {@link ServiceResponseWithHeaders} object if successful.
     */
public ServiceResponseWithHeaders<Void, JobEnableHeaders> enable(String jobId, JobEnableOptions jobEnableOptions) throws BatchErrorException, IOException, IllegalArgumentException {
    if (jobId == null) {
        throw new IllegalArgumentException("Parameter jobId is required and cannot be null.");
    }
    if (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    Validator.validate(jobEnableOptions);
    Integer timeout = null;
    if (jobEnableOptions != null) {
        timeout = jobEnableOptions.timeout();
    }
    String clientRequestId = null;
    if (jobEnableOptions != null) {
        clientRequestId = jobEnableOptions.clientRequestId();
    }
    Boolean returnClientRequestId = null;
    if (jobEnableOptions != null) {
        returnClientRequestId = jobEnableOptions.returnClientRequestId();
    }
    DateTime ocpDate = null;
    if (jobEnableOptions != null) {
        ocpDate = jobEnableOptions.ocpDate();
    }
    String ifMatch = null;
    if (jobEnableOptions != null) {
        ifMatch = jobEnableOptions.ifMatch();
    }
    String ifNoneMatch = null;
    if (jobEnableOptions != null) {
        ifNoneMatch = jobEnableOptions.ifNoneMatch();
    }
    DateTime ifModifiedSince = null;
    if (jobEnableOptions != null) {
        ifModifiedSince = jobEnableOptions.ifModifiedSince();
    }
    DateTime ifUnmodifiedSince = null;
    if (jobEnableOptions != null) {
        ifUnmodifiedSince = jobEnableOptions.ifUnmodifiedSince();
    }
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    DateTimeRfc1123 ifModifiedSinceConverted = null;
    if (ifModifiedSince != null) {
        ifModifiedSinceConverted = new DateTimeRfc1123(ifModifiedSince);
    }
    DateTimeRfc1123 ifUnmodifiedSinceConverted = null;
    if (ifUnmodifiedSince != null) {
        ifUnmodifiedSinceConverted = new DateTimeRfc1123(ifUnmodifiedSince);
    }
    Call<ResponseBody> call = service.enable(jobId, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.userAgent());
    return enableDelegate(call.execute());
}
Also used : DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Example 49 with DateTimeRfc1123

use of com.microsoft.rest.DateTimeRfc1123 in project azure-sdk-for-java by Azure.

the class JobsImpl method delete.

/**
     * Deletes a job.
     *
     * @param jobId The id of the job to delete.
     * @param jobDeleteOptions Additional parameters for the operation
     * @throws BatchErrorException exception thrown from REST call
     * @throws IOException exception thrown from serialization/deserialization
     * @throws IllegalArgumentException exception thrown from invalid parameters
     * @return the {@link ServiceResponseWithHeaders} object if successful.
     */
public ServiceResponseWithHeaders<Void, JobDeleteHeaders> delete(String jobId, JobDeleteOptions jobDeleteOptions) throws BatchErrorException, IOException, IllegalArgumentException {
    if (jobId == null) {
        throw new IllegalArgumentException("Parameter jobId is required and cannot be null.");
    }
    if (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    Validator.validate(jobDeleteOptions);
    Integer timeout = null;
    if (jobDeleteOptions != null) {
        timeout = jobDeleteOptions.timeout();
    }
    String clientRequestId = null;
    if (jobDeleteOptions != null) {
        clientRequestId = jobDeleteOptions.clientRequestId();
    }
    Boolean returnClientRequestId = null;
    if (jobDeleteOptions != null) {
        returnClientRequestId = jobDeleteOptions.returnClientRequestId();
    }
    DateTime ocpDate = null;
    if (jobDeleteOptions != null) {
        ocpDate = jobDeleteOptions.ocpDate();
    }
    String ifMatch = null;
    if (jobDeleteOptions != null) {
        ifMatch = jobDeleteOptions.ifMatch();
    }
    String ifNoneMatch = null;
    if (jobDeleteOptions != null) {
        ifNoneMatch = jobDeleteOptions.ifNoneMatch();
    }
    DateTime ifModifiedSince = null;
    if (jobDeleteOptions != null) {
        ifModifiedSince = jobDeleteOptions.ifModifiedSince();
    }
    DateTime ifUnmodifiedSince = null;
    if (jobDeleteOptions != null) {
        ifUnmodifiedSince = jobDeleteOptions.ifUnmodifiedSince();
    }
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    DateTimeRfc1123 ifModifiedSinceConverted = null;
    if (ifModifiedSince != null) {
        ifModifiedSinceConverted = new DateTimeRfc1123(ifModifiedSince);
    }
    DateTimeRfc1123 ifUnmodifiedSinceConverted = null;
    if (ifUnmodifiedSince != null) {
        ifUnmodifiedSinceConverted = new DateTimeRfc1123(ifUnmodifiedSince);
    }
    Call<ResponseBody> call = service.delete(jobId, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.userAgent());
    return deleteDelegate(call.execute());
}
Also used : DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Example 50 with DateTimeRfc1123

use of com.microsoft.rest.DateTimeRfc1123 in project azure-sdk-for-java by Azure.

the class JobsImpl method add.

/**
     * Adds a job to the specified account.
     *
     * @param job The job to be added.
     * @throws BatchErrorException exception thrown from REST call
     * @throws IOException exception thrown from serialization/deserialization
     * @throws IllegalArgumentException exception thrown from invalid parameters
     * @return the {@link ServiceResponseWithHeaders} object if successful.
     */
public ServiceResponseWithHeaders<Void, JobAddHeaders> add(JobAddParameter job) throws BatchErrorException, IOException, IllegalArgumentException {
    if (job == null) {
        throw new IllegalArgumentException("Parameter job is required and cannot be null.");
    }
    if (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    Validator.validate(job);
    final JobAddOptions jobAddOptions = null;
    Integer timeout = null;
    String clientRequestId = null;
    Boolean returnClientRequestId = null;
    DateTime ocpDate = null;
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    Call<ResponseBody> call = service.add(job, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    return addDelegate(call.execute());
}
Also used : JobAddOptions(com.microsoft.azure.batch.protocol.models.JobAddOptions) DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Aggregations

DateTimeRfc1123 (com.microsoft.rest.DateTimeRfc1123)349 DateTime (org.joda.time.DateTime)349 ResponseBody (okhttp3.ResponseBody)332 ServiceCall (com.microsoft.rest.ServiceCall)148 PagedList (com.microsoft.azure.PagedList)78 ServiceResponseWithHeaders (com.microsoft.rest.ServiceResponseWithHeaders)78 List (java.util.List)52 PageImpl (com.microsoft.azure.batch.protocol.models.PageImpl)26 CloudJob (com.microsoft.azure.batch.protocol.models.CloudJob)14 NodeFile (com.microsoft.azure.batch.protocol.models.NodeFile)12 ApplicationSummary (com.microsoft.azure.batch.protocol.models.ApplicationSummary)8 Certificate (com.microsoft.azure.batch.protocol.models.Certificate)8 CloudJobSchedule (com.microsoft.azure.batch.protocol.models.CloudJobSchedule)8 CloudPool (com.microsoft.azure.batch.protocol.models.CloudPool)8 CloudTask (com.microsoft.azure.batch.protocol.models.CloudTask)8 ComputeNode (com.microsoft.azure.batch.protocol.models.ComputeNode)8 PoolUsageMetrics (com.microsoft.azure.batch.protocol.models.PoolUsageMetrics)6 InputStream (java.io.InputStream)6 JobPreparationAndReleaseTaskExecutionInformation (com.microsoft.azure.batch.protocol.models.JobPreparationAndReleaseTaskExecutionInformation)5 ApplicationListNextOptions (com.microsoft.azure.batch.protocol.models.ApplicationListNextOptions)4