Class: Azure::ARM::Web::ManagedHostingEnvironments

Inherits:
Object
  • Object
show all
Includes:
Models, MsRestAzure
Defined in:
lib/generated/azure_mgmt_web/managed_hosting_environments.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) ⇒ ManagedHostingEnvironments

Creates and initializes a new instance of the ManagedHostingEnvironments class.

Parameters:

  • client

    service class for accessing basic functionality.



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

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientWebSiteManagementClient (readonly)

Returns reference to the WebSiteManagementClient.

Returns:



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

def client
  @client
end

Instance Method Details

#begin_create_or_update_managed_hosting_environment(resource_group_name, name, managed_hosting_environment_envelope, custom_headers = nil) ⇒ HostingEnvironment

Create or update a managed hosting environment.

of managed hosting environment will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • managed_hosting_environment_envelope (HostingEnvironment)

    Properties

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

    A hash of custom headers that

Returns:



184
185
186
187
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 184

def begin_create_or_update_managed_hosting_environment(resource_group_name, name, managed_hosting_environment_envelope, custom_headers = nil)
  response = begin_create_or_update_managed_hosting_environment_async(resource_group_name, name, managed_hosting_environment_envelope, custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_managed_hosting_environment_async(resource_group_name, name, managed_hosting_environment_envelope, custom_headers = nil) ⇒ Concurrent::Promise

Create or update a managed hosting environment.

of managed hosting environment to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • managed_hosting_environment_envelope (HostingEnvironment)

    Properties

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
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
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 217

def begin_create_or_update_managed_hosting_environment_async(resource_group_name, name, managed_hosting_environment_envelope, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'managed_hosting_environment_envelope is nil' if managed_hosting_environment_envelope.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?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = HostingEnvironment.mapper()
  request_content = @client.serialize(request_mapper,  managed_hosting_environment_envelope, 'managed_hosting_environment_envelope')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'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, :put, 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 == 202 || status_code == 400 || status_code == 404 || status_code == 409
      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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = HostingEnvironment.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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

#begin_create_or_update_managed_hosting_environment_with_http_info(resource_group_name, name, managed_hosting_environment_envelope, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update a managed hosting environment.

of managed hosting environment will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • managed_hosting_environment_envelope (HostingEnvironment)

    Properties

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



201
202
203
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 201

def begin_create_or_update_managed_hosting_environment_with_http_info(resource_group_name, name, managed_hosting_environment_envelope, custom_headers = nil)
  begin_create_or_update_managed_hosting_environment_async(resource_group_name, name, managed_hosting_environment_envelope, custom_headers).value!
end

#begin_delete_managed_hosting_environment(resource_group_name, name, force_delete = nil, custom_headers = nil) ⇒ Object

Delete a managed hosting environment.

contains resources will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • force_delete (Boolean) (defaults to: nil)

    Delete even if the managed hosting environment

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

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



346
347
348
349
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 346

def begin_delete_managed_hosting_environment(resource_group_name, name, force_delete = nil, custom_headers = nil)
  response = begin_delete_managed_hosting_environment_async(resource_group_name, name, force_delete, custom_headers).value!
  response.body unless response.nil?
end

#begin_delete_managed_hosting_environment_async(resource_group_name, name, force_delete = nil, custom_headers = nil) ⇒ Concurrent::Promise

Delete a managed hosting environment.

contains resources to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • force_delete (Boolean) (defaults to: nil)

    Delete even if the managed hosting environment

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 379

def begin_delete_managed_hosting_environment_async(resource_group_name, name, force_delete = nil, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_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 = {}

  # 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.Web/managedHostingEnvironments/{name}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'forceDelete' => force_delete,'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, :delete, 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 == 202 || status_code == 400 || status_code == 404 || status_code == 409
      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

#begin_delete_managed_hosting_environment_with_http_info(resource_group_name, name, force_delete = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Delete a managed hosting environment.

contains resources will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • force_delete (Boolean) (defaults to: nil)

    Delete even if the managed hosting environment

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



363
364
365
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 363

def begin_delete_managed_hosting_environment_with_http_info(resource_group_name, name, force_delete = nil, custom_headers = nil)
  begin_delete_managed_hosting_environment_async(resource_group_name, name, force_delete, custom_headers).value!
end

#create_or_update_managed_hosting_environment(resource_group_name, name, managed_hosting_environment_envelope, custom_headers = nil) ⇒ HostingEnvironment

Create or update a managed hosting environment.

of managed hosting environment will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • managed_hosting_environment_envelope (HostingEnvironment)

    Properties

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

    A hash of custom headers that

Returns:



138
139
140
141
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 138

def create_or_update_managed_hosting_environment(resource_group_name, name, managed_hosting_environment_envelope, custom_headers = nil)
  response = create_or_update_managed_hosting_environment_async(resource_group_name, name, managed_hosting_environment_envelope, custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_managed_hosting_environment_async(resource_group_name, name, managed_hosting_environment_envelope, custom_headers = nil) ⇒ Concurrent::Promise

of managed hosting environment will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • managed_hosting_environment_envelope (HostingEnvironment)

    Properties

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 154

def create_or_update_managed_hosting_environment_async(resource_group_name, name, managed_hosting_environment_envelope, custom_headers = nil)
  # Send request
  promise = begin_create_or_update_managed_hosting_environment_async(resource_group_name, name, managed_hosting_environment_envelope, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = HostingEnvironment.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#delete_managed_hosting_environment(resource_group_name, name, force_delete = nil, custom_headers = nil) ⇒ Object

Delete a managed hosting environment.

contains resources will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • force_delete (Boolean) (defaults to: nil)

    Delete even if the managed hosting environment

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

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



294
295
296
297
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 294

def delete_managed_hosting_environment(resource_group_name, name, force_delete = nil, custom_headers = nil)
  response = delete_managed_hosting_environment_async(resource_group_name, name, force_delete, custom_headers).value!
  response.body unless response.nil?
end

#delete_managed_hosting_environment_async(resource_group_name, name, force_delete = nil, custom_headers = nil) ⇒ Concurrent::Promise

contains resources will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • force_delete (Boolean) (defaults to: nil)

    Delete even if the managed hosting environment

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 310

def delete_managed_hosting_environment_async(resource_group_name, name, force_delete = nil, custom_headers = nil)
  # Send request
  promise = begin_delete_managed_hosting_environment_async(resource_group_name, name, force_delete, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = {
        required: false,
        serialized_name: 'parsed_response',
        type: {
          name: 'Object'
        }
      }
      parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#get_managed_hosting_environment(resource_group_name, name, custom_headers = nil) ⇒ ManagedHostingEnvironment

Get properties of a managed hosting environment.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

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

    A hash of custom headers that

Returns:



42
43
44
45
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 42

def get_managed_hosting_environment(resource_group_name, name, custom_headers = nil)
  response = get_managed_hosting_environment_async(resource_group_name, name, custom_headers).value!
  response.body unless response.nil?
end

#get_managed_hosting_environment_async(resource_group_name, name, custom_headers = nil) ⇒ Concurrent::Promise

Get properties of a managed hosting environment.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
117
118
119
120
121
122
123
124
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 71

def get_managed_hosting_environment_async(resource_group_name, name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_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 = {}

  # 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.Web/managedHostingEnvironments/{name}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'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)
        result_mapper = ManagedHostingEnvironment.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_managed_hosting_environment_operation(resource_group_name, name, operation_id, custom_headers = nil) ⇒ Object

Get status of an operation on a managed hosting environment.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • operation_id (String)

    operation identifier GUID

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

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



640
641
642
643
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 640

def get_managed_hosting_environment_operation(resource_group_name, name, operation_id, custom_headers = nil)
  response = get_managed_hosting_environment_operation_async(resource_group_name, name, operation_id, custom_headers).value!
  response.body unless response.nil?
end

#get_managed_hosting_environment_operation_async(resource_group_name, name, operation_id, custom_headers = nil) ⇒ Concurrent::Promise

Get status of an operation on a managed hosting environment.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • operation_id (String)

    operation identifier GUID

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 671

def get_managed_hosting_environment_operation_async(resource_group_name, name, operation_id, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'operation_id is nil' if operation_id.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/operations/{operationId}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'operationId' => operation_id,'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 || status_code == 202 || status_code == 404 || status_code == 500
      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

#get_managed_hosting_environment_operation_with_http_info(resource_group_name, name, operation_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get status of an operation on a managed hosting environment.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • operation_id (String)

    operation identifier GUID

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



656
657
658
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 656

def get_managed_hosting_environment_operation_with_http_info(resource_group_name, name, operation_id, custom_headers = nil)
  get_managed_hosting_environment_operation_async(resource_group_name, name, operation_id, custom_headers).value!
end

#get_managed_hosting_environment_server_farms(resource_group_name, name, custom_headers = nil) ⇒ Array<ServerFarmWithRichSku>

Get all serverfarms (App Service Plans) on the managed hosting environment.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

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

    A hash of custom headers that

Returns:



988
989
990
991
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 988

def get_managed_hosting_environment_server_farms(resource_group_name, name, custom_headers = nil)
  first_page = get_managed_hosting_environment_server_farms_as_lazy(resource_group_name, name, custom_headers)
  first_page.get_all_items
end

#get_managed_hosting_environment_server_farms_as_lazy(resource_group_name, name, custom_headers = nil) ⇒ ServerFarmCollection

Get all serverfarms (App Service Plans) on the managed hosting environment.

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

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

    A hash of custom headers that

Returns:



967
968
969
970
971
972
973
974
975
976
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 967

def get_managed_hosting_environment_server_farms_as_lazy(resource_group_name, name, custom_headers = nil)
  response = get_managed_hosting_environment_server_farms_async(resource_group_name, name, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      get_managed_hosting_environment_server_farms_next_async(next_link, custom_headers)
    end
    page
  end
end

#get_managed_hosting_environment_server_farms_async(resource_group_name, name, custom_headers = nil) ⇒ Concurrent::Promise

Get all serverfarms (App Service Plans) on the managed hosting environment.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 1017

def get_managed_hosting_environment_server_farms_async(resource_group_name, name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_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 = {}

  # 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.Web/managedHostingEnvironments/{name}/serverfarms'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'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)
        result_mapper = ServerFarmCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_managed_hosting_environment_server_farms_next(next_page_link, custom_headers = nil) ⇒ ServerFarmCollection

Get all serverfarms (App Service Plans) on the managed hosting environment.

call to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:



1352
1353
1354
1355
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 1352

def get_managed_hosting_environment_server_farms_next(next_page_link, custom_headers = nil)
  response = get_managed_hosting_environment_server_farms_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#get_managed_hosting_environment_server_farms_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Get all serverfarms (App Service Plans) on the managed hosting environment.

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 1381

def get_managed_hosting_environment_server_farms_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.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 = '{nextLink}'
  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 || {})
  }

  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)
        result_mapper = ServerFarmCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_managed_hosting_environment_server_farms_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get all serverfarms (App Service Plans) on the managed hosting environment.

call to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1367
1368
1369
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 1367

def get_managed_hosting_environment_server_farms_next_with_http_info(next_page_link, custom_headers = nil)
  get_managed_hosting_environment_server_farms_next_async(next_page_link, custom_headers).value!
end

#get_managed_hosting_environment_server_farms_with_http_info(resource_group_name, name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get all serverfarms (App Service Plans) on the managed hosting environment.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1003
1004
1005
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 1003

def get_managed_hosting_environment_server_farms_with_http_info(resource_group_name, name, custom_headers = nil)
  get_managed_hosting_environment_server_farms_async(resource_group_name, name, custom_headers).value!
end

#get_managed_hosting_environment_sites(resource_group_name, name, properties_to_include = nil, custom_headers = nil) ⇒ Array<Site>

Get all sites on the managed hosting environment.

properties to include will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • properties_to_include (String) (defaults to: nil)

    Comma separated list of site

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

    A hash of custom headers that

Returns:

  • (Array<Site>)

    operation results.



752
753
754
755
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 752

def get_managed_hosting_environment_sites(resource_group_name, name, properties_to_include = nil, custom_headers = nil)
  first_page = get_managed_hosting_environment_sites_as_lazy(resource_group_name, name, properties_to_include, custom_headers)
  first_page.get_all_items
end

#get_managed_hosting_environment_sites_as_lazy(resource_group_name, name, properties_to_include = nil, custom_headers = nil) ⇒ SiteCollection

Get all sites on the managed hosting environment.

properties to include will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • properties_to_include (String) (defaults to: nil)

    Comma separated list of site

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

    A hash of custom headers that

Returns:

  • (SiteCollection)

    which provide lazy access to pages of the response.



729
730
731
732
733
734
735
736
737
738
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 729

def get_managed_hosting_environment_sites_as_lazy(resource_group_name, name, properties_to_include = nil, custom_headers = nil)
  response = get_managed_hosting_environment_sites_async(resource_group_name, name, properties_to_include, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      get_managed_hosting_environment_sites_next_async(next_link, custom_headers)
    end
    page
  end
end

#get_managed_hosting_environment_sites_async(resource_group_name, name, properties_to_include = nil, custom_headers = nil) ⇒ Concurrent::Promise

Get all sites on the managed hosting environment.

properties to include to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • properties_to_include (String) (defaults to: nil)

    Comma separated list of site

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 785

def get_managed_hosting_environment_sites_async(resource_group_name, name, properties_to_include = nil, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_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 = {}

  # 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.Web/managedHostingEnvironments/{name}/sites'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'propertiesToInclude' => properties_to_include,'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)
        result_mapper = SiteCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_managed_hosting_environment_sites_next(next_page_link, custom_headers = nil) ⇒ SiteCollection

Get all sites on the managed hosting environment.

call to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:



1172
1173
1174
1175
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 1172

def get_managed_hosting_environment_sites_next(next_page_link, custom_headers = nil)
  response = get_managed_hosting_environment_sites_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#get_managed_hosting_environment_sites_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Get all sites on the managed hosting environment.

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 1201

def get_managed_hosting_environment_sites_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.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 = '{nextLink}'
  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 || {})
  }

  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)
        result_mapper = SiteCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_managed_hosting_environment_sites_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get all sites on the managed hosting environment.

call to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1187
1188
1189
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 1187

def get_managed_hosting_environment_sites_next_with_http_info(next_page_link, custom_headers = nil)
  get_managed_hosting_environment_sites_next_async(next_page_link, custom_headers).value!
end

#get_managed_hosting_environment_sites_with_http_info(resource_group_name, name, properties_to_include = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get all sites on the managed hosting environment.

properties to include will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • properties_to_include (String) (defaults to: nil)

    Comma separated list of site

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



769
770
771
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 769

def get_managed_hosting_environment_sites_with_http_info(resource_group_name, name, properties_to_include = nil, custom_headers = nil)
  get_managed_hosting_environment_sites_async(resource_group_name, name, properties_to_include, custom_headers).value!
end

#get_managed_hosting_environment_vips(resource_group_name, name, custom_headers = nil) ⇒ AddressResponse

Get list of ip addresses assigned to a managed hosting environment

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

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

    A hash of custom headers that

Returns:



545
546
547
548
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 545

def get_managed_hosting_environment_vips(resource_group_name, name, custom_headers = nil)
  response = get_managed_hosting_environment_vips_async(resource_group_name, name, custom_headers).value!
  response.body unless response.nil?
end

#get_managed_hosting_environment_vips_async(resource_group_name, name, custom_headers = nil) ⇒ Concurrent::Promise

Get list of ip addresses assigned to a managed hosting environment

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 574

def get_managed_hosting_environment_vips_async(resource_group_name, name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_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 = {}

  # 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.Web/managedHostingEnvironments/{name}/capacities/virtualip'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'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)
        result_mapper = AddressResponse.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_managed_hosting_environment_vips_with_http_info(resource_group_name, name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get list of ip addresses assigned to a managed hosting environment

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



560
561
562
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 560

def get_managed_hosting_environment_vips_with_http_info(resource_group_name, name, custom_headers = nil)
  get_managed_hosting_environment_vips_async(resource_group_name, name, custom_headers).value!
end

#get_managed_hosting_environment_web_hosting_plans(resource_group_name, name, custom_headers = nil) ⇒ Array<ServerFarmWithRichSku>

Get all serverfarms (App Service Plans) on the managed hosting environment.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

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

    A hash of custom headers that

Returns:



872
873
874
875
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 872

def get_managed_hosting_environment_web_hosting_plans(resource_group_name, name, custom_headers = nil)
  first_page = get_managed_hosting_environment_web_hosting_plans_as_lazy(resource_group_name, name, custom_headers)
  first_page.get_all_items
end

#get_managed_hosting_environment_web_hosting_plans_as_lazy(resource_group_name, name, custom_headers = nil) ⇒ ServerFarmCollection

Get all serverfarms (App Service Plans) on the managed hosting environment.

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

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

    A hash of custom headers that

Returns:



851
852
853
854
855
856
857
858
859
860
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 851

def get_managed_hosting_environment_web_hosting_plans_as_lazy(resource_group_name, name, custom_headers = nil)
  response = get_managed_hosting_environment_web_hosting_plans_async(resource_group_name, name, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      get_managed_hosting_environment_web_hosting_plans_next_async(next_link, custom_headers)
    end
    page
  end
end

#get_managed_hosting_environment_web_hosting_plans_async(resource_group_name, name, custom_headers = nil) ⇒ Concurrent::Promise

Get all serverfarms (App Service Plans) on the managed hosting environment.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 901

def get_managed_hosting_environment_web_hosting_plans_async(resource_group_name, name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_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 = {}

  # 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.Web/managedHostingEnvironments/{name}/webhostingplans'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'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)
        result_mapper = ServerFarmCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_managed_hosting_environment_web_hosting_plans_next(next_page_link, custom_headers = nil) ⇒ ServerFarmCollection

Get all serverfarms (App Service Plans) on the managed hosting environment.

call to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:



1262
1263
1264
1265
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 1262

def get_managed_hosting_environment_web_hosting_plans_next(next_page_link, custom_headers = nil)
  response = get_managed_hosting_environment_web_hosting_plans_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#get_managed_hosting_environment_web_hosting_plans_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Get all serverfarms (App Service Plans) on the managed hosting environment.

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 1291

def get_managed_hosting_environment_web_hosting_plans_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.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 = '{nextLink}'
  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 || {})
  }

  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)
        result_mapper = ServerFarmCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_managed_hosting_environment_web_hosting_plans_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get all serverfarms (App Service Plans) on the managed hosting environment.

call to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1277
1278
1279
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 1277

def get_managed_hosting_environment_web_hosting_plans_next_with_http_info(next_page_link, custom_headers = nil)
  get_managed_hosting_environment_web_hosting_plans_next_async(next_page_link, custom_headers).value!
end

#get_managed_hosting_environment_web_hosting_plans_with_http_info(resource_group_name, name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get all serverfarms (App Service Plans) on the managed hosting environment.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



887
888
889
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 887

def get_managed_hosting_environment_web_hosting_plans_with_http_info(resource_group_name, name, custom_headers = nil)
  get_managed_hosting_environment_web_hosting_plans_async(resource_group_name, name, custom_headers).value!
end

#get_managed_hosting_environment_with_http_info(resource_group_name, name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get properties of a managed hosting environment.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of managed hosting environment

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



57
58
59
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 57

def get_managed_hosting_environment_with_http_info(resource_group_name, name, custom_headers = nil)
  get_managed_hosting_environment_async(resource_group_name, name, custom_headers).value!
end

#get_managed_hosting_environments(resource_group_name, custom_headers = nil) ⇒ Array<HostingEnvironment>

Get all managed hosting environments in a resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

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

    A hash of custom headers that

Returns:



454
455
456
457
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 454

def get_managed_hosting_environments(resource_group_name, custom_headers = nil)
  first_page = get_managed_hosting_environments_as_lazy(resource_group_name, custom_headers)
  first_page.get_all_items
end

#get_managed_hosting_environments_as_lazy(resource_group_name, custom_headers = nil) ⇒ HostingEnvironmentCollection

Get all managed hosting environments in a resource group.

will be added to the HTTP request.

the response.

Parameters:

  • resource_group_name (String)

    Name of resource group

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

    A hash of custom headers that

Returns:



434
435
436
437
438
439
440
441
442
443
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 434

def get_managed_hosting_environments_as_lazy(resource_group_name, custom_headers = nil)
  response = get_managed_hosting_environments_async(resource_group_name, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      get_managed_hosting_environments_next_async(next_link, custom_headers)
    end
    page
  end
end

#get_managed_hosting_environments_async(resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Get all managed hosting environments in a resource group.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 481

def get_managed_hosting_environments_async(resource_group_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_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 = {}

  # 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.Web/managedHostingEnvironments'
  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 || {})
  }

  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)
        result_mapper = HostingEnvironmentCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_managed_hosting_environments_next(next_page_link, custom_headers = nil) ⇒ HostingEnvironmentCollection

Get all managed hosting environments in a resource group.

call to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:



1082
1083
1084
1085
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 1082

def get_managed_hosting_environments_next(next_page_link, custom_headers = nil)
  response = get_managed_hosting_environments_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#get_managed_hosting_environments_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Get all managed hosting environments in a resource group.

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 1111

def get_managed_hosting_environments_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.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 = '{nextLink}'
  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 || {})
  }

  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)
        result_mapper = HostingEnvironmentCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_managed_hosting_environments_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get all managed hosting environments in a resource group.

call to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1097
1098
1099
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 1097

def get_managed_hosting_environments_next_with_http_info(next_page_link, custom_headers = nil)
  get_managed_hosting_environments_next_async(next_page_link, custom_headers).value!
end

#get_managed_hosting_environments_with_http_info(resource_group_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get all managed hosting environments in a resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



468
469
470
# File 'lib/generated/azure_mgmt_web/managed_hosting_environments.rb', line 468

def get_managed_hosting_environments_with_http_info(resource_group_name, custom_headers = nil)
  get_managed_hosting_environments_async(resource_group_name, custom_headers).value!
end