Sha256: 71787a239e19c1b320f694ba276dee03df45f8167897935bccd08d2cecc1ec84

Contents?: true

Size: 1.36 KB

Versions: 1

Compression:

Stored size: 1.36 KB

Contents

module Fog
  module Storage
    class AzureRM
      # This class provides the actual implementation for service calls.
      class Real
        def get_storage_access_keys(resource_group, storage_account_name, options = {})
          options[:request_id] = SecureRandom.uuid
          msg = "Getting storage access keys for storage account: #{storage_account_name}, #{options}."
          Fog::Logger.debug msg
          begin
            storage_account_keys = @storage_mgmt_client.storage_accounts.list_keys(resource_group, storage_account_name, options)
          rescue MsRestAzure::AzureOperationError => ex
            raise_azure_exception(ex, msg)
          end
          Fog::Logger.debug "Storage access keys for storage account: #{storage_account_name} listed successfully."
          storage_account_keys.keys
        end
      end
      # This class provides the mock implementation.
      class Mock
        def get_storage_access_keys(_resource_group, storage_account_name, _options = {})
          Fog::Logger.debug "Getting storage access keys for storage account: #{storage_account_name}."
          Fog::Logger.debug "Storage access keys for storage account: #{storage_account_name} listed successfully."
          {
            'key1' => 'key1 value',
            'key2' => 'key2 value'
          }
        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_access_keys.rb