Class: Infrawrench::DashboardsPinNamespace

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

Overview

client.dashboards.pin

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ DashboardsPinNamespace

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

Parameters:



1315
1316
1317
# File 'lib/infrawrench/client.rb', line 1315

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Pin a resource to a dashboard

Requires permission: dashboards:write.

POST /api/org/orgId/dashboards/pin

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)

    Request body, shaped as PinRequest.

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

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

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

Returns:

  • (Hash)

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

Raises:



1333
1334
1335
1336
1337
1338
1339
1340
1341
# File 'lib/infrawrench/client.rb', line 1333

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

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

Full enriched pin data + cached probe status

Requires permission: dashboards:read.

GET /api/org/orgId/dashboards/pin/pinId

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.

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

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

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

Returns:

  • (Hash)

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

Raises:



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

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

#range(pin_id:, org_id: nil, from_ms: nil, to_ms: nil, request_options: nil) ⇒ Hash

Historical metric series for a pinned resource

Returns per-series metric points between fromMs and toMs. The backend auto-routes between raw, 1-minute, and 1-hour rollups based on span: ≤2h raw, ≤7d 1m, >7d 1h.

GET /api/org/orgId/dashboards/pin/pinId/range

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.

  • pin_id (String)
  • from_ms (Integer, nil, nil) (defaults to: nil)
  • to_ms (Integer, nil, nil) (defaults to: nil)
  • request_options (Hash, nil) (defaults to: nil)

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

  • pin_id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • from_ms: (Integer, nil, nil) (defaults to: nil)
  • to_ms: (Integer, nil, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

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

Raises:



1386
1387
1388
1389
1390
1391
1392
1393
1394
# File 'lib/infrawrench/client.rb', line 1386

def range(pin_id:, org_id: nil, from_ms: nil, to_ms: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/dashboards/pin/{pinId}/range",
    path_params: { "orgId" => org_id, "pinId" => pin_id },
    query: { "fromMs" => from_ms, "toMs" => to_ms },
    request_options: request_options
  )
end