radosgw-s3 0.10 → 0.11

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: 868eb028e225cbc00c66fc3ba4b9d57a8b9e38bf
4
- data.tar.gz: 5124a81ca41786fea9801cfd6f46922a41f5466a
3
+ metadata.gz: 664f2751fdcab0d53899f9aabc9c214543e9647f
4
+ data.tar.gz: a25ec9c2fd36f33037154eecec29fe14f1b1407e
5
5
  SHA512:
6
- metadata.gz: 49beb3af4b07623b7fd8db12cb2f65076a5be5ef073edf6b7ea05017fe0e572743b5b6a200a58e86fba87afe262a4e0107dd64fc8024ee614a50d7ee9f2e7c69
7
- data.tar.gz: f1c76ecb3f8a08e3eb9e726a5c398c7626f8f91f22ee7ed9c52bbe48d26660a9c089d9d72e4f7476a8aebc850ddf6d012e33c70c18165220c8d39bd0b016543e
6
+ metadata.gz: 110baeaa04422a192a0f24ebb6563adb1c4f67436f2fe18602400e442461e1368861742bdb5579c990005e61ed0e3591d63f7f8976c2d491589ef6671edf1abf
7
+ data.tar.gz: 66e77d2ed11487d4a4c96922684aec201741406bb6a8b12a759842981fd0a8bde973762422e0c8c0e9f8aa73095d0a9e3d07705baac4839e0cee5843e111dfad
data/README.rdoc CHANGED
@@ -18,7 +18,7 @@ radosgw-admin guide to {create radosgw user}[http://docs.ceph.com/docs/master/ra
18
18
  === Initialize the service
19
19
 
20
20
  require "radosgw-s3"
21
- service = CEPH::Radosgw.new(:ipaddress => "RADOSGW_HOST_IP",
21
+ service = CEPH::User.new(:ipaddress => "RADOSGW_HOST_IP",
22
22
  :username => "RADOSGW_HOST_USERNAME",
23
23
  :user_password => "RADOSGW_HOST_USER_PASSWORD",
24
24
  )
@@ -26,7 +26,7 @@ radosgw-admin guide to {create radosgw user}[http://docs.ceph.com/docs/master/ra
26
26
 
27
27
  === create user
28
28
 
29
- service.user_create("UID_NAME", "DISPLAY_NAME")
29
+ service.create("UID_NAME", "DISPLAY_NAME")
30
30
 
31
31
  It will give you the access_key and secret_key in hash format
32
32
 
@@ -34,7 +34,7 @@ It will give you the access_key and secret_key in hash format
34
34
 
35
35
  === Get user Usage
36
36
 
37
- service.user_usage("UID_NAME")
37
+ service.usage("UID_NAME")
38
38
 
39
39
  It will return something like
40
40
 
data/lib/ceph/user.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module CEPH
2
2
  class User < Radosgw
3
3
  def execution(command)
4
- radosgw_json =
4
+ radosgw_json =""
5
5
  begin
6
6
  Net::SSH.start( @ipaddress, @username, :password => @user_password, :non_interactive=>true ) do|ssh|
7
7
  radosgw_json = ssh.exec!(command)
@@ -31,7 +31,7 @@ module CEPH
31
31
 
32
32
  def create(uid, display_name)
33
33
  ceph_user_json = ""
34
- ceph_user_json = execution("sudo radosgw-admin user create --uid='#{uid}' --display-name='#{display_name}'")
34
+ ceph_user_json = execution("sudo radosgw-admin user create --uid='#{uid}' --display-name='#{display_name}'")
35
35
  begin
36
36
  ceph_user_hash = JSON.parse(ceph_user_json)
37
37
  secret_hash = {"access_key" => "#{ceph_user_hash['keys'][0]['access_key']}", "secret_key" => "#{ceph_user_hash['keys'][0]['secret_key']}" }
@@ -62,5 +62,17 @@ module CEPH
62
62
  end
63
63
  end
64
64
 
65
+ def info(uid)
66
+ user_info_json=""
67
+ user_info_json = execution("sudo radosgw-admin user info --uid='#{uid}'")
68
+ begin
69
+ user_info_hash = JSON.parse(user_info_json)
70
+ info_hash={"secret_key" => "#{user_info_hash['keys'][0]['secret_key']}","access_key" => "#{user_info_hash['keys'][0]['access_key']}","user_id"=>"#{user_info_hash['user_id']}","User_name"=>"#{user_info_hash['display_name']}"}
71
+ info_hash
72
+ rescue JSON::ParserError => e
73
+ return user_info_json
74
+ end
75
+ end
76
+
65
77
  end
66
78
  end
data/lib/s3/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module S3
2
- VERSION = "0.10"
2
+ VERSION = "0.11"
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.10'
4
+ version: '0.11'
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-11-26 00:00:00.000000000 Z
11
+ date: 2016-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: proxies
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  version: 1.3.6
166
166
  requirements: []
167
167
  rubyforge_project: s3
168
- rubygems_version: 2.4.7
168
+ rubygems_version: 2.5.1
169
169
  signing_key:
170
170
  specification_version: 4
171
171
  summary: Library for accessing ceph objects and buckets