Class: Infrawrench::EnvironmentsNamespace

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

Overview

client.environments

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ EnvironmentsNamespace

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

Parameters:



7300
7301
7302
7303
7304
7305
# File 'lib/infrawrench/client.rb', line 7300

def initialize(transport)
  @transport = transport
  @instances = EnvironmentsInstancesNamespace.new(@transport)
  @settings = EnvironmentsSettingsNamespace.new(@transport)
  @templates = EnvironmentsTemplatesNamespace.new(@transport)
end

Instance Attribute Details

#instancesEnvironmentsInstancesNamespace (readonly)

Returns client.environments.instances.

Returns:



7292
7293
7294
# File 'lib/infrawrench/client.rb', line 7292

def instances
  @instances
end

#settingsEnvironmentsSettingsNamespace (readonly)

Returns client.environments.settings.

Returns:



7294
7295
7296
# File 'lib/infrawrench/client.rb', line 7294

def settings
  @settings
end

#templatesEnvironmentsTemplatesNamespace (readonly)

Returns client.environments.templates.

Returns:



7296
7297
7298
# File 'lib/infrawrench/client.rb', line 7296

def templates
  @templates
end

Instance Method Details

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

Preview a template capture

Turn a selection of live resources into a draft template. Persists nothing — the editor shows the draft so the user can choose which fields to vary before saving. The shape of every member comes from the plugin's own getCreateConfig: a captured value with no matching create field is dropped, and a resource type the plugin cannot create is reported in skipped with a reason rather than silently omitted. Recorded output references whose target is also in the selection are preserved as output field values; a value that is exactly another selected resource's external id becomes a member-id.

Requires permission: resources:read.

POST /api/org/orgId/environments/capture

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, nil) (defaults to: nil)

    Request body, shaped as EnvironmentCaptureRequest.

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

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

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

Returns:

  • (Hash)

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

Raises:



7334
7335
7336
7337
7338
7339
7340
7341
7342
# File 'lib/infrawrench/client.rb', line 7334

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