Class: VMCAdmin::ServiceAuthToken
- Inherits:
-
VMC::CLI
- Object
- VMC::CLI
- VMCAdmin::ServiceAuthToken
- Defined in:
- lib/admin-vmc-plugin/service_auth_token.rb
Instance Method Summary collapse
- #create_service_auth_token ⇒ Object
- #delete_service_auth_token ⇒ Object
- #service_auth_tokens ⇒ Object
- #update_service_auth_token ⇒ Object
Instance Method Details
#create_service_auth_token ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/admin-vmc-plugin/service_auth_token.rb', line 29 def create_service_auth_token sat = client.service_auth_token sat.label = input[:label] sat.provider = input[:provider] sat.token = input[:token] with_progress("Creating service auth token") do sat.create! end end |
#delete_service_auth_token ⇒ Object
74 75 76 77 78 79 80 |
# File 'lib/admin-vmc-plugin/service_auth_token.rb', line 74 def delete_service_auth_token sat = input[:service_auth_token] with_progress("Deleting token #{c(sat.label, :name)}") do sat.delete! end end |
#service_auth_tokens ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/admin-vmc-plugin/service_auth_token.rb', line 7 def service_auth_tokens spaced(client.service_auth_tokens) do |t| line "#{c(t.label, :name)}:" indented do line "guid: #{t.guid}" line "provider: #{t.provider}" end end end |
#update_service_auth_token ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'lib/admin-vmc-plugin/service_auth_token.rb', line 54 def update_service_auth_token sat = input[:service_auth_token] sat.token = input[:token] with_progress("Updating token #{c(sat.label, :name)}") do sat.update! end end |