mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
add head_containers for rackspace files
This commit is contained in:
parent
bd4f4f05c9
commit
337148709d
2 changed files with 52 additions and 0 deletions
41
lib/fog/rackspace/requests/files/head_containers.rb
Normal file
41
lib/fog/rackspace/requests/files/head_containers.rb
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
unless Fog.mocking?
|
||||||
|
|
||||||
|
module Fog
|
||||||
|
module Rackspace
|
||||||
|
class Files
|
||||||
|
|
||||||
|
# List number of containers and total bytes stored
|
||||||
|
#
|
||||||
|
# ==== Returns
|
||||||
|
# * response<~Fog::AWS::Response>:
|
||||||
|
# * headers<~Hash>:
|
||||||
|
# * 'X-Account-Container-Count'<~String> - Count of containers
|
||||||
|
# * 'X-Account-Bytes-Used'<~String> - Bytes used
|
||||||
|
def head_containers
|
||||||
|
response = storage_request(
|
||||||
|
:expects => 204,
|
||||||
|
:method => 'HEAD',
|
||||||
|
:path => '',
|
||||||
|
:query => 'format=json'
|
||||||
|
)
|
||||||
|
response
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
module Fog
|
||||||
|
module Rackspace
|
||||||
|
class Servers
|
||||||
|
|
||||||
|
def get_flavors
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
11
spec/rackspace/requests/files/head_containers.rb
Normal file
11
spec/rackspace/requests/files/head_containers.rb
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
require File.dirname(__FILE__) + '/../../../spec_helper'
|
||||||
|
|
||||||
|
describe 'Rackspace::Files.head_containers' do
|
||||||
|
describe 'success' do
|
||||||
|
|
||||||
|
it "should return proper attributes" do
|
||||||
|
p files.head_containers
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Reference in a new issue