Class: Grafana::Api::Licensing::Token
- Inherits:
-
Object
- Object
- Grafana::Api::Licensing::Token
- Defined in:
- lib/grafana-api/api/licensing/token.rb
Instance Method Summary collapse
- #bulk_destroy(delete_token_command:) ⇒ Object
- #create(delete_token_command:) ⇒ Object
-
#initialize(connection) ⇒ Token
constructor
A new instance of Token.
- #list ⇒ Object
- #renew(body:) ⇒ Object
Constructor Details
#initialize(connection) ⇒ Token
Returns a new instance of Token.
5 6 7 |
# File 'lib/grafana-api/api/licensing/token.rb', line 5 def initialize(connection) @connection = connection end |
Instance Method Details
#bulk_destroy(delete_token_command:) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/grafana-api/api/licensing/token.rb', line 9 def bulk_destroy(delete_token_command:) raise ArgumentError, 'delete_token_command is required' if delete_token_command.nil? @connection.call( :DELETE, '/licensing/token', type: Grafana::Api::Models::ErrorResponseBody, auth: ['api_key', 'basic'], body: delete_token_command ) end |
#create(delete_token_command:) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/grafana-api/api/licensing/token.rb', line 21 def create(delete_token_command:) raise ArgumentError, 'delete_token_command is required' if delete_token_command.nil? @connection.call( :POST, '/licensing/token', type: Grafana::Api::Models::Token, auth: ['api_key', 'basic'], body: delete_token_command ) end |
#list ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/grafana-api/api/licensing/token.rb', line 33 def list @connection.call( :GET, '/licensing/token', type: Grafana::Api::Models::Token, auth: ['api_key', 'basic'] ) end |
#renew(body:) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/grafana-api/api/licensing/token.rb', line 42 def renew(body:) raise ArgumentError, 'body is required' if body.nil? @connection.call( :POST, '/licensing/token/renew', type: nil, auth: ['api_key', 'basic'], body: body ) end |