Class: Infrawrench::DashboardsWidgetsNamespace

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

Overview

client.dashboards.widgets

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ DashboardsWidgetsNamespace

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

Parameters:



5831
5832
5833
# File 'lib/infrawrench/client.rb', line 5831

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Add a cost-graph or budget widget to a dashboard

POST /api/org/orgId/dashboards/widgets

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.

  • body (Hash)

    Request body, shaped as CreateWidgetRequest.

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

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

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

Returns:

  • (Hash)

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

Raises:



5850
5851
5852
5853
5854
5855
5856
5857
5858
# File 'lib/infrawrench/client.rb', line 5850

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

#delete(widget_id:, org_id: nil, request_options: nil) ⇒ Hash

Remove a widget from a dashboard

DELETE /api/org/orgId/dashboards/widgets/widgetId

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.

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

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

  • widget_id: (String)
  • 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:



5872
5873
5874
5875
5876
5877
5878
5879
# File 'lib/infrawrench/client.rb', line 5872

def delete(widget_id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "DELETE",
    path: "/api/org/{orgId}/dashboards/widgets/{widgetId}",
    path_params: { "orgId" => org_id, "widgetId" => widget_id },
    request_options: request_options
  )
end

#update(widget_id:, body:, org_id: nil, request_options: nil) ⇒ Hash

Update a widget's title, config, or layout

PATCH /api/org/orgId/dashboards/widgets/widgetId

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.

  • widget_id (String)
  • body (Hash)

    Request body, shaped as UpdateWidgetRequest.

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

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

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

Returns:

  • (Hash)

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

Raises:



5897
5898
5899
5900
5901
5902
5903
5904
5905
# File 'lib/infrawrench/client.rb', line 5897

def update(widget_id:, body:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "PATCH",
    path: "/api/org/{orgId}/dashboards/widgets/{widgetId}",
    path_params: { "orgId" => org_id, "widgetId" => widget_id },
    body: body,
    request_options: request_options
  )
end