Class: Grafana::Api::Serviceaccounts
- Inherits:
-
Object
- Object
- Grafana::Api::Serviceaccounts
- Defined in:
- lib/grafana-api/api/serviceaccounts.rb
Defined Under Namespace
Classes: Tokens
Instance Method Summary collapse
- #create(create_service_account_form: nil) ⇒ Object
- #delete(service_account_id:) ⇒ Object
- #get(service_account_id:) ⇒ Object
-
#initialize(connection) ⇒ Serviceaccounts
constructor
A new instance of Serviceaccounts.
- #partial_update(service_account_id:, update_service_account_form: nil) ⇒ Object
- #search(disabled: nil, expired_tokens: nil, query: nil, perpage: nil, page: nil) ⇒ Object
Constructor Details
#initialize(connection) ⇒ Serviceaccounts
Returns a new instance of Serviceaccounts.
5 6 7 |
# File 'lib/grafana-api/api/serviceaccounts.rb', line 5 def initialize(connection) @connection = connection end |
Instance Method Details
#create(create_service_account_form: nil) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/grafana-api/api/serviceaccounts.rb', line 9 def create(create_service_account_form: nil) @connection.call( :POST, '/serviceaccounts', type: Grafana::Api::Models::ServiceAccountDTO, auth: ['api_key', 'basic'], body: create_service_account_form ) end |
#delete(service_account_id:) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/grafana-api/api/serviceaccounts.rb', line 19 def delete(service_account_id:) raise ArgumentError, 'service_account_id is required' if service_account_id.nil? @connection.call( :DELETE, '/serviceaccounts/{serviceAccountId}' .gsub('{serviceAccountId}', ERB::Util.url_encode(service_account_id.to_s)), type: Grafana::Api::Models::SuccessResponseBody, auth: ['api_key', 'basic'] ) end |
#get(service_account_id:) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/grafana-api/api/serviceaccounts.rb', line 31 def get(service_account_id:) raise ArgumentError, 'service_account_id is required' if service_account_id.nil? @connection.call( :GET, '/serviceaccounts/{serviceAccountId}' .gsub('{serviceAccountId}', ERB::Util.url_encode(service_account_id.to_s)), type: Grafana::Api::Models::ServiceAccountDTO, auth: ['api_key', 'basic'] ) end |
#partial_update(service_account_id:, update_service_account_form: nil) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/grafana-api/api/serviceaccounts.rb', line 43 def partial_update(service_account_id:, update_service_account_form: nil) raise ArgumentError, 'service_account_id is required' if service_account_id.nil? @connection.call( :PATCH, '/serviceaccounts/{serviceAccountId}' .gsub('{serviceAccountId}', ERB::Util.url_encode(service_account_id.to_s)), type: Grafana::Api::Models::UpdateServiceAccount200Response, auth: ['api_key', 'basic'], body: update_service_account_form ) end |
#search(disabled: nil, expired_tokens: nil, query: nil, perpage: nil, page: nil) ⇒ Object
56 57 58 59 60 61 62 63 64 |
# File 'lib/grafana-api/api/serviceaccounts.rb', line 56 def search(disabled: nil, expired_tokens: nil, query: nil, perpage: nil, page: nil) @connection.call( :GET, '/serviceaccounts/search', type: Grafana::Api::Models::SearchOrgServiceAccountsResult, auth: ['api_key', 'basic'], query: { 'Disabled' => disabled, 'expiredTokens' => expired_tokens, 'query' => query, 'perpage' => perpage, 'page' => page } ) end |