Class: Azure::ARM::Web::ServerFarms

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ServerFarms

Creates and initializes a new instance of the ServerFarms class.

Parameters:

  • client

    service class for accessing basic functionality.



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

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientWebSiteManagementClient (readonly)

Returns reference to the WebSiteManagementClient.

Returns:



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

def client
  @client
end

Instance Method Details

#begin_create_or_update_server_farm(resource_group_name, name, server_farm_envelope, allow_pending_state = nil, custom_headers = nil) ⇒ ServerFarmWithRichSku

Creates or updates an App Service Plan

Plan for App Service Plan will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • server_farm_envelope (ServerFarmWithRichSku)

    Details of App Service

  • allow_pending_state (Boolean) (defaults to: nil)

    OBSOLETE: If true, allow pending state

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

    A hash of custom headers that

Returns:



305
306
307
308
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 305

def begin_create_or_update_server_farm(resource_group_name, name, server_farm_envelope, allow_pending_state = nil, custom_headers = nil)
  response = begin_create_or_update_server_farm_async(resource_group_name, name, server_farm_envelope, allow_pending_state, custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_server_farm_async(resource_group_name, name, server_farm_envelope, allow_pending_state = nil, custom_headers = nil) ⇒ Concurrent::Promise

Creates or updates an App Service Plan

Plan for App Service Plan to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • server_farm_envelope (ServerFarmWithRichSku)

    Details of App Service

  • allow_pending_state (Boolean) (defaults to: nil)

    OBSOLETE: If true, allow pending state

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 342

def begin_create_or_update_server_farm_async(resource_group_name, name, server_farm_envelope, allow_pending_state = nil, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'server_farm_envelope is nil' if server_farm_envelope.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

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

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

  # Serialize Request
  request_mapper = ServerFarmWithRichSku.mapper()
  request_content = @client.serialize(request_mapper,  server_farm_envelope, 'server_farm_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}'
  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: {'allowPendingState' => allow_pending_state,'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#begin_create_or_update_server_farm_with_http_info(resource_group_name, name, server_farm_envelope, allow_pending_state = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates an App Service Plan

Plan for App Service Plan will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • server_farm_envelope (ServerFarmWithRichSku)

    Details of App Service

  • allow_pending_state (Boolean) (defaults to: nil)

    OBSOLETE: If true, allow pending state

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



324
325
326
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 324

def begin_create_or_update_server_farm_with_http_info(resource_group_name, name, server_farm_envelope, allow_pending_state = nil, custom_headers = nil)
  begin_create_or_update_server_farm_async(resource_group_name, name, server_farm_envelope, allow_pending_state, custom_headers).value!
end

#create_or_update_server_farm(resource_group_name, name, server_farm_envelope, allow_pending_state = nil, custom_headers = nil) ⇒ ServerFarmWithRichSku

Creates or updates an App Service Plan

Plan for App Service Plan will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • server_farm_envelope (ServerFarmWithRichSku)

    Details of App Service

  • allow_pending_state (Boolean) (defaults to: nil)

    OBSOLETE: If true, allow pending state

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

    A hash of custom headers that

Returns:



255
256
257
258
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 255

def create_or_update_server_farm(resource_group_name, name, server_farm_envelope, allow_pending_state = nil, custom_headers = nil)
  response = create_or_update_server_farm_async(resource_group_name, name, server_farm_envelope, allow_pending_state, custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_server_farm_async(resource_group_name, name, server_farm_envelope, allow_pending_state = nil, custom_headers = nil) ⇒ Concurrent::Promise

Plan for App Service Plan will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • server_farm_envelope (ServerFarmWithRichSku)

    Details of App Service

  • allow_pending_state (Boolean) (defaults to: nil)

    OBSOLETE: If true, allow pending state

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 273

def create_or_update_server_farm_async(resource_group_name, name, server_farm_envelope, allow_pending_state = nil, custom_headers = nil)
  # Send request
  promise = begin_create_or_update_server_farm_async(resource_group_name, name, server_farm_envelope, allow_pending_state, custom_headers)

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

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

  promise
end

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

Creates a new route or updates an existing route for a vnet in an app service plan.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of virtual network

  • route_name (String)

    Name of the virtual network route

  • route (VnetRoute)

    The route object

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

    A hash of custom headers that

Returns:



1209
1210
1211
1212
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1209

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).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

Creates a new route or updates an existing route for a vnet in an app service plan.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of virtual network

  • route_name (String)

    Name of the virtual network route

  • route (VnetRoute)

    The route object

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1246

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, '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 = {}

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

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

  # Serialize Request
  request_mapper = VnetRoute.mapper()
  request_content = @client.serialize(request_mapper,  route, '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}'
  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 || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Creates a new route or updates an existing route for a vnet in an app service plan.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of virtual network

  • route_name (String)

    Name of the virtual network route

  • route (VnetRoute)

    The route object

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1228
1229
1230
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1228

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).value!
end

#delete_server_farm(resource_group_name, name, custom_headers = nil) ⇒ Object

Deletes a App Service Plan

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • 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.



427
428
429
430
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 427

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

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

Deletes a App Service Plan

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • 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.



456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 456

def delete_server_farm_async(resource_group_name, name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Deletes a App Service Plan

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • 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.



442
443
444
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 442

def delete_server_farm_with_http_info(resource_group_name, name, custom_headers = nil)
  delete_server_farm_async(resource_group_name, name, custom_headers).value!
end

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

Deletes an existing route for a vnet in an app service plan.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of 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:

  • (Object)

    operation results.



1325
1326
1327
1328
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1325

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).value!
  response.body unless response.nil?
end

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

Deletes an existing route for a vnet in an app service plan.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of 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.



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
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1358

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, '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 = {}

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Deletes an existing route for a vnet in an app service plan.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of 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.



1342
1343
1344
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1342

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).value!
end

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

Gets a specific route associated with a vnet, in an app service plan

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of 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.



1091
1092
1093
1094
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1091

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).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

Gets a specific route associated with a vnet, in an app service plan

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of 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.



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
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1124

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, '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 = {}

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Gets a specific route associated with a vnet, in an app service plan

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of 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.



1108
1109
1110
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1108

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).value!
end

#get_routes_for_vnet(resource_group_name, name, vnet_name, custom_headers = nil) ⇒ Array

Gets a list of all routes associated with a vnet, in an app service plan

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of virtual network

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

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



978
979
980
981
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 978

def get_routes_for_vnet(resource_group_name, name, vnet_name, custom_headers = nil)
  response = get_routes_for_vnet_async(resource_group_name, name, vnet_name, custom_headers).value!
  response.body unless response.nil?
end

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

Gets a list of all routes associated with a vnet, in an app service plan

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of virtual network

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1009

def get_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, '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 = {}

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Gets a list of all routes associated with a vnet, in an app service plan

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of virtual network

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



994
995
996
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 994

def get_routes_for_vnet_with_http_info(resource_group_name, name, vnet_name, custom_headers = nil)
  get_routes_for_vnet_async(resource_group_name, name, vnet_name, custom_headers).value!
end

#get_server_farm(resource_group_name, name, custom_headers = nil) ⇒ ServerFarmWithRichSku

Gets specified App Service Plan in a resource group

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

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

    A hash of custom headers that

Returns:



157
158
159
160
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 157

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

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

Gets specified App Service Plan in a resource group

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • 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.



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
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 186

def get_server_farm_async(resource_group_name, name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#get_server_farm_metric_defintions(resource_group_name, name, custom_headers = nil) ⇒ Array<MetricDefinition>

List of metrics that can be queried for an App Service Plan

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

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

    A hash of custom headers that

Returns:



677
678
679
680
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 677

def get_server_farm_metric_defintions(resource_group_name, name, custom_headers = nil)
  first_page = get_server_farm_metric_defintions_as_lazy(resource_group_name, name, custom_headers)
  first_page.get_all_items
end

#get_server_farm_metric_defintions_as_lazy(resource_group_name, name, custom_headers = nil) ⇒ MetricDefinitionCollection

List of metrics that can be queried for an App Service Plan

will be added to the HTTP request.

the response.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

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

    A hash of custom headers that

Returns:



656
657
658
659
660
661
662
663
664
665
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 656

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

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

List of metrics that can be queried for an App Service Plan

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • 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.



706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 706

def get_server_farm_metric_defintions_async(resource_group_name, name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metricdefinitions'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#get_server_farm_metric_defintions_next(next_page_link, custom_headers = nil) ⇒ MetricDefinitionCollection

List of metrics that can be queried for an App Service Plan

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:



2361
2362
2363
2364
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2361

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

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

List of metrics that can be queried for an App Service Plan

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2390

def get_server_farm_metric_defintions_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#get_server_farm_metric_defintions_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

List of metrics that can be queried for an App Service Plan

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2376
2377
2378
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2376

def get_server_farm_metric_defintions_next_with_http_info(next_page_link, custom_headers = nil)
  get_server_farm_metric_defintions_next_async(next_page_link, custom_headers).value!
end

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

List of metrics that can be queried for an App Service Plan

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • 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.



692
693
694
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 692

def get_server_farm_metric_defintions_with_http_info(resource_group_name, name, custom_headers = nil)
  get_server_farm_metric_defintions_async(resource_group_name, name, custom_headers).value!
end

#get_server_farm_metrics(resource_group_name, name, details = nil, filter = nil, custom_headers = nil) ⇒ Array<ResourceMetric>

Queries for App Serice Plan metrics

Plan instance 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 resource group

  • name (String)

    Name of App Service Plan

  • details (Boolean) (defaults to: nil)

    If true, metrics are broken down per App Service

  • 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:



547
548
549
550
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 547

def get_server_farm_metrics(resource_group_name, name, details = nil, filter = nil, custom_headers = nil)
  first_page = get_server_farm_metrics_as_lazy(resource_group_name, name, details, filter, custom_headers)
  first_page.get_all_items
end

#get_server_farm_metrics_as_lazy(resource_group_name, name, details = nil, filter = nil, custom_headers = nil) ⇒ ResourceMetricCollection

Queries for App Serice Plan metrics

Plan instance 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 resource group

  • name (String)

    Name of App Service Plan

  • details (Boolean) (defaults to: nil)

    If true, metrics are broken down per App Service

  • 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:



519
520
521
522
523
524
525
526
527
528
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 519

def get_server_farm_metrics_as_lazy(resource_group_name, name, details = nil, filter = nil, custom_headers = nil)
  response = get_server_farm_metrics_async(resource_group_name, name, details, filter, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      get_server_farm_metrics_next_async(next_link, custom_headers)
    end
    page
  end
end

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

Queries for App Serice Plan metrics

Plan instance 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 resource group

  • name (String)

    Name of App Service Plan

  • details (Boolean) (defaults to: nil)

    If true, metrics are broken down per App Service

  • 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.



590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 590

def get_server_farm_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, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metrics'
  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,'$filter' => filter,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#get_server_farm_metrics_next(next_page_link, custom_headers = nil) ⇒ ResourceMetricCollection

Queries for App Serice Plan metrics

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:



2271
2272
2273
2274
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2271

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

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

Queries for App Serice Plan metrics

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2300

def get_server_farm_metrics_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#get_server_farm_metrics_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Queries for App Serice Plan metrics

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2286
2287
2288
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2286

def get_server_farm_metrics_next_with_http_info(next_page_link, custom_headers = nil)
  get_server_farm_metrics_next_async(next_page_link, custom_headers).value!
end

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

Queries for App Serice Plan metrics

Plan instance 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 resource group

  • name (String)

    Name of App Service Plan

  • details (Boolean) (defaults to: nil)

    If true, metrics are broken down per App Service

  • 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.



569
570
571
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 569

def get_server_farm_metrics_with_http_info(resource_group_name, name, details = nil, filter = nil, custom_headers = nil)
  get_server_farm_metrics_async(resource_group_name, name, details, filter, custom_headers).value!
end

#get_server_farm_operation(resource_group_name, name, operation_id, custom_headers = nil) ⇒ ServerFarmWithRichSku

Gets a server farm operation

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of server farm

  • operation_id (String)

    Id of Server farm operation“&gt;

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

    A hash of custom headers that

Returns:



2081
2082
2083
2084
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2081

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

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

Gets a server farm operation

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of server farm

  • operation_id (String)

    Id of Server farm operation“&gt;

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2112
2113
2114
2115
2116
2117
2118
2119
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
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2112

def get_server_farm_operation_async(resource_group_name, name, operation_id, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'operation_id is nil' if operation_id.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/operationresults/{operationId}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'operationId' => operation_id,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Gets a server farm operation

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of server farm

  • operation_id (String)

    Id of Server farm operation“&gt;

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2097
2098
2099
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2097

def get_server_farm_operation_with_http_info(resource_group_name, name, operation_id, custom_headers = nil)
  get_server_farm_operation_async(resource_group_name, name, operation_id, custom_headers).value!
end

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

Gets list of Apps associated with an App Service Plan

resulting list will contain web apps starting from (including) the skipToken. Else, 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 resource group

  • name (String)

    Name of App Service Plan

  • skip_token (String) (defaults to: nil)

    Skip to of web apps in a list. If specified, the

  • 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.



1791
1792
1793
1794
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1791

def get_server_farm_sites(resource_group_name, name, skip_token = nil, filter = nil, top = nil, custom_headers = nil)
  first_page = get_server_farm_sites_as_lazy(resource_group_name, name, skip_token, filter, top, custom_headers)
  first_page.get_all_items
end

#get_server_farm_sites_as_lazy(resource_group_name, name, skip_token = nil, filter = nil, top = nil, custom_headers = nil) ⇒ SiteCollection

Gets list of Apps associated with an App Service Plan

resulting list will contain web apps starting from (including) the skipToken. Else, 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 resource group

  • name (String)

    Name of App Service Plan

  • skip_token (String) (defaults to: nil)

    Skip to of web apps in a list. If specified, the

  • 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:

  • (SiteCollection)

    which provide lazy access to pages of the response.



1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1763

def get_server_farm_sites_as_lazy(resource_group_name, name, skip_token = nil, filter = nil, top = nil, custom_headers = nil)
  response = get_server_farm_sites_async(resource_group_name, name, skip_token, filter, top, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      get_server_farm_sites_next_async(next_link, custom_headers)
    end
    page
  end
end

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

Gets list of Apps associated with an App Service Plan

resulting list will contain web apps starting from (including) the skipToken. Else, 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 resource group

  • name (String)

    Name of App Service Plan

  • skip_token (String) (defaults to: nil)

    Skip to of web apps in a list. If specified, the

  • 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.



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
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1834

def get_server_farm_sites_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, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'$skipToken' => skip_token,'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#get_server_farm_sites_next(next_page_link, custom_headers = nil) ⇒ SiteCollection

Gets list of Apps associated with an App Service Plan

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:



2451
2452
2453
2454
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2451

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

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

Gets list of Apps associated with an App Service Plan

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2480
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
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2480

def get_server_farm_sites_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#get_server_farm_sites_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets list of Apps associated with an App Service Plan

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2466
2467
2468
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2466

def get_server_farm_sites_next_with_http_info(next_page_link, custom_headers = nil)
  get_server_farm_sites_next_async(next_page_link, custom_headers).value!
end

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

Gets list of Apps associated with an App Service Plan

resulting list will contain web apps starting from (including) the skipToken. Else, 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 resource group

  • name (String)

    Name of App Service Plan

  • skip_token (String) (defaults to: nil)

    Skip to of web apps in a list. If specified, the

  • 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.



1813
1814
1815
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1813

def get_server_farm_sites_with_http_info(resource_group_name, name, skip_token = nil, filter = nil, top = nil, custom_headers = nil)
  get_server_farm_sites_async(resource_group_name, name, skip_token, filter, top, custom_headers).value!
end

#get_server_farm_vnet_gateway(resource_group_name, name, vnet_name, gateway_name, custom_headers = nil) ⇒ VnetGateway

Gets the vnet gateway.

is supported. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • 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:



1536
1537
1538
1539
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1536

def get_server_farm_vnet_gateway(resource_group_name, name, vnet_name, gateway_name, custom_headers = nil)
  response = get_server_farm_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, custom_headers).value!
  response.body unless response.nil?
end

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

Gets the vnet gateway.

is supported. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • 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.



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
1624
1625
1626
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1571

def get_server_farm_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, '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 = {}

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Gets the vnet gateway.

is supported. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • 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.



1554
1555
1556
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1554

def get_server_farm_vnet_gateway_with_http_info(resource_group_name, name, vnet_name, gateway_name, custom_headers = nil)
  get_server_farm_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, custom_headers).value!
end

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

Gets specified App Service Plan in a resource group

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • 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.



172
173
174
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 172

def get_server_farm_with_http_info(resource_group_name, name, custom_headers = nil)
  get_server_farm_async(resource_group_name, name, custom_headers).value!
end

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

Gets collection of App Service Plans in a resource group for a given subscription.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

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

    A hash of custom headers that

Returns:



64
65
66
67
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 64

def get_server_farms(resource_group_name, custom_headers = nil)
  first_page = get_server_farms_as_lazy(resource_group_name, custom_headers)
  first_page.get_all_items
end

#get_server_farms_as_lazy(resource_group_name, custom_headers = nil) ⇒ ServerFarmCollection

Gets collection of App Service Plans in a resource group for a given subscription.

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of resource group

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

    A hash of custom headers that

Returns:



43
44
45
46
47
48
49
50
51
52
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 43

def get_server_farms_as_lazy(resource_group_name, custom_headers = nil)
  response = get_server_farms_async(resource_group_name, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      get_server_farms_next_async(next_link, custom_headers)
    end
    page
  end
end

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

Gets collection of App Service Plans in a resource group for a given subscription.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 93

def get_server_farms_async(resource_group_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#get_server_farms_next(next_page_link, custom_headers = nil) ⇒ ServerFarmCollection

Gets collection of App Service Plans in a resource group for a given subscription.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:



2179
2180
2181
2182
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2179

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

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

Gets collection of App Service Plans in a resource group for a given subscription.

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2210

def get_server_farms_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#get_server_farms_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets collection of App Service Plans in a resource group for a given subscription.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2195
2196
2197
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2195

def get_server_farms_next_with_http_info(next_page_link, custom_headers = nil)
  get_server_farms_next_async(next_page_link, custom_headers).value!
end

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

Gets collection of App Service Plans in a resource group for a given subscription.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



79
80
81
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 79

def get_server_farms_with_http_info(resource_group_name, custom_headers = nil)
  get_server_farms_async(resource_group_name, custom_headers).value!
end

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

Gets a vnet associated with an App Service Plan

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of virtual network

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

    A hash of custom headers that

Returns:



880
881
882
883
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 880

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).value!
  response.body unless response.nil?
end

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

Gets a vnet associated with an App Service Plan

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of virtual network

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 911

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, '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 = {}

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Gets a vnet associated with an App Service Plan

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of virtual network

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



896
897
898
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 896

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).value!
end

#get_vnets_for_server_farm(resource_group_name, name, custom_headers = nil) ⇒ Array

Gets list of vnets associated with App Service Plan

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

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

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



771
772
773
774
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 771

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

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

Gets list of vnets associated with App Service Plan

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • 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.



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
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 800

def get_vnets_for_server_farm_async(resource_group_name, name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Gets list of vnets associated with App Service Plan

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • 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.



786
787
788
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 786

def get_vnets_for_server_farm_with_http_info(resource_group_name, name, custom_headers = nil)
  get_vnets_for_server_farm_async(resource_group_name, name, custom_headers).value!
end

#reboot_worker_for_server_farm(resource_group_name, name, worker_name, custom_headers = nil) ⇒ Object

Submit a reboot request for a worker machine in the specified server farm

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of server farm

  • worker_name (String)

    Name of worker machine, typically starts with RD

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

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



1900
1901
1902
1903
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1900

def reboot_worker_for_server_farm(resource_group_name, name, worker_name, custom_headers = nil)
  response = reboot_worker_for_server_farm_async(resource_group_name, name, worker_name, custom_headers).value!
  response.body unless response.nil?
end

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

Submit a reboot request for a worker machine in the specified server farm

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of server farm

  • worker_name (String)

    Name of worker machine, typically starts with RD

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1931

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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Submit a reboot request for a worker machine in the specified server farm

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of server farm

  • worker_name (String)

    Name of worker machine, typically starts with RD

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1916
1917
1918
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1916

def reboot_worker_for_server_farm_with_http_info(resource_group_name, name, worker_name, custom_headers = nil)
  reboot_worker_for_server_farm_async(resource_group_name, name, worker_name, custom_headers).value!
end

#restart_sites_for_server_farm(resource_group_name, name, soft_restart = nil, custom_headers = nil) ⇒ Object

Restarts web apps in a specified App Service Plan

settings and restarts the apps if necessary. Hard restart always restarts and reprovisions the apps will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • soft_restart (Boolean) (defaults to: nil)

    Soft restart applies the configuration

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

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



1990
1991
1992
1993
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1990

def restart_sites_for_server_farm(resource_group_name, name, soft_restart = nil, custom_headers = nil)
  response = restart_sites_for_server_farm_async(resource_group_name, name, soft_restart, custom_headers).value!
  response.body unless response.nil?
end

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

Restarts web apps in a specified App Service Plan

settings and restarts the apps if necessary. Hard restart always restarts and reprovisions the apps to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • soft_restart (Boolean) (defaults to: nil)

    Soft restart applies the configuration

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2025

def restart_sites_for_server_farm_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, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Restarts web apps in a specified App Service Plan

settings and restarts the apps if necessary. Hard restart always restarts and reprovisions the apps will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • soft_restart (Boolean) (defaults to: nil)

    Soft restart applies the configuration

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2008
2009
2010
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2008

def restart_sites_for_server_farm_with_http_info(resource_group_name, name, soft_restart = nil, custom_headers = nil)
  restart_sites_for_server_farm_async(resource_group_name, name, soft_restart, custom_headers).value!
end

#update_server_farm_vnet_gateway(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers = nil) ⇒ VnetGateway

Updates the vnet gateway

supported. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group

  • name (String)

    The name of the App Service Plan

  • vnet_name (String)

    The name of the virtual network

  • gateway_name (String)

    The name of the gateway. Only ‘primary’ is

  • connection_envelope (VnetGateway)

    The gateway entity.

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

    A hash of custom headers that

Returns:



1642
1643
1644
1645
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1642

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

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

Updates the vnet gateway

supported. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group

  • name (String)

    The name of the App Service Plan

  • vnet_name (String)

    The name of the virtual network

  • gateway_name (String)

    The name of the gateway. Only ‘primary’ is

  • connection_envelope (VnetGateway)

    The gateway entity.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1679
1680
1681
1682
1683
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
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1679

def update_server_farm_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, '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 = {}

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

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

  # Serialize Request
  request_mapper = VnetGateway.mapper()
  request_content = @client.serialize(request_mapper,  connection_envelope, '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}'
  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 || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Updates the vnet gateway

supported. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group

  • name (String)

    The name of the App Service Plan

  • vnet_name (String)

    The name of the virtual network

  • gateway_name (String)

    The name of the gateway. Only ‘primary’ is

  • connection_envelope (VnetGateway)

    The gateway entity.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1661
1662
1663
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1661

def update_server_farm_vnet_gateway_with_http_info(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers = nil)
  update_server_farm_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers).value!
end

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

Creates a new route or updates an existing route for a vnet in an app service plan.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of virtual network

  • route_name (String)

    Name of the virtual network route

  • route (VnetRoute)

    The route object

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

    A hash of custom headers that

Returns:



1419
1420
1421
1422
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1419

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).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

Creates a new route or updates an existing route for a vnet in an app service plan.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of virtual network

  • route_name (String)

    Name of the virtual network route

  • route (VnetRoute)

    The route object

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1456

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, '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 = {}

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

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

  # Serialize Request
  request_mapper = VnetRoute.mapper()
  request_content = @client.serialize(request_mapper,  route, '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}'
  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 || {})
  }

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Creates a new route or updates an existing route for a vnet in an app service plan.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of resource group

  • name (String)

    Name of App Service Plan

  • vnet_name (String)

    Name of virtual network

  • route_name (String)

    Name of the virtual network route

  • route (VnetRoute)

    The route object

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1438
1439
1440
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1438

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).value!
end