Class: Infrawrench::SshFanoutSnippetsNamespace

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

Overview

client.ssh_fanout.snippets

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ SshFanoutSnippetsNamespace

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

Parameters:



13997
13998
13999
# File 'lib/infrawrench/client.rb', line 13997

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Save a command snippet

Requires permission: resources:execute.

POST /api/org/orgId/ssh-fanout/snippets

Raises on 400: Bad request

Raises on 409: Conflict

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

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

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

  • body: (ssh_snippet_input)
  • 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:



14017
14018
14019
14020
14021
14022
14023
14024
14025
# File 'lib/infrawrench/client.rb', line 14017

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

#delete(id:, org_id: nil, request_options: nil) ⇒ Hash

Delete a saved command snippet

Requires permission: resources:execute.

DELETE /api/org/orgId/ssh-fanout/snippets/id

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.

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

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

  • id: (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:



14041
14042
14043
14044
14045
14046
14047
14048
# File 'lib/infrawrench/client.rb', line 14041

def delete(id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "DELETE",
    path: "/api/org/{orgId}/ssh-fanout/snippets/{id}",
    path_params: { "orgId" => org_id, "id" => id },
    request_options: request_options
  )
end

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

List saved command snippets

Org-shared saved commands for reuse from the fan-out screen and CLI.

Requires permission: resources:read.

GET /api/org/orgId/ssh-fanout/snippets

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:



14063
14064
14065
14066
14067
14068
14069
14070
# File 'lib/infrawrench/client.rb', line 14063

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

#update(id:, body:, org_id: nil, request_options: nil) ⇒ Hash

Update a saved command snippet

Requires permission: resources:execute.

PUT /api/org/orgId/ssh-fanout/snippets/id

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.

  • id (String)
  • body (Hash)

    Request body, shaped as SshSnippetInput.

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

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

  • id: (String)
  • body: (ssh_snippet_input)
  • 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:



14089
14090
14091
14092
14093
14094
14095
14096
14097
# File 'lib/infrawrench/client.rb', line 14089

def update(id:, body:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "PUT",
    path: "/api/org/{orgId}/ssh-fanout/snippets/{id}",
    path_params: { "orgId" => org_id, "id" => id },
    body: body,
    request_options: request_options
  )
end