Class: Infrawrench::OrphansNamespace

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

Overview

client.orphans

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ OrphansNamespace

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

Parameters:



2778
2779
2780
# File 'lib/infrawrench/client.rb', line 2778

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

List likely-orphaned and idle resources

Scans the organization's already-synced resources against each plugin's declarative orphan heuristics — unattached volumes, unassigned floating/elastic IPs, reserved-but-unused static IPs — and returns the matches grouped by account, each with the plugin's reason. Purely a read over stored state: no provider API calls are made, so results reflect the last sync. Where the org's collected cost data has per-resource rows, matches are annotated with trailing spend.

Requires permission: resources:read.

GET /api/org/orgId/orphans

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

Raises:



2802
2803
2804
2805
2806
2807
2808
2809
# File 'lib/infrawrench/client.rb', line 2802

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