class Azure::Web::Mgmt::V2020_09_01::Domains
WebSite Management Client
Attributes
@return [WebSiteManagementClient] reference to the WebSiteManagementClient
Private Class Methods
Creates and initializes a new instance of the Domains
class. @param client service class for accessing basic functionality.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 17 def initialize(client) @client = client end
Private Instance Methods
Creates or updates a domain.
Description for Creates or updates a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [Domain] Domain registration information. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Domain] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1592 def begin_create_or_update(resource_group_name, domain_name, domain, custom_headers:nil) response = begin_create_or_update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates or updates a domain.
Description for Creates or updates a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [Domain] Domain registration information. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1629 def begin_create_or_update_async(resource_group_name, domain_name, domain, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil? fail ArgumentError, 'domain_name is nil' if domain_name.nil? fail ArgumentError, "'domain_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9][a-zA-Z0-9\.-]+'" if !domain_name.nil? && domain_name.match(Regexp.new('^[a-zA-Z0-9][a-zA-Z0-9\.-]+$')).nil? fail ArgumentError, 'domain is nil' if domain.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.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? # Serialize Request request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::Domain.mapper() request_content = @client.serialize(request_mapper, domain) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_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, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 202 || status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.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 == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::Domain.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::Domain.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Creates or updates a domain.
Description for Creates or updates a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [Domain] Domain registration information. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1611 def begin_create_or_update_with_http_info(resource_group_name, domain_name, domain, custom_headers:nil) begin_create_or_update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers).value! end
Check if a domain is available for registration.
Description for Check if a domain is available for registration.
@param identifier [NameIdentifier] Name of the domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DomainAvailabilityCheckResult] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 35 def check_availability(identifier, custom_headers:nil) response = check_availability_async(identifier, custom_headers:custom_headers).value! response.body unless response.nil? end
Check if a domain is available for registration.
Description for Check if a domain is available for registration.
@param identifier [NameIdentifier] Name of the domain. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 66 def check_availability_async(identifier, custom_headers:nil) fail ArgumentError, 'identifier is nil' if identifier.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.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? # Serialize Request request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::NameIdentifier.mapper() request_content = @client.serialize(request_mapper, identifier) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'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(:post, path_template, options) 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 MsRest::HttpOperationError.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::Web::Mgmt::V2020_09_01::Models::DomainAvailabilityCheckResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Check if a domain is available for registration.
Description for Check if a domain is available for registration.
@param identifier [NameIdentifier] Name of the domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 51 def check_availability_with_http_info(identifier, custom_headers:nil) check_availability_async(identifier, custom_headers:custom_headers).value! end
Creates or updates a domain.
Description for Creates or updates a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [Domain] Domain registration information. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Domain] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 642 def create_or_update(resource_group_name, domain_name, domain, custom_headers:nil) response = create_or_update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers).value! response.body unless response.nil? end
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [Domain] Domain registration information. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 658 def create_or_update_async(resource_group_name, domain_name, domain, custom_headers:nil) # Send request promise = begin_create_or_update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::Domain.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
Creates an ownership identifier for a domain or updates identifier details for an existing identifer
Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifer
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param domain_ownership_identifier [DomainOwnershipIdentifier] A JSON representation of the domain ownership properties. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DomainOwnershipIdentifier] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1142 def create_or_update_ownership_identifier(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil) response = create_or_update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates an ownership identifier for a domain or updates identifier details for an existing identifer
Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifer
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param domain_ownership_identifier [DomainOwnershipIdentifier] A JSON representation of the domain ownership properties. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1187 def create_or_update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil? fail ArgumentError, 'domain_name is nil' if domain_name.nil? fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, 'domain_ownership_identifier is nil' if domain_ownership_identifier.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.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? # Serialize Request request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::DomainOwnershipIdentifier.mapper() request_content = @client.serialize(request_mapper, domain_ownership_identifier) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_name,'name' => 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, options) 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 MsRest::HttpOperationError.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::Web::Mgmt::V2020_09_01::Models::DomainOwnershipIdentifier.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Creates an ownership identifier for a domain or updates identifier details for an existing identifer
Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifer
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param domain_ownership_identifier [DomainOwnershipIdentifier] A JSON representation of the domain ownership properties. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1165 def create_or_update_ownership_identifier_with_http_info(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil) create_or_update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:custom_headers).value! end
Delete a domain.
Description for Delete a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param force_hard_delete_domain [Boolean] Specify true
to delete the domain immediately. The default is false
which deletes the domain after 24 hours. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 691 def delete(resource_group_name, domain_name, force_hard_delete_domain:nil, custom_headers:nil) response = delete_async(resource_group_name, domain_name, force_hard_delete_domain:force_hard_delete_domain, custom_headers:custom_headers).value! nil end
Delete a domain.
Description for Delete a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param force_hard_delete_domain [Boolean] Specify true
to delete the domain immediately. The default is false
which deletes the domain after 24 hours. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 732 def delete_async(resource_group_name, domain_name, force_hard_delete_domain:nil, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil? fail ArgumentError, 'domain_name is nil' if domain_name.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.DomainRegistration/domains/{domainName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_name,'subscriptionId' => @client.subscription_id}, query_params: {'forceHardDeleteDomain' => force_hard_delete_domain,'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:delete, path_template, options) 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 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.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
Delete ownership identifier for domain
Description for Delete ownership identifier for domain
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1267 def delete_ownership_identifier(resource_group_name, domain_name, name, custom_headers:nil) response = delete_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:custom_headers).value! nil end
Delete ownership identifier for domain
Description for Delete ownership identifier for domain
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1304 def delete_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil? fail ArgumentError, 'domain_name is nil' if domain_name.nil? fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_name,'name' => 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, options) 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 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.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
Delete ownership identifier for domain
Description for Delete ownership identifier for domain
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1286 def delete_ownership_identifier_with_http_info(resource_group_name, domain_name, name, custom_headers:nil) delete_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:custom_headers).value! end
Delete a domain.
Description for Delete a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param force_hard_delete_domain [Boolean] Specify true
to delete the domain immediately. The default is false
which deletes the domain after 24 hours. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 712 def delete_with_http_info(resource_group_name, domain_name, force_hard_delete_domain:nil, custom_headers:nil) delete_async(resource_group_name, domain_name, force_hard_delete_domain:force_hard_delete_domain, custom_headers:custom_headers).value! end
Get a domain.
Description for Get a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Domain] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 535 def get(resource_group_name, domain_name, custom_headers:nil) response = get_async(resource_group_name, domain_name, custom_headers:custom_headers).value! response.body unless response.nil? end
Get a domain.
Description for Get a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 570 def get_async(resource_group_name, domain_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil? fail ArgumentError, 'domain_name is nil' if domain_name.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.DomainRegistration/domains/{domainName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_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, options) 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 MsRest::HttpOperationError.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::Web::Mgmt::V2020_09_01::Models::Domain.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Generate a single sign-on request for the domain management portal.
Description for Generate a single sign-on request for the domain management portal.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DomainControlCenterSsoRequest] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 230 def get_control_center_sso_request(custom_headers:nil) response = get_control_center_sso_request_async(custom_headers:custom_headers).value! response.body unless response.nil? end
Generate a single sign-on request for the domain management portal.
Description for Generate a single sign-on request for the domain management portal.
@param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 261 def get_control_center_sso_request_async(custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.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}/providers/Microsoft.DomainRegistration/generateSsoRequest' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'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, options) 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 MsRest::HttpOperationError.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::Web::Mgmt::V2020_09_01::Models::DomainControlCenterSsoRequest.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Generate a single sign-on request for the domain management portal.
Description for Generate a single sign-on request for the domain management portal.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 246 def get_control_center_sso_request_with_http_info(custom_headers:nil) get_control_center_sso_request_async(custom_headers:custom_headers).value! end
Get ownership identifier for domain
Description for Get ownership identifier for domain
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DomainOwnershipIdentifier] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1028 def get_ownership_identifier(resource_group_name, domain_name, name, custom_headers:nil) response = get_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:custom_headers).value! response.body unless response.nil? end
Get ownership identifier for domain
Description for Get ownership identifier for domain
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1065 def get_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil? fail ArgumentError, 'domain_name is nil' if domain_name.nil? fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_name,'name' => 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, options) 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 MsRest::HttpOperationError.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::Web::Mgmt::V2020_09_01::Models::DomainOwnershipIdentifier.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Get ownership identifier for domain
Description for Get ownership identifier for domain
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1047 def get_ownership_identifier_with_http_info(resource_group_name, domain_name, name, custom_headers:nil) get_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:custom_headers).value! end
Get a domain.
Description for Get a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 553 def get_with_http_info(resource_group_name, domain_name, custom_headers:nil) get_async(resource_group_name, domain_name, custom_headers:custom_headers).value! end
Get all domains in a subscription.
Description for Get all domains in a subscription.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<Domain>] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 137 def list(custom_headers:nil) first_page = list_as_lazy(custom_headers:custom_headers) first_page.get_all_items end
Get all domains in a subscription.
Description for Get all domains in a subscription.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DomainCollection] which provide lazy access to pages of the response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 2101 def list_as_lazy(custom_headers:nil) response = list_async(custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_next_async(next_page_link, custom_headers:custom_headers) end page end end
Get all domains in a subscription.
Description for Get all domains in a subscription.
@param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 166 def list_async(custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.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}/providers/Microsoft.DomainRegistration/domains' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'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, options) 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 MsRest::HttpOperationError.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::Web::Mgmt::V2020_09_01::Models::DomainCollection.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Get all domains in a resource group.
Description for Get all domains in a resource group.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<Domain>] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 432 def list_by_resource_group(resource_group_name, custom_headers:nil) first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers) first_page.get_all_items end
Get all domains in a resource group.
Description for Get all domains in a resource group.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DomainCollection] which provide lazy access to pages of the response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 2149 def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil) response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers) end page end end
Get all domains in a resource group.
Description for Get all domains in a resource group.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 465 def list_by_resource_group_async(resource_group_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.DomainRegistration/domains' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_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, options) 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 MsRest::HttpOperationError.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::Web::Mgmt::V2020_09_01::Models::DomainCollection.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Get all domains in a resource group.
Description for Get all domains in a resource group.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DomainCollection] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1910 def list_by_resource_group_next(next_page_link, custom_headers:nil) response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
Get all domains in a resource group.
Description for Get all domains in a resource group.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1943 def list_by_resource_group_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 options = { 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, options) 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 MsRest::HttpOperationError.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::Web::Mgmt::V2020_09_01::Models::DomainCollection.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Get all domains in a resource group.
Description for Get all domains in a resource group.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1927 def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil) list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value! end
Get all domains in a resource group.
Description for Get all domains in a resource group.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 449 def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil) list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value! end
Get all domains in a subscription.
Description for Get all domains in a subscription.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DomainCollection] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1718 def list_next(next_page_link, custom_headers:nil) response = list_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
Get all domains in a subscription.
Description for Get all domains in a subscription.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1751 def list_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 options = { 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, options) 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 MsRest::HttpOperationError.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::Web::Mgmt::V2020_09_01::Models::DomainCollection.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Get all domains in a subscription.
Description for Get all domains in a subscription.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1735 def list_next_with_http_info(next_page_link, custom_headers:nil) list_next_async(next_page_link, custom_headers:custom_headers).value! end
Lists domain ownership identifiers.
Description for Lists domain ownership identifiers.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<DomainOwnershipIdentifier>] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 921 def list_ownership_identifiers(resource_group_name, domain_name, custom_headers:nil) first_page = list_ownership_identifiers_as_lazy(resource_group_name, domain_name, custom_headers:custom_headers) first_page.get_all_items end
Lists domain ownership identifiers.
Description for Lists domain ownership identifiers.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DomainOwnershipIdentifierCollection] which provide lazy access to pages of the response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 2174 def list_ownership_identifiers_as_lazy(resource_group_name, domain_name, custom_headers:nil) response = list_ownership_identifiers_async(resource_group_name, domain_name, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_ownership_identifiers_next_async(next_page_link, custom_headers:custom_headers) end page end end
Lists domain ownership identifiers.
Description for Lists domain ownership identifiers.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 956 def list_ownership_identifiers_async(resource_group_name, domain_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil? fail ArgumentError, 'domain_name is nil' if domain_name.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_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, options) 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 MsRest::HttpOperationError.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::Web::Mgmt::V2020_09_01::Models::DomainOwnershipIdentifierCollection.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists domain ownership identifiers.
Description for Lists domain ownership identifiers.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DomainOwnershipIdentifierCollection] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 2006 def list_ownership_identifiers_next(next_page_link, custom_headers:nil) response = list_ownership_identifiers_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
Lists domain ownership identifiers.
Description for Lists domain ownership identifiers.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 2039 def list_ownership_identifiers_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 options = { 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, options) 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 MsRest::HttpOperationError.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::Web::Mgmt::V2020_09_01::Models::DomainOwnershipIdentifierCollection.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Lists domain ownership identifiers.
Description for Lists domain ownership identifiers.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 2023 def list_ownership_identifiers_next_with_http_info(next_page_link, custom_headers:nil) list_ownership_identifiers_next_async(next_page_link, custom_headers:custom_headers).value! end
Lists domain ownership identifiers.
Description for Lists domain ownership identifiers.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 939 def list_ownership_identifiers_with_http_info(resource_group_name, domain_name, custom_headers:nil) list_ownership_identifiers_async(resource_group_name, domain_name, custom_headers:custom_headers).value! end
Get domain name recommendations based on keywords.
Description for Get domain name recommendations based on keywords.
@param parameters [DomainRecommendationSearchParameters] Search parameters for domain name recommendations. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array<NameIdentifier>] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 326 def list_recommendations(parameters, custom_headers:nil) first_page = list_recommendations_as_lazy(parameters, custom_headers:custom_headers) first_page.get_all_items end
Get domain name recommendations based on keywords.
Description for Get domain name recommendations based on keywords.
@param parameters [DomainRecommendationSearchParameters] Search parameters for domain name recommendations. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [NameIdentifierCollection] which provide lazy access to pages of the response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 2125 def list_recommendations_as_lazy(parameters, custom_headers:nil) response = list_recommendations_async(parameters, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_recommendations_next_async(next_page_link, custom_headers:custom_headers) end page end end
Get domain name recommendations based on keywords.
Description for Get domain name recommendations based on keywords.
@param parameters [DomainRecommendationSearchParameters] Search parameters for domain name recommendations. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 359 def list_recommendations_async(parameters, custom_headers:nil) fail ArgumentError, 'parameters is nil' if parameters.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.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? # Serialize Request request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::DomainRecommendationSearchParameters.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}/providers/Microsoft.DomainRegistration/listDomainRecommendations' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'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(:post, path_template, options) 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 MsRest::HttpOperationError.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::Web::Mgmt::V2020_09_01::Models::NameIdentifierCollection.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Get domain name recommendations based on keywords.
Description for Get domain name recommendations based on keywords.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [NameIdentifierCollection] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1814 def list_recommendations_next(next_page_link, custom_headers:nil) response = list_recommendations_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
Get domain name recommendations based on keywords.
Description for Get domain name recommendations based on keywords.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1847 def list_recommendations_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 options = { 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(:post, path_template, options) 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 MsRest::HttpOperationError.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::Web::Mgmt::V2020_09_01::Models::NameIdentifierCollection.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Get domain name recommendations based on keywords.
Description for Get domain name recommendations based on keywords.
@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1831 def list_recommendations_next_with_http_info(next_page_link, custom_headers:nil) list_recommendations_next_async(next_page_link, custom_headers:custom_headers).value! end
Get domain name recommendations based on keywords.
Description for Get domain name recommendations based on keywords.
@param parameters [DomainRecommendationSearchParameters] Search parameters for domain name recommendations. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 343 def list_recommendations_with_http_info(parameters, custom_headers:nil) list_recommendations_async(parameters, custom_headers:custom_headers).value! end
Get all domains in a subscription.
Description for Get all domains in a subscription.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 152 def list_with_http_info(custom_headers:nil) list_async(custom_headers:custom_headers).value! end
Renew a domain.
Description for Renew a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1495 def renew(resource_group_name, domain_name, custom_headers:nil) response = renew_async(resource_group_name, domain_name, custom_headers:custom_headers).value! nil end
Renew a domain.
Description for Renew a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1530 def renew_async(resource_group_name, domain_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil? fail ArgumentError, 'domain_name is nil' if domain_name.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.DomainRegistration/domains/{domainName}/renew' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_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, options) 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 == 202 || status_code == 204 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.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
Renew a domain.
Description for Renew a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1513 def renew_with_http_info(resource_group_name, domain_name, custom_headers:nil) renew_async(resource_group_name, domain_name, custom_headers:custom_headers).value! end
Creates or updates a domain.
Description for Creates or updates a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [DomainPatchResource] Domain registration information. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Domain] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 794 def update(resource_group_name, domain_name, domain, custom_headers:nil) response = update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates or updates a domain.
Description for Creates or updates a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [DomainPatchResource] Domain registration information. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 831 def update_async(resource_group_name, domain_name, domain, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil? fail ArgumentError, 'domain_name is nil' if domain_name.nil? fail ArgumentError, "'domain_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9][a-zA-Z0-9\.-]+'" if !domain_name.nil? && domain_name.match(Regexp.new('^[a-zA-Z0-9][a-zA-Z0-9\.-]+$')).nil? fail ArgumentError, 'domain is nil' if domain.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.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? # Serialize Request request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::DomainPatchResource.mapper() request_content = @client.serialize(request_mapper, domain) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_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, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 202 || status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.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 == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::Domain.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::Domain.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Creates an ownership identifier for a domain or updates identifier details for an existing identifer
Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifer
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param domain_ownership_identifier [DomainOwnershipIdentifier] A JSON representation of the domain ownership properties. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [DomainOwnershipIdentifier] operation results.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1371 def update_ownership_identifier(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil) response = update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:custom_headers).value! response.body unless response.nil? end
Creates an ownership identifier for a domain or updates identifier details for an existing identifer
Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifer
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param domain_ownership_identifier [DomainOwnershipIdentifier] A JSON representation of the domain ownership properties. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1416 def update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil? fail ArgumentError, 'domain_name is nil' if domain_name.nil? fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, 'domain_ownership_identifier is nil' if domain_ownership_identifier.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.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? # Serialize Request request_mapper = Azure::Web::Mgmt::V2020_09_01::Models::DomainOwnershipIdentifier.mapper() request_content = @client.serialize(request_mapper, domain_ownership_identifier) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}' request_url = @base_url || @client.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_name,'name' => 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, options) 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 MsRest::HttpOperationError.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::Web::Mgmt::V2020_09_01::Models::DomainOwnershipIdentifier.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Creates an ownership identifier for a domain or updates identifier details for an existing identifer
Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifer
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param domain_ownership_identifier [DomainOwnershipIdentifier] A JSON representation of the domain ownership properties. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 1394 def update_ownership_identifier_with_http_info(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil) update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:custom_headers).value! end
Creates or updates a domain.
Description for Creates or updates a domain.
@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [DomainPatchResource] Domain registration information. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information.
# File lib/2020-09-01/generated/azure_mgmt_web/domains.rb, line 813 def update_with_http_info(resource_group_name, domain_name, domain, custom_headers:nil) update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers).value! end