Class: Fog::Storage::AzureRM::StorageAccounts

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/azurerm/models/storage/storage_accounts.rb

Overview

This class is giving implementation of all/list, get and check name availability for storage account.

Instance Method Summary collapse

Instance Method Details

#allObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/fog/azurerm/models/storage/storage_accounts.rb', line 10

def all
  accounts = []
  if !resource_group.nil?
    requires :resource_group
    hash_of_storage_accounts = service.(resource_group)
  else
    hash_of_storage_accounts = service.list_storage_accounts
  end
  hash_of_storage_accounts.each do ||
    accounts << Fog::Storage::AzureRM::StorageAccount.parse()
  end
  load(accounts)
end

#check_name_availability(name, type = 'Microsoft.Storage/storageAccounts') ⇒ Object



30
31
32
# File 'lib/fog/azurerm/models/storage/storage_accounts.rb', line 30

def check_name_availability(name, type = 'Microsoft.Storage/storageAccounts')
  service.(name, type)
end

#check_storage_account_exists(resource_group_name, storage_account_name) ⇒ Object



41
42
43
# File 'lib/fog/azurerm/models/storage/storage_accounts.rb', line 41

def (resource_group_name, )
  service.(resource_group_name, )
end

#delete_storage_account_from_tag(resource_group_name, tag_key, tag_value) ⇒ Object



34
35
36
37
38
39
# File 'lib/fog/azurerm/models/storage/storage_accounts.rb', line 34

def (resource_group_name, tag_key, tag_value)
  storage_accounts = service.storage_accounts(resource_group: resource_group_name)
  storage_accounts.each do ||
    .destroy if .tags[tag_key].eql? tag_value
  end
end

#get(resource_group_name, storage_account_name) ⇒ Object



24
25
26
27
28
# File 'lib/fog/azurerm/models/storage/storage_accounts.rb', line 24

def get(resource_group_name, )
   = service.(resource_group_name, )
   = Fog::Storage::AzureRM::StorageAccount.new(service: service)
  .merge_attributes(Fog::Storage::AzureRM::StorageAccount.parse())
end