CertificateOperations Class

  • java.lang.Object
    • com.microsoft.azure.batch.CertificateOperations

Implements

@Deprecated
public class CertificateOperations
implements IInheritedBehaviors

Performs certificate-related operations on an Azure Batch account. Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead.

Field Summary

Modifier and Type Field and Description
static final String SHA1_CERTIFICATE_ALGORITHM

The SHA certificate algorithm.

Method Summary

Modifier and Type Method and Description
void cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint)

Cancels a failed deletion of the specified certificate.

void cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint, Iterable<BatchClientBehavior> additionalBehaviors)

Cancels a failed deletion of the specified certificate.

void createCertificate(CertificateAddParameter certificate)

Adds a certificate to the Batch account.

void createCertificate(CertificateAddParameter certificate, Iterable<BatchClientBehavior> additionalBehaviors)

Adds a certificate to the Batch account.

void createCertificate(InputStream certStream)

Adds a certificate to the Batch account.

void createCertificate(InputStream certStream, Iterable<BatchClientBehavior> additionalBehaviors)

Adds a certificate to the Batch account.

Collection<BatchClientBehavior> customBehaviors()

Gets a collection of behaviors that modify or customize requests to the Batch service.

void deleteCertificate(String thumbprintAlgorithm, String thumbprint)

Deletes the certificate from the Batch account.

void deleteCertificate(String thumbprintAlgorithm, String thumbprint, Iterable<BatchClientBehavior> additionalBehaviors)

Deletes the certificate from the Batch account.

Certificate getCertificate(String thumbprintAlgorithm, String thumbprint)

Gets the specified Certificate.

Certificate getCertificate(String thumbprintAlgorithm, String thumbprint, DetailLevel detailLevel)

Gets the specified Certificate.

Certificate getCertificate(String thumbprintAlgorithm, String thumbprint, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)

Gets the specified Certificate.

com.microsoft.azure.PagedList<Certificate> listCertificates()

Lists the Certificate in the Batch account.

com.microsoft.azure.PagedList<Certificate> listCertificates(DetailLevel detailLevel)

Lists the Certificate in the Batch account.

com.microsoft.azure.PagedList<Certificate> listCertificates(DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)

Lists the Certificate in the Batch account.

IInheritedBehaviors withCustomBehaviors(Collection<BatchClientBehavior> behaviors)

Sets a collection of behaviors that modify or customize requests to the Batch service.

Methods inherited from java.lang.Object

Field Details

SHA1_CERTIFICATE_ALGORITHM

public static final String SHA1_CERTIFICATE_ALGORITHM

The SHA certificate algorithm.

Method Details

cancelDeleteCertificate

public void cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint)

Cancels a failed deletion of the specified certificate. This operation can be performed only when the certificate is in the DELETE_FAILED state, and restores the certificate to the ACTIVE state.

Parameters:

thumbprintAlgorithm - The algorithm used to derive the thumbprint parameter. This must be sha1.
thumbprint - The thumbprint of the certificate that failed to delete.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

cancelDeleteCertificate

public void cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint, Iterable additionalBehaviors)

Cancels a failed deletion of the specified certificate. This operation can be performed only when the certificate is in the DELETE_FAILED state, and restores the certificate to the ACTIVE state.

Parameters:

thumbprintAlgorithm - The algorithm used to derive the thumbprint parameter. This must be sha1.
thumbprint - The thumbprint of the certificate that failed to delete.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

createCertificate

public void createCertificate(CertificateAddParameter certificate)

Adds a certificate to the Batch account.

Parameters:

certificate - The certificate to be added.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

createCertificate

public void createCertificate(CertificateAddParameter certificate, Iterable additionalBehaviors)

Adds a certificate to the Batch account.

Parameters:

certificate - The certificate to be added.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

createCertificate

public void createCertificate(InputStream certStream)

Adds a certificate to the Batch account.

Parameters:

certStream - The certificate data in .cer format.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

CertificateException

- Exception thrown when an error response is received from the Batch service.

NoSuchAlgorithmException

- Exception thrown when an error response is received from the Batch service.

createCertificate

public void createCertificate(InputStream certStream, Iterable additionalBehaviors)

Adds a certificate to the Batch account.

Parameters:

certStream - The certificate data in .cer format.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

CertificateException

- Exception thrown when an error response is received from the Batch service.

NoSuchAlgorithmException

- Exception thrown when an error response is received from the Batch service.

customBehaviors

public Collection customBehaviors()

Gets a collection of behaviors that modify or customize requests to the Batch service.

Returns:

A collection of BatchClientBehavior instances.

deleteCertificate

public void deleteCertificate(String thumbprintAlgorithm, String thumbprint)

Deletes the certificate from the Batch account.

The delete operation requests that the certificate be deleted. The request puts the certificate in the DELETING state. The Batch service will perform the actual certificate deletion without any further client action.

You cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a certificate, you must therefore make sure that:

  • The certificate is not associated with any pools.
  • The certificate is not installed on any compute nodes. (Even if you remove a certificate from a pool, it is not removed from existing compute nodes in that pool until they restart.)

If you try to delete a certificate that is in use, the deletion fails. The certificate state changes to DELETE_FAILED. You can use cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint) to set the status back to Active if you decide that you want to continue using the certificate.

Parameters:

thumbprintAlgorithm - The algorithm used to derive the thumbprint parameter. This must be sha1.
thumbprint - The thumbprint of the certificate to delete.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

deleteCertificate

public void deleteCertificate(String thumbprintAlgorithm, String thumbprint, Iterable additionalBehaviors)

Deletes the certificate from the Batch account.

The delete operation requests that the certificate be deleted. The request puts the certificate in the DELETING state. The Batch service will perform the actual certificate deletion without any further client action.

You cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a certificate, you must therefore make sure that:

  • The certificate is not associated with any pools.
  • The certificate is not installed on any compute nodes. (Even if you remove a certificate from a pool, it is not removed from existing compute nodes in that pool until they restart.)

If you try to delete a certificate that is in use, the deletion fails. The certificate state changes to DELETE_FAILED. You can use cancelDeleteCertificate(String thumbprintAlgorithm, String thumbprint) to set the status back to Active if you decide that you want to continue using the certificate.

Parameters:

thumbprintAlgorithm - The algorithm used to derive the thumbprint parameter. This must be sha1.
thumbprint - The thumbprint of the certificate to delete.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

getCertificate

public Certificate getCertificate(String thumbprintAlgorithm, String thumbprint)

Gets the specified Certificate.

Parameters:

thumbprintAlgorithm - The algorithm used to derive the thumbprint parameter. This must be sha1.
thumbprint - The thumbprint of the certificate to get.

Returns:

A Certificate containing information about the specified certificate in the Azure Batch account.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

getCertificate

public Certificate getCertificate(String thumbprintAlgorithm, String thumbprint, DetailLevel detailLevel)

Gets the specified Certificate.

Parameters:

thumbprintAlgorithm - The algorithm used to derive the thumbprint parameter. This must be sha1.
thumbprint - The thumbprint of the certificate to get.
detailLevel - A DetailLevel used for controlling which properties are retrieved from the service.

Returns:

A Certificate containing information about the specified certificate in the Azure Batch account.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

getCertificate

public Certificate getCertificate(String thumbprintAlgorithm, String thumbprint, DetailLevel detailLevel, Iterable additionalBehaviors)

Gets the specified Certificate.

Parameters:

thumbprintAlgorithm - the algorithm used to derive the thumbprint parameter. This must be sha1.
thumbprint - the thumbprint of the certificate to get.
detailLevel - A DetailLevel used for controlling which properties are retrieved from the service.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Returns:

A Certificate containing information about the specified certificate in the Azure Batch account.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

listCertificates

public PagedList listCertificates()

Lists the Certificate in the Batch account.

Returns:

A list of Certificate objects.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

listCertificates

public PagedList listCertificates(DetailLevel detailLevel)

Lists the Certificate in the Batch account.

Parameters:

detailLevel - A DetailLevel used for filtering the list and for controlling which properties are retrieved from the service.

Returns:

A list of Certificate objects.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

listCertificates

public PagedList listCertificates(DetailLevel detailLevel, Iterable additionalBehaviors)

Lists the Certificate in the Batch account.

Parameters:

detailLevel - A DetailLevel used for filtering the list and for controlling which properties are retrieved from the service.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Returns:

A list of Certificate objects.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

withCustomBehaviors

public IInheritedBehaviors withCustomBehaviors(Collection behaviors)

Sets a collection of behaviors that modify or customize requests to the Batch service.

Parameters:

behaviors - The collection of BatchClientBehavior instances.

Returns:

The current instance.

Applies to