Method: Azure::Blob::BlobService#release_lease

Defined in:
lib/azure/blob/blob_service.rb

#release_lease(container, blob, lease, options = {}) ⇒ Object

Public: Releases the lease. The lease may be released if the lease ID specified on the request matches that associated with the blob. Releasing the lease allows another client to immediately acquire the lease for the blob as soon as the release is complete.

Attributes

  • container - String. The container name.

  • blob - String. The blob name.

  • lease - String. The lease id.

  • options - Hash. Optional parameters.

Options

Accepted key/value pairs in options parameter are:

  • :timeout - Integer. A timeout in seconds.

See msdn.microsoft.com/en-us/library/windowsazure/ee691972.aspx

Returns nil on success



1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
# File 'lib/azure/blob/blob_service.rb', line 1302

def release_lease(container, blob, lease, options={})
  query = { "comp" => "lease" }
  query["timeout"] = options[:timeout].to_s if options[:timeout]

  uri = blob_uri(container, blob, query)

  headers = { }
  headers["x-ms-lease-action"] = "release"
  headers["x-ms-lease-id"] = lease

  call(:put, uri, nil, headers)
  nil
end