azure-mgmt-batch/azure/mgmt/batch/operations/certificate_operations.py
def create(
            self, resource_group_name, account_name, certificate_name, parameters, if_match=None, if_none_match=None, custom_headers=None, raw=False, **operation_config):
        """Creates a new certificate inside the specified account.

        :param resource_group_name: The name of the resource group that
         contains the Batch account.
        :type resource_group_name: str
        :param account_name: The name of the Batch account.
        :type account_name: str
        :param certificate_name: The identifier for the certificate. This must
         be made up of algorithm and thumbprint separated by a dash, and must
         match the certificate data in the request. For example SHA1-a3d1c5.
        :type certificate_name: str
        :param parameters: Additional parameters for certificate creation.
        :type parameters:
         ~azure.mgmt.batch.models.CertificateCreateOrUpdateParameters
        :param if_match: The entity state (ETag) version of the certificate to
         update. A value of "*" can be used to apply the operation only if the
         certificate already exists. If omitted, this operation will always be
         applied.
        :type if_match: str
        :param if_none_match: Set to '*' to allow a new certificate to be
         created, but to prevent updating an existing certificate. Other values
         will be ignored.
        :type if_none_match: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :return: An instance of AzureOperationPoller that returns Certificate
         or ClientRawResponse if raw=true
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.batch.models.Certificate]
         or ~msrest.pipeline.ClientRawResponse
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = self._create_initial(
            resource_group_name=resource_group_name,
            account_name=account_name,
            certificate_name=certificate_name,
            parameters=parameters,
            if_match=if_match,
            if_none_match=if_none_match,
            custom_headers=custom_headers,
            raw=True,
            **operation_config
        )
        if raw:
            return raw_result

        # Construct and send request
        def long_running_send():
            return raw_result.response

        def get_long_running_status(status_link, headers=None):

            request = self._client.get(status_link)
            if headers:
                request.headers.update(headers)
            header_parameters = {}
            header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id']
            return self._client.send(
                request, header_parameters, stream=False, **operation_config)

        def get_long_running_output(response):

            if response.status_code not in [200]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            header_dict = {
                'ETag': 'str',
            }
            deserialized = self._deserialize('Certificate', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                client_raw_response.add_headers(header_dict)
                return client_raw_response

            return deserialized

        long_running_operation_timeout = operation_config.get(
            'long_running_operation_timeout',
            self.config.long_running_operation_timeout)
        return AzureOperationPoller(
            long_running_send, get_long_running_output,
            get_long_running_status, long_running_operation_timeout)
def create(
            self, resource_group_name, account_name, certificate_name, parameters, if_match=None, if_none_match=None, custom_headers=None, raw=False, **operation_config):
        raw_result = self._create_initial(
            resource_group_name=resource_group_name,
            account_name=account_name,
            certificate_name=certificate_name,
            parameters=parameters,
            if_match=if_match,
            if_none_match=if_none_match,
            custom_headers=custom_headers,
            raw=True,
            **operation_config
        )
        if raw:
            return raw_result

        # Construct and send request
        def long_running_send():
            return raw_result.response

        def get_long_running_status(status_link, headers=None):

            request = self._client.get(status_link)
            if headers:
                request.headers.update(headers)
            header_parameters = {}
            header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id']
            return self._client.send(
                request, header_parameters, stream=False, **operation_config)

        def get_long_running_output(response):

            if response.status_code not in [200]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            header_dict = {
                'ETag': 'str',
            }
            deserialized = self._deserialize('Certificate', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                client_raw_response.add_headers(header_dict)
                return client_raw_response

            return deserialized

        long_running_operation_timeout = operation_config.get(
            'long_running_operation_timeout',
            self.config.long_running_operation_timeout)
        return AzureOperationPoller(
            long_running_send, get_long_running_output,
            get_long_running_status, long_running_operation_timeout)
def create ( self , resource_group_name , account_name , certificate_name , parameters , if_match = None , if_none_match = None , custom_headers = None , raw = False , * * operation_config ) : raw_result = self . _create_initial ( resource_group_name = resource_group_name , account_name = account_name , certificate_name = certificate_name , parameters = parameters , if_match = if_match , if_none_match = if_none_match , custom_headers = custom_headers , raw = True , * * operation_config ) if raw : return raw_result # Construct and send request def long_running_send ( ) : return raw_result . response def get_long_running_status ( status_link , headers = None ) : request = self . _client . get ( status_link ) if headers : request . headers . update ( headers ) header_parameters = { } header_parameters [ 'x-ms-client-request-id' ] = raw_result . response . request . headers [ 'x-ms-client-request-id' ] return self . _client . send ( request , header_parameters , stream = False , * * operation_config ) def get_long_running_output ( response ) : if response . status_code not in [ 200 ] : exp = CloudError ( response ) exp . request_id = response . headers . get ( 'x-ms-request-id' ) raise exp header_dict = { 'ETag' : 'str' , } deserialized = self . _deserialize ( 'Certificate' , response ) if raw : client_raw_response = ClientRawResponse ( deserialized , response ) client_raw_response . add_headers ( header_dict ) return client_raw_response return deserialized long_running_operation_timeout = operation_config . get ( 'long_running_operation_timeout' , self . config . long_running_operation_timeout ) return AzureOperationPoller ( long_running_send , get_long_running_output , get_long_running_status , long_running_operation_timeout )
Creates a new certificate inside the specified account.

        :param resource_group_name: The name of the resource group that
         contains the Batch account.
        :type resource_group_name: str
        :param account_name: The name of the Batch account.
        :type account_name: str
        :param certificate_name: The identifier for the certificate. This must
         be made up of algorithm and thumbprint separated by a dash, and must
         match the certificate data in the request. For example SHA1-a3d1c5.
        :type certificate_name: str
        :param parameters: Additional parameters for certificate creation.
        :type parameters:
         ~azure.mgmt.batch.models.CertificateCreateOrUpdateParameters
        :param if_match: The entity state (ETag) version of the certificate to
         update. A value of "*" can be used to apply the operation only if the
         certificate already exists. If omitted, this operation will always be
         applied.
        :type if_match: str
        :param if_none_match: Set to '*' to allow a new certificate to be
         created, but to prevent updating an existing certificate. Other values
         will be ignored.
        :type if_none_match: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :return: An instance of AzureOperationPoller that returns Certificate
         or ClientRawResponse if raw=true
        :rtype:
         ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.batch.models.Certificate]
         or ~msrest.pipeline.ClientRawResponse
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
Creates a new certificate inside the specified account .