azure-storage 0.11.5.preview → 0.12.0.preview
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/azure/storage/autoload.rb +8 -0
- data/lib/azure/storage/blob/append.rb +1 -0
- data/lib/azure/storage/blob/blob.rb +9 -9
- data/lib/azure/storage/blob/blob_service.rb +3 -13
- data/lib/azure/storage/blob/block.rb +1 -0
- data/lib/azure/storage/blob/page.rb +6 -2
- data/lib/azure/storage/client.rb +11 -8
- data/lib/azure/storage/client_options.rb +10 -2
- data/lib/azure/storage/configurable.rb +42 -6
- data/lib/azure/storage/core/auth/shared_access_signature_generator.rb +17 -1
- data/lib/azure/storage/core/filter/retry_filter.rb +13 -4
- data/lib/azure/storage/file/directory.rb +268 -0
- data/lib/azure/storage/file/file.rb +602 -0
- data/lib/azure/storage/file/file_service.rb +191 -0
- data/lib/azure/storage/file/serialization.rb +225 -0
- data/lib/azure/storage/file/share.rb +363 -0
- data/lib/azure/storage/queue/queue_service.rb +1 -1
- data/lib/azure/storage/service/storage_service.rb +22 -5
- data/lib/azure/storage/table/table_service.rb +1 -3
- data/lib/azure/storage/version.rb +2 -2
- metadata +7 -2
@@ -32,7 +32,7 @@ module Azure::Storage
|
|
32
32
|
|
33
33
|
def initialize(options = {}, &block)
|
34
34
|
client_config = options[:client] || Azure::Storage
|
35
|
-
signer = options[:signer] || Azure::Storage::Core::Auth::SharedKey.new(client_config.storage_account_name, client_config.storage_access_key)
|
35
|
+
signer = options[:signer] || client_config.signer || Azure::Storage::Core::Auth::SharedKey.new(client_config.storage_account_name, client_config.storage_access_key)
|
36
36
|
super(signer, client_config.storage_account_name, options, &block)
|
37
37
|
@host = @client.storage_queue_host
|
38
38
|
end
|
@@ -60,13 +60,16 @@ module Azure::Storage
|
|
60
60
|
#
|
61
61
|
# ==== Options
|
62
62
|
#
|
63
|
+
# * +:timeout+ - Integer. A timeout in seconds.
|
63
64
|
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
64
65
|
# in the analytics logs when storage analytics logging is enabled.
|
65
66
|
#
|
66
67
|
# Returns a Hash with the service properties or nil if the operation failed
|
67
68
|
def get_service_properties(options={})
|
68
|
-
|
69
|
-
|
69
|
+
query = { }
|
70
|
+
StorageService.with_query query, 'timeout', options[:timeout].to_s if options[:timeout]
|
71
|
+
|
72
|
+
response = call(:get, service_properties_uri(query), nil, {}, options)
|
70
73
|
Serialization.service_properties_from_xml response.body
|
71
74
|
end
|
72
75
|
|
@@ -79,14 +82,17 @@ module Azure::Storage
|
|
79
82
|
#
|
80
83
|
# ==== Options
|
81
84
|
#
|
85
|
+
# * +:timeout+ - Integer. A timeout in seconds.
|
82
86
|
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
83
87
|
# in the analytics logs when storage analytics logging is enabled.
|
84
88
|
#
|
85
89
|
# Returns boolean indicating success.
|
86
90
|
def set_service_properties(service_properties, options={})
|
91
|
+
query = { }
|
92
|
+
StorageService.with_query query, 'timeout', options[:timeout].to_s if options[:timeout]
|
93
|
+
|
87
94
|
body = Serialization.service_properties_to_xml service_properties
|
88
|
-
|
89
|
-
call(:put, uri, body, {}, options)
|
95
|
+
call(:put, service_properties_uri(query), body, {}, options)
|
90
96
|
nil
|
91
97
|
end
|
92
98
|
|
@@ -106,7 +112,7 @@ module Azure::Storage
|
|
106
112
|
# query - Hash. the query parameters
|
107
113
|
#
|
108
114
|
# Returns the uri hash
|
109
|
-
def generate_uri(path='', query={})
|
115
|
+
def generate_uri(path='', query={}, encode=false)
|
110
116
|
if self.client.is_a?(Azure::Storage::Client) && self.client.options[:use_path_style_uri]
|
111
117
|
if path.length > 0
|
112
118
|
path = self.client.options[:storage_account_name] + '/' + path
|
@@ -115,6 +121,17 @@ module Azure::Storage
|
|
115
121
|
end
|
116
122
|
end
|
117
123
|
|
124
|
+
if encode
|
125
|
+
path = CGI.escape(path.encode('UTF-8'))
|
126
|
+
|
127
|
+
# decode the forward slashes to match what the server expects.
|
128
|
+
path = path.gsub(/%2F/, '/')
|
129
|
+
# decode the backward slashes to match what the server expects.
|
130
|
+
path = path.gsub(/%5C/, '/')
|
131
|
+
# Re-encode the spaces (encoded as space) to the % encoding.
|
132
|
+
path = path.gsub(/\+/, '%20')
|
133
|
+
end
|
134
|
+
|
118
135
|
super path, query
|
119
136
|
end
|
120
137
|
|
@@ -33,7 +33,7 @@ module Azure::Storage
|
|
33
33
|
|
34
34
|
def initialize(options = {}, &block)
|
35
35
|
client_config = options[:client] || Azure::Storage
|
36
|
-
signer = options[:signer] || Auth::SharedKey.new(client_config.storage_account_name, client_config.storage_access_key)
|
36
|
+
signer = options[:signer] || client_config.signer || Auth::SharedKey.new(client_config.storage_account_name, client_config.storage_access_key)
|
37
37
|
super(signer, client_config.storage_account_name, options, &block)
|
38
38
|
@host = client.storage_table_host
|
39
39
|
end
|
@@ -236,7 +236,6 @@ module Azure::Storage
|
|
236
236
|
query['timeout'] = options[:timeout].to_s if options[:timeout]
|
237
237
|
|
238
238
|
response = call(:post, entities_uri(table_name, nil, nil, query), body, {}, options)
|
239
|
-
|
240
239
|
result = Table::Serialization.hash_from_entry_xml(response.body)
|
241
240
|
|
242
241
|
Entity.new do |entity|
|
@@ -469,7 +468,6 @@ module Azure::Storage
|
|
469
468
|
|
470
469
|
query = { }
|
471
470
|
query["timeout"] = options[:timeout].to_s if options[:timeout]
|
472
|
-
|
473
471
|
call(:delete, entities_uri(table_name, partition_key, row_key, query), nil, { "If-Match"=> if_match }, options)
|
474
472
|
nil
|
475
473
|
end
|
@@ -27,8 +27,8 @@ module Azure
|
|
27
27
|
class Version
|
28
28
|
# Fields represent the parts defined in http://semver.org/
|
29
29
|
MAJOR = 0 unless defined? MAJOR
|
30
|
-
MINOR =
|
31
|
-
UPDATE =
|
30
|
+
MINOR = 12 unless defined? MINOR
|
31
|
+
UPDATE = 0 unless defined? UPDATE
|
32
32
|
PRE = 'preview' unless defined? PRE
|
33
33
|
|
34
34
|
class << self
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: azure-storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0.preview
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: azure-core
|
@@ -197,6 +197,11 @@ files:
|
|
197
197
|
- lib/azure/storage/core/sr.rb
|
198
198
|
- lib/azure/storage/core/utility.rb
|
199
199
|
- lib/azure/storage/default.rb
|
200
|
+
- lib/azure/storage/file/directory.rb
|
201
|
+
- lib/azure/storage/file/file.rb
|
202
|
+
- lib/azure/storage/file/file_service.rb
|
203
|
+
- lib/azure/storage/file/serialization.rb
|
204
|
+
- lib/azure/storage/file/share.rb
|
200
205
|
- lib/azure/storage/queue/message.rb
|
201
206
|
- lib/azure/storage/queue/queue.rb
|
202
207
|
- lib/azure/storage/queue/queue_service.rb
|