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.
441 442 443 |
# File 'lib/infrawrench/client.rb', line 441 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
459 460 461 462 463 464 465 466 467 |
# File 'lib/infrawrench/client.rb', line 459 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
485 486 487 488 489 490 491 492 |
# File 'lib/infrawrench/client.rb', line 485 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
506 507 508 509 510 511 512 513 |
# File 'lib/infrawrench/client.rb', line 506 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
529 530 531 532 533 534 535 536 |
# File 'lib/infrawrench/client.rb', line 529 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
552 553 554 555 556 557 558 559 |
# File 'lib/infrawrench/client.rb', line 552 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 |