lib/fog/azurerm/storage.rb in fog-azure-rm-0.1.0 vs lib/fog/azurerm/storage.rb in fog-azure-rm-0.1.1

- old
+ new

@@ -31,29 +31,39 @@ request :create_container request :release_container_lease request :acquire_container_lease request :delete_container request :list_containers - request :get_container_metadata - request :set_container_metadata + request :put_container_metadata request :get_container_properties - request :get_container_access_control_list + request :get_container_acl + request :put_container_acl + request :get_container_url # Azure Storage Blob requests request :list_blobs - request :set_blob_metadata - request :get_blob_metadata - request :set_blob_properties + request :put_blob_metadata + request :put_blob_properties request :get_blob_properties - request :upload_block_blob_from_file - request :download_blob_to_file request :copy_blob request :copy_blob_from_uri - request :compare_blob - request :check_blob_exist + request :compare_container_blobs request :acquire_blob_lease request :release_blob_lease request :delete_blob + request :get_blob + request :get_blob_url + request :get_blob_http_url + request :get_blob_https_url + request :create_block_blob + request :put_blob_block + request :commit_blob_blocks + request :create_page_blob + request :put_blob_pages + request :wait_blob_copy_operation_to_finish + request :save_page_blob + request :multipart_save_block_blob + # Azure Recovery Vault requests request :create_or_update_recovery_vault request :get_recovery_vault request :list_recovery_vaults request :delete_recovery_vault @@ -95,10 +105,12 @@ class Real def initialize(options) begin require 'azure_mgmt_storage' require 'azure/storage' + require 'securerandom' + require 'vhd' @debug = ENV['DEBUG'] || options[:debug] require 'azure/core/http/debug_filter' if @debug rescue LoadError => e retry if require('rubygems') raise e.message @@ -109,22 +121,24 @@ @client_secret = options[:client_secret] @subscription_id = options[:subscription_id] credentials = Fog::Credentials::AzureRM.get_credentials(options[:tenant_id], options[:client_id], options[:client_secret]) unless credentials.nil? - @storage_mgmt_client = ::Azure::ARM::Storage::StorageManagementClient.new(credentials) + @storage_mgmt_client = ::Azure::ARM::Storage::StorageManagementClient.new(credentials, resource_manager_endpoint_url) @storage_mgmt_client.subscription_id = options[:subscription_id] end - if Fog::Credentials::AzureRM.new_account_credential? options - Azure::Storage.setup(storage_account_name: options[:azure_storage_account_name], - storage_access_key: options[:azure_storage_access_key], - storage_connection_string: options[:azure_storage_connection_string]) + return unless Fog::Credentials::AzureRM.new_account_credential?(options) - @blob_client = Azure::Storage::Blob::BlobService.new - @blob_client.with_filter(Azure::Storage::Core::Filter::ExponentialRetryPolicyFilter.new) - @blob_client.with_filter(Azure::Core::Http::DebugFilter.new) if @debug - end + Azure::Storage.setup(storage_account_name: options[:azure_storage_account_name], + storage_access_key: options[:azure_storage_access_key], + storage_connection_string: options[:azure_storage_connection_string]) + + @blob_client = Azure::Storage::Blob::BlobService.new + @blob_client.with_filter(Azure::Storage::Core::Filter::ExponentialRetryPolicyFilter.new) + @blob_client.with_filter(Azure::Core::Http::DebugFilter.new) if @debug + @signature_client = Azure::Storage::Core::Auth::SharedAccessSignature.new(options[:azure_storage_account_name], + options[:azure_storage_access_key]) end end end end end