Class: Infrawrench::AppsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::AppsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.apps
Instance Method Summary collapse
-
#check(body:, org_id: nil, request_options: nil) ⇒ Hash
Check whether a host can run Linux applications.
-
#initialize(transport) ⇒ AppsNamespace
constructor
private
A new instance of AppsNamespace.
-
#setup(body:, org_id: nil, request_options: nil) ⇒ Hash
Install what a host needs to run Linux applications.
Constructor Details
#initialize(transport) ⇒ AppsNamespace
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 AppsNamespace.
1601 1602 1603 |
# File 'lib/infrawrench/client.rb', line 1601 def initialize(transport) @transport = transport end |
Instance Method Details
#check(body:, org_id: nil, request_options: nil) ⇒ Hash
Check whether a host can run Linux applications
Runs a read-only shell probe over SSH and reports what the host is missing, plus the packages and commands that would fix it. A POST because it opens a connection to the named host and must never be cached — its whole value is saying what the host is now.
POST /api/org/orgId/apps/check
Raises on 400: Bad request
Raises on 404: Not found
Raises on 409: The host key is new or has changed; trust it and retry
Raises on 502: The host could not be reached or probed
1628 1629 1630 1631 1632 1633 1634 1635 1636 |
# File 'lib/infrawrench/client.rb', line 1628 def check(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/apps/check", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#setup(body:, org_id: nil, request_options: nil) ⇒ Hash
Install what a host needs to run Linux applications
Installs the named requirements using the host's own package manager, then
re-probes and reports what the host now is. Takes requirement ids, never
commands — the commands are derived server-side from a fresh probe. Needs
root or passwordless sudo on the host, respects change freezes, and is
audited as linux_app.host_setup.
Responds with application/x-ndjson: one {"line":"…"} per line of
package-manager output, then a final {"outcome":{…}}. A failure arrives
as {"error":"…"} inside the stream, because the status line has already
been sent by then.
POST /api/org/orgId/apps/setup
Raises on 400: Bad request
Raises on 404: Not found
Raises on 409: A change freeze is in effect, or the host key needs trusting
1667 1668 1669 1670 1671 1672 1673 1674 1675 |
# File 'lib/infrawrench/client.rb', line 1667 def setup(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/apps/setup", path_params: { "orgId" => org_id }, body: body, request_options: ) end |