gitlab-fog-azure-rm 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +12 -0
  3. data/.rubocop_todo.yml +1 -1
  4. data/gitlab-fog-azure-rm.gemspec +3 -2
  5. data/lib/fog/azurerm/docs/storage.md +1 -1
  6. data/lib/fog/azurerm/identity_encoding_filter.rb +12 -0
  7. data/lib/fog/azurerm/models/storage/directories.rb +6 -6
  8. data/lib/fog/azurerm/models/storage/directory.rb +4 -4
  9. data/lib/fog/azurerm/models/storage/file.rb +6 -3
  10. data/lib/fog/azurerm/models/storage/files.rb +8 -8
  11. data/lib/fog/azurerm/models/storage/storage_account.rb +4 -4
  12. data/lib/fog/azurerm/models/storage/storage_accounts.rb +6 -6
  13. data/lib/fog/azurerm/requests/storage/acquire_blob_lease.rb +2 -2
  14. data/lib/fog/azurerm/requests/storage/acquire_container_lease.rb +2 -2
  15. data/lib/fog/azurerm/requests/storage/check_container_exists.rb +2 -2
  16. data/lib/fog/azurerm/requests/storage/commit_blob_blocks.rb +2 -2
  17. data/lib/fog/azurerm/requests/storage/compare_container_blobs.rb +2 -2
  18. data/lib/fog/azurerm/requests/storage/copy_blob.rb +2 -2
  19. data/lib/fog/azurerm/requests/storage/copy_blob_from_uri.rb +2 -2
  20. data/lib/fog/azurerm/requests/storage/copy_object.rb +2 -2
  21. data/lib/fog/azurerm/requests/storage/create_block_blob.rb +2 -2
  22. data/lib/fog/azurerm/requests/storage/create_container.rb +2 -2
  23. data/lib/fog/azurerm/requests/storage/create_page_blob.rb +2 -2
  24. data/lib/fog/azurerm/requests/storage/delete_blob.rb +2 -2
  25. data/lib/fog/azurerm/requests/storage/delete_blob_https_url.rb +4 -4
  26. data/lib/fog/azurerm/requests/storage/delete_container.rb +2 -2
  27. data/lib/fog/azurerm/requests/storage/delete_object.rb +2 -2
  28. data/lib/fog/azurerm/requests/storage/delete_object_url.rb +2 -2
  29. data/lib/fog/azurerm/requests/storage/get_blob.rb +2 -2
  30. data/lib/fog/azurerm/requests/storage/get_blob_http_url.rb +5 -5
  31. data/lib/fog/azurerm/requests/storage/get_blob_https_url.rb +6 -5
  32. data/lib/fog/azurerm/requests/storage/get_blob_properties.rb +2 -2
  33. data/lib/fog/azurerm/requests/storage/get_blob_url.rb +4 -4
  34. data/lib/fog/azurerm/requests/storage/get_container_acl.rb +2 -2
  35. data/lib/fog/azurerm/requests/storage/get_container_properties.rb +2 -2
  36. data/lib/fog/azurerm/requests/storage/get_container_url.rb +4 -4
  37. data/lib/fog/azurerm/requests/storage/get_object.rb +2 -2
  38. data/lib/fog/azurerm/requests/storage/get_object_url.rb +2 -2
  39. data/lib/fog/azurerm/requests/storage/list_blobs.rb +2 -2
  40. data/lib/fog/azurerm/requests/storage/list_containers.rb +2 -2
  41. data/lib/fog/azurerm/requests/storage/put_blob_block.rb +2 -2
  42. data/lib/fog/azurerm/requests/storage/put_blob_http_url.rb +39 -0
  43. data/lib/fog/azurerm/requests/storage/put_blob_https_url.rb +4 -4
  44. data/lib/fog/azurerm/requests/storage/put_blob_metadata.rb +2 -2
  45. data/lib/fog/azurerm/requests/storage/put_blob_pages.rb +2 -2
  46. data/lib/fog/azurerm/requests/storage/put_blob_properties.rb +2 -2
  47. data/lib/fog/azurerm/requests/storage/put_container_acl.rb +2 -2
  48. data/lib/fog/azurerm/requests/storage/put_container_metadata.rb +2 -2
  49. data/lib/fog/azurerm/requests/storage/put_object_url.rb +2 -2
  50. data/lib/fog/azurerm/requests/storage/release_blob_lease.rb +2 -2
  51. data/lib/fog/azurerm/requests/storage/release_container_lease.rb +2 -2
  52. data/lib/fog/azurerm/requests/storage/save_page_blob.rb +2 -2
  53. data/lib/fog/azurerm/requests/storage/wait_blob_copy_operation_to_finish.rb +2 -2
  54. data/lib/fog/azurerm/storage.rb +62 -9
  55. data/lib/fog/azurerm/utilities/general.rb +0 -5
  56. data/lib/fog/azurerm/version.rb +1 -1
  57. data/lib/fog/azurerm.rb +4 -5
  58. data/rakefile +4 -5
  59. data/test/api_stub/models/storage/directory.rb +1 -1
  60. data/test/api_stub/models/storage/file.rb +1 -1
  61. data/test/api_stub/requests/storage/directory.rb +1 -1
  62. data/test/api_stub/requests/storage/file.rb +4 -4
  63. data/test/integration/README.md +5 -7
  64. data/test/integration/blob.rb +28 -36
  65. data/test/integration/container.rb +8 -39
  66. data/test/integration/credentials/azure.yml +4 -5
  67. data/test/models/storage/test_directories.rb +5 -5
  68. data/test/models/storage/test_directory.rb +2 -2
  69. data/test/models/storage/test_file.rb +16 -4
  70. data/test/models/storage/test_files.rb +8 -8
  71. data/test/requests/storage/test_acquire_blob_lease.rb +2 -2
  72. data/test/requests/storage/test_acquire_container_lease.rb +2 -2
  73. data/test/requests/storage/test_check_container_exists.rb +1 -1
  74. data/test/requests/storage/test_commit_blob_blocks.rb +2 -2
  75. data/test/requests/storage/test_compare_container_blobs.rb +2 -2
  76. data/test/requests/storage/test_copy_blob.rb +2 -2
  77. data/test/requests/storage/test_copy_blob_from_uri.rb +2 -2
  78. data/test/requests/storage/test_create_block_blob.rb +2 -2
  79. data/test/requests/storage/test_create_container.rb +2 -2
  80. data/test/requests/storage/test_create_page_blob.rb +2 -2
  81. data/test/requests/storage/test_delete_blob.rb +2 -2
  82. data/test/requests/storage/test_delete_blob_https_url.rb +7 -10
  83. data/test/requests/storage/test_delete_container.rb +2 -2
  84. data/test/requests/storage/test_delete_object.rb +2 -2
  85. data/test/requests/storage/test_get_blob.rb +2 -2
  86. data/test/requests/storage/test_get_blob_encoding.rb +45 -0
  87. data/test/requests/storage/test_get_blob_http_url.rb +13 -9
  88. data/test/requests/storage/test_get_blob_https_url.rb +95 -13
  89. data/test/requests/storage/test_get_blob_properties.rb +2 -2
  90. data/test/requests/storage/test_get_blob_url.rb +15 -24
  91. data/test/requests/storage/test_get_container_acl.rb +2 -2
  92. data/test/requests/storage/test_get_container_properties.rb +2 -2
  93. data/test/requests/storage/test_get_container_url.rb +5 -8
  94. data/test/requests/storage/test_get_object.rb +2 -2
  95. data/test/requests/storage/test_list_blobs.rb +2 -2
  96. data/test/requests/storage/test_list_containers.rb +2 -2
  97. data/test/requests/storage/test_put_blob_block.rb +2 -2
  98. data/test/requests/storage/test_put_blob_http_url.rb +33 -0
  99. data/test/requests/storage/test_put_blob_https_url.rb +8 -11
  100. data/test/requests/storage/test_put_blob_metadata.rb +2 -2
  101. data/test/requests/storage/test_put_blob_pages.rb +2 -2
  102. data/test/requests/storage/test_put_blob_properties.rb +2 -2
  103. data/test/requests/storage/test_put_container_acl.rb +2 -2
  104. data/test/requests/storage/test_put_container_metadata.rb +2 -2
  105. data/test/requests/storage/test_release_blob_lease.rb +2 -2
  106. data/test/requests/storage/test_release_container_lease.rb +2 -2
  107. data/test/requests/storage/test_save_page_blob.rb +2 -2
  108. data/test/requests/storage/test_wait_blob_copy_operation_to_finish.rb +15 -6
  109. data/test/test_helper.rb +38 -690
  110. metadata +27 -20
  111. data/lib/fog/azurerm/models/resources/azure_resource.rb +0 -25
  112. data/lib/fog/azurerm/models/resources/azure_resources.rb +0 -40
  113. data/lib/fog/azurerm/models/resources/dependency.rb +0 -27
  114. data/lib/fog/azurerm/models/resources/deployment.rb +0 -65
  115. data/lib/fog/azurerm/models/resources/deployments.rb +0 -30
  116. data/lib/fog/azurerm/models/resources/provider.rb +0 -27
  117. data/lib/fog/azurerm/models/resources/provider_resource_type.rb +0 -22
  118. data/lib/fog/azurerm/models/resources/resource_group.rb +0 -34
  119. data/lib/fog/azurerm/models/resources/resource_groups.rb +0 -29
  120. data/test/integration/storage_account.rb +0 -135
  121. data/test/smoke_tests/compute/test_resource_group_smoke.rb +0 -37
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e159dfc8b3cace029e335019a550572fd139b03621711088ef223f87989b0b97
4
- data.tar.gz: aaebbcfd822283723b45ebb2db3a1588a67ca90b26cd1ddc319630f21131338d
3
+ metadata.gz: dee64342b22c3eb8a2a9ef9798f78a2b29ca94754f8cd5989cdd54f85e02fa2e
4
+ data.tar.gz: fca636a203da2fb799fca4b3a9728a70c79c064d4501af0e9ab161e3b0d2f220
5
5
  SHA512:
6
- metadata.gz: 28dd5cd1ed31cad829892047887b48790f78370fa2b2e56fd5f5aa57140347cb7f31db8fc03d37552ffdfe0bcda6a6a219541b713d9b286c7d0a833934785ebe
7
- data.tar.gz: 7604dd353e7d0345943e4d90bdc77184ca293deb605d1d3682a293107ae55c38026cde9e88f5ddee3c60c709046dd742a5d08864b8b601fa7609a33d8c807e55
6
+ metadata.gz: e67e3cd13e9e244e49048b173d07b979a582da5c1fe371740e0609baecb47caf87d4f02886d1951ce108fe392f9d0520178540e3b7aeb96f4a00f18da0b50571
7
+ data.tar.gz: 21c78c8d3407104297f2ed6d9cbf841188d2d87e03f10c35a6bd3fae67baee3cfd7661d5c69251bc1a3b6d01b7a2add98cbbed0bd6d67910fcfae489a6ac28b4
data/.gitlab-ci.yml CHANGED
@@ -1,3 +1,6 @@
1
+ include:
2
+ - component: gitlab.com/gitlab-org/components/gem-release/gem-release@~latest
3
+
1
4
  default:
2
5
  image: "ruby:${RUBY_VERSION}"
3
6
 
@@ -21,3 +24,12 @@ rubocop:
21
24
  - bundle exec rubocop
22
25
  variables:
23
26
  RUBY_VERSION: "2.7"
27
+
28
+ integration:
29
+ services:
30
+ - alias: azurite
31
+ name: mcr.microsoft.com/azure-storage/azurite
32
+ script:
33
+ - bundle exec rake integration
34
+ variables:
35
+ RUBY_VERSION: "3.2"
data/.rubocop_todo.yml CHANGED
@@ -86,7 +86,7 @@ Lint/Void:
86
86
  # Offense count: 30
87
87
  # Configuration parameters: IgnoredMethods.
88
88
  Metrics/AbcSize:
89
- Max: 63
89
+ Max: 66
90
90
 
91
91
  # Offense count: 11
92
92
  # Configuration parameters: CountComments, CountAsOne.
@@ -22,9 +22,10 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency 'rake', '~> 13.0'
23
23
  spec.add_development_dependency 'rubocop', '~> 0.89.1'
24
24
  spec.add_development_dependency 'simplecov'
25
+ spec.add_development_dependency 'webrick', '~> 1.8'
25
26
  spec.add_dependency 'azure-storage-blob', '~> 2.0'
26
27
  spec.add_dependency 'azure-storage-common', '~> 2.0'
27
- spec.add_dependency 'fog-core', '= 2.1.0'
28
- spec.add_dependency 'fog-json', '~> 1.2.0'
28
+ spec.add_dependency 'fog-core', '~> 2.1'
29
+ spec.add_dependency 'fog-json', '~> 1.2'
29
30
  spec.add_dependency 'mime-types'
30
31
  end
@@ -15,7 +15,7 @@ require 'fog/azurerm'
15
15
  If you only want to manage the storage data, you can create the connection without the Azure subscription information:
16
16
 
17
17
  ```ruby
18
- fog_storage_service = Fog::Storage::AzureRM.new(
18
+ fog_storage_service = Fog::AzureRM::Storage.new(
19
19
  azure_storage_account_name: '<Storage Account Name>', # Name of an Azure Storage Account
20
20
  azure_storage_access_key: '<Storage Account Key>', # Key of an Azure Storage Account
21
21
  environment: '<AzureCloud/AzureChinaCloud/AzureUSGovernment/AzureGermanCloud>' # Azure cloud environment. Default is AzureCloud.
@@ -0,0 +1,12 @@
1
+ module Fog
2
+ module AzureRM
3
+ # This filter prevents Net::HTTP from inflating compressed response bodies
4
+ class IdentityEncodingFilter
5
+ def call(request, next_filter)
6
+ request.headers['Accept-Encoding'] ||= 'identity'
7
+
8
+ next_filter.call
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,15 +1,15 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class is giving implementation of listing containers.
5
5
  class Directories < Fog::Collection
6
6
  include Fog::AzureRM::Utilities::General
7
7
 
8
- model Fog::Storage::AzureRM::Directory
8
+ model Fog::AzureRM::Storage::Directory
9
9
 
10
10
  # List all directories(containers) in the storage account.
11
11
  #
12
- # @return [Fog::Storage::AzureRM::Directories]
12
+ # @return [Fog::AzureRM::Storage::Directories]
13
13
  #
14
14
  def all
15
15
  containers = service.list_containers
@@ -35,7 +35,7 @@ module Fog
35
35
  # @option options [String] marker Sets the identifier that specifies the portion of the list to be returned.
36
36
  # @option options [String] prefix Sets filters the results to return only files whose name begins with the specified prefix.
37
37
  #
38
- # @return [Fog::Storage::AzureRM::Directory] A directory. Return nil if the directory does not exist.
38
+ # @return [Fog::AzureRM::Storage::Directory] A directory. Return nil if the directory does not exist.
39
39
  #
40
40
  def get(identity, options = {})
41
41
  remap_attributes(options, max_keys: :max_results)
@@ -64,7 +64,7 @@ module Fog
64
64
  end
65
65
 
66
66
  def delete_temporary_container(storage_account_name, access_key, container_name)
67
- storage_data = Fog::Storage::AzureRM.new(azure_storage_account_name: storage_account_name, azure_storage_access_key: access_key)
67
+ storage_data = Fog::AzureRM::Storage.new(azure_storage_account_name: storage_account_name, azure_storage_access_key: access_key)
68
68
  storage_data.delete_container(container_name)
69
69
  end
70
70
 
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class is giving implementation of create and delete a container.
5
5
  class Directory < Fog::Model
6
6
  VALID_ACLS = ['container', 'blob', 'unknown', nil].freeze
@@ -73,10 +73,10 @@ module Fog
73
73
  # If you have set max_results or max_keys when getting this directory by directories.get,
74
74
  # files may be incomplete. You need to use files.all to get all files under this directory.
75
75
  #
76
- # @return [Fog::Storage::AzureRM::Files] Files.
76
+ # @return [Fog::AzureRM::Storage::Files] Files.
77
77
  #
78
78
  def files
79
- @files ||= Fog::Storage::AzureRM::Files.new(directory: self, service: service)
79
+ @files ||= Fog::AzureRM::Storage::Files.new(directory: self, service: service)
80
80
  end
81
81
 
82
82
  # Set the container permission to public or private
@@ -1,8 +1,8 @@
1
1
  require 'mime/types'
2
2
 
3
3
  module Fog
4
- module Storage
5
- class AzureRM
4
+ module AzureRM
5
+ class Storage
6
6
  # This class is giving implementation of create/save and
7
7
  # delete/destroy for Blob.
8
8
  class File < Fog::Model
@@ -149,7 +149,7 @@ module Fog
149
149
  # @param options [Hash] options for copy_object method
150
150
  # @option options [Integer] timeout Sets to raise a TimeoutError if the copy does not finish in timeout seconds.
151
151
  #
152
- # @return [Fog::Storage::AzureRM::File] New File.
152
+ # @return [Fog::AzureRM::Storage::File] New File.
153
153
  #
154
154
  def copy(target_directory_key, target_file_key, options = {})
155
155
  requires :directory, :key
@@ -252,6 +252,9 @@ module Fog
252
252
  # as a query string, while Azure needs the content_disposition parameter
253
253
  # to generate a SAS token.
254
254
  options[:content_disposition] ||= options.dig(:query, 'response-content-disposition')
255
+ options[:content_type] ||= options.dig(:query, 'response-content-type')
256
+ options = options.dup
257
+ options.delete(:query)
255
258
  options
256
259
  end
257
260
 
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class is giving implementation of listing blobs.
5
5
  class Files < Fog::Collection
6
6
  include Fog::AzureRM::Utilities::General
@@ -12,7 +12,7 @@ module Fog
12
12
  attribute :next_marker, aliases: %w(NextMarker next-marker)
13
13
  attribute :prefix, aliases: 'Prefix'
14
14
 
15
- model Fog::Storage::AzureRM::File
15
+ model Fog::AzureRM::Storage::File
16
16
 
17
17
  # List all files(blobs) under the directory.
18
18
  #
@@ -27,7 +27,7 @@ module Fog
27
27
  # @option options [String] marker Sets the identifier that specifies the portion of the list to be returned.
28
28
  # @option options [String] prefix Sets filters the results to return only files whose name begins with the specified prefix.
29
29
  #
30
- # @return [Fog::Storage::AzureRM::Files] Return nil if the directory does not exist.
30
+ # @return [Fog::AzureRM::Storage::Files] Return nil if the directory does not exist.
31
31
  #
32
32
  def all(options = {})
33
33
  requires :directory
@@ -52,7 +52,7 @@ module Fog
52
52
 
53
53
  # Enumerate every file under the directory if block_given?
54
54
  #
55
- # @return [Fog::Storage::AzureRM::Files]
55
+ # @return [Fog::AzureRM::Storage::Files]
56
56
  #
57
57
  alias each_file_this_page each
58
58
  def each
@@ -77,7 +77,7 @@ module Fog
77
77
  # @param options [Hash]
78
78
  # @option options [String] block_size Sets buffer size when block_given? is true. Default is 32 MB
79
79
  #
80
- # @return [Fog::Storage::AzureRM::File] A file. Return nil if the file does not exist.
80
+ # @return [Fog::AzureRM::Storage::File] A file. Return nil if the file does not exist.
81
81
  #
82
82
  def get(key, options = {}, &block)
83
83
  requires :directory
@@ -154,7 +154,7 @@ module Fog
154
154
  # @param key [String] Name of file
155
155
  # @param options [Hash]
156
156
  #
157
- # @return [Fog::Storage::AzureRM::File] A file. Return nil if the file does not exist.
157
+ # @return [Fog::AzureRM::Storage::File] A file. Return nil if the file does not exist.
158
158
  #
159
159
  def head(key, options = {})
160
160
  requires :directory
@@ -172,7 +172,7 @@ module Fog
172
172
  #
173
173
  # required attributes: directory
174
174
  #
175
- # @return [Fog::Storage::AzureRM::File] A file. You need to use File.save to upload this new file.
175
+ # @return [Fog::AzureRM::Storage::File] A file. You need to use File.save to upload this new file.
176
176
  #
177
177
  def new(attributes = {})
178
178
  requires :directory
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class is giving implementation of create/save and
5
5
  # delete/destroy for storage account.
6
6
  class StorageAccount < Fog::Model
@@ -35,7 +35,7 @@ module Fog
35
35
  self.replication = ALLOWED_STANDARD_REPLICATION.first if replication.nil?
36
36
  validate_sku_name!
37
37
  storage_account = service.create_storage_account(storage_account_params)
38
- merge_attributes(Fog::Storage::AzureRM::StorageAccount.parse(storage_account))
38
+ merge_attributes(Fog::AzureRM::Storage::StorageAccount.parse(storage_account))
39
39
  end
40
40
 
41
41
  def storage_account_params
@@ -55,7 +55,7 @@ module Fog
55
55
  storage_account_params = merge_attributes(storage_account_params).all_attributes
56
56
 
57
57
  storage_account = service.update_storage_account(storage_account_params)
58
- merge_attributes(Fog::Storage::AzureRM::StorageAccount.parse(storage_account))
58
+ merge_attributes(Fog::AzureRM::Storage::StorageAccount.parse(storage_account))
59
59
  end
60
60
 
61
61
  def validate_sku_name!
@@ -1,10 +1,10 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class is giving implementation of all/list, get and
5
5
  # check name availability for storage account.
6
6
  class StorageAccounts < Fog::Collection
7
- model Fog::Storage::AzureRM::StorageAccount
7
+ model Fog::AzureRM::Storage::StorageAccount
8
8
  attribute :resource_group
9
9
 
10
10
  def all
@@ -16,15 +16,15 @@ module Fog
16
16
  hash_of_storage_accounts = service.list_storage_accounts
17
17
  end
18
18
  hash_of_storage_accounts.each do |account|
19
- accounts << Fog::Storage::AzureRM::StorageAccount.parse(account)
19
+ accounts << Fog::AzureRM::Storage::StorageAccount.parse(account)
20
20
  end
21
21
  load(accounts)
22
22
  end
23
23
 
24
24
  def get(resource_group_name, storage_account_name)
25
25
  storage_account = service.get_storage_account(resource_group_name, storage_account_name)
26
- storage_account_fog = Fog::Storage::AzureRM::StorageAccount.new(service: service)
27
- storage_account_fog.merge_attributes(Fog::Storage::AzureRM::StorageAccount.parse(storage_account))
26
+ storage_account_fog = Fog::AzureRM::Storage::StorageAccount.new(service: service)
27
+ storage_account_fog.merge_attributes(Fog::AzureRM::Storage::StorageAccount.parse(storage_account))
28
28
  end
29
29
 
30
30
  def check_name_availability(name, type = 'Microsoft.Storage/storageAccounts')
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  def acquire_blob_lease(container_name, name, options = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  def acquire_container_lease(name, options = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  def check_container_exists(name)
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  def commit_blob_blocks(container_name, blob_name, blocks, options = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  def compare_container_blobs(container1, container2)
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  def copy_blob(destination_container, destination_blob, source_container, source_blob, options = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  def copy_blob_from_uri(destination_container, destination_blob, source_blob_uri, options = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  # This is to make this library compatible with CarrierWave.
6
6
  class Real
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  def create_block_blob(container_name, blob_name, body, options = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  def create_container(name, options = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  def create_page_blob(container_name, blob_name, blob_size, options = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  def delete_blob(container_name, blob_name, options = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implemention for service calls.
5
5
  class Real
6
6
  # Get a pre-signed URL to delete an object in Azure blob storage
@@ -22,7 +22,7 @@ module Fog
22
22
  expiry: expires.utc.iso8601,
23
23
  protocol: 'https'
24
24
  }
25
- token = @signature_client.generate_service_sas_token(relative_path, params)
25
+ token = signature_client(expires).generate_service_sas_token(relative_path, params)
26
26
  uri = @blob_client.generate_uri(relative_path, {}, { encode: true })
27
27
  "#{uri}?#{token}"
28
28
  end
@@ -31,7 +31,7 @@ module Fog
31
31
  # This class provides the mock implementation for unit tests.
32
32
  class Mock
33
33
  def delete_blob_https_url(*)
34
- 'https://sa.blob.core.windows.net/test_container/test_blob?token'
34
+ 'https://mockaccount.blob.core.windows.net/test_container/test_blob?token'
35
35
  end
36
36
  end
37
37
  end
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  def delete_container(name)
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  alias delete_object delete_blob
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implemention for service calls.
5
5
  class Real
6
6
  # Get a pre-signed URL to delete an object in Azure blob storage
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implemention for service calls.
5
5
  class Real
6
6
  BLOCK_SIZE = 32 * 1024 * 1024 # 32 MB
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implemention for service calls.
5
5
  class Real
6
6
  # Get an expiring http blob url from Azure blob storage
@@ -23,17 +23,17 @@ module Fog
23
23
  expiry: expires.utc.iso8601,
24
24
  content_disposition: options[:content_disposition]
25
25
  }
26
- token = @signature_client.generate_service_sas_token(relative_path, params)
26
+ token = signature_client(expires).generate_service_sas_token(relative_path, params)
27
27
  uri = @blob_client.generate_uri(relative_path, {}, { encode: true })
28
28
  url = "#{uri}?#{token}"
29
- url.gsub('https:', 'http:')
29
+ url.sub('https:', 'http:')
30
30
  end
31
31
  end
32
32
 
33
33
  # This class provides the mock implementation for unit tests.
34
34
  class Mock
35
35
  def get_blob_http_url(*)
36
- 'http://sa.blob.core.windows.net/test_container/test_blob?token'
36
+ 'http://mockaccount.blob.core.windows.net/test_container/test_blob?token'
37
37
  end
38
38
  end
39
39
  end
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implemention for service calls.
5
5
  class Real
6
6
  # Get an expiring https blob url from Azure blob storage
@@ -22,9 +22,10 @@ module Fog
22
22
  permissions: 'r',
23
23
  expiry: expires.utc.iso8601,
24
24
  protocol: 'https',
25
- content_disposition: options[:content_disposition]
25
+ content_disposition: options[:content_disposition],
26
+ content_type: options[:content_type]
26
27
  }
27
- token = @signature_client.generate_service_sas_token(relative_path, params)
28
+ token = signature_client(expires).generate_service_sas_token(relative_path, params)
28
29
  uri = @blob_client.generate_uri(relative_path, {}, { encode: true })
29
30
  "#{uri}?#{token}"
30
31
  end
@@ -33,7 +34,7 @@ module Fog
33
34
  # This class provides the mock implementation for unit tests.
34
35
  class Mock
35
36
  def get_blob_https_url(*)
36
- 'https://sa.blob.core.windows.net/test_container/test_blob?token'
37
+ 'https://mockaccount.blob.core.windows.net/test_container/test_blob?token'
37
38
  end
38
39
  end
39
40
  end
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  def get_blob_properties(container_name, name, options = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implemention for service calls.
5
5
  class Real
6
6
  # Get a public blob url from Azure blob storage
@@ -18,8 +18,8 @@ module Fog
18
18
  # This class provides the mock implementation for unit tests.
19
19
  class Mock
20
20
  def get_blob_url(_container_name, _blob_name, options = {})
21
- url = 'https://sa.blob.core.windows.net/test_container/test_blob'
22
- url.gsub!('https:', 'http:') if options[:scheme] == 'http'
21
+ url = 'https://mockaccount.blob.core.windows.net/test_container/test_blob'
22
+ url.sub!('https:', 'http:') if options[:scheme] == 'http'
23
23
  url
24
24
  end
25
25
  end
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  def get_container_acl(container_name, options = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  class Real
6
6
  def get_container_properties(name, options = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implemention for service calls.
5
5
  class Real
6
6
  # Get a public container url from Azure storage container
@@ -24,8 +24,8 @@ module Fog
24
24
  # This class provides the mock implementation for unit tests.
25
25
  class Mock
26
26
  def get_container_url(_container_name, options = {})
27
- url = 'https://sa.blob.core.windows.net/test_container?comp=list&restype=container'
28
- url.gsub!('https:', 'http:') if options[:scheme] == 'http'
27
+ url = 'https://mockaccount.blob.core.windows.net/test_container?comp=list&restype=container'
28
+ url.sub!('https:', 'http:') if options[:scheme] == 'http'
29
29
  url
30
30
  end
31
31
  end
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implemention for service calls.
5
5
  class Real
6
6
  def get_object(...)
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implemention for service calls.
5
5
  class Real
6
6
  # Get a public blob url from Azure blob storage
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Storage
3
- class AzureRM
2
+ module AzureRM
3
+ class Storage
4
4
  # This class provides the actual implementation for service calls.
5
5
  # https://msdn.microsoft.com/en-us/library/azure/dd135734.aspx
6
6
  class Real