Sha256: 3c5cc607d484a4d996516fb2b71456683d8e3b7be182b84a0ded3b0528865fe9

Contents?: true

Size: 1.5 KB

Versions: 19

Compression:

Stored size: 1.5 KB

Contents

module Fog
  module Storage
    class AzureRM
      # This class is giving implementation of all/list, get and
      # check name availability for storage account.
      class StorageAccounts < Fog::Collection
        model Fog::Storage::AzureRM::StorageAccount
        attribute :resource_group

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

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

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

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

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
fog-azure-rm-0.3.5 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-0.3.4 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-temp-0.0.4 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-temp-0.0.3 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-0.3.3 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-temp-0.0.2 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-temp-0.0.1 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-0.3.2 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-downgraded-0.3.1 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-0.3.1 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-downgraded-0.3.0 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-0.3.0 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-0.2.7 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-0.2.6 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-0.2.5 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-0.2.4 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-0.2.3 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-0.2.2 lib/fog/azurerm/models/storage/storage_accounts.rb
fog-azure-rm-0.2.1 lib/fog/azurerm/models/storage/storage_accounts.rb