Class: Azure::Compute::Mgmt::V2020_09_30::DiskAccesses

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb

Overview

The Disk Resource Provider Client.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ DiskAccesses

Creates and initializes a new instance of the DiskAccesses class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientComputeManagementClient (readonly)

Returns reference to the ComputeManagementClient.

Returns:



22
23
24
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 22

def client
  @client
end

Instance Method Details

#begin_create_or_update(resource_group_name, disk_access_name, disk_access, custom_headers: nil) ⇒ DiskAccess

Creates or updates a disk access resource

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. the Put disk access operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • disk_access (DiskAccess)

    disk access object supplied in the body of

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

    A hash of custom headers that

Returns:

  • (DiskAccess)

    operation results.



895
896
897
898
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 895

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

#begin_create_or_update_async(resource_group_name, disk_access_name, disk_access, custom_headers: nil) ⇒ Concurrent::Promise

Creates or updates a disk access resource

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. the Put disk access operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • disk_access (DiskAccess)

    disk access object supplied in the body of

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
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
1005
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 934

def begin_create_or_update_async(resource_group_name, disk_access_name, disk_access, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'disk_access_name is nil' if disk_access_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'disk_access is nil' if disk_access.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::DiskAccess.mapper()
  request_content = @client.serialize(request_mapper,  disk_access)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#begin_create_or_update_with_http_info(resource_group_name, disk_access_name, disk_access, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates a disk access resource

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. the Put disk access operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • disk_access (DiskAccess)

    disk access object supplied in the body of

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



915
916
917
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 915

def begin_create_or_update_with_http_info(resource_group_name, disk_access_name, disk_access, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, disk_access_name, disk_access, custom_headers:custom_headers).value!
end

#begin_delete(resource_group_name, disk_access_name, custom_headers: nil) ⇒ Object

Deletes a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

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

    A hash of custom headers that



1146
1147
1148
1149
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1146

def begin_delete(resource_group_name, disk_access_name, custom_headers:nil)
  response = begin_delete_async(resource_group_name, disk_access_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_aprivate_endpoint_connection(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers: nil) ⇒ Object

Deletes a private endpoint connection under a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. endpoint connection will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • private_endpoint_connection_name (String)

    The name of the private

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

    A hash of custom headers that



1380
1381
1382
1383
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1380

def begin_delete_aprivate_endpoint_connection(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers:nil)
  response = begin_delete_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a private endpoint connection under a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. endpoint connection to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • private_endpoint_connection_name (String)

    The name of the private

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1419

def begin_delete_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'disk_access_name is nil' if disk_access_name.nil?
  fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#begin_delete_aprivate_endpoint_connection_with_http_info(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a private endpoint connection under a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. endpoint connection will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • private_endpoint_connection_name (String)

    The name of the private

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1400
1401
1402
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1400

def begin_delete_aprivate_endpoint_connection_with_http_info(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers:nil)
  begin_delete_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
end

#begin_delete_async(resource_group_name, disk_access_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1181

def begin_delete_async(resource_group_name, disk_access_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'disk_access_name is nil' if disk_access_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#begin_delete_with_http_info(resource_group_name, disk_access_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1164
1165
1166
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1164

def begin_delete_with_http_info(resource_group_name, disk_access_name, custom_headers:nil)
  begin_delete_async(resource_group_name, disk_access_name, custom_headers:custom_headers).value!
end

#begin_update(resource_group_name, disk_access_name, disk_access, custom_headers: nil) ⇒ DiskAccess

Updates (patches) a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. of the Patch disk access operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • disk_access (DiskAccessUpdate)

    disk access object supplied in the body

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

    A hash of custom headers that

Returns:

  • (DiskAccess)

    operation results.



1022
1023
1024
1025
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1022

def begin_update(resource_group_name, disk_access_name, disk_access, custom_headers:nil)
  response = begin_update_async(resource_group_name, disk_access_name, disk_access, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_update_aprivate_endpoint_connection(resource_group_name, disk_access_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers: nil) ⇒ PrivateEndpointConnection

Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. endpoint connection endpoint connection object supplied in the body of the Put private endpoint connection operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • private_endpoint_connection_name (String)

    The name of the private

  • private_endpoint_connection (PrivateEndpointConnection)

    private

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

    A hash of custom headers that

Returns:

  • (PrivateEndpointConnection)

    operation results.



1245
1246
1247
1248
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1245

def begin_update_aprivate_endpoint_connection(resource_group_name, disk_access_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil)
  response = begin_update_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_update_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers: nil) ⇒ Concurrent::Promise

Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. endpoint connection endpoint connection object supplied in the body of the Put private endpoint connection operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • private_endpoint_connection_name (String)

    The name of the private

  • private_endpoint_connection (PrivateEndpointConnection)

    private

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1292

def begin_update_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'disk_access_name is nil' if disk_access_name.nil?
  fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'private_endpoint_connection is nil' if private_endpoint_connection.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::PrivateEndpointConnection.mapper()
  request_content = @client.serialize(request_mapper,  private_endpoint_connection)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}'

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#begin_update_aprivate_endpoint_connection_with_http_info(resource_group_name, disk_access_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. endpoint connection endpoint connection object supplied in the body of the Put private endpoint connection operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • private_endpoint_connection_name (String)

    The name of the private

  • private_endpoint_connection (PrivateEndpointConnection)

    private

  • 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/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1269

def begin_update_aprivate_endpoint_connection_with_http_info(resource_group_name, disk_access_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil)
  begin_update_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:custom_headers).value!
end

#begin_update_async(resource_group_name, disk_access_name, disk_access, custom_headers: nil) ⇒ Concurrent::Promise

Updates (patches) a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. of the Patch disk access operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • disk_access (DiskAccessUpdate)

    disk access object supplied in the body

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1061

def begin_update_async(resource_group_name, disk_access_name, disk_access, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'disk_access_name is nil' if disk_access_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'disk_access is nil' if disk_access.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Compute::Mgmt::V2020_09_30::Models::DiskAccessUpdate.mapper()
  request_content = @client.serialize(request_mapper,  disk_access)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#begin_update_with_http_info(resource_group_name, disk_access_name, disk_access, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates (patches) a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. of the Patch disk access operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • disk_access (DiskAccessUpdate)

    disk access object supplied in the body

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1042
1043
1044
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1042

def begin_update_with_http_info(resource_group_name, disk_access_name, disk_access, custom_headers:nil)
  begin_update_async(resource_group_name, disk_access_name, disk_access, custom_headers:custom_headers).value!
end

#create_or_update(resource_group_name, disk_access_name, disk_access, custom_headers: nil) ⇒ DiskAccess

Creates or updates a disk access resource

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. the Put disk access operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • disk_access (DiskAccess)

    disk access object supplied in the body of

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

    A hash of custom headers that

Returns:

  • (DiskAccess)

    operation results.



39
40
41
42
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 39

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

#create_or_update_async(resource_group_name, disk_access_name, disk_access, custom_headers: nil) ⇒ Concurrent::Promise

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. the Put disk access operation. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • disk_access (DiskAccess)

    disk access object supplied in the body of

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 58

def create_or_update_async(resource_group_name, disk_access_name, disk_access, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, disk_access_name, disk_access, custom_headers:custom_headers)

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

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

  promise
end

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

Deletes a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

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

    A hash of custom headers that



242
243
244
245
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 242

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

#delete_aprivate_endpoint_connection(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers: nil) ⇒ Object

Deletes a private endpoint connection under a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. endpoint connection will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • private_endpoint_connection_name (String)

    The name of the private

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

    A hash of custom headers that



739
740
741
742
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 739

def delete_aprivate_endpoint_connection(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers:nil)
  response = delete_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
  nil
end

#delete_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers: nil) ⇒ Concurrent::Promise

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. endpoint connection will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • private_endpoint_connection_name (String)

    The name of the private

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 758

def delete_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers:nil)
  # Send request
  promise = begin_delete_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

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

  promise
end

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

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 259

def delete_async(resource_group_name, disk_access_name, custom_headers:nil)
  # Send request
  promise = begin_delete_async(resource_group_name, disk_access_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

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

  promise
end

#get(resource_group_name, disk_access_name, custom_headers: nil) ⇒ DiskAccess

Gets information about a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

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

    A hash of custom headers that

Returns:

  • (DiskAccess)

    operation results.



141
142
143
144
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 141

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

#get_aprivate_endpoint_connection(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers: nil) ⇒ PrivateEndpointConnection

Gets information about a private endpoint connection under a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. endpoint connection will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • private_endpoint_connection_name (String)

    The name of the private

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

    A hash of custom headers that

Returns:

  • (PrivateEndpointConnection)

    operation results.



629
630
631
632
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 629

def get_aprivate_endpoint_connection(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers:nil)
  response = get_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets information about a private endpoint connection under a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. endpoint connection to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • private_endpoint_connection_name (String)

    The name of the private

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 670

def get_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'disk_access_name is nil' if disk_access_name.nil?
  fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#get_aprivate_endpoint_connection_with_http_info(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets information about a private endpoint connection under a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. endpoint connection will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • private_endpoint_connection_name (String)

    The name of the private

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



650
651
652
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 650

def get_aprivate_endpoint_connection_with_http_info(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers:nil)
  get_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
end

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

Gets information about a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 176

def get_async(resource_group_name, disk_access_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'disk_access_name is nil' if disk_access_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

Gets the private link resources possible under disk access resource

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

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

    A hash of custom headers that

Returns:

  • (PrivateLinkResourceListResult)

    operation results.



464
465
466
467
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 464

def get_private_link_resources(resource_group_name, disk_access_name, custom_headers:nil)
  response = get_private_link_resources_async(resource_group_name, disk_access_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

Gets the private link resources possible under disk access resource

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 499

def get_private_link_resources_async(resource_group_name, disk_access_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'disk_access_name is nil' if disk_access_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

Gets the private link resources possible under disk access resource

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



482
483
484
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 482

def get_private_link_resources_with_http_info(resource_group_name, disk_access_name, custom_headers:nil)
  get_private_link_resources_async(resource_group_name, disk_access_name, custom_headers:custom_headers).value!
end

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

Gets information about a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



159
160
161
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 159

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

#list(custom_headers: nil) ⇒ Array<DiskAccess>

Lists all the disk access resources under a subscription.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (Array<DiskAccess>)

    operation results.



373
374
375
376
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 373

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

#list_as_lazy(custom_headers: nil) ⇒ DiskAccessList

Lists all the disk access resources under a subscription.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (DiskAccessList)

    which provide lazy access to pages of the response.



1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1766

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

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

Lists all the disk access resources under a subscription.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 398

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Lists all the disk access resources under a resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

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

    A hash of custom headers that

Returns:

  • (Array<DiskAccess>)

    operation results.



284
285
286
287
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 284

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

#list_by_resource_group_as_lazy(resource_group_name, custom_headers: nil) ⇒ DiskAccessList

Lists all the disk access resources under a resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

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

    A hash of custom headers that

Returns:

  • (DiskAccessList)

    which provide lazy access to pages of the response.



1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1747

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

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

Lists all the disk access resources under a resource group.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



311
312
313
314
315
316
317
318
319
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
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 311

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_by_resource_group_next(next_page_link, custom_headers: nil) ⇒ DiskAccessList

Lists all the disk access resources under a resource group.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (DiskAccessList)

    operation results.



1475
1476
1477
1478
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1475

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

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

Lists all the disk access resources under a resource group.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1504

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Lists all the disk access resources under a resource group.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1490
1491
1492
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1490

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

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

Lists all the disk access resources under a resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



298
299
300
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 298

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

#list_next(next_page_link, custom_headers: nil) ⇒ DiskAccessList

Lists all the disk access resources under a subscription.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (DiskAccessList)

    operation results.



1565
1566
1567
1568
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1565

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

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

Lists all the disk access resources under a subscription.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1594

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Lists all the disk access resources under a subscription.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1580
1581
1582
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1580

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

#list_private_endpoint_connections(resource_group_name, disk_access_name, custom_headers: nil) ⇒ Array<PrivateEndpointConnection>

List information about private endpoint connections under a disk access resource

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

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

    A hash of custom headers that

Returns:

  • (Array<PrivateEndpointConnection>)

    operation results.



788
789
790
791
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 788

def list_private_endpoint_connections(resource_group_name, disk_access_name, custom_headers:nil)
  first_page = list_private_endpoint_connections_as_lazy(resource_group_name, disk_access_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_private_endpoint_connections_as_lazy(resource_group_name, disk_access_name, custom_headers: nil) ⇒ PrivateEndpointConnectionListResult

List information about private endpoint connections under a disk access resource

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. will be added to the HTTP request.

pages of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

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

    A hash of custom headers that

Returns:

  • (PrivateEndpointConnectionListResult)

    which provide lazy access to



1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1792

def list_private_endpoint_connections_as_lazy(resource_group_name, disk_access_name, custom_headers:nil)
  response = list_private_endpoint_connections_async(resource_group_name, disk_access_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_private_endpoint_connections_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_private_endpoint_connections_async(resource_group_name, disk_access_name, custom_headers: nil) ⇒ Concurrent::Promise

List information about private endpoint connections under a disk access resource

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 825

def list_private_endpoint_connections_async(resource_group_name, disk_access_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'disk_access_name is nil' if disk_access_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_private_endpoint_connections_next(next_page_link, custom_headers: nil) ⇒ PrivateEndpointConnectionListResult

List information about private endpoint connections under a disk access resource

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (PrivateEndpointConnectionListResult)

    operation results.



1656
1657
1658
1659
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1656

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

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

List information about private endpoint connections under a disk access resource

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1687

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

List information about private endpoint connections under a disk access resource

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1672
1673
1674
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 1672

def list_private_endpoint_connections_next_with_http_info(next_page_link, custom_headers:nil)
  list_private_endpoint_connections_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_private_endpoint_connections_with_http_info(resource_group_name, disk_access_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List information about private endpoint connections under a disk access resource

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



807
808
809
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 807

def list_private_endpoint_connections_with_http_info(resource_group_name, disk_access_name, custom_headers:nil)
  list_private_endpoint_connections_async(resource_group_name, disk_access_name, custom_headers:custom_headers).value!
end

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

Lists all the disk access resources under a subscription.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



386
387
388
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 386

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

#update(resource_group_name, disk_access_name, disk_access, custom_headers: nil) ⇒ DiskAccess

Updates (patches) a disk access resource.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. of the Patch disk access operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • disk_access (DiskAccessUpdate)

    disk access object supplied in the body

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

    A hash of custom headers that

Returns:

  • (DiskAccess)

    operation results.



91
92
93
94
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 91

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

#update_aprivate_endpoint_connection(resource_group_name, disk_access_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers: nil) ⇒ PrivateEndpointConnection

Approve or reject a private endpoint connection under disk access resource, this can't be used to create a new private endpoint connection.

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. endpoint connection endpoint connection object supplied in the body of the Put private endpoint connection operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • private_endpoint_connection_name (String)

    The name of the private

  • private_endpoint_connection (PrivateEndpointConnection)

    private

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

    A hash of custom headers that

Returns:

  • (PrivateEndpointConnection)

    operation results.



573
574
575
576
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 573

def update_aprivate_endpoint_connection(resource_group_name, disk_access_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil)
  response = update_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers: nil) ⇒ Concurrent::Promise

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. endpoint connection endpoint connection object supplied in the body of the Put private endpoint connection operation. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • private_endpoint_connection_name (String)

    The name of the private

  • private_endpoint_connection (PrivateEndpointConnection)

    private

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 595

def update_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:nil)
  # Send request
  promise = begin_update_aprivate_endpoint_connection_async(resource_group_name, disk_access_name, private_endpoint_connection_name, private_endpoint_connection, custom_headers:custom_headers)

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

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

  promise
end

#update_async(resource_group_name, disk_access_name, disk_access, custom_headers: nil) ⇒ Concurrent::Promise

being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. of the Patch disk access operation. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • disk_access_name (String)

    The name of the disk access resource that is

  • disk_access (DiskAccessUpdate)

    disk access object supplied in the body

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/2020-09-30/generated/azure_mgmt_compute/disk_accesses.rb', line 110

def update_async(resource_group_name, disk_access_name, disk_access, custom_headers:nil)
  # Send request
  promise = begin_update_async(resource_group_name, disk_access_name, disk_access, custom_headers:custom_headers)

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

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

  promise
end