Sha256: fa19a3dadf91641fb5ccb8790b1faa8eceac8b06c67a747c82109778ba2a0a97

Contents?: true

Size: 1.43 KB

Versions: 1

Compression:

Stored size: 1.43 KB

Contents

module Fog
  module Storage
    class AzureRM
      # This class provides the actual implementation for service calls.
      class Real
        def get_storage_account(resource_group_name, storage_account_name)
          msg = "Getting storage account: #{storage_account_name}."
          Fog::Logger.debug msg
          begin
            storage_account = @storage_mgmt_client.storage_accounts.get_properties(resource_group_name, storage_account_name)
          rescue MsRestAzure::AzureOperationError => ex
            raise_azure_exception(ex, msg)
          end
          Fog::Logger.debug "Getting storage account: #{storage_account_name} successfully."
          storage_account
        end
      end
      # This class provides the mock implementation.
      class Mock
        def get_storage_account(*)
          storage_account_hash = {
            'id' => '/subscriptions/67f2116d-4ea2-4c6c-b20a-f92183dbe3cb/resourceGroups/fog_test_rg/providers/Microsoft.Storage/storageAccounts/fogtestsasecond',
            'name' => 'fog-test-storage-account',
            'location' => 'west us',
            'sku' =>
                {
                  'name' => 'Standard_LRS'
                }
          }
          storage_account_mapper = Azure::ARM::Storage::Models::StorageAccount.mapper
          storage_mgmt_client.deserialize(storage_account_mapper, storage_account_hash, 'hash')
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 lib/fog/azurerm/requests/storage/get_storage_account.rb