Search in sources :

Example 11 with DateTimeRfc1123

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

the class ComputeNodesImpl method reimage.

/**
     * Reinstalls the operating system 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 that you want to restart.
     * @param nodeReimageOption When to reimage the compute node and what to do with currently running tasks. The default value is requeue. Possible values include: 'requeue', 'terminate', 'taskcompletion', 'retaineddata'
     * @param computeNodeReimageOptions 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, ComputeNodeReimageHeaders> reimage(String poolId, String nodeId, ComputeNodeReimageOption nodeReimageOption, ComputeNodeReimageOptions computeNodeReimageOptions) 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 (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    Validator.validate(computeNodeReimageOptions);
    Integer timeout = null;
    if (computeNodeReimageOptions != null) {
        timeout = computeNodeReimageOptions.timeout();
    }
    String clientRequestId = null;
    if (computeNodeReimageOptions != null) {
        clientRequestId = computeNodeReimageOptions.clientRequestId();
    }
    Boolean returnClientRequestId = null;
    if (computeNodeReimageOptions != null) {
        returnClientRequestId = computeNodeReimageOptions.returnClientRequestId();
    }
    DateTime ocpDate = null;
    if (computeNodeReimageOptions != null) {
        ocpDate = computeNodeReimageOptions.ocpDate();
    }
    NodeReimageParameter nodeReimageParameter = null;
    if (nodeReimageOption != null) {
        nodeReimageParameter = new NodeReimageParameter();
        nodeReimageParameter.withNodeReimageOption(nodeReimageOption);
    }
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    Call<ResponseBody> call = service.reimage(poolId, nodeId, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, nodeReimageParameter, this.client.userAgent());
    return reimageDelegate(call.execute());
}
Also used : DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) NodeReimageParameter(com.microsoft.azure.batch.protocol.models.NodeReimageParameter) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Example 12 with DateTimeRfc1123

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

the class CertificatesImpl method cancelDeletion.

/**
     * Cancels a failed deletion of a certificate from the specified account.
     *
     * @param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter. This must be sha1.
     * @param thumbprint The thumbprint of the certificate being deleted.
     * @param certificateCancelDeletionOptions 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, CertificateCancelDeletionHeaders> cancelDeletion(String thumbprintAlgorithm, String thumbprint, CertificateCancelDeletionOptions certificateCancelDeletionOptions) throws BatchErrorException, IOException, IllegalArgumentException {
    if (thumbprintAlgorithm == null) {
        throw new IllegalArgumentException("Parameter thumbprintAlgorithm is required and cannot be null.");
    }
    if (thumbprint == null) {
        throw new IllegalArgumentException("Parameter thumbprint 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(certificateCancelDeletionOptions);
    Integer timeout = null;
    if (certificateCancelDeletionOptions != null) {
        timeout = certificateCancelDeletionOptions.timeout();
    }
    String clientRequestId = null;
    if (certificateCancelDeletionOptions != null) {
        clientRequestId = certificateCancelDeletionOptions.clientRequestId();
    }
    Boolean returnClientRequestId = null;
    if (certificateCancelDeletionOptions != null) {
        returnClientRequestId = certificateCancelDeletionOptions.returnClientRequestId();
    }
    DateTime ocpDate = null;
    if (certificateCancelDeletionOptions != null) {
        ocpDate = certificateCancelDeletionOptions.ocpDate();
    }
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    Call<ResponseBody> call = service.cancelDeletion(thumbprintAlgorithm, thumbprint, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    return cancelDeletionDelegate(call.execute());
}
Also used : DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Example 13 with DateTimeRfc1123

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

the class CertificatesImpl method listNext.

/**
     * Lists all of the certificates that have been added to the specified account.
     *
     * @param nextPageLink The NextLink from the previous successful call to List operation.
     * @param certificateListNextOptions 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;Certificate&gt; object wrapped in {@link ServiceResponseWithHeaders} if successful.
     */
public ServiceResponseWithHeaders<PageImpl<Certificate>, CertificateListHeaders> listNext(final String nextPageLink, final CertificateListNextOptions certificateListNextOptions) throws BatchErrorException, IOException, IllegalArgumentException {
    if (nextPageLink == null) {
        throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
    }
    Validator.validate(certificateListNextOptions);
    String clientRequestId = null;
    if (certificateListNextOptions != null) {
        clientRequestId = certificateListNextOptions.clientRequestId();
    }
    Boolean returnClientRequestId = null;
    if (certificateListNextOptions != null) {
        returnClientRequestId = certificateListNextOptions.returnClientRequestId();
    }
    DateTime ocpDate = null;
    if (certificateListNextOptions != null) {
        ocpDate = certificateListNextOptions.ocpDate();
    }
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    Call<ResponseBody> call = service.listNext(nextPageLink, this.client.acceptLanguage(), clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    return listNextDelegate(call.execute());
}
Also used : DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Example 14 with DateTimeRfc1123

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

the class ComputeNodesImpl method get.

/**
     * Gets information about the specified compute node.
     *
     * @param poolId The id of the pool that contains the compute node.
     * @param nodeId The id of the compute node that you want to get information about.
     * @param computeNodeGetOptions 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 ComputeNode object wrapped in {@link ServiceResponseWithHeaders} if successful.
     */
public ServiceResponseWithHeaders<ComputeNode, ComputeNodeGetHeaders> get(String poolId, String nodeId, ComputeNodeGetOptions computeNodeGetOptions) 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 (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    Validator.validate(computeNodeGetOptions);
    String select = null;
    if (computeNodeGetOptions != null) {
        select = computeNodeGetOptions.select();
    }
    Integer timeout = null;
    if (computeNodeGetOptions != null) {
        timeout = computeNodeGetOptions.timeout();
    }
    String clientRequestId = null;
    if (computeNodeGetOptions != null) {
        clientRequestId = computeNodeGetOptions.clientRequestId();
    }
    Boolean returnClientRequestId = null;
    if (computeNodeGetOptions != null) {
        returnClientRequestId = computeNodeGetOptions.returnClientRequestId();
    }
    DateTime ocpDate = null;
    if (computeNodeGetOptions != null) {
        ocpDate = computeNodeGetOptions.ocpDate();
    }
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    Call<ResponseBody> call = service.get(poolId, nodeId, this.client.apiVersion(), this.client.acceptLanguage(), select, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
    return getDelegate(call.execute());
}
Also used : DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) DateTime(org.joda.time.DateTime) ResponseBody(okhttp3.ResponseBody)

Example 15 with DateTimeRfc1123

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

the class ComputeNodesImpl method reboot.

/**
     * Restarts the specified compute node.
     *
     * @param poolId The id of the pool that contains the compute node.
     * @param nodeId The id of the compute node that you want to restart.
     * @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, ComputeNodeRebootHeaders> reboot(String poolId, String nodeId) 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 (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    final ComputeNodeRebootOption nodeRebootOption = null;
    final ComputeNodeRebootOptions computeNodeRebootOptions = null;
    Integer timeout = null;
    String clientRequestId = null;
    Boolean returnClientRequestId = null;
    DateTime ocpDate = null;
    NodeRebootParameter nodeRebootParameter = new NodeRebootParameter();
    nodeRebootParameter.withNodeRebootOption(null);
    DateTimeRfc1123 ocpDateConverted = null;
    if (ocpDate != null) {
        ocpDateConverted = new DateTimeRfc1123(ocpDate);
    }
    Call<ResponseBody> call = service.reboot(poolId, nodeId, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, nodeRebootParameter, this.client.userAgent());
    return rebootDelegate(call.execute());
}
Also used : DateTimeRfc1123(com.microsoft.rest.DateTimeRfc1123) ComputeNodeRebootOption(com.microsoft.azure.batch.protocol.models.ComputeNodeRebootOption) NodeRebootParameter(com.microsoft.azure.batch.protocol.models.NodeRebootParameter) ComputeNodeRebootOptions(com.microsoft.azure.batch.protocol.models.ComputeNodeRebootOptions) 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