ocp 0.0.16 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a06e29b6773dfda36c5c4a6bbe30b48ec7c01383
4
- data.tar.gz: 807f835b1ae3774857378fd0edccf3374821a26a
3
+ metadata.gz: ea86e5351cf24e1f9b223cc420f4b20e42cc268a
4
+ data.tar.gz: aa5efac06c58092aedd49a339b4ddd15b641b62d
5
5
  SHA512:
6
- metadata.gz: 87d142a2e1c8c4dd37098ae5bcfb3930bd2c30e8898a86911921d8fabd104d5e3fbf3bee35544883b6547f044b6f9c7b0baf221822168d35fed434c9b596a260
7
- data.tar.gz: 1790ccb38dd5c6eadea589e3fca7db354d057a2eaa7f500e0db9c3b20f90a894e98e1d2267a705c8abe8cd5e5790c559e03a8abdf68e2692fddec126ae62806e
6
+ metadata.gz: f821202450fdfa8eb69c8d9a3788e7905d6b40716b39266f2647f18fc5556a6f78f3714d8591c1d559076ac2554f3a7a4431ca5574c664480277db97f2f34d4a
7
+ data.tar.gz: e1576b184ae89972c5cf67cb9d0269b11c886c1698239022b1939c59350b92ab8caddbe37a50cdd3d49ea7b4b2ccaebd1a6add8c6eea4b99bb331774a2d9a5e6
data/lib/base/Base.rb CHANGED
@@ -58,8 +58,8 @@ class Base
58
58
  return @response
59
59
  end
60
60
 
61
- def update(body)
62
- @response = @client.put(@endpoint,body)
61
+ def update(body, name)
62
+ @response = @client.put(@endpoint+"/"+name,body)
63
63
  return @response
64
64
  end
65
65
 
@@ -41,7 +41,7 @@ class RoleBinding < OcpApi
41
41
  end
42
42
 
43
43
  def update_role_binding(user, role)
44
- data = update(create_body(user, role))
44
+ data = update(create_body(user, role), role)
45
45
  return data
46
46
  end
47
47
 
@@ -147,6 +147,9 @@ class OcpClient
147
147
  puts "CA File - #{@clientcafile}"
148
148
  puts "URL - #{@url}#{location}"
149
149
  puts "Method - #{method}"
150
+ unless body.nil?
151
+ puts "Body - #{JSON.pretty_generate(body)}"
152
+ end
150
153
  end
151
154
 
152
155
  response = nil
@@ -220,6 +220,29 @@ class OcpCommander
220
220
  end
221
221
  end
222
222
 
223
+ command :update_role_binding do |c|
224
+ c.syntax = 'ocp update_role_binding [options]'
225
+ c.description = 'Update a Project Roles Binding'
226
+ c.option '--name PROJECTNAME', String, 'The name of the project'
227
+ c.option '--user USERNAME', String, 'The name of the user'
228
+ c.option '--role ROLE', String, 'The role to add to the user'
229
+ c.action do |args, options|
230
+ # Do something or c.when_called Ocp::Commands::Getoapi,
231
+ ocpconfig = OcpConfig.new
232
+ ocpconfig.set_config_with_options(options)
233
+ if ocpconfig.debug
234
+ puts "Config: #{ocpconfig.inspect}"
235
+ end
236
+
237
+ roles = RoleBinding.new(options.name)
238
+
239
+ roles.setup(ocpconfig)
240
+ resp = roles.update_role_binding(options.user, options.role)
241
+ puts "#{resp}"
242
+
243
+ end
244
+ end
245
+
223
246
  run!
224
247
  end
225
248
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Evensen