Class: Azure::Storage::Mgmt::V2015_05_01_preview::StorageAccounts

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb

Overview

The Storage Management Client.

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/2015-05-01-preview/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/2015-05-01-preview/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. Existing accounts cannot be updated with this API and should instead use the Update Storage Account API. If an account is already created and subsequent PUT request is issued with exact same set of properties, then HTTP 200 would be returned.

user’s subscription. 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.



946
947
948
949
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 946

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. Existing accounts cannot be updated with this API and should instead use the Update Storage Account API. If an account is already created and subsequent PUT request is issued with exact same set of properties, then HTTP 200 would be returned.

user’s subscription. 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.



993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 993

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


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

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

  # Serialize Request
  request_mapper = Azure::Storage::Mgmt::V2015_05_01_preview::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::V2015_05_01_preview::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. Existing accounts cannot be updated with this API and should instead use the Update Storage Account API. If an account is already created and subsequent PUT request is issued with exact same set of properties, then HTTP 200 would be returned.

user’s subscription. 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.



970
971
972
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 970

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

#check_name_availability(account_name, custom_headers: nil) ⇒ CheckNameAvailabilityResult

Checks that account name is valid and is not 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/2015-05-01-preview/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 account name is valid and is not 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
# File 'lib/2015-05-01-preview/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.subscription_id is nil' if @client.subscription_id.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Storage::Mgmt::V2015_05_01_preview::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::V2015_05_01_preview::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 account name is valid and is not 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/2015-05-01-preview/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. Existing accounts cannot be updated with this API and should instead use the Update Storage Account API. If an account is already created and subsequent PUT request is issued with exact same set of properties, then HTTP 200 would be returned.

user’s subscription. 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.



149
150
151
152
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 149

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



168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 168

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::V2015_05_01_preview::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. 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



198
199
200
201
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 198

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



233
234
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
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 233

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


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

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



216
217
218
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 216

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

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

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

user’s subscription. 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:

  • (StorageAccount)

    operation results.



293
294
295
296
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 293

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

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

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

user’s subscription. 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.



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 332

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


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.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(: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::V2015_05_01_preview::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, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

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

user’s subscription. 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.



313
314
315
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 313

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

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

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:

  • (Array<StorageAccount>)

    operation results.



634
635
636
637
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 634

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

#list_as_lazy(custom_headers: nil) ⇒ 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.

response.

Parameters:

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

    A hash of custom headers that

Returns:

  • (StorageAccountListResult)

    which provide lazy access to pages of the



1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 1252

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

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

Lists all the 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.



661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 661

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


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.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::V2015_05_01_preview::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) ⇒ Array<StorageAccount>

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

  • (Array<StorageAccount>)

    operation results.



725
726
727
728
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 725

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

#list_by_resource_group_as_lazy(resource_group_name, custom_headers: nil) ⇒ 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. will be added to the HTTP request.

response.

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)

    which provide lazy access to pages of the



1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 1275

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

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

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

user’s subscription. 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.



756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 756

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


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.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::V2015_05_01_preview::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_next(next_page_link, 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.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (StorageAccountListResult)

    operation results.



1160
1161
1162
1163
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 1160

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

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

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

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 1191

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2015_05_01_preview::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_next_with_http_info(next_page_link, 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.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1176
1177
1178
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 1176

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

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

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

user’s subscription. 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.



741
742
743
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 741

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

Lists the access keys for the specified storage account.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • account_name (String)

    The name of the storage account.

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

    A hash of custom headers that

Returns:

  • (StorageAccountKeys)

    operation results.



541
542
543
544
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 541

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.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • account_name (String)

    The name of the storage account.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 570

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


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

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • account_name (String)

    The name of the storage account.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



556
557
558
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 556

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_next(next_page_link, 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.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (StorageAccountListResult)

    operation results.



1067
1068
1069
1070
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 1067

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

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

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

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 1098

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Storage::Mgmt::V2015_05_01_preview::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_next_with_http_info(next_page_link, 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.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1083
1084
1085
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 1083

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

#list_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.



648
649
650
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 648

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

Regenerates the access keys for the specified storage account.

user’s subscription. 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. 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:

  • (StorageAccountKeys)

    operation results.



825
826
827
828
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 825

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 the access keys for the specified storage account.

user’s subscription. 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. 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.



864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 864

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, 'account_name is nil' if .nil?
  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.subscription_id is nil' if @client.subscription_id.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Storage::Mgmt::V2015_05_01_preview::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::V2015_05_01_preview::Models::StorageAccountKeys.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 the access keys for the specified storage account.

user’s subscription. 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. 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.



845
846
847
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 845

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

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

Updates the account type or tags for a storage account. It can also be used to add a custom domain (note that custom domains cannot be added via the Create operation). Only one custom domain is supported per storage account. This API can only be used to update one of tags, accountType, or customDomain per call. To update multiple of these properties, call the API multiple times with one change per call. This call does not change the storage keys for the account. If you want to change storage account keys, use the RegenerateKey operation. The location and name of the storage account cannot be changed after creation.

user’s subscription. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. on the account. Note that only one property can be changed at a time using this API. 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 update

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

    A hash of custom headers that

Returns:

  • (StorageAccount)

    operation results.



411
412
413
414
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 411

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

Updates the account type or tags for a storage account. It can also be used to add a custom domain (note that custom domains cannot be added via the Create operation). Only one custom domain is supported per storage account. This API can only be used to update one of tags, accountType, or customDomain per call. To update multiple of these properties, call the API multiple times with one change per call. This call does not change the storage keys for the account. If you want to change storage account keys, use the RegenerateKey operation. The location and name of the storage account cannot be changed after creation.

user’s subscription. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. on the account. Note that only one property can be changed at a time using this API. 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 update

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
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
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 468

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


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

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

  # Serialize Request
  request_mapper = Azure::Storage::Mgmt::V2015_05_01_preview::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::V2015_05_01_preview::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

Updates the account type or tags for a storage account. It can also be used to add a custom domain (note that custom domains cannot be added via the Create operation). Only one custom domain is supported per storage account. This API can only be used to update one of tags, accountType, or customDomain per call. To update multiple of these properties, call the API multiple times with one change per call. This call does not change the storage keys for the account. If you want to change storage account keys, use the RegenerateKey operation. The location and name of the storage account cannot be changed after creation.

user’s subscription. specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. on the account. Note that only one property can be changed at a time using this API. 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 update

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



440
441
442
# File 'lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb', line 440

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