radosgw-s3 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f4de403dff6cada02537bb0c5d9029ad53d7653
4
- data.tar.gz: 0e04ab65febaa12366b68d114de1bb8109e00bd1
3
+ metadata.gz: 103bcdb77d57ac4c1d660ba97bda904b2519ed37
4
+ data.tar.gz: 7fa6c624c2e3d641a4c748e5ade3bc573800a333
5
5
  SHA512:
6
- metadata.gz: 1202e5b75f42b65b9d8d673271425f4c9c3803bff03b25ed41f96144b8d600b2fded2006fbf33039ef8f9d3b73338a896d981aa99ce1702e5465cf70d1bc3fc8
7
- data.tar.gz: 12ce9062fa6e8cbd9d40e3ceb6605ea6a984c941ba6ced495b65724d3a6c880f585835edc8210e49c4f4afb4ab6c229efe25253331ecb6394a1c1b79a7a45db3
6
+ metadata.gz: 7f670800ea35dd1ba27b4cee2556e71e96c03a2d4beed1b85a973c561bd9923dea04b5c70789140aab6b4a211717622d40642d63383c357fd19e60c77c11446f
7
+ data.tar.gz: 1b3fa3b26b2c3e3833fe50192840d550ec741f8763e882edc31102e165ef45283e18e3ac3fa50ee44ce33271432d0c8fb3e32c4315bbf837f952e18fb4567b4e
@@ -29,7 +29,16 @@ radosgw-admin guide to {create radosgw user}[http://docs.ceph.com/docs/master/ra
29
29
  service.user_create("UID_NAME")
30
30
 
31
31
  It will give you the access_key and secret_key in hash format
32
- Eg : {"access_key"=>"8OC3R0QYPOW9TWE6M4L7", "secret_key"=>"+dDV9U+0hx7VufeFGWvF+34AC9g1IcrsIrOzLtZL"}
32
+
33
+ {"access_key"=>"8OC3R0QYPOW9TWE6M4L7", "secret_key"=>"+dDV9U+0hx7VufeFGWvF+34AC9g1IcrsIrOzLtZL"}
34
+
35
+ === Get user Usage
36
+
37
+ service.user_usage("UID_NAME")
38
+
39
+ It will return something like
40
+
41
+ {"total_objects"=>"2", "total_bytes"=>"102400", "last_update"=>"2015-10-09 05:45:02.466953Z"}
33
42
 
34
43
  == See also
35
44
 
@@ -31,5 +31,17 @@ module CEPH
31
31
  secret_hash
32
32
  end
33
33
 
34
+ def user_usage(uid)
35
+ user_usage_json = ""
36
+ Net::SSH.start( @ipaddress, @username, :password => @user_password ) do|ssh|
37
+ user_usage_json = ssh.exec!("sudo radosgw-admin user stats --uid='#{uid}'")
38
+ end
39
+
40
+
41
+ user_usage_hash = JSON.parse(user_usage_json)
42
+ usage_hash = {"total_objects" => "#{user_usage_hash['stats']['total_entries']}", "total_bytes" => "#{user_usage_hash['stats']['total_bytes_rounded']}", "last_update" => "#{user_usage_hash['last_stats_update']}" }
43
+ usage_hash
44
+ end
45
+
34
46
  end
35
47
  end
@@ -1,3 +1,3 @@
1
1
  module S3
2
- VERSION = "0.3"
2
+ VERSION = "0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radosgw-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Alrin, Kishorekumar Neelamegam, Rajthilak, Kuba Kuźma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-06 00:00:00.000000000 Z
11
+ date: 2015-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: proxies