Class: Infrawrench::SshFanoutNamespace
- Inherits:
-
Object
- Object
- Infrawrench::SshFanoutNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.ssh_fanout
Instance Attribute Summary collapse
-
#snippets ⇒ SshFanoutSnippetsNamespace
readonly
client.ssh_fanout.snippets.
Instance Method Summary collapse
-
#initialize(transport) ⇒ SshFanoutNamespace
constructor
private
A new instance of SshFanoutNamespace.
-
#run(body:, org_id: nil, request_options: nil) ⇒ Hash
Run one command across many SSH hosts.
-
#targets(org_id: nil, request_options: nil) ⇒ Hash
List SSH-capable fan-out targets.
Constructor Details
#initialize(transport) ⇒ SshFanoutNamespace
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 SshFanoutNamespace.
6422 6423 6424 6425 |
# File 'lib/infrawrench/client.rb', line 6422 def initialize(transport) @transport = transport @snippets = SshFanoutSnippetsNamespace.new(@transport) end |
Instance Attribute Details
#snippets ⇒ SshFanoutSnippetsNamespace (readonly)
Returns client.ssh_fanout.snippets.
6418 6419 6420 |
# File 'lib/infrawrench/client.rb', line 6418 def snippets @snippets end |
Instance Method Details
#run(body:, org_id: nil, request_options: nil) ⇒ Hash
Run one command across many SSH hosts
Executes the command on every selected target under a concurrency cap
(default 8, max 16). Per-host results carry stdout, stderr, and exit code;
transport failures (unreachable, untrusted host key, blocked internal
host) are per-host too. Resource targets need sshKeyId (an org SSH key
owned by the caller). Blocked with HTTP 423 while a change freeze is in
effect; audit-logged.
Requires permission: resources:execute.
POST /api/org/orgId/ssh-fanout/run
Raises on 400: Bad request
Raises on 423: Blocked by an active change freeze. Retry with the
x-change-freeze-override: true header if you hold freezes:override;
both blocks and overrides are audit-logged.
6453 6454 6455 6456 6457 6458 6459 6460 6461 |
# File 'lib/infrawrench/client.rb', line 6453 def run(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/ssh-fanout/run", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#targets(org_id: nil, request_options: nil) ⇒ Hash
List SSH-capable fan-out targets
Every SSH-capable target in the org: ssh plugin accounts (native
credentials) plus resources whose type declares an sshEndpoint with a
resolvable host (EC2 instances, droplets, Hetzner servers, …).
Requires permission: resources:read.
GET /api/org/orgId/ssh-fanout/targets
6479 6480 6481 6482 6483 6484 6485 6486 |
# File 'lib/infrawrench/client.rb', line 6479 def targets(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/ssh-fanout/targets", path_params: { "orgId" => org_id }, request_options: ) end |