Class: Infrawrench::SshTunnelsNamespace

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

Overview

client.ssh_tunnels

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ SshTunnelsNamespace

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 SshTunnelsNamespace.

Parameters:



4974
4975
4976
# File 'lib/infrawrench/client.rb', line 4974

def initialize(transport)
  @transport = transport
end

Instance Method Details

#active(org_id: nil, request_options: nil) ⇒ Hash

List active tunnels for this org

Requires permission: resources:execute.

GET /api/org/orgId/ssh-tunnels/active

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 Hash — see sig/infrawrench/sdk.rbs.

Raises:



4989
4990
4991
4992
4993
4994
4995
4996
# File 'lib/infrawrench/client.rb', line 4989

def active(org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/ssh-tunnels/active",
    path_params: { "orgId" => org_id },
    request_options: request_options
  )
end

#close(body:, org_id: nil, request_options: nil) ⇒ Hash

Close a tunnel by id

Requires permission: resources:execute.

POST /api/org/orgId/ssh-tunnels/close

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 Hash.

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

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

  • body: ({ "tunnelId" => String })
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

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

Raises:



5010
5011
5012
5013
5014
5015
5016
5017
5018
# File 'lib/infrawrench/client.rb', line 5010

def close(body:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/ssh-tunnels/close",
    path_params: { "orgId" => org_id },
    body: body,
    request_options: request_options
  )
end

#create_account(body:, org_id: nil, request_options: nil) ⇒ Hash

Create an account whose traffic is tunneled over SSH

Verifies the SSH connection works before persisting.

Requires permission: accounts:write.

POST /api/org/orgId/ssh-tunnels/create-account

Raises on 400: Bad request

Raises on 404: Not found

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 SshTunnelCreateAccountRequest.

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

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

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

Returns:

  • (Hash)

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

Raises:



5039
5040
5041
5042
5043
5044
5045
5046
5047
# File 'lib/infrawrench/client.rb', line 5039

def (body:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/ssh-tunnels/create-account",
    path_params: { "orgId" => org_id },
    body: body,
    request_options: request_options
  )
end

#exec(body:, org_id: nil, request_options: nil) ⇒ Hash

Run a command over SSH using an org SSH key

Requires permission: resources:execute.

POST /api/org/orgId/ssh-tunnels/exec

Raises on 400: Bad request

Raises on 404: Not found

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 SshExecRequest.

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

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

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

Returns:

  • (Hash)

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

Raises:



5065
5066
5067
5068
5069
5070
5071
5072
5073
# File 'lib/infrawrench/client.rb', line 5065

def exec(body:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/ssh-tunnels/exec",
    path_params: { "orgId" => org_id },
    body: body,
    request_options: request_options
  )
end

#open(body:, org_id: nil, request_options: nil) ⇒ Hash

Re-open the tunnel for an existing account

Requires permission: resources:execute.

POST /api/org/orgId/ssh-tunnels/open

Raises on 404: Not found

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 Hash.

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

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

  • body: ({ "accountId" => String })
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

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

Raises:



5089
5090
5091
5092
5093
5094
5095
5096
5097
# File 'lib/infrawrench/client.rb', line 5089

def open(body:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/ssh-tunnels/open",
    path_params: { "orgId" => org_id },
    body: body,
    request_options: request_options
  )
end