Class: Melaya::RunnerAPI
- Inherits:
-
Object
- Object
- Melaya::RunnerAPI
- Defined in:
- lib/melaya/runner.rb
Overview
Runner API — mint, list, and revoke runner tokens.
Runner tokens (mel_run_ prefix) authenticate the Melaya runner CLI process that executes agent pipelines on your infrastructure. The plaintext token is returned only once on creation — store it securely.
Maps to /api/v1/private/runner/tokens/*.
Instance Method Summary collapse
-
#create_token(label: nil) ⇒ Object
POST /api/v1/private/runner/tokens Mint a new mel_run_ runner token.
-
#initialize(http) ⇒ RunnerAPI
constructor
A new instance of RunnerAPI.
-
#list_tokens ⇒ Object
GET /api/v1/private/runner/tokens List all runner tokens for the caller (masked, with last_seen).
-
#revoke_token(token_id) ⇒ Object
DELETE /api/v1/private/runner/tokens/:tokenId Revoke a runner token by ID.
Constructor Details
#initialize(http) ⇒ RunnerAPI
Returns a new instance of RunnerAPI.
19 20 21 |
# File 'lib/melaya/runner.rb', line 19 def initialize(http) @http = http end |
Instance Method Details
#create_token(label: nil) ⇒ Object
POST /api/v1/private/runner/tokens Mint a new mel_run_ runner token.
26 27 28 29 |
# File 'lib/melaya/runner.rb', line 26 def create_token(label: nil) body = label ? { "label" => label } : nil @http.post("/api/v1/private/runner/tokens", body) end |
#list_tokens ⇒ Object
GET /api/v1/private/runner/tokens List all runner tokens for the caller (masked, with last_seen).
33 34 35 |
# File 'lib/melaya/runner.rb', line 33 def list_tokens @http.get("/api/v1/private/runner/tokens") end |
#revoke_token(token_id) ⇒ Object
DELETE /api/v1/private/runner/tokens/:tokenId Revoke a runner token by ID.
40 41 42 |
# File 'lib/melaya/runner.rb', line 40 def revoke_token(token_id) @http.delete("/api/v1/private/runner/tokens/#{URI.encode_www_form_component(token_id.to_s)}") end |