Class: Azure::ARM::Web::GlobalDomainRegistration

Inherits:
Object
  • Object
show all
Includes:
Models, MsRestAzure
Defined in:
lib/azure_mgmt_web/global_domain_registration.rb

Overview

Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see <a href=“msdn.microsoft.com/en-us/library/azure/dn790557.aspx”>Authenticating Azure Resource Manager requests.</a>

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ GlobalDomainRegistration

Creates and initializes a new instance of the GlobalDomainRegistration class.

Parameters:

  • client

    service class for accessing basic functionality.



25
26
27
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 25

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns reference to the WebSiteManagementClient.

Returns:

  • reference to the WebSiteManagementClient



30
31
32
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 30

def client
  @client
end

Instance Method Details

#check_domain_availability(identifier, custom_headers = nil) ⇒ DomainAvailablilityCheckResult

Checks if a domain is available for registration

will be added to the HTTP request.

Parameters:

  • identifier (NameIdentifier)

    Name of the domain

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



303
304
305
306
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 303

def check_domain_availability(identifier, custom_headers = nil)
  response = check_domain_availability_async(identifier, custom_headers).value!
  response.body unless response.nil?
end

#check_domain_availability_async(identifier, custom_headers = nil) ⇒ Concurrent::Promise

Checks if a domain is available for registration

to the HTTP request.

Parameters:

  • identifier (NameIdentifier)

    Name of the domain

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 330

def check_domain_availability_async(identifier, custom_headers = nil)
  fail ArgumentError, 'identifier is nil' if identifier.nil?
  identifier.validate unless 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 = {}

  # 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_headers['Content-Type'] = 'application/json; charset=utf-8'
  unless identifier.nil?
    identifier = NameIdentifier.serialize_object(identifier)
  end
  request_content = identifier != nil ? JSON.generate(identifier, quirks_mode: true) : nil
  path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        unless parsed_response.nil?
          parsed_response = DomainAvailablilityCheckResult.deserialize_object(parsed_response)
        end
        result.body = 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_domain_availability_with_http_info(identifier, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Checks if a domain is available for registration

will be added to the HTTP request.

Parameters:

  • identifier (NameIdentifier)

    Name of the domain

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



317
318
319
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 317

def check_domain_availability_with_http_info(identifier, custom_headers = nil)
  check_domain_availability_async(identifier, custom_headers).value!
end

#get_all_domains(custom_headers = nil) ⇒ DomainCollection

Lists all domains in a subscription

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



40
41
42
43
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 40

def get_all_domains(custom_headers = nil)
  response = get_all_domains_async(custom_headers).value!
  response.body unless response.nil?
end

#get_all_domains_async(custom_headers = nil) ⇒ Concurrent::Promise

Lists all domains in a subscription

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 65

def get_all_domains_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 = {}

  # 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'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        unless parsed_response.nil?
          parsed_response = DomainCollection.deserialize_object(parsed_response)
        end
        result.body = 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_with_http_info(custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all domains in a subscription

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



53
54
55
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 53

def get_all_domains_with_http_info(custom_headers = nil)
  get_all_domains_async(custom_headers).value!
end

#get_domain_control_center_sso_request(custom_headers = nil) ⇒ DomainControlCenterSsoRequest

Generates a single sign on request for domain management portal

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



126
127
128
129
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 126

def get_domain_control_center_sso_request(custom_headers = nil)
  response = get_domain_control_center_sso_request_async(custom_headers).value!
  response.body unless response.nil?
end

#get_domain_control_center_sso_request_async(custom_headers = nil) ⇒ Concurrent::Promise

Generates a single sign on request for domain management portal

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 151

def get_domain_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 = {}

  # 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'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        unless parsed_response.nil?
          parsed_response = DomainControlCenterSsoRequest.deserialize_object(parsed_response)
        end
        result.body = 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_control_center_sso_request_with_http_info(custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Generates a single sign on request for domain management portal

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



139
140
141
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 139

def get_domain_control_center_sso_request_with_http_info(custom_headers = nil)
  get_domain_control_center_sso_request_async(custom_headers).value!
end

#list_domain_recommendations(parameters, custom_headers = nil) ⇒ NameIdentifierCollection

Lists domain recommendations based on keywords

recommendation search parameters will be added to the HTTP request.

Parameters:

Returns:



403
404
405
406
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 403

def list_domain_recommendations(parameters, custom_headers = nil)
  response = list_domain_recommendations_async(parameters, custom_headers).value!
  response.body unless response.nil?
end

#list_domain_recommendations_async(parameters, custom_headers = nil) ⇒ Concurrent::Promise

Lists domain recommendations based on keywords

recommendation search parameters to the HTTP request.

Parameters:

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
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
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 432

def list_domain_recommendations_async(parameters, custom_headers = nil)
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  parameters.validate unless 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 = {}

  # 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_headers['Content-Type'] = 'application/json; charset=utf-8'
  unless parameters.nil?
    parameters = DomainRecommendationSearchParameters.serialize_object(parameters)
  end
  request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
  path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        unless parsed_response.nil?
          parsed_response = NameIdentifierCollection.deserialize_object(parsed_response)
        end
        result.body = 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

#list_domain_recommendations_with_http_info(parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Lists domain recommendations based on keywords

recommendation search parameters will be added to the HTTP request.

Parameters:

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



418
419
420
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 418

def list_domain_recommendations_with_http_info(parameters, custom_headers = nil)
  list_domain_recommendations_async(parameters, custom_headers).value!
end

#validate_domain_purchase_information(domain_registration_input, custom_headers = nil) ⇒ Object

Validates domain registration information

registration information will be added to the HTTP request.

Parameters:

  • domain_registration_input (DomainRegistrationInput)

    Domain

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



214
215
216
217
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 214

def validate_domain_purchase_information(domain_registration_input, custom_headers = nil)
  response = validate_domain_purchase_information_async(domain_registration_input, custom_headers).value!
  response.body unless response.nil?
end

#validate_domain_purchase_information_async(domain_registration_input, custom_headers = nil) ⇒ Concurrent::Promise

Validates domain registration information

registration information to the HTTP request.

Parameters:

  • domain_registration_input (DomainRegistrationInput)

    Domain

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 243

def validate_domain_purchase_information_async(domain_registration_input, custom_headers = nil)
  fail ArgumentError, 'domain_registration_input is nil' if domain_registration_input.nil?
  domain_registration_input.validate unless domain_registration_input.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 = {}

  # 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_headers['Content-Type'] = 'application/json; charset=utf-8'
  unless domain_registration_input.nil?
    domain_registration_input = DomainRegistrationInput.serialize_object(domain_registration_input)
  end
  request_content = domain_registration_input != nil ? JSON.generate(domain_registration_input, quirks_mode: true) : nil
  path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/validateDomainRegistrationInformation'
  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 || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_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(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#validate_domain_purchase_information_with_http_info(domain_registration_input, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Validates domain registration information

registration information will be added to the HTTP request.

Parameters:

  • domain_registration_input (DomainRegistrationInput)

    Domain

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



229
230
231
# File 'lib/azure_mgmt_web/global_domain_registration.rb', line 229

def validate_domain_purchase_information_with_http_info(domain_registration_input, custom_headers = nil)
  validate_domain_purchase_information_async(domain_registration_input, custom_headers).value!
end