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.
864 865 866 |
# File 'lib/infrawrench/client.rb', line 864 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
882 883 884 885 886 887 888 889 890 |
# File 'lib/infrawrench/client.rb', line 882 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
908 909 910 911 912 913 914 915 |
# File 'lib/infrawrench/client.rb', line 908 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
929 930 931 932 933 934 935 936 |
# File 'lib/infrawrench/client.rb', line 929 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
952 953 954 955 956 957 958 959 |
# File 'lib/infrawrench/client.rb', line 952 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
975 976 977 978 979 980 981 982 |
# File 'lib/infrawrench/client.rb', line 975 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 |