Class: Infrawrench::RightsizingNamespace

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

Overview

client.rightsizing

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ RightsizingNamespace

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

Parameters:



5099
5100
5101
# File 'lib/infrawrench/client.rb', line 5099

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

List oversized resources with resize recommendations

Computes p95 CPU/memory utilisation over the last 14 days of stored metrics for every resource whose plugin declares right-sizing support, and matches under-utilised ones against the plugin's real size catalog (the create form's size options, live-priced). Each recommendation names the cheapest smaller size that still clears a headroom margin and quotes the monthly saving. Apply one by submitting sizeFieldKey with the recommended size id through the resource-update endpoint — which enforces change freezes and writes the audit trail. Results are cached for a few minutes; pass refresh=true to recompute.

Requires permission: resources:read.

GET /api/org/orgId/rightsizing

Parameters:

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

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

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

    Bypass the short server-side cache and recompute now.

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

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

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

Returns:

  • (Hash)

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

Raises:



5126
5127
5128
5129
5130
5131
5132
5133
5134
# File 'lib/infrawrench/client.rb', line 5126

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