Class: Infrawrench::AgentsSessionsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::AgentsSessionsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.agents.sessions
Instance Method Summary collapse
-
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create an agent session.
-
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Delete an agent session and destroy its VM.
-
#initialize(transport) ⇒ AgentsSessionsNamespace
constructor
private
A new instance of AgentsSessionsNamespace.
-
#list(org_id: nil, request_options: nil) ⇒ Array<Hash>
List agent sessions.
-
#open(id:, org_id: nil, request_options: nil) ⇒ Hash
Return the command and working directory for an agent session.
-
#reconcile(id:, org_id: nil, request_options: nil) ⇒ Hash
Return reconciliation branch metadata.
Constructor Details
#initialize(transport) ⇒ AgentsSessionsNamespace
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 AgentsSessionsNamespace.
325 326 327 |
# File 'lib/infrawrench/client.rb', line 325 def initialize(transport) @transport = transport end |
Instance Method Details
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create an agent session
Requires permission: resources:write.
POST /api/org/orgId/agents/sessions
Raises on 400: Bad request
343 344 345 346 347 348 349 350 351 |
# File 'lib/infrawrench/client.rb', line 343 def create(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/agents/sessions", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Delete an agent session and destroy its VM
Requires permission: resources:delete.
DELETE /api/org/orgId/agents/sessions/id
Raises on 404: Not found
Raises on 502: The provider refused to delete the VM
369 370 371 372 373 374 375 376 |
# File 'lib/infrawrench/client.rb', line 369 def delete(id:, org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/agents/sessions/{id}", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#list(org_id: nil, request_options: nil) ⇒ Array<Hash>
List agent sessions
Requires permission: resources:read.
GET /api/org/orgId/agents/sessions
390 391 392 393 394 395 396 397 |
# File 'lib/infrawrench/client.rb', line 390 def list(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/agents/sessions", path_params: { "orgId" => org_id }, request_options: ) end |
#open(id:, org_id: nil, request_options: nil) ⇒ Hash
Return the command and working directory for an agent session
Requires permission: resources:execute.
POST /api/org/orgId/agents/sessions/id/open
Raises on 404: Not found
413 414 415 416 417 418 419 420 |
# File 'lib/infrawrench/client.rb', line 413 def open(id:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/agents/sessions/{id}/open", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#reconcile(id:, org_id: nil, request_options: nil) ⇒ Hash
Return reconciliation branch metadata
Requires permission: resources:execute.
POST /api/org/orgId/agents/sessions/id/reconcile
Raises on 404: Not found
436 437 438 439 440 441 442 443 |
# File 'lib/infrawrench/client.rb', line 436 def reconcile(id:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/agents/sessions/{id}/reconcile", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |