azure-storage 0.13.0.preview → 0.14.0.preview
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.
- checksums.yaml +4 -4
- data/lib/azure/storage.rb +14 -13
- data/lib/azure/storage/autoload.rb +31 -31
- data/lib/azure/storage/blob/append.rb +43 -41
- data/lib/azure/storage/blob/blob.rb +150 -147
- data/lib/azure/storage/blob/blob_service.rb +186 -184
- data/lib/azure/storage/blob/block.rb +56 -56
- data/lib/azure/storage/blob/container.rb +93 -92
- data/lib/azure/storage/blob/page.rb +187 -104
- data/lib/azure/storage/blob/serialization.rb +32 -18
- data/lib/azure/storage/client.rb +18 -17
- data/lib/azure/storage/client_options.rb +192 -193
- data/lib/azure/storage/client_options_error.rb +5 -5
- data/lib/azure/storage/configurable.rb +39 -39
- data/lib/azure/storage/core.rb +6 -4
- data/lib/azure/storage/core/auth/shared_access_signature.rb +5 -3
- data/lib/azure/storage/core/auth/shared_access_signature_generator.rb +34 -33
- data/lib/azure/storage/core/auth/shared_access_signature_signer.rb +5 -5
- data/lib/azure/storage/core/auth/shared_key.rb +17 -15
- data/lib/azure/storage/core/autoload.rb +15 -13
- data/lib/azure/storage/core/error.rb +3 -1
- data/lib/azure/storage/core/filter/exponential_retry_filter.rb +13 -11
- data/lib/azure/storage/core/filter/linear_retry_filter.rb +10 -8
- data/lib/azure/storage/core/filter/retry_filter.rb +30 -29
- data/lib/azure/storage/core/http_client.rb +18 -16
- data/lib/azure/storage/core/sr.rb +50 -48
- data/lib/azure/storage/core/utility.rb +19 -17
- data/lib/azure/storage/default.rb +371 -361
- data/lib/azure/storage/file/directory.rb +36 -31
- data/lib/azure/storage/file/file.rb +103 -100
- data/lib/azure/storage/file/file_service.rb +42 -40
- data/lib/azure/storage/file/serialization.rb +9 -6
- data/lib/azure/storage/file/share.rb +48 -46
- data/lib/azure/storage/queue/message.rb +3 -1
- data/lib/azure/storage/queue/queue.rb +3 -2
- data/lib/azure/storage/queue/queue_service.rb +152 -151
- data/lib/azure/storage/queue/serialization.rb +7 -5
- data/lib/azure/storage/service/access_policy.rb +3 -1
- data/lib/azure/storage/service/cors.rb +4 -2
- data/lib/azure/storage/service/cors_rule.rb +3 -1
- data/lib/azure/storage/service/enumeration_results.rb +3 -1
- data/lib/azure/storage/service/logging.rb +5 -3
- data/lib/azure/storage/service/metrics.rb +5 -3
- data/lib/azure/storage/service/retention_policy.rb +3 -1
- data/lib/azure/storage/service/serialization.rb +31 -30
- data/lib/azure/storage/service/signed_identifier.rb +5 -4
- data/lib/azure/storage/service/storage_service.rb +33 -32
- data/lib/azure/storage/service/storage_service_properties.rb +6 -4
- data/lib/azure/storage/table/auth/shared_key.rb +9 -8
- data/lib/azure/storage/table/batch.rb +55 -55
- data/lib/azure/storage/table/batch_response.rb +17 -17
- data/lib/azure/storage/table/edmtype.rb +9 -7
- data/lib/azure/storage/table/entity.rb +4 -3
- data/lib/azure/storage/table/guid.rb +3 -1
- data/lib/azure/storage/table/query.rb +17 -19
- data/lib/azure/storage/table/serialization.rb +14 -12
- data/lib/azure/storage/table/table_service.rb +79 -80
- data/lib/azure/storage/version.rb +7 -5
- metadata +2 -2
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#-------------------------------------------------------------------------
|
2
4
|
# # Copyright (c) Microsoft and contributors. All rights reserved.
|
3
5
|
#
|
@@ -21,9 +23,9 @@
|
|
21
23
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
24
|
# THE SOFTWARE.
|
23
25
|
#--------------------------------------------------------------------------
|
24
|
-
require
|
25
|
-
require
|
26
|
-
require
|
26
|
+
require "azure/storage/core/auth/shared_key"
|
27
|
+
require "azure/storage/file/serialization"
|
28
|
+
require "azure/storage/file/file"
|
27
29
|
|
28
30
|
module Azure::Storage
|
29
31
|
module File
|
@@ -40,13 +42,13 @@ module Azure::Storage
|
|
40
42
|
@host = client.storage_file_host
|
41
43
|
end
|
42
44
|
|
43
|
-
def call(method, uri, body=nil, headers={}, options={})
|
45
|
+
def call(method, uri, body = nil, headers = {}, options = {})
|
44
46
|
# Force the request.body to the content encoding of specified in the header
|
45
|
-
if headers && !body.nil? && (body.is_a? String) && ((body.encoding.to_s <=>
|
46
|
-
if headers[
|
47
|
-
Service::StorageService.with_header headers,
|
47
|
+
if headers && !body.nil? && (body.is_a? String) && ((body.encoding.to_s <=> "ASCII_8BIT") != 0)
|
48
|
+
if headers["x-ms-content-type"].nil?
|
49
|
+
Service::StorageService.with_header headers, "x-ms-content-type", "text/plain; charset=#{body.encoding}"
|
48
50
|
else
|
49
|
-
charset = parse_charset_from_content_type(headers[
|
51
|
+
charset = parse_charset_from_content_type(headers["x-ms-content-type"])
|
50
52
|
body.force_encoding(charset) if charset
|
51
53
|
end
|
52
54
|
end
|
@@ -55,8 +57,8 @@ module Azure::Storage
|
|
55
57
|
|
56
58
|
# Force the response.body to the content charset of specified in the header.
|
57
59
|
# Content-Type is echo'd back for the blob and is used to store the encoding of the octet stream
|
58
|
-
if !response.nil? && !response.body.nil? && response.headers[
|
59
|
-
charset = parse_charset_from_content_type(response.headers[
|
60
|
+
if !response.nil? && !response.body.nil? && response.headers["Content-Type"]
|
61
|
+
charset = parse_charset_from_content_type(response.headers["Content-Type"])
|
60
62
|
response.body.force_encoding(charset) if charset && charset.length > 0
|
61
63
|
end
|
62
64
|
|
@@ -93,21 +95,21 @@ module Azure::Storage
|
|
93
95
|
#
|
94
96
|
# * +:timeout+ - Integer. A timeout in seconds.
|
95
97
|
#
|
96
|
-
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
98
|
+
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
97
99
|
# in the analytics logs when storage analytics logging is enabled.
|
98
100
|
#
|
99
101
|
# See: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/list-shares
|
100
102
|
#
|
101
103
|
# Returns an Azure::Service::EnumerationResults
|
102
104
|
#
|
103
|
-
def list_shares(options={})
|
104
|
-
query = {
|
105
|
+
def list_shares(options = {})
|
106
|
+
query = {}
|
105
107
|
if options
|
106
|
-
StorageService.with_query query,
|
107
|
-
StorageService.with_query query,
|
108
|
-
StorageService.with_query query,
|
109
|
-
StorageService.with_query query,
|
110
|
-
StorageService.with_query query,
|
108
|
+
StorageService.with_query query, "prefix", options[:prefix]
|
109
|
+
StorageService.with_query query, "marker", options[:marker]
|
110
|
+
StorageService.with_query query, "maxresults", options[:max_results].to_s if options[:max_results]
|
111
|
+
StorageService.with_query query, "include", "metadata" if options[:metadata] == true
|
112
|
+
StorageService.with_query query, "timeout", options[:timeout].to_s if options[:timeout]
|
111
113
|
end
|
112
114
|
|
113
115
|
uri = shares_uri(query)
|
@@ -125,10 +127,10 @@ module Azure::Storage
|
|
125
127
|
# Returns a URI.
|
126
128
|
#
|
127
129
|
protected
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
130
|
+
def shares_uri(query = {})
|
131
|
+
query = { "comp" => "list" }.merge(query)
|
132
|
+
generate_uri("", query)
|
133
|
+
end
|
132
134
|
|
133
135
|
# Protected: Generate the URI for a specific share.
|
134
136
|
#
|
@@ -140,11 +142,11 @@ module Azure::Storage
|
|
140
142
|
# Returns a URI.
|
141
143
|
#
|
142
144
|
protected
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
145
|
+
def share_uri(name, query = {})
|
146
|
+
return name if name.kind_of? ::URI
|
147
|
+
query = { "restype" => "share" }.merge(query)
|
148
|
+
generate_uri(name, query)
|
149
|
+
end
|
148
150
|
|
149
151
|
# Protected: Generate the URI for a specific directory.
|
150
152
|
#
|
@@ -158,11 +160,11 @@ module Azure::Storage
|
|
158
160
|
# Returns a URI.
|
159
161
|
#
|
160
162
|
protected
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
163
|
+
def directory_uri(share, directory_path, query = {})
|
164
|
+
path = directory_path.nil? ? share : ::File.join(share, directory_path)
|
165
|
+
query = { "restype" => "directory" }.merge(query)
|
166
|
+
generate_uri(path, query, true)
|
167
|
+
end
|
166
168
|
|
167
169
|
# Protected: Generate the URI for a specific file.
|
168
170
|
#
|
@@ -176,16 +178,16 @@ module Azure::Storage
|
|
176
178
|
# Returns a URI.
|
177
179
|
#
|
178
180
|
protected
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
181
|
+
def file_uri(share, directory_path, file, query = {})
|
182
|
+
if directory_path.nil?
|
183
|
+
path = ::File.join(share, file)
|
184
|
+
else
|
185
|
+
path = ::File.join(share, directory_path, file)
|
186
|
+
end
|
187
|
+
generate_uri(path, query, true)
|
184
188
|
end
|
185
|
-
generate_uri(path, query, true)
|
186
|
-
end
|
187
189
|
end
|
188
190
|
end
|
189
191
|
end
|
190
192
|
|
191
|
-
Azure::Storage::FileService = Azure::Storage::File::FileService
|
193
|
+
Azure::Storage::FileService = Azure::Storage::File::FileService
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#-------------------------------------------------------------------------
|
2
4
|
# # Copyright (c) Microsoft and contributors. All rights reserved.
|
3
5
|
#
|
@@ -21,7 +23,7 @@
|
|
21
23
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
24
|
# THE SOFTWARE.
|
23
25
|
#--------------------------------------------------------------------------
|
24
|
-
require
|
26
|
+
require "azure/storage/service/serialization"
|
25
27
|
|
26
28
|
module Azure::Storage
|
27
29
|
module File
|
@@ -33,7 +35,7 @@ module Azure::Storage
|
|
33
35
|
expect_node("EnumerationResults", xml)
|
34
36
|
|
35
37
|
results = enumeration_results_from_xml(xml, Azure::Service::EnumerationResults.new)
|
36
|
-
|
38
|
+
|
37
39
|
return results unless (xml > "Shares").any? && ((xml > "Shares") > "Share").any?
|
38
40
|
|
39
41
|
if xml.Shares.Share.count == 0
|
@@ -79,7 +81,7 @@ module Azure::Storage
|
|
79
81
|
|
80
82
|
def self.share_properties_from_headers(headers)
|
81
83
|
props = {}
|
82
|
-
props[:last_modified] = headers["Last-Modified"]
|
84
|
+
props[:last_modified] = headers["Last-Modified"]
|
83
85
|
props[:etag] = headers["ETag"]
|
84
86
|
props
|
85
87
|
end
|
@@ -162,7 +164,7 @@ module Azure::Storage
|
|
162
164
|
|
163
165
|
def self.directory_properties_from_headers(headers)
|
164
166
|
props = {}
|
165
|
-
props[:last_modified] = headers["Last-Modified"]
|
167
|
+
props[:last_modified] = headers["Last-Modified"]
|
166
168
|
props[:etag] = headers["ETag"]
|
167
169
|
props
|
168
170
|
end
|
@@ -183,12 +185,13 @@ module Azure::Storage
|
|
183
185
|
|
184
186
|
props[:content_length] = headers["Content-Length"].to_i unless headers["Content-Length"].nil?
|
185
187
|
props[:content_length] = headers["x-ms-content-length"].to_i unless headers["x-ms-content-length"].nil?
|
186
|
-
|
188
|
+
|
187
189
|
props[:content_type] = headers["Content-Type"]
|
188
190
|
props[:content_encoding] = headers["Content-Encoding"]
|
189
191
|
props[:content_language] = headers["Content-Language"]
|
190
192
|
props[:content_disposition] = headers["Content-Disposition"]
|
191
|
-
props[:content_md5] = headers["Content-MD5"]
|
193
|
+
props[:content_md5] = headers["x-ms-content-md5"] || headers["Content-MD5"]
|
194
|
+
props[:range_md5] = headers["Content-MD5"] if headers["x-ms-content-md5"] && headers["Content-MD5"]
|
192
195
|
props[:cache_control] = headers["Cache-Control"]
|
193
196
|
|
194
197
|
props[:copy_id] = headers["x-ms-copy-id"]
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
#-------------------------------------------------------------------------
|
2
4
|
# # Copyright (c) Microsoft and contributors. All rights reserved.
|
3
5
|
#
|
@@ -21,12 +23,12 @@
|
|
21
23
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
24
|
# THE SOFTWARE.
|
23
25
|
#--------------------------------------------------------------------------
|
24
|
-
require
|
26
|
+
require "azure/storage/file/serialization"
|
25
27
|
|
26
28
|
module Azure::Storage::File
|
27
29
|
module Share
|
28
30
|
include Azure::Storage::Service
|
29
|
-
|
31
|
+
|
30
32
|
class Share
|
31
33
|
def initialize
|
32
34
|
@properties = {}
|
@@ -55,16 +57,16 @@ module Azure::Storage::File
|
|
55
57
|
# * +:quota+ - Integer. The maximum size of the share, in gigabytes.
|
56
58
|
# Must be greater than 0, and less than or equal to 5TB (5120). (optional).
|
57
59
|
# * +:timeout+ - Integer. A timeout in seconds.
|
58
|
-
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
60
|
+
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
59
61
|
# in the analytics logs when storage analytics logging is enabled.
|
60
62
|
#
|
61
63
|
# See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/create-share
|
62
64
|
#
|
63
65
|
# Returns a Share
|
64
|
-
def create_share(name, options={})
|
66
|
+
def create_share(name, options = {})
|
65
67
|
# Query
|
66
|
-
query = {
|
67
|
-
query[
|
68
|
+
query = {}
|
69
|
+
query["timeout"] = options[:timeout].to_s if options[:timeout]
|
68
70
|
|
69
71
|
# Scheme + path
|
70
72
|
uri = share_uri(name, query)
|
@@ -72,7 +74,7 @@ module Azure::Storage::File
|
|
72
74
|
# Headers
|
73
75
|
headers = StorageService.common_headers
|
74
76
|
StorageService.add_metadata_to_headers(options[:metadata], headers) if options[:metadata]
|
75
|
-
headers[
|
77
|
+
headers["x-ms-share-quota"] = options[:quota].to_s if options[:quota]
|
76
78
|
|
77
79
|
# Call
|
78
80
|
response = call(:put, uri, nil, headers, options)
|
@@ -96,16 +98,16 @@ module Azure::Storage::File
|
|
96
98
|
#
|
97
99
|
# Accepted key/value pairs in options parameter are:
|
98
100
|
# * +:timeout+ - Integer. A timeout in seconds.
|
99
|
-
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
101
|
+
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
100
102
|
# in the analytics logs when storage analytics logging is enabled.
|
101
103
|
#
|
102
104
|
# See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/get-share-properties
|
103
105
|
#
|
104
106
|
# Returns a Share
|
105
|
-
def get_share_properties(name, options={})
|
107
|
+
def get_share_properties(name, options = {})
|
106
108
|
# Query
|
107
|
-
query = {
|
108
|
-
query[
|
109
|
+
query = {}
|
110
|
+
query["timeout"] = options[:timeout].to_s if options[:timeout]
|
109
111
|
|
110
112
|
# Call
|
111
113
|
response = call(:get, share_uri(name, query), nil, {}, options)
|
@@ -129,24 +131,24 @@ module Azure::Storage::File
|
|
129
131
|
# * +:quota+ - Integer. The maximum size of the share, in gigabytes.
|
130
132
|
# Must be greater than 0, and less than or equal to 5TB (5120). (optional).
|
131
133
|
# * +:timeout+ - Integer. A timeout in seconds.
|
132
|
-
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
134
|
+
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
133
135
|
# in the analytics logs when storage analytics logging is enabled.
|
134
136
|
#
|
135
137
|
# See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/set-share-properties
|
136
138
|
#
|
137
139
|
# Returns nil on success
|
138
|
-
def set_share_properties(name, options={})
|
140
|
+
def set_share_properties(name, options = {})
|
139
141
|
# Query
|
140
|
-
query = {
|
141
|
-
query[
|
142
|
+
query = { "comp" => "properties" }
|
143
|
+
query["timeout"] = options[:timeout].to_s if options[:timeout]
|
142
144
|
|
143
145
|
# Headers
|
144
146
|
headers = StorageService.common_headers
|
145
|
-
headers[
|
147
|
+
headers["x-ms-share-quota"] = options[:quota].to_s if options[:quota]
|
146
148
|
|
147
149
|
# Call
|
148
150
|
call(:put, share_uri(name, query), nil, headers, options)
|
149
|
-
|
151
|
+
|
150
152
|
# Result
|
151
153
|
nil
|
152
154
|
end
|
@@ -162,16 +164,16 @@ module Azure::Storage::File
|
|
162
164
|
#
|
163
165
|
# Accepted key/value pairs in options parameter are:
|
164
166
|
# * +:timeout+ - Integer. A timeout in seconds.
|
165
|
-
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
167
|
+
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
166
168
|
# in the analytics logs when storage analytics logging is enabled.
|
167
169
|
#
|
168
170
|
# See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/get-share-metadata
|
169
171
|
#
|
170
172
|
# Returns a Share
|
171
|
-
def get_share_metadata(name, options={})
|
173
|
+
def get_share_metadata(name, options = {})
|
172
174
|
# Query
|
173
|
-
query = {
|
174
|
-
query[
|
175
|
+
query = { "comp" => "metadata" }
|
176
|
+
query["timeout"] = options[:timeout].to_s if options[:timeout]
|
175
177
|
|
176
178
|
# Call
|
177
179
|
response = call(:get, share_uri(name, query), nil, {}, options)
|
@@ -194,16 +196,16 @@ module Azure::Storage::File
|
|
194
196
|
#
|
195
197
|
# Accepted key/value pairs in options parameter are:
|
196
198
|
# * +:timeout+ - Integer. A timeout in seconds.
|
197
|
-
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
199
|
+
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
198
200
|
# in the analytics logs when storage analytics logging is enabled.
|
199
201
|
#
|
200
202
|
# See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/set-share-metadata
|
201
203
|
#
|
202
204
|
# Returns nil on success
|
203
|
-
def set_share_metadata(name, metadata, options={})
|
205
|
+
def set_share_metadata(name, metadata, options = {})
|
204
206
|
# Query
|
205
|
-
query = {
|
206
|
-
query[
|
207
|
+
query = { "comp" => "metadata" }
|
208
|
+
query["timeout"] = options[:timeout].to_s if options[:timeout]
|
207
209
|
|
208
210
|
# Headers
|
209
211
|
headers = StorageService.common_headers
|
@@ -211,7 +213,7 @@ module Azure::Storage::File
|
|
211
213
|
|
212
214
|
# Call
|
213
215
|
call(:put, share_uri(name, query), nil, headers, options)
|
214
|
-
|
216
|
+
|
215
217
|
# Result
|
216
218
|
nil
|
217
219
|
end
|
@@ -227,20 +229,20 @@ module Azure::Storage::File
|
|
227
229
|
#
|
228
230
|
# Accepted key/value pairs in options parameter are:
|
229
231
|
# * +:timeout+ - Integer. A timeout in seconds.
|
230
|
-
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
232
|
+
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
231
233
|
# in the analytics logs when storage analytics logging is enabled.
|
232
234
|
#
|
233
235
|
# See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/delete-share
|
234
236
|
#
|
235
237
|
# Returns nil on success
|
236
|
-
def delete_share(name, options={})
|
238
|
+
def delete_share(name, options = {})
|
237
239
|
# Query
|
238
|
-
query = {
|
239
|
-
query[
|
240
|
+
query = {}
|
241
|
+
query["timeout"] = options[:timeout].to_s if options[:timeout]
|
240
242
|
|
241
243
|
# Call
|
242
244
|
call(:delete, share_uri(name, query), nil, {}, options)
|
243
|
-
|
245
|
+
|
244
246
|
# result
|
245
247
|
nil
|
246
248
|
end
|
@@ -256,7 +258,7 @@ module Azure::Storage::File
|
|
256
258
|
#
|
257
259
|
# Accepted key/value pairs in options parameter are:
|
258
260
|
# * +:timeout+ - Integer. A timeout in seconds.
|
259
|
-
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
261
|
+
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
260
262
|
# in the analytics logs when storage analytics logging is enabled.
|
261
263
|
#
|
262
264
|
# See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/get-share-acl
|
@@ -265,11 +267,11 @@ module Azure::Storage::File
|
|
265
267
|
# share - A Azure::Storage::File::Share::Share instance
|
266
268
|
# signed_identifiers - A list of Azure::Storage::Service::SignedIdentifier instances
|
267
269
|
#
|
268
|
-
def get_share_acl(name, options={})
|
270
|
+
def get_share_acl(name, options = {})
|
269
271
|
# Query
|
270
|
-
query = {
|
271
|
-
query[
|
272
|
-
|
272
|
+
query = { "comp" => "acl" }
|
273
|
+
query["timeout"] = options[:timeout].to_s if options[:timeout]
|
274
|
+
|
273
275
|
# Call
|
274
276
|
response = call(:get, share_uri(name, query), nil, {}, options)
|
275
277
|
|
@@ -295,19 +297,19 @@ module Azure::Storage::File
|
|
295
297
|
# Accepted key/value pairs in options parameter are:
|
296
298
|
# * +:signed_identifiers+ - Array. A list of Azure::Storage::Service::SignedIdentifier instances.
|
297
299
|
# * +:timeout+ - Integer. A timeout in seconds.
|
298
|
-
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
300
|
+
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
299
301
|
# in the analytics logs when storage analytics logging is enabled.
|
300
|
-
#
|
302
|
+
#
|
301
303
|
# See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/set-share-acl
|
302
304
|
#
|
303
305
|
# Returns a tuple of (share, signed_identifiers)
|
304
306
|
# * +share+ - A Azure::Storage::File::Share::Share instance
|
305
307
|
# * +signed_identifiers+ - A list of Azure::Storage::Service::SignedIdentifier instances
|
306
308
|
#
|
307
|
-
def set_share_acl(name, options={})
|
309
|
+
def set_share_acl(name, options = {})
|
308
310
|
# Query
|
309
|
-
query = {
|
310
|
-
query[
|
311
|
+
query = { "comp" => "acl" }
|
312
|
+
query["timeout"] = options[:timeout].to_s if options[:timeout]
|
311
313
|
|
312
314
|
# Scheme + path
|
313
315
|
uri = share_uri(name, query)
|
@@ -339,16 +341,16 @@ module Azure::Storage::File
|
|
339
341
|
#
|
340
342
|
# Accepted key/value pairs in options parameter are:
|
341
343
|
# * +:timeout+ - Integer. A timeout in seconds.
|
342
|
-
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
344
|
+
# * +:request_id+ - String. Provides a client-generated, opaque value with a 1 KB character limit that is recorded
|
343
345
|
# in the analytics logs when storage analytics logging is enabled.
|
344
346
|
#
|
345
347
|
# See https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/get-share-stats
|
346
348
|
#
|
347
349
|
# Returns a Share
|
348
|
-
def get_share_stats(name, options={})
|
350
|
+
def get_share_stats(name, options = {})
|
349
351
|
# Query
|
350
|
-
query = {
|
351
|
-
query[
|
352
|
+
query = { "comp" => "stats" }
|
353
|
+
query["timeout"] = options[:timeout].to_s if options[:timeout]
|
352
354
|
|
353
355
|
# Call
|
354
356
|
response = call(:get, share_uri(name, query), nil, {}, options)
|
@@ -360,4 +362,4 @@ module Azure::Storage::File
|
|
360
362
|
share
|
361
363
|
end
|
362
364
|
end
|
363
|
-
end
|
365
|
+
end
|