Class: Infrawrench::ApiKeysNamespace
- Inherits:
-
Object
- Object
- Infrawrench::ApiKeysNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.api_keys
Instance Method Summary collapse
-
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create an API key (plaintext returned once).
-
#initialize(transport) ⇒ ApiKeysNamespace
constructor
private
A new instance of ApiKeysNamespace.
-
#list(org_id: nil, request_options: nil) ⇒ Array<Hash>
List API keys (no plaintext).
-
#revoke(id:, org_id: nil, request_options: nil) ⇒ Hash
Revoke an API key.
-
#rotate(id:, org_id: nil, request_options: nil) ⇒ Hash
Rotate an API key (revokes old, returns new).
Constructor Details
#initialize(transport) ⇒ ApiKeysNamespace
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ApiKeysNamespace.
1513 1514 1515 |
# File 'lib/infrawrench/client.rb', line 1513 def initialize(transport) @transport = transport end |
Instance Method Details
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create an API key (plaintext returned once)
POST /api/org/orgId/api-keys
1527 1528 1529 1530 1531 1532 1533 1534 1535 |
# File 'lib/infrawrench/client.rb', line 1527 def create(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/api-keys", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#list(org_id: nil, request_options: nil) ⇒ Array<Hash>
List API keys (no plaintext)
GET /api/org/orgId/api-keys
1547 1548 1549 1550 1551 1552 1553 1554 |
# File 'lib/infrawrench/client.rb', line 1547 def list(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/api-keys", path_params: { "orgId" => org_id }, request_options: ) end |
#revoke(id:, org_id: nil, request_options: nil) ⇒ Hash
Revoke an API key
POST /api/org/orgId/api-keys/id/revoke
1566 1567 1568 1569 1570 1571 1572 1573 |
# File 'lib/infrawrench/client.rb', line 1566 def revoke(id:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/api-keys/{id}/revoke", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#rotate(id:, org_id: nil, request_options: nil) ⇒ Hash
Rotate an API key (revokes old, returns new)
POST /api/org/orgId/api-keys/id/rotate
Raises on 404: Not found
1587 1588 1589 1590 1591 1592 1593 1594 |
# File 'lib/infrawrench/client.rb', line 1587 def rotate(id:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/api-keys/{id}/rotate", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |