Class: Infrawrench::MomentNamespace

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

Overview

client.moment

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ MomentNamespace

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

Parameters:



3567
3568
3569
# File 'lib/infrawrench/client.rb', line 3567

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Everything that happened around a timestamp

"What changed around 03:14?" — one merged, chronological narrative of everything the platform knows happened in a window: resource changes (including sleep/wake schedule attribution), provider status incidents that started/resolved in or overlap the window, cost anomalies, workflow runs, deployments, audit-log entries, change freezes, and the drift/expiry alert deliveries. Each feed is gated on the same permission its own endpoint requires; feeds the caller cannot read are reported as omitted, and a feed whose query fails is reported as error without blanking the rest of the response.

Requires permission: resources:read.

GET /api/org/orgId/moment

Raises on 400: Bad request

Parameters:

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

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

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

    Centre of the window. Defaults to now.

  • window (Integer, nil) (defaults to: nil)

    Half-window in minutes (the ± around at). Default 60, max 4320 (±3 days).

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

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

  • org_id: (String, nil) (defaults to: nil)
  • at: (String, nil) (defaults to: nil)
  • window: (Integer, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

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

Raises:



3597
3598
3599
3600
3601
3602
3603
3604
3605
# File 'lib/infrawrench/client.rb', line 3597

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