Class: Infrawrench::SshFanoutNamespace

Inherits:
Object
  • Object
show all
Defined in:
lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs

Overview

client.ssh_fanout

Instance Attribute Summary collapse

Instance Method Summary collapse

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.

Parameters:



6419
6420
6421
6422
# File 'lib/infrawrench/client.rb', line 6419

def initialize(transport)
  @transport = transport
  @snippets = SshFanoutSnippetsNamespace.new(@transport)
end

Instance Attribute Details

#snippetsSshFanoutSnippetsNamespace (readonly)

Returns client.ssh_fanout.snippets.

Returns:



6415
6416
6417
# File 'lib/infrawrench/client.rb', line 6415

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.

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • body (Hash)

    Request body, shaped as SshFanoutRunRequest.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • body: (ssh_fanout_run_request)
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as SshFanoutRunResponse — see sig/infrawrench/sdk.rbs.

Raises:



6450
6451
6452
6453
6454
6455
6456
6457
6458
# File 'lib/infrawrench/client.rb', line 6450

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: 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

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as SshFanoutTargetsResponse — see sig/infrawrench/sdk.rbs.

Raises:



6476
6477
6478
6479
6480
6481
6482
6483
# File 'lib/infrawrench/client.rb', line 6476

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: request_options
  )
end