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

#clientObject (readonly)

Returns reference to the WebSiteManagementClient.

Returns:

  • reference to the WebSiteManagementClient



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:



283
284
285
286
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 283

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.



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

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.



302
303
304
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 302

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:



233
234
235
236
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 233

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



251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 251

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:



1136
1137
1138
1139
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1136

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.



1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1173

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.



1155
1156
1157
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1155

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.



405
406
407
408
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 405

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.



434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 434

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.



420
421
422
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 420

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.



1252
1253
1254
1255
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1252

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.



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
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1285

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.



1269
1270
1271
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1269

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.



1018
1019
1020
1021
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1018

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.



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
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1051

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.



1035
1036
1037
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1035

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.



905
906
907
908
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 905

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.



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
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 936

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.



921
922
923
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 921

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:



135
136
137
138
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 135

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.



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 164

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) ⇒ MetricDefinitionCollection

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:



604
605
606
607
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 604

def get_server_farm_metric_defintions(resource_group_name, name, custom_headers = nil)
  response = get_server_farm_metric_defintions_async(resource_group_name, name, custom_headers).value!
  response.body unless response.nil?
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.



633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 633

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



619
620
621
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 619

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

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:



496
497
498
499
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 496

def get_server_farm_metrics(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!
  response.body unless response.nil?
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.



539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 539

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



518
519
520
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 518

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:



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

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.



2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2039

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.



2024
2025
2026
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2024

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.



1718
1719
1720
1721
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1718

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.



1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1690

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.



1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1761

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:



2105
2106
2107
2108
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2105

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.



2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2134

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.



2120
2121
2122
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 2120

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.



1740
1741
1742
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1740

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:



1463
1464
1465
1466
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1463

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.



1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1498

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.



1481
1482
1483
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1481

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.



150
151
152
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 150

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) ⇒ ServerFarmCollection

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:



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

def get_server_farms(resource_group_name, custom_headers = nil)
  response = get_server_farms_async(resource_group_name, custom_headers).value!
  response.body unless response.nil?
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.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 71

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



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

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:



807
808
809
810
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 807

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.



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
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 838

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.



823
824
825
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 823

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.



698
699
700
701
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 698

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.



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
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 727

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.



713
714
715
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 713

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.



1827
1828
1829
1830
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1827

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.



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
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1858

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.



1843
1844
1845
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1843

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.



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

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.



1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1952

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.



1935
1936
1937
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1935

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:



1569
1570
1571
1572
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1569

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.



1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1606

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.



1588
1589
1590
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1588

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:



1346
1347
1348
1349
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1346

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.



1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1383

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.



1365
1366
1367
# File 'lib/generated/azure_mgmt_web/server_farms.rb', line 1365

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