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 +4 -4
- data/README.rdoc +10 -1
- data/lib/ceph/radosgw.rb +12 -0
- data/lib/s3/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 103bcdb77d57ac4c1d660ba97bda904b2519ed37
|
4
|
+
data.tar.gz: 7fa6c624c2e3d641a4c748e5ade3bc573800a333
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f670800ea35dd1ba27b4cee2556e71e96c03a2d4beed1b85a973c561bd9923dea04b5c70789140aab6b4a211717622d40642d63383c357fd19e60c77c11446f
|
7
|
+
data.tar.gz: 1b3fa3b26b2c3e3833fe50192840d550ec741f8763e882edc31102e165ef45283e18e3ac3fa50ee44ce33271432d0c8fb3e32c4315bbf837f952e18fb4567b4e
|
data/README.rdoc
CHANGED
@@ -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
|
-
|
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
|
|
data/lib/ceph/radosgw.rb
CHANGED
@@ -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
|
data/lib/s3/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: proxies
|