Class: Azure::Batch::Mgmt::V2019_08_01::CertificateOperations
- Inherits:
-
Object
- Object
- Azure::Batch::Mgmt::V2019_08_01::CertificateOperations
- Includes:
- MsRestAzure
- Defined in:
- lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb
Overview
CertificateOperations
Instance Attribute Summary collapse
-
#client ⇒ BatchManagementClient
readonly
Reference to the BatchManagementClient.
Instance Method Summary collapse
-
#begin_create(resource_group_name, account_name, certificate_name, parameters, if_match: nil, if_none_match: nil, custom_headers: nil) ⇒ Certificate
Creates a new certificate inside the specified account.
-
#begin_create_async(resource_group_name, account_name, certificate_name, parameters, if_match: nil, if_none_match: nil, custom_headers: nil) ⇒ Concurrent::Promise
Creates a new certificate inside the specified account.
-
#begin_create_with_http_info(resource_group_name, account_name, certificate_name, parameters, if_match: nil, if_none_match: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Creates a new certificate inside the specified account.
-
#begin_delete(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Object
Deletes the specified certificate.
-
#begin_delete_async(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise
Deletes the specified certificate.
-
#begin_delete_with_http_info(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes the specified certificate.
-
#cancel_deletion(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Certificate
Cancels a failed deletion of a certificate from the specified account.
-
#cancel_deletion_async(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise
Cancels a failed deletion of a certificate from the specified account.
-
#cancel_deletion_with_http_info(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Cancels a failed deletion of a certificate from the specified account.
-
#create(resource_group_name, account_name, certificate_name, parameters, if_match: nil, if_none_match: nil, custom_headers: nil) ⇒ Certificate
Creates a new certificate inside the specified account.
-
#create_async(resource_group_name, account_name, certificate_name, parameters, if_match: nil, if_none_match: nil, custom_headers: nil) ⇒ Concurrent::Promise
contains the Batch account.
-
#delete(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Object
Deletes the specified certificate.
-
#delete_async(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise
contains the Batch account.
-
#get(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Certificate
Gets information about the specified certificate.
-
#get_async(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets information about the specified certificate.
-
#get_with_http_info(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets information about the specified certificate.
-
#initialize(client) ⇒ CertificateOperations
constructor
Creates and initializes a new instance of the CertificateOperations class.
-
#list_by_batch_account(resource_group_name, account_name, maxresults: nil, select: nil, filter: nil, custom_headers: nil) ⇒ Array<Certificate>
Lists all of the certificates in the specified account.
-
#list_by_batch_account_as_lazy(resource_group_name, account_name, maxresults: nil, select: nil, filter: nil, custom_headers: nil) ⇒ ListCertificatesResult
Lists all of the certificates in the specified account.
-
#list_by_batch_account_async(resource_group_name, account_name, maxresults: nil, select: nil, filter: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists all of the certificates in the specified account.
-
#list_by_batch_account_next(next_page_link, custom_headers: nil) ⇒ ListCertificatesResult
Lists all of the certificates in the specified account.
-
#list_by_batch_account_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists all of the certificates in the specified account.
-
#list_by_batch_account_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all of the certificates in the specified account.
-
#list_by_batch_account_with_http_info(resource_group_name, account_name, maxresults: nil, select: nil, filter: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all of the certificates in the specified account.
-
#update(resource_group_name, account_name, certificate_name, parameters, if_match: nil, custom_headers: nil) ⇒ Certificate
Updates the properties of an existing certificate.
-
#update_async(resource_group_name, account_name, certificate_name, parameters, if_match: nil, custom_headers: nil) ⇒ Concurrent::Promise
Updates the properties of an existing certificate.
-
#update_with_http_info(resource_group_name, account_name, certificate_name, parameters, if_match: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Updates the properties of an existing certificate.
Constructor Details
#initialize(client) ⇒ CertificateOperations
Creates and initializes a new instance of the CertificateOperations class.
17 18 19 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 17 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ BatchManagementClient (readonly)
Returns reference to the BatchManagementClient.
22 23 24 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 22 def client @client end |
Instance Method Details
#begin_create(resource_group_name, account_name, certificate_name, parameters, if_match: nil, if_none_match: nil, custom_headers: nil) ⇒ Certificate
Creates a new certificate inside the specified account.
contains the Batch account. 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. for certificate creation. 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. created, but to prevent updating an existing certificate. Other values will be ignored. will be added to the HTTP request.
672 673 674 675 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 672 def begin_create(resource_group_name, account_name, certificate_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil) response = begin_create_async(resource_group_name, account_name, certificate_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value! response.body unless response.nil? end |
#begin_create_async(resource_group_name, account_name, certificate_name, parameters, if_match: nil, if_none_match: nil, custom_headers: nil) ⇒ Concurrent::Promise
Creates a new certificate inside the specified account.
contains the Batch account. 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. for certificate creation. 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. created, but to prevent updating an existing certificate. Other values will be ignored. to the HTTP request.
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 727 def begin_create_async(resource_group_name, account_name, certificate_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, "'certificate_name' should satisfy the constraint - 'MaxLength': '45'" if !certificate_name.nil? && certificate_name.length > 45 fail ArgumentError, "'certificate_name' should satisfy the constraint - 'MinLength': '5'" if !certificate_name.nil? && certificate_name.length < 5 fail ArgumentError, "'certificate_name' should satisfy the constraint - 'Pattern': '^[\w]+-[\w]+$'" if !certificate_name.nil? && certificate_name.match(Regexp.new('^^[\w]+-[\w]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['If-None-Match'] = if_none_match unless if_none_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Batch::Mgmt::V2019_08_01::Models::CertificateCreateOrUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'certificateName' => certificate_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:put, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Batch::Mgmt::V2019_08_01::Models::Certificate.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#begin_create_with_http_info(resource_group_name, account_name, certificate_name, parameters, if_match: nil, if_none_match: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Creates a new certificate inside the specified account.
contains the Batch account. 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. for certificate creation. 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. created, but to prevent updating an existing certificate. Other values will be ignored. will be added to the HTTP request.
700 701 702 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 700 def begin_create_with_http_info(resource_group_name, account_name, certificate_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil) begin_create_async(resource_group_name, account_name, certificate_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value! end |
#begin_delete(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Object
Deletes the specified certificate.
contains the Batch account. 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. will be added to the HTTP request.
812 813 814 815 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 812 def begin_delete(resource_group_name, account_name, certificate_name, custom_headers:nil) response = begin_delete_async(resource_group_name, account_name, certificate_name, custom_headers:custom_headers).value! nil end |
#begin_delete_async(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise
Deletes the specified certificate.
contains the Batch account. 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. to the HTTP request.
849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 849 def begin_delete_async(resource_group_name, account_name, certificate_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, "'certificate_name' should satisfy the constraint - 'MaxLength': '45'" if !certificate_name.nil? && certificate_name.length > 45 fail ArgumentError, "'certificate_name' should satisfy the constraint - 'MinLength': '5'" if !certificate_name.nil? && certificate_name.length < 5 fail ArgumentError, "'certificate_name' should satisfy the constraint - 'Pattern': '^[\w]+-[\w]+$'" if !certificate_name.nil? && certificate_name.match(Regexp.new('^^[\w]+-[\w]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'certificateName' => certificate_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:delete, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 204 || status_code == 202 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end |
#begin_delete_with_http_info(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes the specified certificate.
contains the Batch account. 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. will be added to the HTTP request.
831 832 833 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 831 def begin_delete_with_http_info(resource_group_name, account_name, certificate_name, custom_headers:nil) begin_delete_async(resource_group_name, account_name, certificate_name, custom_headers:custom_headers).value! end |
#cancel_deletion(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Certificate
Cancels a failed deletion of a certificate from the specified account.
If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate.
contains the Batch account. 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. will be added to the HTTP request.
534 535 536 537 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 534 def cancel_deletion(resource_group_name, account_name, certificate_name, custom_headers:nil) response = cancel_deletion_async(resource_group_name, account_name, certificate_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#cancel_deletion_async(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise
Cancels a failed deletion of a certificate from the specified account.
If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate.
contains the Batch account. 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. to the HTTP request.
587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 587 def cancel_deletion_async(resource_group_name, account_name, certificate_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, "'certificate_name' should satisfy the constraint - 'MaxLength': '45'" if !certificate_name.nil? && certificate_name.length > 45 fail ArgumentError, "'certificate_name' should satisfy the constraint - 'MinLength': '5'" if !certificate_name.nil? && certificate_name.length < 5 fail ArgumentError, "'certificate_name' should satisfy the constraint - 'Pattern': '^[\w]+-[\w]+$'" if !certificate_name.nil? && certificate_name.match(Regexp.new('^^[\w]+-[\w]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}/cancelDelete' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'certificateName' => certificate_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Batch::Mgmt::V2019_08_01::Models::Certificate.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#cancel_deletion_with_http_info(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Cancels a failed deletion of a certificate from the specified account.
If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate.
contains the Batch account. 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. will be added to the HTTP request.
561 562 563 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 561 def cancel_deletion_with_http_info(resource_group_name, account_name, certificate_name, custom_headers:nil) cancel_deletion_async(resource_group_name, account_name, certificate_name, custom_headers:custom_headers).value! end |
#create(resource_group_name, account_name, certificate_name, parameters, if_match: nil, if_none_match: nil, custom_headers: nil) ⇒ Certificate
Creates a new certificate inside the specified account.
contains the Batch account. 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. for certificate creation. 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. created, but to prevent updating an existing certificate. Other values will be ignored. will be added to the HTTP request.
171 172 173 174 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 171 def create(resource_group_name, account_name, certificate_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil) response = create_async(resource_group_name, account_name, certificate_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value! response.body unless response.nil? end |
#create_async(resource_group_name, account_name, certificate_name, parameters, if_match: nil, if_none_match: nil, custom_headers: nil) ⇒ Concurrent::Promise
contains the Batch account. 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. for certificate creation. 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. created, but to prevent updating an existing certificate. Other values will be ignored. will be added to the HTTP request.
response.
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 198 def create_async(resource_group_name, account_name, certificate_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil) # Send request promise = begin_create_async(resource_group_name, account_name, certificate_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Batch::Mgmt::V2019_08_01::Models::Certificate.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#delete(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Object
Deletes the specified certificate.
contains the Batch account. 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. will be added to the HTTP request.
365 366 367 368 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 365 def delete(resource_group_name, account_name, certificate_name, custom_headers:nil) response = delete_async(resource_group_name, account_name, certificate_name, custom_headers:custom_headers).value! nil end |
#delete_async(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise
contains the Batch account. 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. will be added to the HTTP request.
response.
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 383 def delete_async(resource_group_name, account_name, certificate_name, custom_headers:nil) # Send request promise = begin_delete_async(resource_group_name, account_name, certificate_name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#get(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Certificate
Gets information about the specified certificate.
contains the Batch account. 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. will be added to the HTTP request.
413 414 415 416 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 413 def get(resource_group_name, account_name, certificate_name, custom_headers:nil) response = get_async(resource_group_name, account_name, certificate_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_async(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets information about the specified certificate.
contains the Batch account. 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. to the HTTP request.
450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 450 def get_async(resource_group_name, account_name, certificate_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, "'certificate_name' should satisfy the constraint - 'MaxLength': '45'" if !certificate_name.nil? && certificate_name.length > 45 fail ArgumentError, "'certificate_name' should satisfy the constraint - 'MinLength': '5'" if !certificate_name.nil? && certificate_name.length < 5 fail ArgumentError, "'certificate_name' should satisfy the constraint - 'Pattern': '^[\w]+-[\w]+$'" if !certificate_name.nil? && certificate_name.match(Regexp.new('^^[\w]+-[\w]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'certificateName' => certificate_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Batch::Mgmt::V2019_08_01::Models::Certificate.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_with_http_info(resource_group_name, account_name, certificate_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets information about the specified certificate.
contains the Batch account. 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. will be added to the HTTP request.
432 433 434 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 432 def get_with_http_info(resource_group_name, account_name, certificate_name, custom_headers:nil) get_async(resource_group_name, account_name, certificate_name, custom_headers:custom_headers).value! end |
#list_by_batch_account(resource_group_name, account_name, maxresults: nil, select: nil, filter: nil, custom_headers: nil) ⇒ Array<Certificate>
Lists all of the certificates in the specified account.
contains the Batch account. response. returned. e.g. “properties/provisioningState”. Only top level properties under properties/ are valid for selection. filtering are “properties/provisioningState”, “properties/provisioningStateTransitionTime”, “name”. will be added to the HTTP request.
43 44 45 46 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 43 def list_by_batch_account(resource_group_name, account_name, maxresults:nil, select:nil, filter:nil, custom_headers:nil) first_page = list_by_batch_account_as_lazy(resource_group_name, account_name, maxresults:maxresults, select:select, filter:filter, custom_headers:custom_headers) first_page.get_all_items end |
#list_by_batch_account_as_lazy(resource_group_name, account_name, maxresults: nil, select: nil, filter: nil, custom_headers: nil) ⇒ ListCertificatesResult
Lists all of the certificates in the specified account.
contains the Batch account. response. returned. e.g. “properties/provisioningState”. Only top level properties under properties/ are valid for selection. filtering are “properties/provisioningState”, “properties/provisioningStateTransitionTime”, “name”. will be added to the HTTP request.
response.
1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 1011 def list_by_batch_account_as_lazy(resource_group_name, account_name, maxresults:nil, select:nil, filter:nil, custom_headers:nil) response = list_by_batch_account_async(resource_group_name, account_name, maxresults:maxresults, select:select, filter:filter, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_batch_account_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_by_batch_account_async(resource_group_name, account_name, maxresults: nil, select: nil, filter: nil, custom_headers: nil) ⇒ Concurrent::Promise
Lists all of the certificates in the specified account.
contains the Batch account. response. returned. e.g. “properties/provisioningState”. Only top level properties under properties/ are valid for selection. filtering are “properties/provisioningState”, “properties/provisioningStateTransitionTime”, “name”. to the HTTP request.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 90 def list_by_batch_account_async(resource_group_name, account_name, maxresults:nil, select:nil, filter:nil, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id}, query_params: {'maxresults' => maxresults,'$select' => select,'$filter' => filter,'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Batch::Mgmt::V2019_08_01::Models::ListCertificatesResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_batch_account_next(next_page_link, custom_headers: nil) ⇒ ListCertificatesResult
Lists all of the certificates in the specified account.
to List operation. will be added to the HTTP request.
911 912 913 914 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 911 def list_by_batch_account_next(next_page_link, custom_headers:nil) response = list_by_batch_account_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_by_batch_account_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Lists all of the certificates in the specified account.
to List operation. to the HTTP request.
940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 940 def list_by_batch_account_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{nextLink}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Batch::Mgmt::V2019_08_01::Models::ListCertificatesResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_batch_account_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all of the certificates in the specified account.
to List operation. will be added to the HTTP request.
926 927 928 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 926 def list_by_batch_account_next_with_http_info(next_page_link, custom_headers:nil) list_by_batch_account_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_by_batch_account_with_http_info(resource_group_name, account_name, maxresults: nil, select: nil, filter: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all of the certificates in the specified account.
contains the Batch account. response. returned. e.g. “properties/provisioningState”. Only top level properties under properties/ are valid for selection. filtering are “properties/provisioningState”, “properties/provisioningStateTransitionTime”, “name”. will be added to the HTTP request.
67 68 69 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 67 def list_by_batch_account_with_http_info(resource_group_name, account_name, maxresults:nil, select:nil, filter:nil, custom_headers:nil) list_by_batch_account_async(resource_group_name, account_name, maxresults:maxresults, select:select, filter:filter, custom_headers:custom_headers).value! end |
#update(resource_group_name, account_name, certificate_name, parameters, if_match: nil, custom_headers: nil) ⇒ Certificate
Updates the properties of an existing certificate.
contains the Batch account. 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. update. to update. This value can be omitted or set to “*” to apply the operation unconditionally. will be added to the HTTP request.
235 236 237 238 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 235 def update(resource_group_name, account_name, certificate_name, parameters, if_match:nil, custom_headers:nil) response = update_async(resource_group_name, account_name, certificate_name, parameters, if_match:if_match, custom_headers:custom_headers).value! response.body unless response.nil? end |
#update_async(resource_group_name, account_name, certificate_name, parameters, if_match: nil, custom_headers: nil) ⇒ Concurrent::Promise
Updates the properties of an existing certificate.
contains the Batch account. 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. update. to update. This value can be omitted or set to “*” to apply the operation unconditionally. to the HTTP request.
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 282 def update_async(resource_group_name, account_name, certificate_name, parameters, if_match:nil, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'account_name is nil' if account_name.nil? fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24 fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3 fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[-\w\._]+$'" if !account_name.nil? && account_name.match(Regexp.new('^^[-\w\._]+$$')).nil? fail ArgumentError, 'certificate_name is nil' if certificate_name.nil? fail ArgumentError, "'certificate_name' should satisfy the constraint - 'MaxLength': '45'" if !certificate_name.nil? && certificate_name.length > 45 fail ArgumentError, "'certificate_name' should satisfy the constraint - 'MinLength': '5'" if !certificate_name.nil? && certificate_name.length < 5 fail ArgumentError, "'certificate_name' should satisfy the constraint - 'Pattern': '^[\w]+-[\w]+$'" if !certificate_name.nil? && certificate_name.match(Regexp.new('^^[\w]+-[\w]+$$')).nil? fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['If-Match'] = if_match unless if_match.nil? request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::Batch::Mgmt::V2019_08_01::Models::CertificateCreateOrUpdateParameters.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'certificateName' => certificate_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:patch, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Batch::Mgmt::V2019_08_01::Models::Certificate.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#update_with_http_info(resource_group_name, account_name, certificate_name, parameters, if_match: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Updates the properties of an existing certificate.
contains the Batch account. 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. update. to update. This value can be omitted or set to “*” to apply the operation unconditionally. will be added to the HTTP request.
259 260 261 |
# File 'lib/2019-08-01/generated/azure_mgmt_batch/certificate_operations.rb', line 259 def update_with_http_info(resource_group_name, account_name, certificate_name, parameters, if_match:nil, custom_headers:nil) update_async(resource_group_name, account_name, certificate_name, parameters, if_match:if_match, custom_headers:custom_headers).value! end |