azure 0.6.4 → 0.7.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/.env_sample +11 -0
  3. data/.gitignore +4 -1
  4. data/.travis.yml +3 -1
  5. data/ChangeLog.txt +17 -1
  6. data/LICENSE.txt +202 -0
  7. data/README.md +58 -20
  8. data/Rakefile +27 -35
  9. data/azure.gemspec +17 -13
  10. data/bin/pfxer +35 -0
  11. data/lib/azure.rb +8 -0
  12. data/lib/azure/base_management/base_management_service.rb +24 -26
  13. data/lib/azure/base_management/management_http_request.rb +17 -14
  14. data/lib/azure/base_management/serialization.rb +1 -0
  15. data/lib/azure/blob/auth/shared_access_signature.rb +141 -0
  16. data/lib/azure/blob/blob_service.rb +221 -217
  17. data/lib/azure/cloud_service_management/cloud_service_management_service.rb +27 -30
  18. data/lib/azure/cloud_service_management/serialization.rb +1 -0
  19. data/lib/azure/core.rb +17 -15
  20. data/lib/azure/core/configuration.rb +7 -0
  21. data/lib/azure/core/http/http_error.rb +1 -1
  22. data/lib/azure/core/http/http_request.rb +4 -1
  23. data/lib/azure/core/utility.rb +16 -1
  24. data/lib/azure/queue/queue_service.rb +13 -13
  25. data/lib/azure/service/cors.rb +11 -0
  26. data/lib/azure/service/cors_rule.rb +15 -0
  27. data/lib/azure/service/serialization.rb +69 -10
  28. data/lib/azure/service/storage_service.rb +10 -6
  29. data/lib/azure/service/storage_service_properties.rb +8 -3
  30. data/lib/azure/service_bus/brokered_message.rb +1 -1
  31. data/lib/azure/service_bus/relay.rb +88 -0
  32. data/lib/azure/service_bus/serialization.rb +1 -0
  33. data/lib/azure/service_bus/service_bus_service.rb +70 -4
  34. data/lib/azure/sql_database_management/serialization.rb +1 -0
  35. data/lib/azure/sql_database_management/sql_database_management_service.rb +22 -22
  36. data/lib/azure/storage_management/serialization.rb +34 -14
  37. data/lib/azure/storage_management/storage_account.rb +9 -1
  38. data/lib/azure/storage_management/storage_management_service.rb +74 -32
  39. data/lib/azure/table/batch.rb +6 -6
  40. data/lib/azure/table/table_service.rb +13 -13
  41. data/lib/azure/version.rb +3 -3
  42. data/lib/azure/virtual_machine_image_management/serialization.rb +19 -0
  43. data/lib/azure/virtual_machine_image_management/virtual_machine_image.rb +1 -1
  44. data/lib/azure/virtual_machine_image_management/virtual_machine_image_management_service.rb +30 -7
  45. data/lib/azure/virtual_machine_management/serialization.rb +32 -12
  46. data/lib/azure/virtual_machine_management/virtual_machine.rb +1 -0
  47. data/lib/azure/virtual_machine_management/virtual_machine_management_service.rb +92 -81
  48. data/lib/azure/virtual_network_management/serialization.rb +12 -5
  49. data/lib/azure/virtual_network_management/virtual_network.rb +1 -0
  50. data/lib/azure/virtual_network_management/virtual_network_management_service.rb +11 -11
  51. data/test/fixtures/get_storage_account_properties.xml +6 -4
  52. data/test/fixtures/{list_images.xml → list_os_images.xml} +1 -1
  53. data/test/fixtures/list_storage_accounts.xml +2 -0
  54. data/test/fixtures/list_vm_images.xml +21 -0
  55. data/test/fixtures/metrics.xml +2 -2
  56. data/test/fixtures/sb_default_create_relay_response.xml +15 -0
  57. data/test/fixtures/storage_service_keys.xml +8 -0
  58. data/test/fixtures/storage_service_properties.xml +35 -3
  59. data/test/fixtures/updated_storage_accounts.xml +2 -0
  60. data/test/fixtures/virtual_machine.xml +3 -1
  61. data/test/integration/affinity_group/Affinity_test.rb +1 -1
  62. data/test/integration/affinity_group/Create_Affinity_test.rb +8 -7
  63. data/test/integration/affinity_group/Delete_Affinity_test.rb +3 -3
  64. data/test/integration/affinity_group/List_Affinity_test.rb +1 -1
  65. data/test/integration/affinity_group/Update_Affinity_test.rb +9 -8
  66. data/test/integration/cloud_service/Cloud_Create_test.rb +3 -2
  67. data/test/integration/cloud_service/Cloud_Delete_test.rb +5 -4
  68. data/test/integration/database/create_sql_server_firewall_test.rb +1 -1
  69. data/test/integration/database/create_sql_server_test.rb +1 -1
  70. data/test/integration/database/delete_sql_server_firewall_test.rb +1 -1
  71. data/test/integration/database/delete_sql_server_test.rb +1 -1
  72. data/test/integration/database/list_sql_server_firewall_test.rb +1 -1
  73. data/test/integration/database/list_sql_servers_test.rb +1 -1
  74. data/test/integration/database/reset_password_sql_server_test.rb +1 -1
  75. data/test/integration/service_bus/queues_test.rb +22 -22
  76. data/test/integration/service_bus/relay_test.rb +132 -0
  77. data/test/integration/storage_management/storage_management_test.rb +58 -33
  78. data/test/integration/test_helper.rb +11 -15
  79. data/test/integration/vm/VM_Create_test.rb +17 -18
  80. data/test/integration/vm/VM_Delete_test.rb +2 -4
  81. data/test/integration/vm/VM_Operations_test.rb +1 -2
  82. data/test/integration/vnet/Virtual_Network_Create_test.rb +9 -15
  83. data/test/integration/vnet/Virtual_Network_list_test.rb +4 -9
  84. data/test/support/name_generator.rb +8 -0
  85. data/test/support/virtual_network_helper.rb +2 -2
  86. data/test/test_helper.rb +13 -24
  87. data/test/unit/affinity_group/affinity_group_test.rb +10 -13
  88. data/test/unit/affinity_group/serialization_test.rb +7 -8
  89. data/test/unit/base_management/location_test.rb +1 -2
  90. data/test/unit/blob/auth/shared_access_signature_test.rb +71 -0
  91. data/test/unit/blob/blob_service_test.rb +393 -371
  92. data/test/unit/cloud_service_management/cloud_service_management_service_test.rb +16 -16
  93. data/test/unit/core/auth/shared_key_lite_test.rb +4 -4
  94. data/test/unit/core/auth/shared_key_test.rb +2 -2
  95. data/test/unit/core/http/http_error_test.rb +10 -5
  96. data/test/unit/core/http/http_request_test.rb +72 -25
  97. data/test/unit/database/serialization_test.rb +7 -7
  98. data/test/unit/database/sql_database_server_service_test.rb +43 -47
  99. data/test/unit/service/serialization_test.rb +40 -9
  100. data/test/unit/service/storage_service_test.rb +13 -11
  101. data/test/unit/storage_management/serialization_test.rb +26 -14
  102. data/test/unit/storage_management/storage_management_service_test.rb +48 -62
  103. data/test/unit/virtual_machine_image_management/serialization_test.rb +20 -5
  104. data/test/unit/virtual_machine_image_management/virtual_machine_image_management_service_test.rb +78 -29
  105. data/test/unit/virtual_machine_management/serialization_test.rb +112 -43
  106. data/test/unit/virtual_machine_management/virtual_machine_management_service_test.rb +123 -100
  107. data/test/unit/vnet/serialization_test.rb +7 -7
  108. data/test/unit/vnet/virtual_network_management_service_test.rb +1 -1
  109. metadata +70 -16
  110. data/test/fixtures/certificate.pem +0 -21
@@ -16,6 +16,7 @@
16
16
  module Azure
17
17
  module BaseManagement
18
18
  module Serialization
19
+ extend Azure::Core::Utility
19
20
  def self.locations_from_xml(locationXML)
20
21
  location_objs = []
21
22
  xml = locationXML.css('Locations Location')
@@ -0,0 +1,141 @@
1
+ #-------------------------------------------------------------------------
2
+ # # Copyright (c) Microsoft and contributors. All rights reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ #--------------------------------------------------------------------------
15
+
16
+ # TODO: extract common SAS logic, add support for the other SAS types
17
+
18
+ require "azure/core/configuration"
19
+ require "azure/core/auth/signer"
20
+
21
+ # This will break if used against API version prior to 2013-08-15 as the format
22
+ # changed
23
+ # See https://msdn.microsoft.com/library/azure/dn140255.aspx for more information on construction
24
+ module Azure
25
+ module Blob
26
+ module Auth
27
+ class SharedAccessSignature < Core::Auth::Signer
28
+ DEFAULTS = {
29
+ resource: 'b',
30
+ permissions: 'r',
31
+ version: '2013-08-15'
32
+ }
33
+
34
+ KEY_MAPPINGS = {
35
+ permissions: :sp,
36
+ start: :st,
37
+ expiry: :se,
38
+ resource: :sr,
39
+ identifier: :si,
40
+ version: :sv,
41
+ cache_control: :rscc,
42
+ content_disposition: :rscd,
43
+ content_encoding: :rsce,
44
+ content_language: :rscl,
45
+ content_type: :rsct
46
+ }
47
+
48
+ OPTIONAL_QUERY_PARAMS = [:sp, :si, :rscc, :rscd, :rsce, :rscl, :rsct]
49
+
50
+ attr :path
51
+ attr :options
52
+ attr :account_name
53
+
54
+ # Public: Initialize the Signer.
55
+ #
56
+ # ==== Attributes
57
+ #
58
+ # * +path+ - the container or blob path
59
+ # * +options+ - Hash. Required and optional parameters
60
+ # * +account_name+ - The account name. Defaults to the one in the
61
+ # global configuration.
62
+ # * +access_key+ - The access_key encoded in Base64. Defaults to the
63
+ # one in the global configuration.
64
+ #
65
+ # ==== Options
66
+ #
67
+ # * +:resource+ - String. Resource type, either 'b' (blob) or 'c' (container). Default 'b'
68
+ # * +:permissions+ - String. Combination of 'r','w','d','l' (container only) in this order. Default 'r'
69
+ # * +:start+ - String. UTC Date/Time in ISO8601 format. Optional.
70
+ # * +:expiry+ - String. UTC Date/Time in ISO8601 format. Required.
71
+ # * +:identifier+ - String. Identifier for stored access policy. Optional
72
+ # * +:version+ - String. API version. Default '2013-08-15'
73
+ #
74
+ # * +:cache_control - String. Response header override. Optional.
75
+ # * +:content_disposition - String. Response header override. Optional.
76
+ # * +:content_encoding - String. Response header override. Optional.
77
+ # * +:content_language - String. Response header override. Optional.
78
+ # * +:content_type - String. Response header override. Optional.
79
+ def initialize(path, options, account_name=Azure.config.storage_account_name, access_key=Azure.config.storage_access_key)
80
+ @path = path
81
+ @account_name = account_name
82
+ @options = DEFAULTS.merge(options)
83
+
84
+ super(access_key)
85
+ end
86
+
87
+ # Public: Construct the plaintext to the spec required for signatures
88
+ def signable_string
89
+ # Order is significant
90
+ # The newlines from empty strings here are required
91
+ [
92
+ options[:permissions],
93
+ options[:start],
94
+ options[:expiry],
95
+ canonicalized_resource,
96
+ options[:identifier],
97
+
98
+ options[:version],
99
+
100
+ options[:cache_control],
101
+ options[:content_disposition],
102
+ options[:content_encoding],
103
+ options[:content_language],
104
+ options[:content_type]
105
+ ].join("\n")
106
+ end
107
+
108
+ def canonicalized_resource
109
+ "/#{account_name}/#{path}"
110
+ end
111
+
112
+ # Public: A customised URI reflecting options for the resource signed with the Shared Access Signature
113
+ def signed_uri
114
+ query_params = URI.encode_www_form(query_hash)
115
+ "https://#{account_name}.blob.core.windows.net/#{path}?#{query_params}"
116
+ end
117
+
118
+ def to_s
119
+ signed_uri
120
+ end
121
+
122
+ private
123
+
124
+ def signature
125
+ sign(signable_string)
126
+ end
127
+
128
+ def query_hash
129
+ Hash[options.map { |k, v|
130
+ [KEY_MAPPINGS[k], v]
131
+ }].reject { |k,v|
132
+ OPTIONAL_QUERY_PARAMS.include?(k) && v.to_s == ''
133
+ }.merge(
134
+ sig: signature
135
+ )
136
+ end
137
+
138
+ end
139
+ end
140
+ end
141
+ end
@@ -14,6 +14,7 @@
14
14
  #--------------------------------------------------------------------------
15
15
  require 'azure/service/storage_service'
16
16
  require 'azure/blob/serialization'
17
+ require 'azure/blob/auth/shared_access_signature'
17
18
  require 'base64'
18
19
 
19
20
  module Azure
@@ -29,25 +30,25 @@ module Azure
29
30
  #
30
31
  # ==== Attributes
31
32
  #
32
- # * +options+ - Hash. Optional parameters.
33
+ # * +options+ - Hash. Optional parameters.
33
34
  #
34
35
  # ==== Options
35
36
  #
36
37
  # Accepted key/value pairs in options parameter are:
37
- # * +:prefix+ - String. Filters the results to return only containers
38
+ # * +:prefix+ - String. Filters the results to return only containers
38
39
  # whose name begins with the specified prefix. (optional)
39
40
  #
40
- # * +:marker+ - String. An identifier the specifies the portion of the
41
+ # * +:marker+ - String. An identifier the specifies the portion of the
41
42
  # list to be returned. This value comes from the property
42
- # Azure::Service::EnumerationResults.continuation_token when there
43
- # are more containers available than were returned. The
43
+ # Azure::Service::EnumerationResults.continuation_token when there
44
+ # are more containers available than were returned. The
44
45
  # marker value may then be used here to request the next set
45
46
  # of list items. (optional)
46
47
  #
47
- # * +:max_results+ - Integer. Specifies the maximum number of containers to return.
48
- # If max_results is not specified, or is a value greater than
49
- # 5,000, the server will return up to 5,000 items. If it is set
50
- # to a value less than or equal to zero, the server will return
48
+ # * +:max_results+ - Integer. Specifies the maximum number of containers to return.
49
+ # If max_results is not specified, or is a value greater than
50
+ # 5,000, the server will return up to 5,000 items. If it is set
51
+ # to a value less than or equal to zero, the server will return
51
52
  # status code 400 (Bad Request). (optional)
52
53
  #
53
54
  # * +:metadata+ - Boolean. Specifies whether or not to return the container metadata.
@@ -56,16 +57,16 @@ module Azure
56
57
  # * +:timeout+ - Integer. A timeout in seconds.
57
58
  #
58
59
  # NOTE: Metadata requested with the :metadata parameter must have been stored in
59
- # accordance with the naming restrictions imposed by the 2009-09-19 version of the Blob
60
- # service. Beginning with that version, all metadata names must adhere to the naming
60
+ # accordance with the naming restrictions imposed by the 2009-09-19 version of the Blob
61
+ # service. Beginning with that version, all metadata names must adhere to the naming
61
62
  # conventions for C# identifiers.
62
63
  #
63
- # See: http://msdn.microsoft.com/en-us/library/aa664670(VS.71).aspx
64
+ # See: http://msdn.microsoft.com/en-us/library/aa664670(VS.71).aspx
64
65
  #
65
- # Any metadata with invalid names which were previously stored, will be returned with the
66
+ # Any metadata with invalid names which were previously stored, will be returned with the
66
67
  # key "x-ms-invalid-name" in the metadata hash. This may contain multiple values and be an
67
68
  # Array (vs a String if it only contains a single value).
68
- #
69
+ #
69
70
  # Returns an Azure::Service::EnumerationResults
70
71
  def list_containers(options={})
71
72
  query = { }
@@ -76,19 +77,19 @@ module Azure
76
77
  query["include"] = "metadata" if options[:metadata] == true
77
78
  query["timeout"] = options[:timeout].to_s if options[:timeout]
78
79
  end
79
-
80
+
80
81
  uri = containers_uri(query)
81
82
  response = call(:get, uri)
82
83
 
83
84
  Serialization.container_enumeration_results_from_xml(response.body)
84
85
  end
85
86
 
86
- # Public: Create a new container
87
+ # Public: Create a new container
87
88
  #
88
89
  # ==== Attributes
89
90
  #
90
91
  # * +name+ - String. The name of the container
91
- # * +options+ - Hash. Optional parameters.
92
+ # * +options+ - Hash. Optional parameters.
92
93
  #
93
94
  # ==== Options
94
95
  #
@@ -97,7 +98,7 @@ module Azure
97
98
  # * +:public_access_level+ - String. One of "container" or "blob" (optional)
98
99
  # * +:timeout+ - Integer. A timeout in seconds.
99
100
  #
100
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd179468.aspx
101
+ # See http://msdn.microsoft.com/en-us/library/azure/dd179468.aspx
101
102
  #
102
103
  # Returns a Container
103
104
  def create_container(name, options={})
@@ -106,7 +107,7 @@ module Azure
106
107
 
107
108
  uri = container_uri(name, query)
108
109
 
109
- headers = { }
110
+ headers = service_properties_headers
110
111
 
111
112
  add_metadata_to_headers(options[:metadata], headers) if options[:metadata]
112
113
 
@@ -125,14 +126,14 @@ module Azure
125
126
  # ==== Attributes
126
127
  #
127
128
  # * +name+ - String. The name of the container
128
- # * +options+ - Hash. Optional parameters.
129
+ # * +options+ - Hash. Optional parameters.
129
130
  #
130
131
  # ==== Options
131
132
  #
132
133
  # Accepted key/value pairs in options parameter are:
133
134
  # * +:timeout+ - Integer. A timeout in seconds.
134
135
  #
135
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd179408.aspx
136
+ # See http://msdn.microsoft.com/en-us/library/azure/dd179408.aspx
136
137
  #
137
138
  # Returns nil on success
138
139
  def delete_container(name, options={})
@@ -148,14 +149,14 @@ module Azure
148
149
  # ==== Attributes
149
150
  #
150
151
  # * +name+ - String. The name of the container
151
- # * +options+ - Hash. Optional parameters.
152
+ # * +options+ - Hash. Optional parameters.
152
153
  #
153
154
  # ==== Options
154
155
  #
155
156
  # Accepted key/value pairs in options parameter are:
156
157
  # * +:timeout+ - Integer. A timeout in seconds.
157
158
  #
158
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd179370.aspx
159
+ # See http://msdn.microsoft.com/en-us/library/azure/dd179370.aspx
159
160
  #
160
161
  # Returns a Container
161
162
  def get_container_properties(name, options={})
@@ -174,14 +175,14 @@ module Azure
174
175
  # ==== Attributes
175
176
  #
176
177
  # * +name+ - String. The name of the container
177
- # * +options+ - Hash. Optional parameters.
178
+ # * +options+ - Hash. Optional parameters.
178
179
  #
179
180
  # ==== Options
180
181
  #
181
182
  # Accepted key/value pairs in options parameter are:
182
183
  # * +:timeout+ - Integer. A timeout in seconds.
183
184
  #
184
- # See http://msdn.microsoft.com/en-us/library/windowsazure/ee691976.aspx
185
+ # See http://msdn.microsoft.com/en-us/library/azure/ee691976.aspx
185
186
  #
186
187
  # Returns a Container
187
188
  def get_container_metadata(name, options={})
@@ -195,20 +196,20 @@ module Azure
195
196
  container
196
197
  end
197
198
 
198
- # Public: Gets the access control list (ACL) and any container-level access policies
199
+ # Public: Gets the access control list (ACL) and any container-level access policies
199
200
  # for the container.
200
201
  #
201
202
  # ==== Attributes
202
203
  #
203
204
  # * +name+ - String. The name of the container
204
- # * +options+ - Hash. Optional parameters.
205
+ # * +options+ - Hash. Optional parameters.
205
206
  #
206
207
  # ==== Options
207
208
  #
208
209
  # Accepted key/value pairs in options parameter are:
209
210
  # * +:timeout+ - Integer. A timeout in seconds.
210
211
  #
211
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd179469.aspx
212
+ # See http://msdn.microsoft.com/en-us/library/azure/dd179469.aspx
212
213
  #
213
214
  # Returns a tuple of (container, signed_identifiers)
214
215
  # container - A Azure::Entity::Blob::Container instance
@@ -234,15 +235,15 @@ module Azure
234
235
  #
235
236
  # * +name+ - String. The name of the container
236
237
  # * +public_access_level+ - String. The container public access level
237
- # * +options+ - Hash. Optional parameters.
238
+ # * +options+ - Hash. Optional parameters.
238
239
  #
239
240
  # ==== Options
240
241
  #
241
242
  # Accepted key/value pairs in options parameter are:
242
- # * +:signed_identifiers+ - Array. A list of Azure::Entity::SignedIdentifier instances (optional)
243
+ # * +:signed_identifiers+ - Array. A list of Azure::Entity::SignedIdentifier instances (optional)
243
244
  # * +:timeout+ - Integer. A timeout in seconds.
244
245
  #
245
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd179391.aspx
246
+ # See http://msdn.microsoft.com/en-us/library/azure/dd179391.aspx
246
247
  #
247
248
  # Returns a tuple of (container, signed_identifiers)
248
249
  # * +container+ - A Azure::Entity::Blob::Container instance
@@ -253,14 +254,14 @@ module Azure
253
254
  query["timeout"] = options[:timeout].to_s if options[:timeout]
254
255
  uri =container_uri(name, query)
255
256
 
256
- headers = { }
257
+ headers = service_properties_headers
257
258
  headers["x-ms-blob-public-access"] = public_access_level if public_access_level && public_access_level.to_s.length > 0
258
259
 
259
260
  signed_identifiers = nil
260
261
  signed_identifiers = options[:signed_identifiers] if options[:signed_identifiers]
261
262
 
262
263
  body = nil
263
- body = Serialization.signed_identifiers_to_xml(signed_identifiers) if signed_identifiers && headers["x-ms-blob-public-access"] == "container"
264
+ body = Serialization.signed_identifiers_to_xml(signed_identifiers) if signed_identifiers
264
265
 
265
266
  response = call(:put, uri, body, headers)
266
267
 
@@ -278,21 +279,21 @@ module Azure
278
279
  #
279
280
  # * +name+ - String. The name of the container
280
281
  # * +metadata+ - Hash. A Hash of the metadata values
281
- # * +options+ - Hash. Optional parameters.
282
+ # * +options+ - Hash. Optional parameters.
282
283
  #
283
284
  # ==== Options
284
285
  #
285
286
  # Accepted key/value pairs in options parameter are:
286
287
  # * +:timeout+ - Integer. A timeout in seconds.
287
288
  #
288
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd179362.aspx
289
+ # See http://msdn.microsoft.com/en-us/library/azure/dd179362.aspx
289
290
  #
290
291
  # Returns nil on success
291
292
  def set_container_metadata(name, metadata, options={})
292
293
  query = { "comp" => "metadata" }
293
294
  query["timeout"] = options[:timeout].to_s if options[:timeout]
294
295
 
295
- headers = { }
296
+ headers = service_properties_headers
296
297
  add_metadata_to_headers(metadata, headers) if metadata
297
298
 
298
299
  call(:put, container_uri(name, query), nil, headers)
@@ -303,54 +304,54 @@ module Azure
303
304
  #
304
305
  # ==== Attributes
305
306
  #
306
- # * +name+ - String. The name of the container to list blobs for.
307
- # * +options+ - Hash. Optional parameters.
307
+ # * +name+ - String. The name of the container to list blobs for.
308
+ # * +options+ - Hash. Optional parameters.
308
309
  #
309
310
  # ==== Options
310
311
  #
311
312
  # Accepted key/value pairs in options parameter are:
312
- # * +:prefix+ - String. Filters the results to return only blobs
313
+ # * +:prefix+ - String. Filters the results to return only blobs
313
314
  # whose name begins with the specified prefix. (optional)
314
- # * +:delimiter+ - String. When the request includes this parameter, the operation
315
- # returns a BlobPrefix element in the response body that acts as a
316
- # placeholder for all blobs whose names begin with the same substring
317
- # up to the appearance of the delimiter character. The delimiter may
315
+ # * +:delimiter+ - String. When the request includes this parameter, the operation
316
+ # returns a BlobPrefix element in the response body that acts as a
317
+ # placeholder for all blobs whose names begin with the same substring
318
+ # up to the appearance of the delimiter character. The delimiter may
318
319
  # be a single character or a string.
319
- # * +:marker+ - String. An identifier that specifies the portion of the
320
+ # * +:marker+ - String. An identifier that specifies the portion of the
320
321
  # list to be returned. This value comes from the property
321
- # Azure::Service::EnumerationResults.continuation_token when
322
- # there are more blobs available than were returned. The
322
+ # Azure::Service::EnumerationResults.continuation_token when
323
+ # there are more blobs available than were returned. The
323
324
  # marker value may then be used here to request the next set
324
325
  # of list items. (optional)
325
- # * +:max_results+ - Integer. Specifies the maximum number of blobs to return.
326
- # If max_results is not specified, or is a value greater than
327
- # 5,000, the server will return up to 5,000 items. If it is set
328
- # to a value less than or equal to zero, the server will return
326
+ # * +:max_results+ - Integer. Specifies the maximum number of blobs to return.
327
+ # If max_results is not specified, or is a value greater than
328
+ # 5,000, the server will return up to 5,000 items. If it is set
329
+ # to a value less than or equal to zero, the server will return
329
330
  # status code 400 (Bad Request). (optional)
330
331
  # * +:metadata+ - Boolean. Specifies whether or not to return the blob metadata.
331
332
  # (optional, Default=false)
332
- # * +:snapshots+ - Boolean. Specifies that snapshots should be included in the
333
- # enumeration. Snapshots are listed from oldest to newest in the
333
+ # * +:snapshots+ - Boolean. Specifies that snapshots should be included in the
334
+ # enumeration. Snapshots are listed from oldest to newest in the
334
335
  # response. (optional, Default=false)
335
- # * +:uncomittedblobs+ - Boolean. Specifies that blobs for which blocks have been uploaded,
336
+ # * +:uncomittedblobs+ - Boolean. Specifies that blobs for which blocks have been uploaded,
336
337
  # but which have not been committed using put_block_list, be included
337
338
  # in the response. (optional, Default=false)
338
- # * +:copy+ - Boolean. Specifies that metadata related to any current or previous
339
- # copy_blob operation should be included in the response.
339
+ # * +:copy+ - Boolean. Specifies that metadata related to any current or previous
340
+ # copy_blob operation should be included in the response.
340
341
  # (optional, Default=false)
341
342
  # * +:timeout+ - Integer. A timeout in seconds.
342
343
  #
343
344
  # NOTE: Metadata requested with the :metadata parameter must have been stored in
344
- # accordance with the naming restrictions imposed by the 2009-09-19 version of the Blob
345
- # service. Beginning with that version, all metadata names must adhere to the naming
345
+ # accordance with the naming restrictions imposed by the 2009-09-19 version of the Blob
346
+ # service. Beginning with that version, all metadata names must adhere to the naming
346
347
  # conventions for C# identifiers.
347
348
  #
348
- # See: http://msdn.microsoft.com/en-us/library/windowsazure/dd135734.aspx
349
+ # See: http://msdn.microsoft.com/en-us/library/azure/dd135734.aspx
349
350
  #
350
- # Any metadata with invalid names which were previously stored, will be returned with the
351
+ # Any metadata with invalid names which were previously stored, will be returned with the
351
352
  # key "x-ms-invalid-name" in the metadata hash. This may contain multiple values and be an
352
353
  # Array (vs a String if it only contains a single value).
353
- #
354
+ #
354
355
  # Returns an Azure::Service::EnumerationResults
355
356
  def list_blobs(name, options={})
356
357
  query = { "comp" => "list" }
@@ -376,13 +377,13 @@ module Azure
376
377
 
377
378
  # Public: Creates a new page blob. Note that calling create_page_blob to create a page
378
379
  # blob only initializes the blob. To add content to a page blob, call create_blob_pages method.
379
- #
380
+ #
380
381
  # ==== Attributes
381
382
  #
382
383
  # * +container+ - String. The container name.
383
384
  # * +blob+ - String. The blob name.
384
385
  # * +length+ - Integer. Specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary.
385
- # * +options+ - Hash. Optional parameters.
386
+ # * +options+ - Hash. Optional parameters.
386
387
  #
387
388
  # ==== Options
388
389
  #
@@ -401,7 +402,7 @@ module Azure
401
402
  # * +:sequence_number+ - Integer. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1.The default value is 0.
402
403
  # * +:timeout+ - Integer. A timeout in seconds.
403
404
  #
404
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd179451.aspx
405
+ # See http://msdn.microsoft.com/en-us/library/azure/dd179451.aspx
405
406
  #
406
407
  # Returns a Blob
407
408
  def create_page_blob(container, blob, length, options={})
@@ -410,7 +411,7 @@ module Azure
410
411
 
411
412
  uri = blob_uri(container, blob, query)
412
413
 
413
- headers = { }
414
+ headers = service_properties_headers
414
415
 
415
416
  # set x-ms-blob-type to PageBlob
416
417
  headers["x-ms-blob-type"] = "PageBlob"
@@ -418,7 +419,7 @@ module Azure
418
419
  # ensure content-length is 0 and x-ms-blob-content-length is the blob length
419
420
  headers["Content-Length"] = 0.to_s
420
421
  headers["x-ms-blob-content-length"] = length.to_s
421
-
422
+
422
423
  # set x-ms-sequence-number from options (or default to 0)
423
424
  headers["x-ms-sequence-number"] = (options[:sequence_number] || 0).to_s
424
425
 
@@ -469,7 +470,7 @@ module Azure
469
470
  # * +:if_none_match+ - An ETag value. Specify an ETag value for this conditional header to write the page only if the blob's ETag value does not match the value specified. If the values are identical, the Blob service returns status code 412 (Precondition Failed).
470
471
  # * +:timeout+ - Integer. A timeout in seconds.
471
472
  #
472
- # See http://msdn.microsoft.com/en-us/library/windowsazure/ee691975.aspx
473
+ # See http://msdn.microsoft.com/en-us/library/azure/ee691975.aspx
473
474
  #
474
475
  # Returns Blob
475
476
  def create_blob_pages(container, blob, start_range, end_range, content, options={})
@@ -477,7 +478,7 @@ module Azure
477
478
  query["timeout"] = options[:timeout].to_s if options[:timeout]
478
479
 
479
480
  uri = blob_uri(container, blob, query)
480
- headers = { }
481
+ headers = service_properties_headers
481
482
  headers["x-ms-range"] = "bytes=#{start_range}-#{end_range}"
482
483
  headers["x-ms-page-write"] = "update"
483
484
 
@@ -511,14 +512,14 @@ module Azure
511
512
  # * +blob+ - String. Name of blob.
512
513
  # * +start_range+ - Integer. Position of first byte of first page.
513
514
  # * +end_range+ - Integer. Position of last byte of of last page.
514
- # * +options+ - Hash. Optional parameters.
515
+ # * +options+ - Hash. Optional parameters.
515
516
  #
516
517
  # ==== Options
517
518
  #
518
519
  # Accepted key/value pairs in options parameter are:
519
520
  # * +:timeout+ - Integer. A timeout in seconds.
520
521
  #
521
- # See http://msdn.microsoft.com/en-us/library/windowsazure/ee691975.aspx
522
+ # See http://msdn.microsoft.com/en-us/library/azure/ee691975.aspx
522
523
  #
523
524
  # Returns Blob
524
525
  def clear_blob_pages(container, blob, start_range, end_range, options={})
@@ -527,7 +528,7 @@ module Azure
527
528
 
528
529
  uri = blob_uri(container, blob, query)
529
530
 
530
- headers = { }
531
+ headers = service_properties_headers
531
532
  headers["x-ms-range"] = "bytes=#{start_range}-#{end_range}"
532
533
  headers["x-ms-page-write"] = "clear"
533
534
 
@@ -543,7 +544,7 @@ module Azure
543
544
  end
544
545
 
545
546
  # Public: Creates a new block blob or updates the content of an existing block blob.
546
- #
547
+ #
547
548
  # Updating an existing block blob overwrites any existing metadata on the blob
548
549
  # Partial updates are not supported with create_block_blob the content of the
549
550
  # existing blob is overwritten with the content of the new blob. To perform a
@@ -557,7 +558,7 @@ module Azure
557
558
  # * +container+ - String. The container name.
558
559
  # * +blob+ - String. The blob name.
559
560
  # * +content+ - IO or String. The content of the blob.
560
- # * +options+ - Hash. Optional parameters.
561
+ # * +options+ - Hash. Optional parameters.
561
562
  #
562
563
  # ==== Options
563
564
  #
@@ -575,7 +576,7 @@ module Azure
575
576
  # * +:metadata+ - Hash. Custom metadata values to store with the blob.
576
577
  # * +:timeout+ - Integer. A timeout in seconds.
577
578
  #
578
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd179451.aspx
579
+ # See http://msdn.microsoft.com/en-us/library/azure/dd179451.aspx
579
580
  #
580
581
  # Returns a Blob
581
582
  def create_block_blob(container, blob, content, options={})
@@ -583,8 +584,8 @@ module Azure
583
584
  query["timeout"] = options[:timeout].to_s if options[:timeout]
584
585
 
585
586
  uri = blob_uri(container, blob, query)
586
-
587
- headers = { }
587
+
588
+ headers = service_properties_headers
588
589
 
589
590
  # set x-ms-blob-type to BlockBlob
590
591
  headers["x-ms-blob-type"] = "BlockBlob"
@@ -601,6 +602,7 @@ module Azure
601
602
  headers["x-ms-blob-content-language"] = options[:blob_content_language] if options[:blob_content_language]
602
603
  headers["x-ms-blob-content-md5"] = options[:blob_content_md5] if options[:blob_content_md5]
603
604
  headers["x-ms-blob-cache-control"] = options[:blob_cache_control] if options[:blob_cache_control]
605
+ headers["x-ms-blob-content-disposition"] = options[:blob_content_disposition] if options[:blob_content_disposition]
604
606
 
605
607
  add_metadata_to_headers(options[:metadata], headers) if options[:metadata]
606
608
 
@@ -621,7 +623,7 @@ module Azure
621
623
  # * +blob+ - String. The blob name.
622
624
  # * +block_id+ - String. The block id. Note: this should be the raw block id, not Base64 encoded.
623
625
  # * +content+ - IO or String. The content of the blob.
624
- # * +options+ - Hash. Optional parameters.
626
+ # * +options+ - Hash. Optional parameters.
625
627
  #
626
628
  # ==== Options
627
629
  #
@@ -629,7 +631,7 @@ module Azure
629
631
  # * +:content_md5+ - String. Content MD5 for the request contents.
630
632
  # * +:timeout+ - Integer. A timeout in seconds.
631
633
  #
632
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd135726.aspx
634
+ # See http://msdn.microsoft.com/en-us/library/azure/dd135726.aspx
633
635
  #
634
636
  # Returns the MD5 of the uploaded block (as calculated by the server)
635
637
  def create_blob_block(container, blob, block_id, content, options={})
@@ -639,7 +641,7 @@ module Azure
639
641
 
640
642
  uri = blob_uri(container, blob, query)
641
643
 
642
- headers = { }
644
+ headers = service_properties_headers
643
645
  headers["Content-MD5"] = options[:content_md5] if options[:content_md5]
644
646
 
645
647
  response = call(:put, uri, content, headers)
@@ -648,27 +650,27 @@ module Azure
648
650
  end
649
651
 
650
652
  # Public: Commits existing blob blocks to a blob.
651
- #
653
+ #
652
654
  # This method writes a blob by specifying the list of block IDs that make up the
653
- # blob. In order to be written as part of a blob, a block must have been
655
+ # blob. In order to be written as part of a blob, a block must have been
654
656
  # successfully written to the server in a prior create_blob_block method.
655
- #
656
- # You can call Put Block List to update a blob by uploading only those blocks
657
- # that have changed, then committing the new and existing blocks together.
658
- # You can do this by specifying whether to commit a block from the committed
657
+ #
658
+ # You can call Put Block List to update a blob by uploading only those blocks
659
+ # that have changed, then committing the new and existing blocks together.
660
+ # You can do this by specifying whether to commit a block from the committed
659
661
  # block list or from the uncommitted block list, or to commit the most recently
660
662
  # uploaded version of the block, whichever list it may belong to.
661
- #
663
+ #
662
664
  # ==== Attributes
663
665
  #
664
666
  # * +container+ - String. The container name.
665
667
  # * +blob+ - String. The blob name.
666
- # * +block_list+ - Array. A ordered list of lists in the following format:
668
+ # * +block_list+ - Array. A ordered list of lists in the following format:
667
669
  # [ ["block_id1", :committed], ["block_id2", :uncommitted], ["block_id3"], ["block_id4", :committed]... ]
668
- # The first element of the inner list is the block_id, the second is optional
669
- # and can be either :committed or :uncommitted to indicate in which group of blocks
670
+ # The first element of the inner list is the block_id, the second is optional
671
+ # and can be either :committed or :uncommitted to indicate in which group of blocks
670
672
  # the id should be looked for. If it is omitted, the latest of either group will be used.
671
- # * +options+ - Hash. Optional parameters.
673
+ # * +options+ - Hash. Optional parameters.
672
674
  #
673
675
  # ==== Options
674
676
  #
@@ -682,8 +684,8 @@ module Azure
682
684
  # * +:metadata+ - Hash. Custom metadata values to store with the blob.
683
685
  # * +:timeout+ - Integer. A timeout in seconds.
684
686
  #
685
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd179467.aspx
686
- #
687
+ # See http://msdn.microsoft.com/en-us/library/azure/dd179467.aspx
688
+ #
687
689
  # Returns nil on success
688
690
  def commit_blob_blocks(container, blob, block_list, options={})
689
691
  query = { "comp" => "blocklist" }
@@ -691,7 +693,7 @@ module Azure
691
693
 
692
694
  uri = blob_uri(container, blob, query)
693
695
 
694
- headers = { }
696
+ headers = service_properties_headers
695
697
  unless options.empty?
696
698
  headers["Content-MD5"] = options[:content_md5] if options[:content_md5]
697
699
  headers["x-ms-blob-content-type"] = options[:blob_content_type] if options[:blob_content_type]
@@ -699,6 +701,7 @@ module Azure
699
701
  headers["x-ms-blob-content-language"] = options[:blob_content_language] if options[:blob_content_language]
700
702
  headers["x-ms-blob-content-md5"] = options[:blob_content_md5] if options[:blob_content_md5]
701
703
  headers["x-ms-blob-cache-control"] = options[:blob_cache_control] if options[:blob_cache_control]
704
+ headers["x-ms-blob-content-disposition"] = options[:blob_content_disposition] if options[:blob_content_disposition]
702
705
 
703
706
  add_metadata_to_headers(options[:metadata], headers) if options[:metadata]
704
707
  end
@@ -709,30 +712,30 @@ module Azure
709
712
  end
710
713
 
711
714
  # Public: Retrieves the list of blocks that have been uploaded as part of a block blob.
712
- #
715
+ #
713
716
  # There are two block lists maintained for a blob:
714
- # 1) Committed Block List: The list of blocks that have been successfully
717
+ # 1) Committed Block List: The list of blocks that have been successfully
715
718
  # committed to a given blob with commitBlobBlocks.
716
719
  # 2) Uncommitted Block List: The list of blocks that have been uploaded for a
717
720
  # blob using Put Block (REST API), but that have not yet been committed.
718
- # These blocks are stored in Windows Azure in association with a blob, but do
721
+ # These blocks are stored in Microsoft Azure in association with a blob, but do
719
722
  # not yet form part of the blob.
720
723
  #
721
724
  # ==== Attributes
722
725
  #
723
726
  # * +container+ - String. The container name.
724
727
  # * +blob+ - String. The blob name.
725
- # * +options+ - Hash. Optional parameters.
728
+ # * +options+ - Hash. Optional parameters.
726
729
  #
727
730
  # ==== Options
728
731
  #
729
732
  # Accepted key/value pairs in options parameter are:
730
733
  # * +:blocklist_type+ - Symbol. One of :all, :committed, :uncommitted. Defaults to :all (optional)
731
- # * +:snapshot+ - String. An opaque DateTime value that specifies the blob snapshot to
734
+ # * +:snapshot+ - String. An opaque DateTime value that specifies the blob snapshot to
732
735
  # retrieve information from. (optional)
733
736
  # * +:timeout+ - Integer. A timeout in seconds.
734
737
  #
735
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd179400.aspx
738
+ # See http://msdn.microsoft.com/en-us/library/azure/dd179400.aspx
736
739
  #
737
740
  # Returns a list of Azure::Entity::Blob::Block instances
738
741
  def list_blob_blocks(container, blob, options={})
@@ -757,16 +760,16 @@ module Azure
757
760
  #
758
761
  # * +container+ - String. The container name.
759
762
  # * +blob+ - String. The blob name.
760
- # * +options+ - Hash. Optional parameters.
763
+ # * +options+ - Hash. Optional parameters.
761
764
  #
762
765
  # ==== Options
763
766
  #
764
767
  # Accepted key/value pairs in options parameter are:
765
- # * +:snapshot+ - String. An opaque DateTime value that specifies the blob snapshot to
768
+ # * +:snapshot+ - String. An opaque DateTime value that specifies the blob snapshot to
766
769
  # retrieve information from.
767
770
  # * +:timeout+ - Integer. A timeout in seconds.
768
771
  #
769
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd179394.aspx
772
+ # See http://msdn.microsoft.com/en-us/library/azure/dd179394.aspx
770
773
  #
771
774
  # Returns a Blob
772
775
  def get_blob_properties(container, blob, options={})
@@ -792,16 +795,16 @@ module Azure
792
795
  #
793
796
  # * +container+ - String. The container name.
794
797
  # * +blob+ - String. The blob name.
795
- # * +options+ - Hash. Optional parameters.
798
+ # * +options+ - Hash. Optional parameters.
796
799
  #
797
800
  # ==== Options
798
801
  #
799
802
  # Accepted key/value pairs in options parameter are:
800
- # * +:snapshot+ - String. An opaque DateTime value that specifies the blob snapshot to
803
+ # * +:snapshot+ - String. An opaque DateTime value that specifies the blob snapshot to
801
804
  # retrieve information from.
802
805
  # * +:timeout+ - Integer. A timeout in seconds.
803
806
  #
804
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd179350.aspx
807
+ # See http://msdn.microsoft.com/en-us/library/azure/dd179350.aspx
805
808
  #
806
809
  # Returns a Blob
807
810
  def get_blob_metadata(container, blob, options={})
@@ -821,25 +824,25 @@ module Azure
821
824
  result
822
825
  end
823
826
 
824
- # Public: Returns a list of active page ranges for a page blob. Active page ranges are
827
+ # Public: Returns a list of active page ranges for a page blob. Active page ranges are
825
828
  # those that have been populated with data.
826
829
  #
827
830
  # ==== Attributes
828
831
  #
829
832
  # * +container+ - String. The container name.
830
833
  # * +blob+ - String. The blob name.
831
- # * +options+ - Hash. Optional parameters.
834
+ # * +options+ - Hash. Optional parameters.
832
835
  #
833
836
  # ==== Options
834
837
  #
835
838
  # Accepted key/value pairs in options parameter are:
836
839
  # * +:start_range+ - Integer. Position of first byte of first page. (optional)
837
840
  # * +:end_range+ - Integer. Position of last byte of of last page. (optional)
838
- # * +:snapshot+ - String. An opaque DateTime value that specifies the blob snapshot to
841
+ # * +:snapshot+ - String. An opaque DateTime value that specifies the blob snapshot to
839
842
  # retrieve information from. (optional)
840
843
  # * +:timeout+ - Integer. A timeout in seconds.
841
844
  #
842
- # See http://msdn.microsoft.com/en-us/library/windowsazure/ee691973.aspx
845
+ # See http://msdn.microsoft.com/en-us/library/azure/ee691973.aspx
843
846
  #
844
847
  # Returns a list of page ranges in the format [ [start, end], [start, end], ... ]
845
848
  #
@@ -854,7 +857,7 @@ module Azure
854
857
 
855
858
  options[:start_range] = 0 if options[:end_range] and not options[:start_range]
856
859
 
857
- headers = { }
860
+ headers = service_properties_headers
858
861
  headers = { "x-ms-range" => "bytes=#{options[:start_range]}-#{options[:end_range]}" } if options[:start_range]
859
862
 
860
863
  response = call(:get, uri, nil, headers)
@@ -869,7 +872,7 @@ module Azure
869
872
  #
870
873
  # * +container+ - String. The container name.
871
874
  # * +blob+ - String. The blob name.
872
- # * +options+ - Hash. Optional parameters.
875
+ # * +options+ - Hash. Optional parameters.
873
876
  #
874
877
  # ==== Options
875
878
  #
@@ -879,33 +882,33 @@ module Azure
879
882
  # * +:content_language+ - String. Content language for the blob. Will be saved with blob.
880
883
  # * +:content_md5+ - String. Content MD5 for the blob. Will be saved with blob.
881
884
  # * +:cache_control+ - String. Cache control for the blob. Will be saved with blob.
882
- # * +:content_length+ - Integer. Resizes a page blob to the specified size. If the specified
883
- # value is less than the current size of the blob, then all pages above
884
- # the specified value are cleared. This property cannot be used to change
885
- # the size of a block blob. Setting this property for a block blob returns
885
+ # * +:content_length+ - Integer. Resizes a page blob to the specified size. If the specified
886
+ # value is less than the current size of the blob, then all pages above
887
+ # the specified value are cleared. This property cannot be used to change
888
+ # the size of a block blob. Setting this property for a block blob returns
886
889
  # status code 400 (Bad Request).
887
- # * +:sequence_number_action+ - Symbol. This property indicates how the service should modify the sequence
888
- # number for the blob. Required if :sequence_number is used. This property
890
+ # * +:sequence_number_action+ - Symbol. This property indicates how the service should modify the sequence
891
+ # number for the blob. Required if :sequence_number is used. This property
889
892
  # applies to page blobs only.
890
893
  #
891
894
  # Specify one of the following options for this property:
892
895
  #
893
- # * +:max+ - Sets the sequence number to be the higher of the value included with
896
+ # * +:max+ - Sets the sequence number to be the higher of the value included with
894
897
  # the request and the value currently stored for the blob.
895
898
  # * +:update+ - Sets the sequence number to the value included with the request.
896
- # * +:increment+ - Increments the value of the sequence number by 1. If specifying this
899
+ # * +:increment+ - Increments the value of the sequence number by 1. If specifying this
897
900
  # option, do not include the sequence_number option; doing so will return
898
901
  # status code 400 (Bad Request).
899
- # * +:sequence_number+ - Integer. This property sets the blob's sequence number. The sequence number is a
900
- # user-controlled property that you can use to track requests and manage concurrency
901
- # issues. Required if the :sequence_number_action option is set to :max or :update.
902
+ # * +:sequence_number+ - Integer. This property sets the blob's sequence number. The sequence number is a
903
+ # user-controlled property that you can use to track requests and manage concurrency
904
+ # issues. Required if the :sequence_number_action option is set to :max or :update.
902
905
  # This property applies to page blobs only.
903
906
  #
904
- # Use this together with the :sequence_number_action to update the blob's sequence
905
- # number, either to the specified value or to the higher of the values specified with
907
+ # Use this together with the :sequence_number_action to update the blob's sequence
908
+ # number, either to the specified value or to the higher of the values specified with
906
909
  # the request or currently stored with the blob.
907
910
  #
908
- # This header should not be specified if :sequence_number_action is set to :increment;
911
+ # This header should not be specified if :sequence_number_action is set to :increment;
909
912
  # in this case the service automatically increments the sequence number by one.
910
913
  #
911
914
  # To set the sequence number to a value of your choosing, this property must be specified
@@ -917,27 +920,27 @@ module Azure
917
920
  # The semantics for updating a blob's properties are as follows:
918
921
  #
919
922
  # * A page blob's sequence number is updated only if the request meets either of the following conditions:
920
- #
923
+ #
921
924
  # * The :sequence_number_action property is set to :max or :update, and a value for :sequence_number is also set.
922
925
  # * The :sequence_number_action property is set to :increment, indicating that the service should increment
923
926
  # the sequence number by one.
924
- #
927
+ #
925
928
  # * The size of the page blob is modified only if a value for :content_length is specified.
926
929
  #
927
930
  # * If :sequence_number and/or :content_length are the only properties specified, then the other properties of the blob
928
931
  # will NOT be modified.
929
- #
932
+ #
930
933
  # * If any one or more of the following properties are set, then all of these properties are set together. If a value is
931
934
  # not provided for a given property when at least one of the properties listed below is set, then that property will be
932
935
  # cleared for the blob.
933
- #
936
+ #
934
937
  # * :cache_control
935
938
  # * :content_type
936
939
  # * :content_md5
937
940
  # * :content_encoding
938
941
  # * :content_language
939
942
  #
940
- # See http://msdn.microsoft.com/en-us/library/windowsazure/ee691966.aspx
943
+ # See http://msdn.microsoft.com/en-us/library/azure/ee691966.aspx
941
944
  #
942
945
  # Returns nil on success.
943
946
  def set_blob_properties(container, blob, options={})
@@ -945,7 +948,7 @@ module Azure
945
948
  query["timeout"] = options[:timeout].to_s if options[:timeout]
946
949
  uri = blob_uri(container, blob, query)
947
950
 
948
- headers = { }
951
+ headers = service_properties_headers
949
952
 
950
953
  unless options.empty?
951
954
  headers["x-ms-blob-content-type"] = options[:blob_content_type] if options[:blob_content_type]
@@ -956,6 +959,7 @@ module Azure
956
959
  headers["x-ms-blob-content-length"] = options[:blob_content_length].to_s if options[:blob_content_length]
957
960
  headers["x-ms-blob-sequence-number-action"] = options[:sequence_number_action].to_s if options[:sequence_number_action]
958
961
  headers["x-ms-blob-sequence-number"] = options[:sequence_number].to_s if options[:sequence_number]
962
+ headers["x-ms-blob-content-disposition"] = options[:blob_content_disposition] if options[:blob_content_disposition]
959
963
  end
960
964
 
961
965
  call(:put, uri, nil, headers)
@@ -969,14 +973,14 @@ module Azure
969
973
  # * +container+ - String. The container name.
970
974
  # * +blob+ - String. The blob name.
971
975
  # * +metadata+ - Hash. The custom metadata.
972
- # * +options+ - Hash. Optional parameters.
976
+ # * +options+ - Hash. Optional parameters.
973
977
  #
974
978
  # ==== Options
975
979
  #
976
980
  # Accepted key/value pairs in options parameter are:
977
981
  # * +:timeout+ - Integer. A timeout in seconds.
978
982
  #
979
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd179414.aspx
983
+ # See http://msdn.microsoft.com/en-us/library/azure/dd179414.aspx
980
984
  #
981
985
  # Returns nil on success.
982
986
  def set_blob_metadata(container, blob, metadata, options={})
@@ -984,7 +988,7 @@ module Azure
984
988
  query["timeout"] = options[:timeout].to_s if options[:timeout]
985
989
  uri = blob_uri(container, blob, query)
986
990
 
987
- headers = { }
991
+ headers = service_properties_headers
988
992
 
989
993
  add_metadata_to_headers(metadata, headers) if metadata
990
994
 
@@ -998,20 +1002,20 @@ module Azure
998
1002
  #
999
1003
  # * +container+ - String. The container name.
1000
1004
  # * +blob+ - String. The blob name.
1001
- # * +options+ - Hash. Optional parameters.
1005
+ # * +options+ - Hash. Optional parameters.
1002
1006
  #
1003
1007
  # ==== Options
1004
1008
  #
1005
1009
  # Accepted key/value pairs in options parameter are:
1006
1010
  # * +:start_range+ - Integer. Position of first byte of first page. (optional)
1007
1011
  # * +:end_range+ - Integer. Position of last byte of of last page. (optional)
1008
- # * +:snapshot+ - String. An opaque DateTime value that specifies the blob snapshot to
1012
+ # * +:snapshot+ - String. An opaque DateTime value that specifies the blob snapshot to
1009
1013
  # retrieve information from. (optional)
1010
1014
  # * +:get_content_md5+ - Boolean. Return the MD5 hash for the range. This option only valid if
1011
1015
  # start_range and end_range are specified. (optional)
1012
1016
  # * +:timeout+ - Integer. A timeout in seconds.
1013
1017
  #
1014
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd179440.aspx
1018
+ # See http://msdn.microsoft.com/en-us/library/azure/dd179440.aspx
1015
1019
  #
1016
1020
  # Returns a blob and the blob body
1017
1021
  def get_blob(container, blob, options={})
@@ -1020,7 +1024,7 @@ module Azure
1020
1024
  query["timeout"] = options[:timeout].to_s if options[:timeout]
1021
1025
  uri = blob_uri(container, blob, query)
1022
1026
 
1023
- headers = { }
1027
+ headers = service_properties_headers
1024
1028
  options[:start_range] = 0 if options[:end_range] and not options[:start_range]
1025
1029
  if options[:start_range]
1026
1030
  headers["x-ms-range"] = "bytes=#{options[:start_range]}-#{options[:end_range]}"
@@ -1039,23 +1043,23 @@ module Azure
1039
1043
  #
1040
1044
  # * +container+ - String. The container name.
1041
1045
  # * +blob+ - String. The blob name.
1042
- # * +options+ - Hash. Optional parameters.
1046
+ # * +options+ - Hash. Optional parameters.
1043
1047
  #
1044
1048
  # ==== Options
1045
1049
  #
1046
1050
  # Accepted key/value pairs in options parameter are:
1047
- # * +:snapshot+ - String. An opaque DateTime value that specifies the blob snapshot to
1051
+ # * +:snapshot+ - String. An opaque DateTime value that specifies the blob snapshot to
1048
1052
  # retrieve information from. (optional)
1049
1053
  # * +:delete_snapshots+ - Symbol. Used to specify the scope of the delete operation for snapshots.
1050
- # This parameter is ignored if a blob does not have snapshots, or if a
1054
+ # This parameter is ignored if a blob does not have snapshots, or if a
1051
1055
  # snapshot is specified in the snapshot parameter. (optional)
1052
- #
1053
- # Possible values include:
1056
+ #
1057
+ # Possible values include:
1054
1058
  # * +:only+ - Deletes only the snapshots for the blob, but leaves the blob
1055
1059
  # * +:include+ - Deletes the blob and all of the snapshots for the blob
1056
1060
  # * +:timeout+ - Integer. A timeout in seconds.
1057
1061
  #
1058
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd179440.aspx
1062
+ # See http://msdn.microsoft.com/en-us/library/azure/dd179440.aspx
1059
1063
  #
1060
1064
  # Returns nil on success
1061
1065
  def delete_blob(container, blob, options={})
@@ -1067,7 +1071,7 @@ module Azure
1067
1071
 
1068
1072
  options[:delete_snapshots] = :include if !options[:delete_snapshots]
1069
1073
 
1070
- headers = { }
1074
+ headers = service_properties_headers
1071
1075
  headers["x-ms-delete-snapshots"] = options[:delete_snapshots].to_s if options[:delete_snapshots] && options[:snapshot] == nil
1072
1076
 
1073
1077
  call(:delete, uri, nil, headers)
@@ -1080,28 +1084,28 @@ module Azure
1080
1084
  #
1081
1085
  # * +container+ - String. The container name.
1082
1086
  # * +blob+ - String. The blob name.
1083
- # * +options+ - Hash. Optional parameters.
1087
+ # * +options+ - Hash. Optional parameters.
1084
1088
  #
1085
1089
  # ==== Options
1086
1090
  #
1087
1091
  # Accepted key/value pairs in options parameter are:
1088
1092
  # * +:metadata+ - Hash. Custom metadata values to store with the blob snapshot.
1089
- # * +:if_modified_since+ - A DateTime value. Specify this option to write the page only if the blob has been
1090
- # modified since the specified date/time. If the blob has not been modified, the
1093
+ # * +:if_modified_since+ - A DateTime value. Specify this option to write the page only if the blob has been
1094
+ # modified since the specified date/time. If the blob has not been modified, the
1091
1095
  # Blob service returns status code 412 (Precondition Failed).
1092
- # * +:if_unmodified_since+ - A DateTime value. Specify this option to write the page only if the blob has not
1093
- # been modified since the specified date/time. If the blob has been modified, the
1096
+ # * +:if_unmodified_since+ - A DateTime value. Specify this option to write the page only if the blob has not
1097
+ # been modified since the specified date/time. If the blob has been modified, the
1094
1098
  # Blob service returns status code 412 (Precondition Failed).
1095
- # * +:if_match+ - An ETag value. Specify an ETag value to write the page only if the blob's ETag
1096
- # value matches the value specified. If the values do not match, the Blob service
1099
+ # * +:if_match+ - An ETag value. Specify an ETag value to write the page only if the blob's ETag
1100
+ # value matches the value specified. If the values do not match, the Blob service
1097
1101
  # returns status code 412 (Precondition Failed).
1098
- # * +:if_none_match+ - An ETag value. Specify an ETag value to write the page only if the blob's ETag
1099
- # value does not match the value specified. If the values are identical, the Blob
1102
+ # * +:if_none_match+ - An ETag value. Specify an ETag value to write the page only if the blob's ETag
1103
+ # value does not match the value specified. If the values are identical, the Blob
1100
1104
  # service returns status code 412 (Precondition Failed).
1101
1105
  # * +:timeout+ - Integer. A timeout in seconds.
1102
1106
  #
1103
- # See http://msdn.microsoft.com/en-us/library/windowsazure/ee691971.aspx
1104
- #
1107
+ # See http://msdn.microsoft.com/en-us/library/azure/ee691971.aspx
1108
+ #
1105
1109
  # Returns the snapshot DateTime value
1106
1110
  def create_blob_snapshot(container, blob, options={})
1107
1111
  query = { "comp" => "snapshot" }
@@ -1109,7 +1113,7 @@ module Azure
1109
1113
 
1110
1114
  uri = blob_uri(container, blob, query)
1111
1115
 
1112
- headers = { }
1116
+ headers = service_properties_headers
1113
1117
  unless options.empty?
1114
1118
  add_metadata_to_headers(options[:metadata], headers) if options[:metadata]
1115
1119
 
@@ -1125,65 +1129,65 @@ module Azure
1125
1129
  end
1126
1130
 
1127
1131
  # Public: Copies a source blob to a destination blob within the same storage account.
1128
- #
1132
+ #
1129
1133
  # ==== Attributes
1130
1134
  #
1131
1135
  # * +source_container+ - String. The destination container name to copy to.
1132
1136
  # * +source_blob+ - String. The destination blob name to copy to.
1133
1137
  # * +destination_container+ - String. The source container name to copy from.
1134
1138
  # * +destination_blob+ - String. The source blob name to copy from.
1135
- # * +options+ - Hash. Optional parameters.
1139
+ # * +options+ - Hash. Optional parameters.
1136
1140
  #
1137
1141
  # ==== Options
1138
1142
  #
1139
1143
  # Accepted key/value pairs in options parameter are:
1140
1144
  # * +:source_snapshot+ - String. A snapshot id for the source blob
1141
- # * +:metadata+ - Hash. Custom metadata values to store with the copy. If this parameter is not
1142
- # specified, the operation will copy the source blob metadata to the destination
1143
- # blob. If this parameter is specified, the destination blob is created with the
1145
+ # * +:metadata+ - Hash. Custom metadata values to store with the copy. If this parameter is not
1146
+ # specified, the operation will copy the source blob metadata to the destination
1147
+ # blob. If this parameter is specified, the destination blob is created with the
1144
1148
  # specified metadata, and metadata is not copied from the source blob.
1145
- # * +:source_if_modified_since+ - A DateTime value. Specify this option to write the page only if the source blob
1146
- # has been modified since the specified date/time. If the blob has not been
1149
+ # * +:source_if_modified_since+ - A DateTime value. Specify this option to write the page only if the source blob
1150
+ # has been modified since the specified date/time. If the blob has not been
1147
1151
  # modified, the Blob service returns status code 412 (Precondition Failed).
1148
1152
  # * +:source_if_unmodified_since+ - A DateTime value. Specify this option to write the page only if the source blob
1149
- # has not been modified since the specified date/time. If the blob has been
1153
+ # has not been modified since the specified date/time. If the blob has been
1150
1154
  # modified, the Blob service returns status code 412 (Precondition Failed).
1151
- # * +:source_if_match+ - An ETag value. Specify an ETag value to write the page only if the source blob's
1152
- # ETag value matches the value specified. If the values do not match, the Blob
1155
+ # * +:source_if_match+ - An ETag value. Specify an ETag value to write the page only if the source blob's
1156
+ # ETag value matches the value specified. If the values do not match, the Blob
1153
1157
  # service returns status code 412 (Precondition Failed).
1154
- # * +:source_if_none_match+ - An ETag value. Specify an ETag value to write the page only if the source blob's
1155
- # ETag value does not match the value specified. If the values are identical, the
1158
+ # * +:source_if_none_match+ - An ETag value. Specify an ETag value to write the page only if the source blob's
1159
+ # ETag value does not match the value specified. If the values are identical, the
1156
1160
  # Blob service returns status code 412 (Precondition Failed).
1157
- # * +:dest_if_modified_since+ - A DateTime value. Specify this option to write the page only if the destination
1158
- # blob has been modified since the specified date/time. If the blob has not been
1161
+ # * +:dest_if_modified_since+ - A DateTime value. Specify this option to write the page only if the destination
1162
+ # blob has been modified since the specified date/time. If the blob has not been
1159
1163
  # modified, the Blob service returns status code 412 (Precondition Failed).
1160
- # * +:dest_if_unmodified_since+ - A DateTime value. Specify this option to write the page only if the destination
1161
- # blob has not been modified since the specified date/time. If the blob has been
1164
+ # * +:dest_if_unmodified_since+ - A DateTime value. Specify this option to write the page only if the destination
1165
+ # blob has not been modified since the specified date/time. If the blob has been
1162
1166
  # modified, the Blob service returns status code 412 (Precondition Failed).
1163
- # * +:dest_if_match+ - An ETag value. Specify an ETag value to write the page only if the destination
1164
- # blob's ETag value matches the value specified. If the values do not match, the
1167
+ # * +:dest_if_match+ - An ETag value. Specify an ETag value to write the page only if the destination
1168
+ # blob's ETag value matches the value specified. If the values do not match, the
1165
1169
  # Blob service returns status code 412 (Precondition Failed).
1166
- # * +:dest_if_none_match+ - An ETag value. Specify an ETag value to write the page only if the destination
1167
- # blob's ETag value does not match the value specified. If the values are
1170
+ # * +:dest_if_none_match+ - An ETag value. Specify an ETag value to write the page only if the destination
1171
+ # blob's ETag value does not match the value specified. If the values are
1168
1172
  # identical, the Blob service returns status code 412 (Precondition Failed).
1169
1173
  # * +:timeout+ - Integer. A timeout in seconds.
1170
1174
  #
1171
- # See http://msdn.microsoft.com/en-us/library/windowsazure/dd894037.aspx
1175
+ # See http://msdn.microsoft.com/en-us/library/azure/dd894037.aspx
1172
1176
  #
1173
- # Returns a tuple of (copy_id, copy_status).
1177
+ # Returns a tuple of (copy_id, copy_status).
1174
1178
  #
1175
- # * +copy_id+ - String identifier for this copy operation. Use with get_blob or get_blob_properties to check
1179
+ # * +copy_id+ - String identifier for this copy operation. Use with get_blob or get_blob_properties to check
1176
1180
  # the status of this copy operation, or pass to abort_copy_blob to abort a pending copy.
1177
1181
  # * +copy_status+ - String. The state of the copy operation, with these values:
1178
1182
  # "success" - The copy completed successfully.
1179
- # "pending" - The copy is in progress.
1183
+ # "pending" - The copy is in progress.
1180
1184
  #
1181
1185
  def copy_blob(destination_container, destination_blob, source_container, source_blob, options={})
1182
1186
  query = { }
1183
1187
  query["timeout"] = options[:timeout].to_s if options[:timeout]
1184
1188
 
1185
1189
  uri = blob_uri(destination_container, destination_blob, query)
1186
- headers = { }
1190
+ headers = service_properties_headers
1187
1191
  headers["x-ms-copy-source"] = blob_uri(source_container, source_blob, options[:source_snapshot] ? { "snapshot" => options[:source_snapshot] } : {}).to_s
1188
1192
 
1189
1193
  unless options.empty?
@@ -1209,21 +1213,21 @@ module Azure
1209
1213
  # ==== Attributes
1210
1214
  #
1211
1215
  # * +container+ - String. The container name.
1212
- # * +blob+ - String. The blob name.
1213
- # * +options+ - Hash. Optional parameters.
1216
+ # * +blob+ - String. The blob name.
1217
+ # * +options+ - Hash. Optional parameters.
1214
1218
  #
1215
1219
  # ==== Options
1216
1220
  #
1217
- # Accepted key/value pairs in options parameter are:
1218
- # * +:duration+ - Integer. Default -1. Specifies the duration of the lease, in seconds, or negative one (-1)
1221
+ # Accepted key/value pairs in options parameter are:
1222
+ # * +:duration+ - Integer. Default -1. Specifies the duration of the lease, in seconds, or negative one (-1)
1219
1223
  # for a lease that never expires. A non-infinite lease can be between 15 and 60 seconds. (optional)
1220
1224
  # * +:proposed_lease_id+ - String. Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request)
1221
1225
  # if the proposed lease ID is not in the correct format. (optional)
1222
1226
  # * +:timeout+ - Integer. A timeout in seconds.
1223
1227
  #
1224
- # See http://msdn.microsoft.com/en-us/library/windowsazure/ee691972.aspx
1228
+ # See http://msdn.microsoft.com/en-us/library/azure/ee691972.aspx
1225
1229
  #
1226
- # Returns a String of the new unique lease id. While the lease is active, you must include the lease ID with any request
1230
+ # Returns a String of the new unique lease id. While the lease is active, you must include the lease ID with any request
1227
1231
  # to write to the blob, or to renew, change, or release the lease. A successful renew operation also returns the lease id
1228
1232
  # for the active lease.
1229
1233
  #
@@ -1236,7 +1240,7 @@ module Azure
1236
1240
  duration = -1
1237
1241
  duration = options[:duration] if options[:duration]
1238
1242
 
1239
- headers = { }
1243
+ headers = service_properties_headers
1240
1244
  headers["x-ms-lease-action"] = "acquire"
1241
1245
  headers["x-ms-lease-duration"] = duration.to_s if duration
1242
1246
  headers["x-ms-proposed-lease-id"] = options[:proposed_lease_id] if options[:proposed_lease_id]
@@ -1245,9 +1249,9 @@ module Azure
1245
1249
  response.headers["x-ms-lease-id"]
1246
1250
  end
1247
1251
 
1248
- # Public: Renews the lease. The lease can be renewed if the lease ID specified on the request matches that
1249
- # associated with the blob. Note that the lease may be renewed even if it has expired as long as the blob
1250
- # has not been modified or leased again since the expiration of that lease. When you renew a lease, the
1252
+ # Public: Renews the lease. The lease can be renewed if the lease ID specified on the request matches that
1253
+ # associated with the blob. Note that the lease may be renewed even if it has expired as long as the blob
1254
+ # has not been modified or leased again since the expiration of that lease. When you renew a lease, the
1251
1255
  # lease duration clock resets.
1252
1256
  #
1253
1257
  # ==== Attributes
@@ -1255,14 +1259,14 @@ module Azure
1255
1259
  # * +container+ - String. The container name.
1256
1260
  # * +blob+ - String. The blob name.
1257
1261
  # * +lease+ - String. The lease id
1258
- # * +options+ - Hash. Optional parameters.
1262
+ # * +options+ - Hash. Optional parameters.
1259
1263
  #
1260
1264
  # ==== Options
1261
1265
  #
1262
- # Accepted key/value pairs in options parameter are:
1266
+ # Accepted key/value pairs in options parameter are:
1263
1267
  # * +:timeout+ - Integer. A timeout in seconds.
1264
1268
  #
1265
- # See http://msdn.microsoft.com/en-us/library/windowsazure/ee691972.aspx
1269
+ # See http://msdn.microsoft.com/en-us/library/azure/ee691972.aspx
1266
1270
  #
1267
1271
  # Returns the renewed lease id
1268
1272
  def renew_lease(container, blob, lease, options={})
@@ -1271,7 +1275,7 @@ module Azure
1271
1275
 
1272
1276
  uri = blob_uri(container, blob, query)
1273
1277
 
1274
- headers = { }
1278
+ headers = service_properties_headers
1275
1279
  headers["x-ms-lease-action"] = "renew"
1276
1280
  headers["x-ms-lease-id"] = lease
1277
1281
 
@@ -1279,8 +1283,8 @@ module Azure
1279
1283
  response.headers["x-ms-lease-id"]
1280
1284
  end
1281
1285
 
1282
- # Public: Releases the lease. The lease may be released if the lease ID specified on the request matches that
1283
- # associated with the blob. Releasing the lease allows another client to immediately acquire the lease for
1286
+ # Public: Releases the lease. The lease may be released if the lease ID specified on the request matches that
1287
+ # associated with the blob. Releasing the lease allows another client to immediately acquire the lease for
1284
1288
  # the blob as soon as the release is complete.
1285
1289
  #
1286
1290
  # ==== Attributes
@@ -1288,14 +1292,14 @@ module Azure
1288
1292
  # * +container+ - String. The container name.
1289
1293
  # * +blob+ - String. The blob name.
1290
1294
  # * +lease+ - String. The lease id.
1291
- # * +options+ - Hash. Optional parameters.
1295
+ # * +options+ - Hash. Optional parameters.
1292
1296
  #
1293
1297
  # ==== Options
1294
1298
  #
1295
- # Accepted key/value pairs in options parameter are:
1299
+ # Accepted key/value pairs in options parameter are:
1296
1300
  # * +:timeout+ - Integer. A timeout in seconds.
1297
1301
  #
1298
- # See http://msdn.microsoft.com/en-us/library/windowsazure/ee691972.aspx
1302
+ # See http://msdn.microsoft.com/en-us/library/azure/ee691972.aspx
1299
1303
  #
1300
1304
  # Returns nil on success
1301
1305
  def release_lease(container, blob, lease, options={})
@@ -1304,7 +1308,7 @@ module Azure
1304
1308
 
1305
1309
  uri = blob_uri(container, blob, query)
1306
1310
 
1307
- headers = { }
1311
+ headers = service_properties_headers
1308
1312
  headers["x-ms-lease-action"] = "release"
1309
1313
  headers["x-ms-lease-id"] = lease
1310
1314
 
@@ -1312,38 +1316,38 @@ module Azure
1312
1316
  nil
1313
1317
  end
1314
1318
 
1315
- # Public: Breaks the lease, if the blob has an active lease. Once a lease is broken, it cannot be renewed. Any
1316
- # authorized request can break the lease; the request is not required to specify a matching lease ID. When a
1317
- # lease is broken, the lease break period is allowed to elapse, during which time no lease operation except
1318
- # break and release can be performed on the blob. When a lease is successfully broken, the response indicates
1319
+ # Public: Breaks the lease, if the blob has an active lease. Once a lease is broken, it cannot be renewed. Any
1320
+ # authorized request can break the lease; the request is not required to specify a matching lease ID. When a
1321
+ # lease is broken, the lease break period is allowed to elapse, during which time no lease operation except
1322
+ # break and release can be performed on the blob. When a lease is successfully broken, the response indicates
1319
1323
  # the interval in seconds until a new lease can be acquired.
1320
1324
  #
1321
- # A lease that has been broken can also be released, in which case another client may immediately acquire the
1325
+ # A lease that has been broken can also be released, in which case another client may immediately acquire the
1322
1326
  # lease on the blob.
1323
1327
  #
1324
1328
  # ==== Attributes
1325
1329
  #
1326
1330
  # * +container+ - String. The container name.
1327
1331
  # * +blob+ - String. The blob name.
1328
- # * +options+ - Hash. Optional parameters.
1332
+ # * +options+ - Hash. Optional parameters.
1329
1333
  #
1330
1334
  # ==== Options
1331
1335
  #
1332
- # Accepted key/value pairs in options parameter are:
1333
- # * +:break_period+ - Integer. The proposed duration of seconds that the lease should continue before it is
1334
- # broken, between 0 and 60 seconds. This break period is only used if it is shorter than
1335
- # the time remaining on the lease. If longer, the time remaining on the lease is used. A
1336
- # new lease will not be available before the break period has expired, but the lease may
1336
+ # Accepted key/value pairs in options parameter are:
1337
+ # * +:break_period+ - Integer. The proposed duration of seconds that the lease should continue before it is
1338
+ # broken, between 0 and 60 seconds. This break period is only used if it is shorter than
1339
+ # the time remaining on the lease. If longer, the time remaining on the lease is used. A
1340
+ # new lease will not be available before the break period has expired, but the lease may
1337
1341
  # be held for longer than the break period.
1338
1342
  #
1339
- # If this option is not used, a fixed-duration lease breaks after the remaining lease
1343
+ # If this option is not used, a fixed-duration lease breaks after the remaining lease
1340
1344
  # period elapses, and an infinite lease breaks immediately.
1341
1345
  # * +:timeout+ - Integer. A timeout in seconds.
1342
1346
  #
1343
- # See http://msdn.microsoft.com/en-us/library/windowsazure/ee691972.aspx
1347
+ # See http://msdn.microsoft.com/en-us/library/azure/ee691972.aspx
1344
1348
  #
1345
- # Returns an Integer of the remaining lease time. This value is the approximate time remaining in the lease
1346
- # period, in seconds. This header is returned only for a successful request to break the lease. If the break
1349
+ # Returns an Integer of the remaining lease time. This value is the approximate time remaining in the lease
1350
+ # period, in seconds. This header is returned only for a successful request to break the lease. If the break
1347
1351
  # is immediate, 0 is returned.
1348
1352
  def break_lease(container, blob, options={})
1349
1353
  query = { "comp" => "lease" }
@@ -1351,7 +1355,7 @@ module Azure
1351
1355
 
1352
1356
  uri = blob_uri(container, blob, query)
1353
1357
 
1354
- headers = { }
1358
+ headers = service_properties_headers
1355
1359
  headers["x-ms-lease-action"] = "break"
1356
1360
  headers["x-ms-lease-break-period"] = options[:break_period].to_s if options[:break_period]
1357
1361