Class CertificateOperations

    • Field Detail

      • SHA1_CERTIFICATE_ALGORITHM

        public static final String SHA1_CERTIFICATE_ALGORITHM
        The SHA certificate algorithm.
        See Also:
        Constant Field Values
    • Method Detail

      • createCertificate

        public void createCertificate​(CertificateAddParameter certificate)
                               throws BatchErrorException,
                                      IOException
        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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
      • cancelDeleteCertificate

        public void cancelDeleteCertificate​(String thumbprintAlgorithm,
                                            String thumbprint)
                                     throws BatchErrorException,
                                            IOException
        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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
      • cancelDeleteCertificate

        public void cancelDeleteCertificate​(String thumbprintAlgorithm,
                                            String thumbprint,
                                            Iterable<BatchClientBehavior> additionalBehaviors)
                                     throws BatchErrorException,
                                            IOException
        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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
      • deleteCertificate

        public void deleteCertificate​(String thumbprintAlgorithm,
                                      String thumbprint)
                               throws BatchErrorException,
                                      IOException
        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, String) 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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
      • deleteCertificate

        public void deleteCertificate​(String thumbprintAlgorithm,
                                      String thumbprint,
                                      Iterable<BatchClientBehavior> additionalBehaviors)
                               throws BatchErrorException,
                                      IOException
        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, String) 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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
      • getCertificate

        public Certificate getCertificate​(String thumbprintAlgorithm,
                                          String thumbprint)
                                   throws BatchErrorException,
                                          IOException
        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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
      • getCertificate

        public Certificate getCertificate​(String thumbprintAlgorithm,
                                          String thumbprint,
                                          DetailLevel detailLevel)
                                   throws BatchErrorException,
                                          IOException
        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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
      • getCertificate

        public Certificate getCertificate​(String thumbprintAlgorithm,
                                          String thumbprint,
                                          DetailLevel detailLevel,
                                          Iterable<BatchClientBehavior> additionalBehaviors)
                                   throws BatchErrorException,
                                          IOException
        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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
      • listCertificates

        public com.microsoft.azure.PagedList<Certificate> listCertificates​(DetailLevel detailLevel)
                                                                    throws BatchErrorException,
                                                                           IOException
        Lists the certificates 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 there is an error in serialization/deserialization of data sent to/received from the Batch service.