Class: Azure::Storage::Mgmt::V2018_11_01::StorageAccounts

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb

Overview

The Azure Storage Management API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ StorageAccounts

Creates and initializes a new instance of the StorageAccounts class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientStorageManagementClient (readonly)

Returns reference to the StorageManagementClient.

Returns:



22
23
24
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 22

def client
  @client
end

Instance Method Details

#begin_create(resource_group_name, account_name, parameters, custom_headers: nil) ⇒ StorageAccount

Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. for the created account. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • parameters (StorageAccountCreateParameters)

    The parameters to provide

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

    A hash of custom headers that

Returns:

  • (StorageAccount)

    operation results.



1402
1403
1404
1405
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 1402

def begin_create(resource_group_name, , parameters, custom_headers:nil)
  response = begin_create_async(resource_group_name, , parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_async(resource_group_name, account_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. for the created account. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • parameters (StorageAccountCreateParameters)

    The parameters to provide

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 1449

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


  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::Storage::Mgmt::V2018_11_01::Models::StorageAccountCreateParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail 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::Storage::Mgmt::V2018_11_01::Models::StorageAccount.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_with_http_info(resource_group_name, account_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. for the created account. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • parameters (StorageAccountCreateParameters)

    The parameters to provide

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1426
1427
1428
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 1426

def begin_create_with_http_info(resource_group_name, , parameters, custom_headers:nil)
  begin_create_async(resource_group_name, , parameters, custom_headers:custom_headers).value!
end

#begin_failover(resource_group_name, account_name, custom_headers: nil) ⇒ Object

Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account’s primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

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

    A hash of custom headers that



1534
1535
1536
1537
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 1534

def begin_failover(resource_group_name, , custom_headers:nil)
  response = begin_failover_async(resource_group_name, , custom_headers:custom_headers).value!
  nil
end

#begin_failover_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise

Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account’s primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 1575

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


  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.Storage/storageAccounts/{accountName}/failover'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || 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?

    result
  end

  promise.execute
end

#begin_failover_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account’s primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1555
1556
1557
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 1555

def begin_failover_with_http_info(resource_group_name, , custom_headers:nil)
  begin_failover_async(resource_group_name, , custom_headers:custom_headers).value!
end

#check_name_availability(account_name, custom_headers: nil) ⇒ CheckNameAvailabilityResult

Checks that the storage account name is valid and is not already in use.

of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. will be added to the HTTP request.

Parameters:

  • account_name (StorageAccountCheckNameAvailabilityParameters)

    The name

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

    A hash of custom headers that

Returns:

  • (CheckNameAvailabilityResult)

    operation results.



36
37
38
39
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 36

def check_name_availability(, custom_headers:nil)
  response = check_name_availability_async(, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#check_name_availability_async(account_name, custom_headers: nil) ⇒ Concurrent::Promise

Checks that the storage account name is valid and is not already in use.

of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. to the HTTP request.

Parameters:

  • account_name (StorageAccountCheckNameAvailabilityParameters)

    The name

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 69

def check_name_availability_async(, custom_headers:nil)
  fail ArgumentError, 'account_name is nil' if .nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


  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::Storage::Mgmt::V2018_11_01::Models::StorageAccountCheckNameAvailabilityParameters.mapper()
  request_content = @client.serialize(request_mapper,  )
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'

  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},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail 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::Storage::Mgmt::V2018_11_01::Models::CheckNameAvailabilityResult.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

#check_name_availability_with_http_info(account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Checks that the storage account name is valid and is not already in use.

of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. will be added to the HTTP request.

Parameters:

  • account_name (StorageAccountCheckNameAvailabilityParameters)

    The name

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



53
54
55
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 53

def check_name_availability_with_http_info(, custom_headers:nil)
  check_name_availability_async(, custom_headers:custom_headers).value!
end

#create(resource_group_name, account_name, parameters, custom_headers: nil) ⇒ StorageAccount

Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. for the created account. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • parameters (StorageAccountCreateParameters)

    The parameters to provide

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

    A hash of custom headers that

Returns:

  • (StorageAccount)

    operation results.



151
152
153
154
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 151

def create(resource_group_name, , parameters, custom_headers:nil)
  response = create_async(resource_group_name, , parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_async(resource_group_name, account_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. for the created account. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • parameters (StorageAccountCreateParameters)

    The parameters to provide

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 170

def create_async(resource_group_name, , parameters, custom_headers:nil)
  # Send request
  promise = begin_create_async(resource_group_name, , parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Storage::Mgmt::V2018_11_01::Models::StorageAccount.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, account_name, custom_headers: nil) ⇒ Object

Deletes a storage account in Microsoft Azure.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

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

    A hash of custom headers that



200
201
202
203
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 200

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

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

Deletes a storage account in Microsoft Azure.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 235

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


  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.Storage/storageAccounts/{accountName}'

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

Deletes a storage account in Microsoft Azure.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



218
219
220
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 218

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

#failover(resource_group_name, account_name, custom_headers: nil) ⇒ Object

Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account’s primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

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

    A hash of custom headers that



1251
1252
1253
1254
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 1251

def failover(resource_group_name, , custom_headers:nil)
  response = failover_async(resource_group_name, , custom_headers:custom_headers).value!
  nil
end

#failover_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 1268

def failover_async(resource_group_name, , custom_headers:nil)
  # Send request
  promise = begin_failover_async(resource_group_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, FinalStateVia::LOCATION)
  end

  promise
end

#get_properties(resource_group_name, account_name, expand: nil, custom_headers: nil) ⇒ StorageAccount

Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. within account’s properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: ‘geoReplicationStats’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • expand (StorageAccountExpand) (defaults to: nil)

    May be used to expand the properties

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

    A hash of custom headers that

Returns:

  • (StorageAccount)

    operation results.



306
307
308
309
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 306

def get_properties(resource_group_name, , expand:nil, custom_headers:nil)
  response = get_properties_async(resource_group_name, , expand:expand, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_properties_async(resource_group_name, account_name, expand: nil, custom_headers: nil) ⇒ Concurrent::Promise

Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. within account’s properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: ‘geoReplicationStats’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • expand (StorageAccountExpand) (defaults to: nil)

    May be used to expand the properties

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 353

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


  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.Storage/storageAccounts/{accountName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'accountName' => ,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version,'$expand' => expand},
      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::Storage::Mgmt::V2018_11_01::Models::StorageAccount.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_properties_with_http_info(resource_group_name, account_name, expand: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. within account’s properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: ‘geoReplicationStats’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • expand (StorageAccountExpand) (defaults to: nil)

    May be used to expand the properties

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



330
331
332
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 330

def get_properties_with_http_info(resource_group_name, , expand:nil, custom_headers:nil)
  get_properties_async(resource_group_name, , expand:expand, custom_headers:custom_headers).value!
end

#list(custom_headers: nil) ⇒ StorageAccountListResult

Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (StorageAccountListResult)

    operation results.



572
573
574
575
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 572

def list(custom_headers:nil)
  response = list_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_account_sas(resource_group_name, account_name, parameters, custom_headers: nil) ⇒ ListAccountSasResponse

List SAS credentials of a storage account.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. SAS credentials for the storage account. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • parameters (AccountSasParameters)

    The parameters to provide to list

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

    A hash of custom headers that

Returns:

  • (ListAccountSasResponse)

    operation results.



1004
1005
1006
1007
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 1004

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

#list_account_sas_async(resource_group_name, account_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

List SAS credentials of a storage account.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. SAS credentials for the storage account. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • parameters (AccountSasParameters)

    The parameters to provide to list

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
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
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 1043

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


  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::Storage::Mgmt::V2018_11_01::Models::AccountSasParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail 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::Storage::Mgmt::V2018_11_01::Models::ListAccountSasResponse.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_account_sas_with_http_info(resource_group_name, account_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List SAS credentials of a storage account.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. SAS credentials for the storage account. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • parameters (AccountSasParameters)

    The parameters to provide to list

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1024
1025
1026
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 1024

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

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

Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this.

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.



599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 599

def list_async(custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1


  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.Storage/storageAccounts'

  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::Storage::Mgmt::V2018_11_01::Models::StorageAccountListResult.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) ⇒ StorageAccountListResult

Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this.

user’s subscription. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

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

    A hash of custom headers that

Returns:

  • (StorageAccountListResult)

    operation results.



665
666
667
668
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 665

def list_by_resource_group(resource_group_name, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

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

Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this.

user’s subscription. The name is case insensitive. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 696

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


  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.Storage/storageAccounts'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail 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::Storage::Mgmt::V2018_11_01::Models::StorageAccountListResult.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_with_http_info(resource_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this.

user’s subscription. The name is case insensitive. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



681
682
683
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 681

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_keys(resource_group_name, account_name, custom_headers: nil) ⇒ StorageAccountListKeysResult

Lists the access keys for the specified storage account.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

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

    A hash of custom headers that

Returns:

  • (StorageAccountListKeysResult)

    operation results.



768
769
770
771
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 768

def list_keys(resource_group_name, , custom_headers:nil)
  response = list_keys_async(resource_group_name, , custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_keys_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise

Lists the access keys for the specified storage account.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 803

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


  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.Storage/storageAccounts/{accountName}/listKeys'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail 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::Storage::Mgmt::V2018_11_01::Models::StorageAccountListKeysResult.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_keys_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the access keys for the specified storage account.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



786
787
788
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 786

def list_keys_with_http_info(resource_group_name, , custom_headers:nil)
  list_keys_async(resource_group_name, , custom_headers:custom_headers).value!
end

#list_service_sas(resource_group_name, account_name, parameters, custom_headers: nil) ⇒ ListServiceSasResponse

List service SAS credentials of a specific resource.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. service SAS credentials. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • parameters (ServiceSasParameters)

    The parameters to provide to list

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

    A hash of custom headers that

Returns:

  • (ListServiceSasResponse)

    operation results.



1128
1129
1130
1131
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 1128

def list_service_sas(resource_group_name, , parameters, custom_headers:nil)
  response = list_service_sas_async(resource_group_name, , parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_service_sas_async(resource_group_name, account_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

List service SAS credentials of a specific resource.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. service SAS credentials. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • parameters (ServiceSasParameters)

    The parameters to provide to list

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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

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


  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::Storage::Mgmt::V2018_11_01::Models::ServiceSasParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail 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::Storage::Mgmt::V2018_11_01::Models::ListServiceSasResponse.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_service_sas_with_http_info(resource_group_name, account_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List service SAS credentials of a specific resource.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. service SAS credentials. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • parameters (ServiceSasParameters)

    The parameters to provide to list

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1148
1149
1150
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 1148

def list_service_sas_with_http_info(resource_group_name, , parameters, custom_headers:nil)
  list_service_sas_async(resource_group_name, , parameters, custom_headers:custom_headers).value!
end

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

Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this.

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.



586
587
588
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 586

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

#regenerate_key(resource_group_name, account_name, regenerate_key, custom_headers: nil) ⇒ StorageAccountListKeysResult

Regenerates one of the access keys for the specified storage account.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. of the key which should be regenerated – key1 or key2. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • regenerate_key (StorageAccountRegenerateKeyParameters)

    Specifies name

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

    A hash of custom headers that

Returns:

  • (StorageAccountListKeysResult)

    operation results.



880
881
882
883
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 880

def regenerate_key(resource_group_name, , regenerate_key, custom_headers:nil)
  response = regenerate_key_async(resource_group_name, , regenerate_key, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#regenerate_key_async(resource_group_name, account_name, regenerate_key, custom_headers: nil) ⇒ Concurrent::Promise

Regenerates one of the access keys for the specified storage account.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. of the key which should be regenerated – key1 or key2. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • regenerate_key (StorageAccountRegenerateKeyParameters)

    Specifies name

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 919

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


  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::Storage::Mgmt::V2018_11_01::Models::StorageAccountRegenerateKeyParameters.mapper()
  request_content = @client.serialize(request_mapper,  regenerate_key)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail 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::Storage::Mgmt::V2018_11_01::Models::StorageAccountListKeysResult.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

#regenerate_key_with_http_info(resource_group_name, account_name, regenerate_key, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Regenerates one of the access keys for the specified storage account.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. of the key which should be regenerated – key1 or key2. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • regenerate_key (StorageAccountRegenerateKeyParameters)

    Specifies name

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



900
901
902
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 900

def regenerate_key_with_http_info(resource_group_name, , regenerate_key, custom_headers:nil)
  regenerate_key_async(resource_group_name, , regenerate_key, custom_headers:custom_headers).value!
end

#revoke_user_delegation_keys(resource_group_name, account_name, custom_headers: nil) ⇒ Object

Revoke user delegation keys.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

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

    A hash of custom headers that



1296
1297
1298
1299
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 1296

def revoke_user_delegation_keys(resource_group_name, , custom_headers:nil)
  response = revoke_user_delegation_keys_async(resource_group_name, , custom_headers:custom_headers).value!
  nil
end

#revoke_user_delegation_keys_async(resource_group_name, account_name, custom_headers: nil) ⇒ Concurrent::Promise

Revoke user delegation keys.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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

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


  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.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail 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

#revoke_user_delegation_keys_with_http_info(resource_group_name, account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Revoke user delegation keys.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1314
1315
1316
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 1314

def revoke_user_delegation_keys_with_http_info(resource_group_name, , custom_headers:nil)
  revoke_user_delegation_keys_async(resource_group_name, , custom_headers:custom_headers).value!
end

#update(resource_group_name, account_name, parameters, custom_headers: nil) ⇒ StorageAccount

The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. for the updated account. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • parameters (StorageAccountUpdateParameters)

    The parameters to provide

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

    A hash of custom headers that

Returns:

  • (StorageAccount)

    operation results.



438
439
440
441
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 438

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

#update_async(resource_group_name, account_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. for the updated account. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • parameters (StorageAccountUpdateParameters)

    The parameters to provide

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 493

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


  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::Storage::Mgmt::V2018_11_01::Models::StorageAccountUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      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::Storage::Mgmt::V2018_11_01::Models::StorageAccount.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update_with_http_info(resource_group_name, account_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation.

user’s subscription. The name is case insensitive. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. for the updated account. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group within the

  • account_name (String)

    The name of the storage account within the

  • parameters (StorageAccountUpdateParameters)

    The parameters to provide

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



466
467
468
# File 'lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb', line 466

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