Class: Azure::Web::Mgmt::V2018_02_01::AppServicePlans

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb

Overview

WebSite Management Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ AppServicePlans

Creates and initializes a new instance of the AppServicePlans class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientWebSiteManagementClient (readonly)

Returns reference to the WebSiteManagementClient.

Returns:



22
23
24
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 22

def client
  @client
end

Instance Method Details

#begin_create_or_update(resource_group_name, name, app_service_plan, custom_headers: nil) ⇒ AppServicePlan

Creates or updates an App Service Plan.

Creates or updates an App Service Plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • app_service_plan (AppServicePlan)

    Details of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (AppServicePlan)

    operation results.



3280
3281
3282
3283
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3280

def begin_create_or_update(resource_group_name, name, app_service_plan, custom_headers:nil)
  response = begin_create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_async(resource_group_name, name, app_service_plan, custom_headers: nil) ⇒ Concurrent::Promise

Creates or updates an App Service Plan.

Creates or updates an App Service Plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • app_service_plan (AppServicePlan)

    Details of the App Service plan.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3317

def begin_create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'app_service_plan is nil' if app_service_plan.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlan.mapper()
  request_content = @client.serialize(request_mapper,  app_service_plan)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlan.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlan.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_create_or_update_with_http_info(resource_group_name, name, app_service_plan, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates an App Service Plan.

Creates or updates an App Service Plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • app_service_plan (AppServicePlan)

    Details of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3299
3300
3301
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3299

def begin_create_or_update_with_http_info(resource_group_name, name, app_service_plan, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers).value!
end

#create_or_update(resource_group_name, name, app_service_plan, custom_headers: nil) ⇒ AppServicePlan

Creates or updates an App Service Plan.

Creates or updates an App Service Plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • app_service_plan (AppServicePlan)

    Details of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (AppServicePlan)

    operation results.



350
351
352
353
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 350

def create_or_update(resource_group_name, name, app_service_plan, custom_headers:nil)
  response = create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(resource_group_name, name, app_service_plan, custom_headers: nil) ⇒ Concurrent::Promise

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • app_service_plan (AppServicePlan)

    Details of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 366

def create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlan.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

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

  promise
end

#create_or_update_vnet_route(resource_group_name, name, vnet_name, route_name, route, custom_headers: nil) ⇒ VnetRoute

Create or update a Virtual Network route in an App Service plan.

Create or update a Virtual Network route in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • route_name (String)

    Name of the Virtual Network route.

  • route (VnetRoute)

    Definition of the Virtual Network route.

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

    A hash of custom headers that

Returns:

  • (VnetRoute)

    operation results.



2827
2828
2829
2830
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2827

def create_or_update_vnet_route(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
  response = create_or_update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers: nil) ⇒ Concurrent::Promise

Create or update a Virtual Network route in an App Service plan.

Create or update a Virtual Network route in an App Service plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • route_name (String)

    Name of the Virtual Network route.

  • route (VnetRoute)

    Definition of the Virtual Network route.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2868

def create_or_update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
  fail ArgumentError, 'route_name is nil' if route_name.nil?
  fail ArgumentError, 'route is nil' if route.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetRoute.mapper()
  request_content = @client.serialize(request_mapper,  route)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 400 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetRoute.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#create_or_update_vnet_route_with_http_info(resource_group_name, name, vnet_name, route_name, route, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update a Virtual Network route in an App Service plan.

Create or update a Virtual Network route in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • route_name (String)

    Name of the Virtual Network route.

  • route (VnetRoute)

    Definition of the Virtual Network route.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2848
2849
2850
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2848

def create_or_update_vnet_route_with_http_info(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
  create_or_update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:custom_headers).value!
end

#delete(resource_group_name, name, custom_headers: nil) ⇒ Object

Delete an App Service plan.

Delete an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that



396
397
398
399
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 396

def delete(resource_group_name, name, custom_headers:nil)
  response = delete_async(resource_group_name, name, custom_headers:custom_headers).value!
  nil
end

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

Delete an App Service plan.

Delete an App Service plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



431
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
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 431

def delete_async(resource_group_name, name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#delete_hybrid_connection(resource_group_name, name, namespace_name, relay_name, custom_headers: nil) ⇒ Object

Delete a Hybrid Connection in use in an App Service plan.

Delete a Hybrid Connection in use in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • namespace_name (String)

    Name of the Service Bus namespace.

  • relay_name (String)

    Name of the Service Bus relay.

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

    A hash of custom headers that



859
860
861
862
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 859

def delete_hybrid_connection(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  response = delete_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
  nil
end

#delete_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers: nil) ⇒ Concurrent::Promise

Delete a Hybrid Connection in use in an App Service plan.

Delete a Hybrid Connection in use in an App Service plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • namespace_name (String)

    Name of the Service Bus namespace.

  • relay_name (String)

    Name of the Service Bus relay.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



898
899
900
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
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 898

def delete_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'relay_name is nil' if relay_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'namespaceName' => namespace_name,'relayName' => relay_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#delete_hybrid_connection_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Delete a Hybrid Connection in use in an App Service plan.

Delete a Hybrid Connection in use in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • namespace_name (String)

    Name of the Service Bus namespace.

  • relay_name (String)

    Name of the Service Bus relay.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



879
880
881
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 879

def delete_hybrid_connection_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  delete_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
end

#delete_vnet_route(resource_group_name, name, vnet_name, route_name, custom_headers: nil) ⇒ Object

Delete a Virtual Network route in an App Service plan.

Delete a Virtual Network route in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • route_name (String)

    Name of the Virtual Network route.

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

    A hash of custom headers that



2950
2951
2952
2953
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2950

def delete_vnet_route(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
  response = delete_vnet_route_async(resource_group_name, name, vnet_name, route_name, custom_headers:custom_headers).value!
  nil
end

#delete_vnet_route_async(resource_group_name, name, vnet_name, route_name, custom_headers: nil) ⇒ Concurrent::Promise

Delete a Virtual Network route in an App Service plan.

Delete a Virtual Network route in an App Service plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • route_name (String)

    Name of the Virtual Network route.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2989

def delete_vnet_route_async(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
  fail ArgumentError, 'route_name is nil' if route_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#delete_vnet_route_with_http_info(resource_group_name, name, vnet_name, route_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Delete a Virtual Network route in an App Service plan.

Delete a Virtual Network route in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • route_name (String)

    Name of the Virtual Network route.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2970
2971
2972
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2970

def delete_vnet_route_with_http_info(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
  delete_vnet_route_async(resource_group_name, name, vnet_name, route_name, custom_headers:custom_headers).value!
end

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

Delete an App Service plan.

Delete an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



414
415
416
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 414

def delete_with_http_info(resource_group_name, name, custom_headers:nil)
  delete_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#get(resource_group_name, name, custom_headers: nil) ⇒ AppServicePlan

Get an App Service plan.

Get an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (AppServicePlan)

    operation results.



243
244
245
246
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 243

def get(resource_group_name, name, custom_headers:nil)
  response = get_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Get an App Service plan.

Get an App Service plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 278

def get_async(resource_group_name, name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlan.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_hybrid_connection(resource_group_name, name, namespace_name, relay_name, custom_headers: nil) ⇒ HybridConnection

Retrieve a Hybrid Connection in use in an App Service plan.

Retrieve a Hybrid Connection in use in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • namespace_name (String)

    Name of the Service Bus namespace.

  • relay_name (String)

    Name of the Service Bus relay.

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

    A hash of custom headers that

Returns:

  • (HybridConnection)

    operation results.



746
747
748
749
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 746

def get_hybrid_connection(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  response = get_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers: nil) ⇒ Concurrent::Promise

Retrieve a Hybrid Connection in use in an App Service plan.

Retrieve a Hybrid Connection in use in an App Service plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • namespace_name (String)

    Name of the Service Bus namespace.

  • relay_name (String)

    Name of the Service Bus relay.

  • 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
839
840
841
842
843
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 785

def get_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'relay_name is nil' if relay_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'namespaceName' => namespace_name,'relayName' => relay_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::HybridConnection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_hybrid_connection_plan_limit(resource_group_name, name, custom_headers: nil) ⇒ HybridConnectionLimits

Get the maximum number of Hybrid Connections allowed in an App Service plan.

Get the maximum number of Hybrid Connections allowed in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (HybridConnectionLimits)

    operation results.



1189
1190
1191
1192
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1189

def get_hybrid_connection_plan_limit(resource_group_name, name, custom_headers:nil)
  response = get_hybrid_connection_plan_limit_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Get the maximum number of Hybrid Connections allowed in an App Service plan.

Get the maximum number of Hybrid Connections allowed in an App Service plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1224

def get_hybrid_connection_plan_limit_async(resource_group_name, name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionPlanLimits/limit'

  request_url = @base_url || @client.base_url

  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 || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::HybridConnectionLimits.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

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

Get the maximum number of Hybrid Connections allowed in an App Service plan.

Get the maximum number of Hybrid Connections allowed in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1207
1208
1209
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1207

def get_hybrid_connection_plan_limit_with_http_info(resource_group_name, name, custom_headers:nil)
  get_hybrid_connection_plan_limit_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#get_hybrid_connection_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Retrieve a Hybrid Connection in use in an App Service plan.

Retrieve a Hybrid Connection in use in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • namespace_name (String)

    Name of the Service Bus namespace.

  • relay_name (String)

    Name of the Service Bus relay.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



766
767
768
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 766

def get_hybrid_connection_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  get_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
end

#get_route_for_vnet(resource_group_name, name, vnet_name, route_name, custom_headers: nil) ⇒ Array

Get a Virtual Network route in an App Service plan.

Get a Virtual Network route in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • route_name (String)

    Name of the Virtual Network route.

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

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



2696
2697
2698
2699
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2696

def get_route_for_vnet(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
  response = get_route_for_vnet_async(resource_group_name, name, vnet_name, route_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_route_for_vnet_async(resource_group_name, name, vnet_name, route_name, custom_headers: nil) ⇒ Concurrent::Promise

Get a Virtual Network route in an App Service plan.

Get a Virtual Network route in an App Service plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • route_name (String)

    Name of the Virtual Network route.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2735

def get_route_for_vnet_async(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
  fail ArgumentError, 'route_name is nil' if route_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'VnetRouteElementType',
                type: {
                  name: 'Composite',
                  class_name: 'VnetRoute'
                }
            }
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_route_for_vnet_with_http_info(resource_group_name, name, vnet_name, route_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get a Virtual Network route in an App Service plan.

Get a Virtual Network route in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • route_name (String)

    Name of the Virtual Network route.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2716
2717
2718
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2716

def get_route_for_vnet_with_http_info(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
  get_route_for_vnet_async(resource_group_name, name, vnet_name, route_name, custom_headers:custom_headers).value!
end

#get_server_farm_skus(resource_group_name, name, custom_headers: nil) ⇒ Object

Gets all selectable sku’s for a given App Service Plan

Gets all selectable sku’s for a given App Service Plan

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of App Service Plan

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

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



1873
1874
1875
1876
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1873

def get_server_farm_skus(resource_group_name, name, custom_headers:nil)
  response = get_server_farm_skus_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Gets all selectable sku’s for a given App Service Plan

Gets all selectable sku’s for a given App Service Plan

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of App Service Plan

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1908

def get_server_farm_skus_async(resource_group_name, name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/skus'

  request_url = @base_url || @client.base_url

  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 || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

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

Gets all selectable sku’s for a given App Service Plan

Gets all selectable sku’s for a given App Service Plan

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of App Service Plan

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1891
1892
1893
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1891

def get_server_farm_skus_with_http_info(resource_group_name, name, custom_headers:nil)
  get_server_farm_skus_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#get_vnet_from_server_farm(resource_group_name, name, vnet_name, custom_headers: nil) ⇒ VnetInfo

Get a Virtual Network associated with an App Service plan.

Get a Virtual Network associated with an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

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

    A hash of custom headers that

Returns:

  • (VnetInfo)

    operation results.



2208
2209
2210
2211
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2208

def get_vnet_from_server_farm(resource_group_name, name, vnet_name, custom_headers:nil)
  response = get_vnet_from_server_farm_async(resource_group_name, name, vnet_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_vnet_from_server_farm_async(resource_group_name, name, vnet_name, custom_headers: nil) ⇒ Concurrent::Promise

Get a Virtual Network associated with an App Service plan.

Get a Virtual Network associated with an App Service plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2245

def get_vnet_from_server_farm_async(resource_group_name, name, vnet_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetInfo.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_vnet_from_server_farm_with_http_info(resource_group_name, name, vnet_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get a Virtual Network associated with an App Service plan.

Get a Virtual Network associated with an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2227
2228
2229
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2227

def get_vnet_from_server_farm_with_http_info(resource_group_name, name, vnet_name, custom_headers:nil)
  get_vnet_from_server_farm_async(resource_group_name, name, vnet_name, custom_headers:custom_headers).value!
end

#get_vnet_gateway(resource_group_name, name, vnet_name, gateway_name, custom_headers: nil) ⇒ VnetGateway

Get a Virtual Network gateway.

Get a Virtual Network gateway.

resource belongs. is supported. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • gateway_name (String)

    Name of the gateway. Only the ‘primary’ gateway

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

    A hash of custom headers that

Returns:

  • (VnetGateway)

    operation results.



2320
2321
2322
2323
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2320

def get_vnet_gateway(resource_group_name, name, vnet_name, gateway_name, custom_headers:nil)
  response = get_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, custom_headers: nil) ⇒ Concurrent::Promise

Get a Virtual Network gateway.

Get a Virtual Network gateway.

resource belongs. is supported. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • gateway_name (String)

    Name of the gateway. Only the ‘primary’ gateway

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2361

def get_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'gatewayName' => gateway_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetGateway.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_vnet_gateway_with_http_info(resource_group_name, name, vnet_name, gateway_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get a Virtual Network gateway.

Get a Virtual Network gateway.

resource belongs. is supported. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • gateway_name (String)

    Name of the gateway. Only the ‘primary’ gateway

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2341
2342
2343
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2341

def get_vnet_gateway_with_http_info(resource_group_name, name, vnet_name, gateway_name, custom_headers:nil)
  get_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, custom_headers:custom_headers).value!
end

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

Get an App Service plan.

Get an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



261
262
263
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 261

def get_with_http_info(resource_group_name, name, custom_headers:nil)
  get_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#list(detailed: nil, custom_headers: nil) ⇒ Array<AppServicePlan>

Get all App Service plans for a subcription.

Get all App Service plans for a subcription.

plan properties. The default is false, which returns a subset of the properties. Retrieval of all properties may increase the API latency. will be added to the HTTP request.

Parameters:

  • detailed (Boolean) (defaults to: nil)

    Specify true to return all App Service

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

    A hash of custom headers that

Returns:

  • (Array<AppServicePlan>)

    operation results.



38
39
40
41
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 38

def list(detailed:nil, custom_headers:nil)
  first_page = list_as_lazy(detailed:detailed, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_as_lazy(detailed: nil, custom_headers: nil) ⇒ AppServicePlanCollection

Get all App Service plans for a subcription.

Get all App Service plans for a subcription.

plan properties. The default is false, which returns a subset of the properties. Retrieval of all properties may increase the API latency. will be added to the HTTP request.

response.

Parameters:

  • detailed (Boolean) (defaults to: nil)

    Specify true to return all App Service

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

    A hash of custom headers that

Returns:

  • (AppServicePlanCollection)

    which provide lazy access to pages of the



4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 4182

def list_as_lazy(detailed:nil, custom_headers:nil)
  response = list_async(detailed:detailed, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_async(detailed: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get all App Service plans for a subcription.

Get all App Service plans for a subcription.

plan properties. The default is false, which returns a subset of the properties. Retrieval of all properties may increase the API latency. to the HTTP request.

Parameters:

  • detailed (Boolean) (defaults to: nil)

    Specify true to return all App Service

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
125
126
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 75

def list_async(detailed:nil, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'detailed' => detailed,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlanCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group(resource_group_name, custom_headers: nil) ⇒ Array<AppServicePlan>

Get all App Service plans in a resource group.

Get all App Service plans in a resource group.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

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

    A hash of custom headers that

Returns:

  • (Array<AppServicePlan>)

    operation results.



140
141
142
143
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 140

def list_by_resource_group(resource_group_name, custom_headers:nil)
  first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_resource_group_as_lazy(resource_group_name, custom_headers: nil) ⇒ AppServicePlanCollection

Get all App Service plans in a resource group.

Get all App Service plans in a resource group.

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

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

    A hash of custom headers that

Returns:

  • (AppServicePlanCollection)

    which provide lazy access to pages of the



4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 4206

def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_resource_group_async(resource_group_name, custom_headers: nil) ⇒ Concurrent::Promise

Get all App Service plans in a resource group.

Get all App Service plans in a resource group.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 173

def list_by_resource_group_async(resource_group_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlanCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group_next(next_page_link, custom_headers: nil) ⇒ AppServicePlanCollection

Get all App Service plans in a resource group.

Get all App Service plans in a resource group.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (AppServicePlanCollection)

    operation results.



3501
3502
3503
3504
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3501

def list_by_resource_group_next(next_page_link, custom_headers:nil)
  response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_resource_group_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get all App Service plans in a resource group.

Get all App Service plans in a resource group.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3534

def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlanCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all App Service plans in a resource group.

Get all App Service plans in a resource group.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3518
3519
3520
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3518

def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_resource_group_with_http_info(resource_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all App Service plans in a resource group.

Get all App Service plans in a resource group.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



157
158
159
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 157

def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
end

#list_capabilities(resource_group_name, name, custom_headers: nil) ⇒ Array

List all capabilities of an App Service plan.

List all capabilities of an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



622
623
624
625
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 622

def list_capabilities(resource_group_name, name, custom_headers:nil)
  response = list_capabilities_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

List all capabilities of an App Service plan.

List all capabilities of an App Service plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



657
658
659
660
661
662
663
664
665
666
667
668
669
670
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
716
717
718
719
720
721
722
723
724
725
726
727
728
729
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 657

def list_capabilities_async(resource_group_name, name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/capabilities'

  request_url = @base_url || @client.base_url

  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 || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'CapabilityElementType',
                type: {
                  name: 'Composite',
                  class_name: 'Capability'
                }
            }
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

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

List all capabilities of an App Service plan.

List all capabilities of an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



640
641
642
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 640

def list_capabilities_with_http_info(resource_group_name, name, custom_headers:nil)
  list_capabilities_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#list_hybrid_connection_keys(resource_group_name, name, namespace_name, relay_name, custom_headers: nil) ⇒ HybridConnectionKey

Get the send key name and value of a Hybrid Connection.

Get the send key name and value of a Hybrid Connection.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • namespace_name (String)

    The name of the Service Bus namespace.

  • relay_name (String)

    The name of the Service Bus relay.

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

    A hash of custom headers that

Returns:

  • (HybridConnectionKey)

    operation results.



963
964
965
966
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 963

def list_hybrid_connection_keys(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  response = list_hybrid_connection_keys_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_hybrid_connection_keys_async(resource_group_name, name, namespace_name, relay_name, custom_headers: nil) ⇒ Concurrent::Promise

Get the send key name and value of a Hybrid Connection.

Get the send key name and value of a Hybrid Connection.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • namespace_name (String)

    The name of the Service Bus namespace.

  • relay_name (String)

    The name of the Service Bus relay.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
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
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1002

def list_hybrid_connection_keys_async(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'relay_name is nil' if relay_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'namespaceName' => namespace_name,'relayName' => relay_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::HybridConnectionKey.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_hybrid_connection_keys_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get the send key name and value of a Hybrid Connection.

Get the send key name and value of a Hybrid Connection.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • namespace_name (String)

    The name of the Service Bus namespace.

  • relay_name (String)

    The name of the Service Bus relay.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



983
984
985
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 983

def list_hybrid_connection_keys_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  list_hybrid_connection_keys_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
end

#list_hybrid_connections(resource_group_name, name, custom_headers: nil) ⇒ Array<HybridConnection>

Retrieve all Hybrid Connections in use in an App Service plan.

Retrieve all Hybrid Connections in use in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (Array<HybridConnection>)

    operation results.



1295
1296
1297
1298
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1295

def list_hybrid_connections(resource_group_name, name, custom_headers:nil)
  first_page = list_hybrid_connections_as_lazy(resource_group_name, name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_hybrid_connections_as_lazy(resource_group_name, name, custom_headers: nil) ⇒ HybridConnectionCollection

Retrieve all Hybrid Connections in use in an App Service plan.

Retrieve all Hybrid Connections in use in an App Service plan.

resource belongs. will be added to the HTTP request.

the response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (HybridConnectionCollection)

    which provide lazy access to pages of



4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 4258

def list_hybrid_connections_as_lazy(resource_group_name, name, custom_headers:nil)
  response = list_hybrid_connections_async(resource_group_name, name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_hybrid_connections_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Retrieve all Hybrid Connections in use in an App Service plan.

Retrieve all Hybrid Connections in use in an App Service plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1330

def list_hybrid_connections_async(resource_group_name, name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionRelays'

  request_url = @base_url || @client.base_url

  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 || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::HybridConnectionCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_hybrid_connections_next(next_page_link, custom_headers: nil) ⇒ HybridConnectionCollection

Retrieve all Hybrid Connections in use in an App Service plan.

Retrieve all Hybrid Connections in use in an App Service plan.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (HybridConnectionCollection)

    operation results.



3693
3694
3695
3696
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3693

def list_hybrid_connections_next(next_page_link, custom_headers:nil)
  response = list_hybrid_connections_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_hybrid_connections_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Retrieve all Hybrid Connections in use in an App Service plan.

Retrieve all Hybrid Connections in use in an App Service plan.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3726

def list_hybrid_connections_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::HybridConnectionCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_hybrid_connections_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Retrieve all Hybrid Connections in use in an App Service plan.

Retrieve all Hybrid Connections in use in an App Service plan.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3710
3711
3712
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3710

def list_hybrid_connections_next_with_http_info(next_page_link, custom_headers:nil)
  list_hybrid_connections_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Retrieve all Hybrid Connections in use in an App Service plan.

Retrieve all Hybrid Connections in use in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1313
1314
1315
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1313

def list_hybrid_connections_with_http_info(resource_group_name, name, custom_headers:nil)
  list_hybrid_connections_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#list_metric_defintions(resource_group_name, name, custom_headers: nil) ⇒ Array<ResourceMetricDefinition>

Get metrics that can be queried for an App Service plan, and their definitions.

Get metrics that can be queried for an App Service plan, and their definitions.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (Array<ResourceMetricDefinition>)

    operation results.



1403
1404
1405
1406
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1403

def list_metric_defintions(resource_group_name, name, custom_headers:nil)
  first_page = list_metric_defintions_as_lazy(resource_group_name, name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_metric_defintions_as_lazy(resource_group_name, name, custom_headers: nil) ⇒ ResourceMetricDefinitionCollection

Get metrics that can be queried for an App Service plan, and their definitions.

Get metrics that can be queried for an App Service plan, and their definitions.

resource belongs. will be added to the HTTP request.

pages of the response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (ResourceMetricDefinitionCollection)

    which provide lazy access to



4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 4285

def list_metric_defintions_as_lazy(resource_group_name, name, custom_headers:nil)
  response = list_metric_defintions_async(resource_group_name, name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_metric_defintions_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Get metrics that can be queried for an App Service plan, and their definitions.

Get metrics that can be queried for an App Service plan, and their definitions.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1442

def list_metric_defintions_async(resource_group_name, name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metricdefinitions'

  request_url = @base_url || @client.base_url

  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 || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::ResourceMetricDefinitionCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_metric_defintions_next(next_page_link, custom_headers: nil) ⇒ ResourceMetricDefinitionCollection

Get metrics that can be queried for an App Service plan, and their definitions.

Get metrics that can be queried for an App Service plan, and their definitions.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ResourceMetricDefinitionCollection)

    operation results.



3791
3792
3793
3794
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3791

def list_metric_defintions_next(next_page_link, custom_headers:nil)
  response = list_metric_defintions_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_metric_defintions_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get metrics that can be queried for an App Service plan, and their definitions.

Get metrics that can be queried for an App Service plan, and their definitions.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3828

def list_metric_defintions_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::ResourceMetricDefinitionCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_metric_defintions_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get metrics that can be queried for an App Service plan, and their definitions.

Get metrics that can be queried for an App Service plan, and their definitions.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3810
3811
3812
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3810

def list_metric_defintions_next_with_http_info(next_page_link, custom_headers:nil)
  list_metric_defintions_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Get metrics that can be queried for an App Service plan, and their definitions.

Get metrics that can be queried for an App Service plan, and their definitions.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1423
1424
1425
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1423

def list_metric_defintions_with_http_info(resource_group_name, name, custom_headers:nil)
  list_metric_defintions_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#list_metrics(resource_group_name, name, details: nil, filter: nil, custom_headers: nil) ⇒ Array<ResourceMetric>

Get metrics for an App Serice plan.

Get metrics for an App Serice plan.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration’‘. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (Array<ResourceMetric>)

    operation results.



1519
1520
1521
1522
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1519

def list_metrics(resource_group_name, name, details:nil, filter:nil, custom_headers:nil)
  first_page = list_metrics_as_lazy(resource_group_name, name, details:details, filter:filter, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_metrics_as_lazy(resource_group_name, name, details: nil, filter: nil, custom_headers: nil) ⇒ ResourceMetricCollection

Get metrics for an App Serice plan.

Get metrics for an App Serice plan.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration’‘. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (ResourceMetricCollection)

    which provide lazy access to pages of the



4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 4316

def list_metrics_as_lazy(resource_group_name, name, details:nil, filter:nil, custom_headers:nil)
  response = list_metrics_async(resource_group_name, name, details:details, filter:filter, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_metrics_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_metrics_async(resource_group_name, name, details: nil, filter: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get metrics for an App Serice plan.

Get metrics for an App Serice plan.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration’‘. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1566

def list_metrics_async(resource_group_name, name, details:nil, filter:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metrics'

  request_url = @base_url || @client.base_url

  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: {'details' => details,'api-version' => @client.api_version},
      skip_encoding_query_params: {'$filter' => filter},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::ResourceMetricCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_metrics_next(next_page_link, custom_headers: nil) ⇒ ResourceMetricCollection

Get metrics for an App Serice plan.

Get metrics for an App Serice plan.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ResourceMetricCollection)

    operation results.



3891
3892
3893
3894
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3891

def list_metrics_next(next_page_link, custom_headers:nil)
  response = list_metrics_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_metrics_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get metrics for an App Serice plan.

Get metrics for an App Serice plan.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3924

def list_metrics_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::ResourceMetricCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_metrics_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get metrics for an App Serice plan.

Get metrics for an App Serice plan.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3908
3909
3910
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3908

def list_metrics_next_with_http_info(next_page_link, custom_headers:nil)
  list_metrics_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_metrics_with_http_info(resource_group_name, name, details: nil, filter: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get metrics for an App Serice plan.

Get metrics for an App Serice plan.

resource belongs. details. The default is false. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’) and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration’‘. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • details (Boolean) (defaults to: nil)

    Specify true to include instance

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1543
1544
1545
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1543

def list_metrics_with_http_info(resource_group_name, name, details:nil, filter:nil, custom_headers:nil)
  list_metrics_async(resource_group_name, name, details:details, filter:filter, custom_headers:custom_headers).value!
end

#list_next(next_page_link, custom_headers: nil) ⇒ AppServicePlanCollection

Get all App Service plans for a subcription.

Get all App Service plans for a subcription.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (AppServicePlanCollection)

    operation results.



3405
3406
3407
3408
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3405

def list_next(next_page_link, custom_headers:nil)
  response = list_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get all App Service plans for a subcription.

Get all App Service plans for a subcription.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3438

def list_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlanCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all App Service plans for a subcription.

Get all App Service plans for a subcription.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3422
3423
3424
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3422

def list_next_with_http_info(next_page_link, custom_headers:nil)
  list_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_routes_for_vnet(resource_group_name, name, vnet_name, custom_headers: nil) ⇒ Array

Get all routes that are associated with a Virtual Network in an App Service plan.

Get all routes that are associated with a Virtual Network in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

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

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



2565
2566
2567
2568
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2565

def list_routes_for_vnet(resource_group_name, name, vnet_name, custom_headers:nil)
  response = list_routes_for_vnet_async(resource_group_name, name, vnet_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_routes_for_vnet_async(resource_group_name, name, vnet_name, custom_headers: nil) ⇒ Concurrent::Promise

Get all routes that are associated with a Virtual Network in an App Service plan.

Get all routes that are associated with a Virtual Network in an App Service plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2606

def list_routes_for_vnet_async(resource_group_name, name, vnet_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'VnetRouteElementType',
                type: {
                  name: 'Composite',
                  class_name: 'VnetRoute'
                }
            }
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_routes_for_vnet_with_http_info(resource_group_name, name, vnet_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all routes that are associated with a Virtual Network in an App Service plan.

Get all routes that are associated with a Virtual Network in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2586
2587
2588
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2586

def list_routes_for_vnet_with_http_info(resource_group_name, name, vnet_name, custom_headers:nil)
  list_routes_for_vnet_async(resource_group_name, name, vnet_name, custom_headers:custom_headers).value!
end

#list_usages(resource_group_name, name, filter: nil, custom_headers: nil) ⇒ Array<CsmUsageQuota>

Gets server farm usage information

Gets server farm usage information

resource belongs. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’). will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of App Service Plan

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (Array<CsmUsageQuota>)

    operation results.



1972
1973
1974
1975
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1972

def list_usages(resource_group_name, name, filter:nil, custom_headers:nil)
  first_page = list_usages_as_lazy(resource_group_name, name, filter:filter, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_usages_as_lazy(resource_group_name, name, filter: nil, custom_headers: nil) ⇒ CsmUsageQuotaCollection

Gets server farm usage information

Gets server farm usage information

resource belongs. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’). will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of App Service Plan

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (CsmUsageQuotaCollection)

    which provide lazy access to pages of the



4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 4376

def list_usages_as_lazy(resource_group_name, name, filter:nil, custom_headers:nil)
  response = list_usages_async(resource_group_name, name, filter:filter, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_usages_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_usages_async(resource_group_name, name, filter: nil, custom_headers: nil) ⇒ Concurrent::Promise

Gets server farm usage information

Gets server farm usage information

resource belongs. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’). to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of App Service Plan

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2013

def list_usages_async(resource_group_name, name, filter:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/usages'

  request_url = @base_url || @client.base_url

  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},
      skip_encoding_query_params: {'$filter' => filter},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::CsmUsageQuotaCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_usages_next(next_page_link, custom_headers: nil) ⇒ CsmUsageQuotaCollection

Gets server farm usage information

Gets server farm usage information

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (CsmUsageQuotaCollection)

    operation results.



4083
4084
4085
4086
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 4083

def list_usages_next(next_page_link, custom_headers:nil)
  response = list_usages_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_usages_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Gets server farm usage information

Gets server farm usage information

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 4116

def list_usages_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::CsmUsageQuotaCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_usages_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets server farm usage information

Gets server farm usage information

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4100
4101
4102
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 4100

def list_usages_next_with_http_info(next_page_link, custom_headers:nil)
  list_usages_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_usages_with_http_info(resource_group_name, name, filter: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets server farm usage information

Gets server farm usage information

resource belongs. Filter conforms to odata syntax. Example: $filter=(name.value eq ‘Metric1’ or name.value eq ‘Metric2’). will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of App Service Plan

  • filter (String) (defaults to: nil)

    Return only usages/metrics specified in the filter.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1993
1994
1995
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1993

def list_usages_with_http_info(resource_group_name, name, filter:nil, custom_headers:nil)
  list_usages_async(resource_group_name, name, filter:filter, custom_headers:custom_headers).value!
end

#list_vnets(resource_group_name, name, custom_headers: nil) ⇒ Array

Get all Virtual Networks associated with an App Service plan.

Get all Virtual Networks associated with an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



2085
2086
2087
2088
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2085

def list_vnets(resource_group_name, name, custom_headers:nil)
  response = list_vnets_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Get all Virtual Networks associated with an App Service plan.

Get all Virtual Networks associated with an App Service plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2120

def list_vnets_async(resource_group_name, name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections'

  request_url = @base_url || @client.base_url

  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 || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'VnetInfoElementType',
                type: {
                  name: 'Composite',
                  class_name: 'VnetInfo'
                }
            }
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

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

Get all Virtual Networks associated with an App Service plan.

Get all Virtual Networks associated with an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2103
2104
2105
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2103

def list_vnets_with_http_info(resource_group_name, name, custom_headers:nil)
  list_vnets_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#list_web_apps(resource_group_name, name, skip_token: nil, filter: nil, top: nil, custom_headers: nil) ⇒ Array<Site>

Get all apps associated with an App Service plan.

Get all apps associated with an App Service plan.

resource belongs. associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list only web apps that are currently running will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • skip_token (String) (defaults to: nil)

    Skip to a web app in the list of webapps

  • filter (String) (defaults to: nil)

    Supported filter: $filter=state eq running. Returns

  • top (String) (defaults to: nil)

    List page size. If specified, results are paged.

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

    A hash of custom headers that

Returns:

  • (Array<Site>)

    operation results.



1752
1753
1754
1755
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1752

def list_web_apps(resource_group_name, name, skip_token:nil, filter:nil, top:nil, custom_headers:nil)
  first_page = list_web_apps_as_lazy(resource_group_name, name, skip_token:skip_token, filter:filter, top:top, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_web_apps_as_lazy(resource_group_name, name, skip_token: nil, filter: nil, top: nil, custom_headers: nil) ⇒ WebAppCollection

Get all apps associated with an App Service plan.

Get all apps associated with an App Service plan.

resource belongs. associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list only web apps that are currently running will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • skip_token (String) (defaults to: nil)

    Skip to a web app in the list of webapps

  • filter (String) (defaults to: nil)

    Supported filter: $filter=state eq running. Returns

  • top (String) (defaults to: nil)

    List page size. If specified, results are paged.

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

    A hash of custom headers that

Returns:

  • (WebAppCollection)

    which provide lazy access to pages of the



4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 4348

def list_web_apps_as_lazy(resource_group_name, name, skip_token:nil, filter:nil, top:nil, custom_headers:nil)
  response = list_web_apps_async(resource_group_name, name, skip_token:skip_token, filter:filter, top:top, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_web_apps_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_web_apps_async(resource_group_name, name, skip_token: nil, filter: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get all apps associated with an App Service plan.

Get all apps associated with an App Service plan.

resource belongs. associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list only web apps that are currently running to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • skip_token (String) (defaults to: nil)

    Skip to a web app in the list of webapps

  • filter (String) (defaults to: nil)

    Supported filter: $filter=state eq running. Returns

  • top (String) (defaults to: nil)

    List page size. If specified, results are paged.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1801

def list_web_apps_async(resource_group_name, name, skip_token:nil, filter:nil, top:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites'

  request_url = @base_url || @client.base_url

  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: {'$skipToken' => skip_token,'$top' => top,'api-version' => @client.api_version},
      skip_encoding_query_params: {'$filter' => filter},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_web_apps_by_hybrid_connection(resource_group_name, name, namespace_name, relay_name, custom_headers: nil) ⇒ Array<String>

Get all apps that use a Hybrid Connection in an App Service Plan.

Get all apps that use a Hybrid Connection in an App Service Plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • namespace_name (String)

    Name of the Hybrid Connection namespace.

  • relay_name (String)

    Name of the Hybrid Connection relay.

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

    A hash of custom headers that

Returns:

  • (Array<String>)

    operation results.



1077
1078
1079
1080
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1077

def list_web_apps_by_hybrid_connection(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  first_page = list_web_apps_by_hybrid_connection_as_lazy(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_web_apps_by_hybrid_connection_as_lazy(resource_group_name, name, namespace_name, relay_name, custom_headers: nil) ⇒ ResourceCollection

Get all apps that use a Hybrid Connection in an App Service Plan.

Get all apps that use a Hybrid Connection in an App Service Plan.

resource belongs. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • namespace_name (String)

    Name of the Hybrid Connection namespace.

  • relay_name (String)

    Name of the Hybrid Connection relay.

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

    A hash of custom headers that

Returns:

  • (ResourceCollection)

    which provide lazy access to pages of the



4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 4233

def list_web_apps_by_hybrid_connection_as_lazy(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  response = list_web_apps_by_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_web_apps_by_hybrid_connection_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_web_apps_by_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers: nil) ⇒ Concurrent::Promise

Get all apps that use a Hybrid Connection in an App Service Plan.

Get all apps that use a Hybrid Connection in an App Service Plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • namespace_name (String)

    Name of the Hybrid Connection namespace.

  • relay_name (String)

    Name of the Hybrid Connection relay.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1116

def list_web_apps_by_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'relay_name is nil' if relay_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'namespaceName' => namespace_name,'relayName' => relay_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::ResourceCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_web_apps_by_hybrid_connection_next(next_page_link, custom_headers: nil) ⇒ ResourceCollection

Get all apps that use a Hybrid Connection in an App Service Plan.

Get all apps that use a Hybrid Connection in an App Service Plan.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (ResourceCollection)

    operation results.



3597
3598
3599
3600
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3597

def list_web_apps_by_hybrid_connection_next(next_page_link, custom_headers:nil)
  response = list_web_apps_by_hybrid_connection_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_web_apps_by_hybrid_connection_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get all apps that use a Hybrid Connection in an App Service Plan.

Get all apps that use a Hybrid Connection in an App Service Plan.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3630

def list_web_apps_by_hybrid_connection_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::ResourceCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_web_apps_by_hybrid_connection_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all apps that use a Hybrid Connection in an App Service Plan.

Get all apps that use a Hybrid Connection in an App Service Plan.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3614
3615
3616
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3614

def list_web_apps_by_hybrid_connection_next_with_http_info(next_page_link, custom_headers:nil)
  list_web_apps_by_hybrid_connection_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_web_apps_by_hybrid_connection_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all apps that use a Hybrid Connection in an App Service Plan.

Get all apps that use a Hybrid Connection in an App Service Plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • namespace_name (String)

    Name of the Hybrid Connection namespace.

  • relay_name (String)

    Name of the Hybrid Connection relay.

  • 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/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1097

def list_web_apps_by_hybrid_connection_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
  list_web_apps_by_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
end

#list_web_apps_next(next_page_link, custom_headers: nil) ⇒ WebAppCollection

Get all apps associated with an App Service plan.

Get all apps associated with an App Service plan.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (WebAppCollection)

    operation results.



3987
3988
3989
3990
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3987

def list_web_apps_next(next_page_link, custom_headers:nil)
  response = list_web_apps_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_web_apps_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Get all apps associated with an App Service plan.

Get all apps associated with an App Service plan.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 4020

def list_web_apps_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_web_apps_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all apps associated with an App Service plan.

Get all apps associated with an App Service plan.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



4004
4005
4006
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 4004

def list_web_apps_next_with_http_info(next_page_link, custom_headers:nil)
  list_web_apps_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_web_apps_with_http_info(resource_group_name, name, skip_token: nil, filter: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all apps associated with an App Service plan.

Get all apps associated with an App Service plan.

resource belongs. associated with app service plan. If specified, the resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list contains web apps from the start of the list only web apps that are currently running will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • skip_token (String) (defaults to: nil)

    Skip to a web app in the list of webapps

  • filter (String) (defaults to: nil)

    Supported filter: $filter=state eq running. Returns

  • top (String) (defaults to: nil)

    List page size. If specified, results are paged.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1777
1778
1779
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1777

def list_web_apps_with_http_info(resource_group_name, name, skip_token:nil, filter:nil, top:nil, custom_headers:nil)
  list_web_apps_async(resource_group_name, name, skip_token:skip_token, filter:filter, top:top, custom_headers:custom_headers).value!
end

#list_with_http_info(detailed: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get all App Service plans for a subcription.

Get all App Service plans for a subcription.

plan properties. The default is false, which returns a subset of the properties. Retrieval of all properties may increase the API latency. will be added to the HTTP request.

Parameters:

  • detailed (Boolean) (defaults to: nil)

    Specify true to return all App Service

  • 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/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 57

def list_with_http_info(detailed:nil, custom_headers:nil)
  list_async(detailed:detailed, custom_headers:custom_headers).value!
end

#reboot_worker(resource_group_name, name, worker_name, custom_headers: nil) ⇒ Object

Reboot a worker machine in an App Service plan.

Reboot a worker machine in an App Service plan.

resource belongs. with RD. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • worker_name (String)

    Name of worker machine, which typically starts

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

    A hash of custom headers that



3178
3179
3180
3181
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3178

def reboot_worker(resource_group_name, name, worker_name, custom_headers:nil)
  response = reboot_worker_async(resource_group_name, name, worker_name, custom_headers:custom_headers).value!
  nil
end

#reboot_worker_async(resource_group_name, name, worker_name, custom_headers: nil) ⇒ Concurrent::Promise

Reboot a worker machine in an App Service plan.

Reboot a worker machine in an App Service plan.

resource belongs. with RD. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • worker_name (String)

    Name of worker machine, which typically starts

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3217

def reboot_worker_async(resource_group_name, name, worker_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'worker_name is nil' if worker_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'workerName' => worker_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#reboot_worker_with_http_info(resource_group_name, name, worker_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Reboot a worker machine in an App Service plan.

Reboot a worker machine in an App Service plan.

resource belongs. with RD. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • worker_name (String)

    Name of worker machine, which typically starts

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3198
3199
3200
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3198

def reboot_worker_with_http_info(resource_group_name, name, worker_name, custom_headers:nil)
  reboot_worker_async(resource_group_name, name, worker_name, custom_headers:custom_headers).value!
end

#restart_web_apps(resource_group_name, name, soft_restart: nil, custom_headers: nil) ⇒ Object

Restart all apps in an App Service plan.

Restart all apps in an App Service plan.

resource belongs. restart, applies the configuration settings and restarts the apps if necessary. The default is false, which always restarts and reprovisions the apps will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • soft_restart (Boolean) (defaults to: nil)

    Specify true to performa a soft

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

    A hash of custom headers that



1641
1642
1643
1644
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1641

def restart_web_apps(resource_group_name, name, soft_restart:nil, custom_headers:nil)
  response = restart_web_apps_async(resource_group_name, name, soft_restart:soft_restart, custom_headers:custom_headers).value!
  nil
end

#restart_web_apps_async(resource_group_name, name, soft_restart: nil, custom_headers: nil) ⇒ Concurrent::Promise

Restart all apps in an App Service plan.

Restart all apps in an App Service plan.

resource belongs. restart, applies the configuration settings and restarts the apps if necessary. The default is false, which always restarts and reprovisions the apps to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • soft_restart (Boolean) (defaults to: nil)

    Specify true to performa a soft

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1684

def restart_web_apps_async(resource_group_name, name, soft_restart:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites'

  request_url = @base_url || @client.base_url

  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: {'softRestart' => soft_restart,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#restart_web_apps_with_http_info(resource_group_name, name, soft_restart: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Restart all apps in an App Service plan.

Restart all apps in an App Service plan.

resource belongs. restart, applies the configuration settings and restarts the apps if necessary. The default is false, which always restarts and reprovisions the apps will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • soft_restart (Boolean) (defaults to: nil)

    Specify true to performa a soft

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1663
1664
1665
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 1663

def restart_web_apps_with_http_info(resource_group_name, name, soft_restart:nil, custom_headers:nil)
  restart_web_apps_async(resource_group_name, name, soft_restart:soft_restart, custom_headers:custom_headers).value!
end

#update(resource_group_name, name, app_service_plan, custom_headers: nil) ⇒ AppServicePlan

Creates or updates an App Service Plan.

Creates or updates an App Service Plan.

resource belongs. Service plan. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • app_service_plan (AppServicePlanPatchResource)

    Details of the App

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

    A hash of custom headers that

Returns:

  • (AppServicePlan)

    operation results.



494
495
496
497
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 494

def update(resource_group_name, name, app_service_plan, custom_headers:nil)
  response = update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, name, app_service_plan, custom_headers: nil) ⇒ Concurrent::Promise

Creates or updates an App Service Plan.

Creates or updates an App Service Plan.

resource belongs. Service plan. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • app_service_plan (AppServicePlanPatchResource)

    Details of the App

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
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
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 533

def update_async(resource_group_name, name, app_service_plan, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'app_service_plan is nil' if app_service_plan.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlanPatchResource.mapper()
  request_content = @client.serialize(request_mapper,  app_service_plan)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlan.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlan.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update_vnet_gateway(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers: nil) ⇒ VnetGateway

Update a Virtual Network gateway.

Update a Virtual Network gateway.

resource belongs. is supported. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • gateway_name (String)

    Name of the gateway. Only the ‘primary’ gateway

  • connection_envelope (VnetGateway)

    Definition of the gateway.

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

    A hash of custom headers that

Returns:

  • (VnetGateway)

    operation results.



2438
2439
2440
2441
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2438

def update_vnet_gateway(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:nil)
  response = update_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers: nil) ⇒ Concurrent::Promise

Update a Virtual Network gateway.

Update a Virtual Network gateway.

resource belongs. is supported. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • gateway_name (String)

    Name of the gateway. Only the ‘primary’ gateway

  • connection_envelope (VnetGateway)

    Definition of the gateway.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2481

def update_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
  fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?
  fail ArgumentError, 'connection_envelope is nil' if connection_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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetGateway.mapper()
  request_content = @client.serialize(request_mapper,  connection_envelope)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'gatewayName' => gateway_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetGateway.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update_vnet_gateway_with_http_info(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Update a Virtual Network gateway.

Update a Virtual Network gateway.

resource belongs. is supported. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • gateway_name (String)

    Name of the gateway. Only the ‘primary’ gateway

  • connection_envelope (VnetGateway)

    Definition of the gateway.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2460
2461
2462
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 2460

def update_vnet_gateway_with_http_info(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:nil)
  update_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:custom_headers).value!
end

#update_vnet_route(resource_group_name, name, vnet_name, route_name, route, custom_headers: nil) ⇒ VnetRoute

Create or update a Virtual Network route in an App Service plan.

Create or update a Virtual Network route in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • route_name (String)

    Name of the Virtual Network route.

  • route (VnetRoute)

    Definition of the Virtual Network route.

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

    A hash of custom headers that

Returns:

  • (VnetRoute)

    operation results.



3055
3056
3057
3058
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3055

def update_vnet_route(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
  response = update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers: nil) ⇒ Concurrent::Promise

Create or update a Virtual Network route in an App Service plan.

Create or update a Virtual Network route in an App Service plan.

resource belongs. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • route_name (String)

    Name of the Virtual Network route.

  • route (VnetRoute)

    Definition of the Virtual Network route.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3096

def update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
  fail ArgumentError, 'route_name is nil' if route_name.nil?
  fail ArgumentError, 'route is nil' if route.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetRoute.mapper()
  request_content = @client.serialize(request_mapper,  route)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 400 || status_code == 404
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetRoute.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update_vnet_route_with_http_info(resource_group_name, name, vnet_name, route_name, route, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update a Virtual Network route in an App Service plan.

Create or update a Virtual Network route in an App Service plan.

resource belongs. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • vnet_name (String)

    Name of the Virtual Network.

  • route_name (String)

    Name of the Virtual Network route.

  • route (VnetRoute)

    Definition of the Virtual Network route.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



3076
3077
3078
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 3076

def update_vnet_route_with_http_info(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
  update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:custom_headers).value!
end

#update_with_http_info(resource_group_name, name, app_service_plan, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates an App Service Plan.

Creates or updates an App Service Plan.

resource belongs. Service plan. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group to which the

  • name (String)

    Name of the App Service plan.

  • app_service_plan (AppServicePlanPatchResource)

    Details of the App

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



514
515
516
# File 'lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb', line 514

def update_with_http_info(resource_group_name, name, app_service_plan, custom_headers:nil)
  update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers).value!
end