Search in sources :

Example 31 with DateTimeRfc1123

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

the class FilesImpl method getNodeFilePropertiesFromComputeNodeAsync.

/**
     * Gets the properties of the specified compute node file.
     *
     * @param poolId The id of the pool that contains the compute node.
     * @param nodeId The id of the compute node that contains the file.
     * @param fileName The path to the compute node file that you want to get the properties of.
     * @param fileGetNodeFilePropertiesFromComputeNodeOptions Additional parameters for the operation
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if callback is null
     * @return the {@link Call} object
     */
public ServiceCall getNodeFilePropertiesFromComputeNodeAsync(String poolId, String nodeId, String fileName, FileGetNodeFilePropertiesFromComputeNodeOptions fileGetNodeFilePropertiesFromComputeNodeOptions, final ServiceCallback<Void> serviceCallback) throws IllegalArgumentException {
    if (serviceCallback == null) {
        throw new IllegalArgumentException("ServiceCallback is required for async calls.");
    }
    if (poolId == null) {
        serviceCallback.failure(new IllegalArgumentException("Parameter poolId is required and cannot be null."));
        return null;
    }
    if (nodeId == null) {
        serviceCallback.failure(new IllegalArgumentException("Parameter nodeId is required and cannot be null."));
        return null;
    }
    if (fileName == null) {
        serviceCallback.failure(new IllegalArgumentException("Parameter fileName is required and cannot be null."));
        return null;
    }
    if (this.client.apiVersion() == null) {
        serviceCallback.failure(new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."));
        return null;
    }
    Validator.validate(fileGetNodeFilePropertiesFromComputeNodeOptions, serviceCallback);
    Integer timeout = null;
    if (fileGetNodeFilePropertiesFromComputeNodeOptions != null) {
        timeout = fileGetNodeFilePropertiesFromComputeNodeOptions.timeout();
    }
    String clientRequestId = null;
    if (fileGetNodeFilePropertiesFromComputeNodeOptions != null) {
        clientRequestId = fileGetNodeFilePropertiesFromComputeNodeOptions.clientRequestId();
    }
    Boolean returnClientRequestId = null;
    if (fileGetNodeFilePropertiesFromComputeNodeOptions != null) {
        returnClientRequestId = fileGetNodeFilePropertiesFromComputeNodeOptions.returnClientRequestId();
    }
    DateTime ocpDate = null;
    if (fileGetNodeFilePropertiesFromComputeNodeOptions != null) {
        ocpDate = fileGetNodeFilePropertiesFromComputeNodeOptions.ocpDate();
    }
    DateTime ifModifiedSince = null;
    if (fileGetNodeFilePropertiesFromComputeNodeOptions != null) {
        ifModifiedSince = fileGetNodeFilePropertiesFromComputeNodeOptions.ifModifiedSince();
    }
    DateTime ifUnmodifiedSince = null;
    if (fileGetNodeFilePropertiesFromComputeNodeOptions != null) {
        ifUnmodifiedSince = fileGetNodeFilePropertiesFromComputeNodeOptions.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<Void> call = service.getNodeFilePropertiesFromComputeNode(poolId, nodeId, fileName, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.userAgent());
    final ServiceCall serviceCall = new ServiceCall(call);
    call.enqueue(new ServiceResponseEmptyCallback<Void>(serviceCallback) {

        @Override
        public void onResponse(Call<Void> call, Response<Void> response) {
            try {
                serviceCallback.success(getNodeFilePropertiesFromComputeNodeDelegate(response));
            } catch (BatchErrorException | IOException exception) {
                serviceCallback.failure(exception);
            }
        }
    });
    return serviceCall;
}
Also used : ServiceCall(com.microsoft.rest.ServiceCall) DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) DateTime(org.joda.time.DateTime)

Example 32 with DateTimeRfc1123

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

the class ComputeNodesImpl method deleteUser.

/**
     * Deletes a user account from the specified compute node.
     *
     * @param poolId The id of the pool that contains the compute node.
     * @param nodeId The id of the machine on which you want to delete a user account.
     * @param userName The name of the user account to delete.
     * @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, ComputeNodeDeleteUserHeaders> deleteUser(String poolId, String nodeId, String userName) throws BatchErrorException, IOException, IllegalArgumentException {
    if (poolId == null) {
        throw new IllegalArgumentException("Parameter poolId is required and cannot be null.");
    }
    if (nodeId == null) {
        throw new IllegalArgumentException("Parameter nodeId is required and cannot be null.");
    }
    if (userName == null) {
        throw new IllegalArgumentException("Parameter userName is required and cannot be null.");
    }
    if (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    final ComputeNodeDeleteUserOptions computeNodeDeleteUserOptions = 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.deleteUser(poolId, nodeId, userName, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    return deleteUserDelegate(call.execute());
}
Also used : ComputeNodeDeleteUserOptions(com.microsoft.azure.batch.protocol.models.ComputeNodeDeleteUserOptions) DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Example 33 with DateTimeRfc1123

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

the class FilesImpl method listFromComputeNodeNext.

/**
     * Lists all of the files in task directories on the specified compute node.
     *
     * @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;NodeFile&gt; object wrapped in {@link ServiceResponseWithHeaders} if successful.
     */
public ServiceResponseWithHeaders<PageImpl<NodeFile>, FileListFromComputeNodeHeaders> listFromComputeNodeNext(final String nextPageLink) throws BatchErrorException, IOException, IllegalArgumentException {
    if (nextPageLink == null) {
        throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
    }
    final FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions = null;
    String clientRequestId = null;
    Boolean returnClientRequestId = null;
    DateTime ocpDate = null;
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    Call<ResponseBody> call = service.listFromComputeNodeNext(nextPageLink, this.client.acceptLanguage(), clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    return listFromComputeNodeNextDelegate(call.execute());
}
Also used : FileListFromComputeNodeNextOptions(com.microsoft.azure.batch.protocol.models.FileListFromComputeNodeNextOptions) DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Example 34 with DateTimeRfc1123

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

the class JobsImpl method getAllJobsLifetimeStatisticsAsync.

/**
     * Gets lifetime summary statistics for all of the jobs in the specified account.
     * Statistics are aggregated across all jobs that have ever existed in the account, from account creation to the last update time of the statistics.
     *
     * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
     * @throws IllegalArgumentException thrown if callback is null
     * @return the {@link Call} object
     */
public ServiceCall getAllJobsLifetimeStatisticsAsync(final ServiceCallback<JobStatistics> serviceCallback) throws IllegalArgumentException {
    if (serviceCallback == null) {
        throw new IllegalArgumentException("ServiceCallback is required for async calls.");
    }
    if (this.client.apiVersion() == null) {
        serviceCallback.failure(new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."));
        return null;
    }
    final JobGetAllJobsLifetimeStatisticsOptions jobGetAllJobsLifetimeStatisticsOptions = 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.getAllJobsLifetimeStatistics(this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    final ServiceCall serviceCall = new ServiceCall(call);
    call.enqueue(new ServiceResponseCallback<JobStatistics>(serviceCallback) {

        @Override
        public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
            try {
                serviceCallback.success(getAllJobsLifetimeStatisticsDelegate(response));
            } catch (BatchErrorException | IOException exception) {
                serviceCallback.failure(exception);
            }
        }
    });
    return serviceCall;
}
Also used : JobStatistics(com.microsoft.azure.batch.protocol.models.JobStatistics) ServiceCall(com.microsoft.rest.ServiceCall) JobGetAllJobsLifetimeStatisticsOptions(com.microsoft.azure.batch.protocol.models.JobGetAllJobsLifetimeStatisticsOptions) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody) DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123)

Example 35 with DateTimeRfc1123

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

the class PoolsImpl method add.

/**
     * Adds a pool to the specified account.
     *
     * @param pool The pool 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, PoolAddHeaders> add(PoolAddParameter pool) throws BatchErrorException, IOException, IllegalArgumentException {
    if (pool == null) {
        throw new IllegalArgumentException("Parameter pool 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(pool);
    final PoolAddOptions poolAddOptions = 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(pool, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    return addDelegate(call.execute());
}
Also used : DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) DateTime(org.joda.time.DateTime) PoolAddOptions(com.microsoft.azure.batch.protocol.models.PoolAddOptions) 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