Class: GraylogAPI::Users
- Inherits:
-
Object
- Object
- GraylogAPI::Users
- Defined in:
- lib/graylogapi/users.rb
Overview
class for manage users
Instance Method Summary collapse
-
#create_token(username, name) ⇒ Object
Generate a new access token for a user.
-
#delete_token(username, name) ⇒ Object
Removes a token for a user.
-
#initialize(client) ⇒ Users
constructor
A new instance of Users.
-
#tokens(username) ⇒ Object
Retrieves the list of access tokens for a user.
Constructor Details
#initialize(client) ⇒ Users
Returns a new instance of Users.
4 5 6 |
# File 'lib/graylogapi/users.rb', line 4 def initialize(client) @client = client end |
Instance Method Details
#create_token(username, name) ⇒ Object
Generate a new access token for a user
14 15 16 |
# File 'lib/graylogapi/users.rb', line 14 def create_token(username, name) @client.request(:post, "/users/#{username}/tokens/#{name}", {}) end |
#delete_token(username, name) ⇒ Object
Removes a token for a user
19 20 21 |
# File 'lib/graylogapi/users.rb', line 19 def delete_token(username, name) @client.request(:delete, "/users/#{username}/tokens/#{name}") end |
#tokens(username) ⇒ Object
Retrieves the list of access tokens for a user
9 10 11 |
# File 'lib/graylogapi/users.rb', line 9 def tokens(username) @client.request(:get, "/users/#{username}/tokens") end |