Class: Infrawrench::ChangesNamespace

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

Overview

client.changes

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ ChangesNamespace

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

Parameters:



1276
1277
1278
# File 'lib/infrawrench/client.rb', line 1276

def initialize(transport)
  @transport = transport
end

Instance Method Details

#get(org_id: nil, page: nil, page_size: nil, account_id: nil, resource_id: nil, kind: nil, from: nil, to: nil, request_options: nil) ⇒ Hash

Org-wide change timeline (paginated, filterable)

Change events recorded by the resource poller: each poll cycle diffs the freshly fetched state against the stored snapshot and records resources that appeared, changed a stored field, or disappeared upstream. Cross-provider by construction — the diff runs on the generic stored record, so every plugin's resources show up here.

Requires permission: resources:read.

GET /api/org/orgId/changes

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.

  • page (Integer, nil) (defaults to: nil)
  • page_size (Integer, nil) (defaults to: nil)
  • account_id (String, nil) (defaults to: nil)
  • resource_id (String, nil) (defaults to: nil)
  • kind (String, nil) (defaults to: nil)
  • from (String, nil) (defaults to: nil)
  • to (String, nil) (defaults to: nil)
  • request_options (Hash, nil) (defaults to: nil)

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

  • org_id: (String, nil) (defaults to: nil)
  • page: (Integer, nil) (defaults to: nil)
  • page_size: (Integer, nil) (defaults to: nil)
  • account_id: (String, nil) (defaults to: nil)
  • resource_id: (String, nil) (defaults to: nil)
  • kind: (resource_change_kind, nil) (defaults to: nil)
  • from: (String, nil) (defaults to: nil)
  • to: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

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

Raises:



1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
# File 'lib/infrawrench/client.rb', line 1307

def get(
  org_id: nil,
  page: nil,
  page_size: nil,
  account_id: nil,
  resource_id: nil,
  kind: nil,
  from: nil,
  to: nil,
  request_options: nil
)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/changes",
    path_params: { "orgId" => org_id },
    query: {
      "page" => page,
      "pageSize" => page_size,
      "accountId" => ,
      "resourceId" => resource_id,
      "kind" => kind,
      "from" => from,
      "to" => to
    },
    request_options: request_options
  )
end

#resource(resource_id:, org_id: nil, limit: nil, request_options: nil) ⇒ Hash

Change timeline for one resource

Recent change events for a single resource, newest first. The resource id travels as a query parameter because composite ids contain slashes and colons.

Requires permission: resources:read.

GET /api/org/orgId/changes/resource

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.

  • resource_id (String)
  • limit (Integer, nil) (defaults to: nil)
  • request_options (Hash, nil) (defaults to: nil)

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

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

Returns:

  • (Hash)

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

Raises:



1355
1356
1357
1358
1359
1360
1361
1362
1363
# File 'lib/infrawrench/client.rb', line 1355

def resource(resource_id:, org_id: nil, limit: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/changes/resource",
    path_params: { "orgId" => org_id },
    query: { "resourceId" => resource_id, "limit" => limit },
    request_options: request_options
  )
end