Module: Rundeck::Client::Token
- Included in:
- Rundeck::Client
- Defined in:
- lib/rundeck/client/token.rb
Overview
Defines methods related to managing security.
Instance Method Summary collapse
-
#create_token(user, options = {}) ⇒ Rundeck::ObjectifiedHash
Create a new token for a user.
-
#delete_token(id, options = {}) ⇒ nil
Delete a token.
-
#token(id, options = {}) ⇒ Rundeck::ObjectifiedHash
Get a specific token.
-
#tokens(user = nil, options = {}) ⇒ Rundeck::ObjectifiedHash+
List all tokens, or all tokens for a specific user.
Instance Method Details
#create_token(user, options = {}) ⇒ Rundeck::ObjectifiedHash
Create a new token for a user
45 46 47 |
# File 'lib/rundeck/client/token.rb', line 45 def create_token(user, = {}) objectify post("/tokens/#{user}", )['token'] end |
#delete_token(id, options = {}) ⇒ nil
Delete a token
58 59 60 |
# File 'lib/rundeck/client/token.rb', line 58 def delete_token(id, = {}) delete("/token/#{id}", ) end |
#token(id, options = {}) ⇒ Rundeck::ObjectifiedHash
Get a specific token
32 33 34 |
# File 'lib/rundeck/client/token.rb', line 32 def token(id, = {}) objectify get("/token/#{id}", )['token'] end |
#tokens(user = nil, options = {}) ⇒ Rundeck::ObjectifiedHash+
List all tokens, or all tokens for a specific user.
18 19 20 21 |
# File 'lib/rundeck/client/token.rb', line 18 def tokens(user = nil, = {}) path = user.nil? ? '/tokens' : "/tokens/#{user}" objectify get(path, )['tokens'] end |