Search in sources :

Example 26 with PagedList

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

the class JobsImpl method listPreparationAndReleaseTaskStatus.

/**
     * 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 jobId The id of the job.
     * @throws BatchErrorException exception thrown from REST call
     * @throws IOException exception thrown from serialization/deserialization
     * @throws IllegalArgumentException exception thrown from invalid parameters
     * @return the List<JobPreparationAndReleaseTaskExecutionInformation> object wrapped in {@link ServiceResponseWithHeaders} if successful.
     */
public ServiceResponseWithHeaders<PagedList<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders> listPreparationAndReleaseTaskStatus(final String jobId) 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.");
    }
    final JobListPreparationAndReleaseTaskStatusOptions jobListPreparationAndReleaseTaskStatusOptions = null;
    String filter = null;
    String select = null;
    Integer maxResults = 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.listPreparationAndReleaseTaskStatus(jobId, this.client.apiVersion(), this.client.acceptLanguage(), filter, select, maxResults, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    ServiceResponseWithHeaders<PageImpl<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders> response = listPreparationAndReleaseTaskStatusDelegate(call.execute());
    PagedList<JobPreparationAndReleaseTaskExecutionInformation> result = new PagedList<JobPreparationAndReleaseTaskExecutionInformation>(response.getBody()) {

        @Override
        public Page<JobPreparationAndReleaseTaskExecutionInformation> nextPage(String nextPageLink) throws BatchErrorException, IOException {
            return listPreparationAndReleaseTaskStatusNext(nextPageLink, null).getBody();
        }
    };
    return new ServiceResponseWithHeaders<>(result, response.getHeaders(), response.getResponse());
}
Also used : PageImpl(com.microsoft.azure.batch.protocol.models.PageImpl) PagedList(com.microsoft.azure.PagedList) JobListPreparationAndReleaseTaskStatusHeaders(com.microsoft.azure.batch.protocol.models.JobListPreparationAndReleaseTaskStatusHeaders) DateTime(org.joda.time.DateTime) ServiceResponseWithHeaders(com.microsoft.rest.ServiceResponseWithHeaders) ResponseBody(okhttp3.ResponseBody) JobListPreparationAndReleaseTaskStatusOptions(com.microsoft.azure.batch.protocol.models.JobListPreparationAndReleaseTaskStatusOptions) DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) JobPreparationAndReleaseTaskExecutionInformation(com.microsoft.azure.batch.protocol.models.JobPreparationAndReleaseTaskExecutionInformation)

Example 27 with PagedList

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

the class JobsImpl method list.

/**
     * Lists all of the jobs in the specified account.
     *
     * @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;CloudJob&gt; object wrapped in {@link ServiceResponseWithHeaders} if successful.
     */
public ServiceResponseWithHeaders<PagedList<CloudJob>, JobListHeaders> list() throws BatchErrorException, IOException, IllegalArgumentException {
    if (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    final JobListOptions jobListOptions = null;
    String filter = null;
    String select = null;
    String expand = null;
    Integer maxResults = 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.list(this.client.apiVersion(), this.client.acceptLanguage(), filter, select, expand, maxResults, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    ServiceResponseWithHeaders<PageImpl<CloudJob>, JobListHeaders> response = listDelegate(call.execute());
    PagedList<CloudJob> result = new PagedList<CloudJob>(response.getBody()) {

        @Override
        public Page<CloudJob> nextPage(String nextPageLink) throws BatchErrorException, IOException {
            return listNext(nextPageLink, null).getBody();
        }
    };
    return new ServiceResponseWithHeaders<>(result, response.getHeaders(), response.getResponse());
}
Also used : PageImpl(com.microsoft.azure.batch.protocol.models.PageImpl) PagedList(com.microsoft.azure.PagedList) DateTime(org.joda.time.DateTime) ServiceResponseWithHeaders(com.microsoft.rest.ServiceResponseWithHeaders) ResponseBody(okhttp3.ResponseBody) CloudJob(com.microsoft.azure.batch.protocol.models.CloudJob) JobListHeaders(com.microsoft.azure.batch.protocol.models.JobListHeaders) JobListOptions(com.microsoft.azure.batch.protocol.models.JobListOptions) DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123)

Example 28 with PagedList

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

the class JobsImpl method listPreparationAndReleaseTaskStatus.

/**
     * 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 jobId The id of the job.
     * @param jobListPreparationAndReleaseTaskStatusOptions 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 List&lt;JobPreparationAndReleaseTaskExecutionInformation&gt; object wrapped in {@link ServiceResponseWithHeaders} if successful.
     */
public ServiceResponseWithHeaders<PagedList<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders> listPreparationAndReleaseTaskStatus(final String jobId, final JobListPreparationAndReleaseTaskStatusOptions jobListPreparationAndReleaseTaskStatusOptions) 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(jobListPreparationAndReleaseTaskStatusOptions);
    String filter = null;
    if (jobListPreparationAndReleaseTaskStatusOptions != null) {
        filter = jobListPreparationAndReleaseTaskStatusOptions.filter();
    }
    String select = null;
    if (jobListPreparationAndReleaseTaskStatusOptions != null) {
        select = jobListPreparationAndReleaseTaskStatusOptions.select();
    }
    Integer maxResults = null;
    if (jobListPreparationAndReleaseTaskStatusOptions != null) {
        maxResults = jobListPreparationAndReleaseTaskStatusOptions.maxResults();
    }
    Integer timeout = null;
    if (jobListPreparationAndReleaseTaskStatusOptions != null) {
        timeout = jobListPreparationAndReleaseTaskStatusOptions.timeout();
    }
    String clientRequestId = null;
    if (jobListPreparationAndReleaseTaskStatusOptions != null) {
        clientRequestId = jobListPreparationAndReleaseTaskStatusOptions.clientRequestId();
    }
    Boolean returnClientRequestId = null;
    if (jobListPreparationAndReleaseTaskStatusOptions != null) {
        returnClientRequestId = jobListPreparationAndReleaseTaskStatusOptions.returnClientRequestId();
    }
    DateTime ocpDate = null;
    if (jobListPreparationAndReleaseTaskStatusOptions != null) {
        ocpDate = jobListPreparationAndReleaseTaskStatusOptions.ocpDate();
    }
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    Call<ResponseBody> call = service.listPreparationAndReleaseTaskStatus(jobId, this.client.apiVersion(), this.client.acceptLanguage(), filter, select, maxResults, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    ServiceResponseWithHeaders<PageImpl<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders> response = listPreparationAndReleaseTaskStatusDelegate(call.execute());
    PagedList<JobPreparationAndReleaseTaskExecutionInformation> result = new PagedList<JobPreparationAndReleaseTaskExecutionInformation>(response.getBody()) {

        @Override
        public Page<JobPreparationAndReleaseTaskExecutionInformation> nextPage(String nextPageLink) throws BatchErrorException, IOException {
            JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions = null;
            if (jobListPreparationAndReleaseTaskStatusOptions != null) {
                jobListPreparationAndReleaseTaskStatusNextOptions = new JobListPreparationAndReleaseTaskStatusNextOptions();
                jobListPreparationAndReleaseTaskStatusNextOptions.withClientRequestId(jobListPreparationAndReleaseTaskStatusOptions.clientRequestId());
                jobListPreparationAndReleaseTaskStatusNextOptions.withReturnClientRequestId(jobListPreparationAndReleaseTaskStatusOptions.returnClientRequestId());
                jobListPreparationAndReleaseTaskStatusNextOptions.withOcpDate(jobListPreparationAndReleaseTaskStatusOptions.ocpDate());
            }
            return listPreparationAndReleaseTaskStatusNext(nextPageLink, jobListPreparationAndReleaseTaskStatusNextOptions).getBody();
        }
    };
    return new ServiceResponseWithHeaders<>(result, response.getHeaders(), response.getResponse());
}
Also used : PageImpl(com.microsoft.azure.batch.protocol.models.PageImpl) PagedList(com.microsoft.azure.PagedList) JobListPreparationAndReleaseTaskStatusHeaders(com.microsoft.azure.batch.protocol.models.JobListPreparationAndReleaseTaskStatusHeaders) DateTime(org.joda.time.DateTime) ServiceResponseWithHeaders(com.microsoft.rest.ServiceResponseWithHeaders) ResponseBody(okhttp3.ResponseBody) DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) JobPreparationAndReleaseTaskExecutionInformation(com.microsoft.azure.batch.protocol.models.JobPreparationAndReleaseTaskExecutionInformation) JobListPreparationAndReleaseTaskStatusNextOptions(com.microsoft.azure.batch.protocol.models.JobListPreparationAndReleaseTaskStatusNextOptions)

Example 29 with PagedList

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

the class FileOperations method listFilesFromComputeNode.

/**
     * Enumerates files on the specified compute node.
     *
     * @param poolId The ID of the pool that contains the compute node.
     * @param nodeId The ID of the compute node.
     * @param recursive If true, recursively enumerates all files on the compute node. If false, enumerates only the files in the compute node root directory.
     * @param detailLevel A {@link DetailLevel} used for filtering the list and for controlling which properties are retrieved from the service.
     * @param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Batch service request.
     * @return A collection of {@link NodeFile}
     * @throws BatchErrorException Exception thrown from REST call
     * @throws IOException Exception thrown from serialization/deserialization
     */
public List<NodeFile> listFilesFromComputeNode(String poolId, String nodeId, Boolean recursive, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
    FileListFromComputeNodeOptions options = new FileListFromComputeNodeOptions();
    BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors);
    bhMgr.appendDetailLevelToPerCallBehaviors(detailLevel);
    bhMgr.applyRequestBehaviors(options);
    ServiceResponseWithHeaders<PagedList<NodeFile>, FileListFromComputeNodeHeaders> response = this._parentBatchClient.protocolLayer().files().listFromComputeNode(poolId, nodeId, recursive, options);
    return response.getBody();
}
Also used : PagedList(com.microsoft.azure.PagedList) FileListFromComputeNodeHeaders(com.microsoft.azure.batch.protocol.models.FileListFromComputeNodeHeaders) FileListFromComputeNodeOptions(com.microsoft.azure.batch.protocol.models.FileListFromComputeNodeOptions)

Example 30 with PagedList

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

the class CertificateOperations method listCertificates.

/**
     * Enumerates the {@link Certificate certificates} in the Batch account.
     *
     * @param detailLevel A {@link DetailLevel} used for filtering the list and for controlling which properties are retrieved from the service.
     * @param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Batch service request.
     * @return A collection of {@link Certificate certificates}
     * @throws BatchErrorException Exception thrown from REST call
     * @throws IOException Exception thrown from serialization/deserialization
     */
public List<Certificate> listCertificates(DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
    CertificateListOptions certificateListOptions = new CertificateListOptions();
    BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors);
    bhMgr.appendDetailLevelToPerCallBehaviors(detailLevel);
    bhMgr.applyRequestBehaviors(certificateListOptions);
    ServiceResponseWithHeaders<PagedList<Certificate>, CertificateListHeaders> response = this._parentBatchClient.protocolLayer().certificates().list(certificateListOptions);
    return response.getBody();
}
Also used : CertificateListOptions(com.microsoft.azure.batch.protocol.models.CertificateListOptions) PagedList(com.microsoft.azure.PagedList) CertificateListHeaders(com.microsoft.azure.batch.protocol.models.CertificateListHeaders)

Aggregations

PagedList (com.microsoft.azure.PagedList)36 PageImpl (com.microsoft.azure.batch.protocol.models.PageImpl)26 DateTimeRfc1123 (com.microsoft.rest.DateTimeRfc1123)26 ServiceResponseWithHeaders (com.microsoft.rest.ServiceResponseWithHeaders)26 ResponseBody (okhttp3.ResponseBody)26 DateTime (org.joda.time.DateTime)26 CloudJob (com.microsoft.azure.batch.protocol.models.CloudJob)4 NodeFile (com.microsoft.azure.batch.protocol.models.NodeFile)4 VirtualMachineSize (com.microsoft.azure.management.compute.VirtualMachineSize)4 AccountListNodeAgentSkusHeaders (com.microsoft.azure.batch.protocol.models.AccountListNodeAgentSkusHeaders)3 ApplicationListHeaders (com.microsoft.azure.batch.protocol.models.ApplicationListHeaders)3 CertificateListHeaders (com.microsoft.azure.batch.protocol.models.CertificateListHeaders)3 FileListFromComputeNodeHeaders (com.microsoft.azure.batch.protocol.models.FileListFromComputeNodeHeaders)3 FileListFromTaskHeaders (com.microsoft.azure.batch.protocol.models.FileListFromTaskHeaders)3 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)2 Task (com.intellij.openapi.progress.Task)2 AccountListNodeAgentSkusOptions (com.microsoft.azure.batch.protocol.models.AccountListNodeAgentSkusOptions)2 ApplicationListOptions (com.microsoft.azure.batch.protocol.models.ApplicationListOptions)2 ApplicationSummary (com.microsoft.azure.batch.protocol.models.ApplicationSummary)2 Certificate (com.microsoft.azure.batch.protocol.models.Certificate)2