Class: FlexOps::Resources::ApiKeys
- Inherits:
-
Object
- Object
- FlexOps::Resources::ApiKeys
- Defined in:
- lib/flexops/resources/api_keys.rb
Instance Method Summary collapse
- #create(request) ⇒ Object
-
#initialize(http, ws_id_proc) ⇒ ApiKeys
constructor
A new instance of ApiKeys.
- #list ⇒ Object
- #revoke(key_id) ⇒ Object
- #rotate(key_id) ⇒ Object
Constructor Details
#initialize(http, ws_id_proc) ⇒ ApiKeys
Returns a new instance of ApiKeys.
12 13 14 15 |
# File 'lib/flexops/resources/api_keys.rb', line 12 def initialize(http, ws_id_proc) @http = http @ws_id = ws_id_proc end |
Instance Method Details
#create(request) ⇒ Object
21 22 23 |
# File 'lib/flexops/resources/api_keys.rb', line 21 def create(request) @http.post("#{ws_path}/api-keys", body: request) end |
#list ⇒ Object
17 18 19 |
# File 'lib/flexops/resources/api_keys.rb', line 17 def list @http.get("#{ws_path}/api-keys") end |
#revoke(key_id) ⇒ Object
25 26 27 |
# File 'lib/flexops/resources/api_keys.rb', line 25 def revoke(key_id) @http.delete("#{ws_path}/api-keys/#{key_id}") end |
#rotate(key_id) ⇒ Object
29 30 31 |
# File 'lib/flexops/resources/api_keys.rb', line 29 def rotate(key_id) @http.post("#{ws_path}/api-keys/#{key_id}/rotate") end |