Class: Infrawrench::DashboardsWidgetsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::DashboardsWidgetsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.dashboards.widgets
Instance Method Summary collapse
-
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Add a cost-graph or budget widget to a dashboard.
-
#delete(widget_id:, org_id: nil, request_options: nil) ⇒ Hash
Remove a widget from a dashboard.
-
#initialize(transport) ⇒ DashboardsWidgetsNamespace
constructor
private
A new instance of DashboardsWidgetsNamespace.
-
#update(widget_id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Update a widget's title, config, or layout.
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.
1658 1659 1660 |
# File 'lib/infrawrench/client.rb', line 1658 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
1677 1678 1679 1680 1681 1682 1683 1684 1685 |
# File 'lib/infrawrench/client.rb', line 1677 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: ) 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
1699 1700 1701 1702 1703 1704 1705 1706 |
# File 'lib/infrawrench/client.rb', line 1699 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" => }, 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
1724 1725 1726 1727 1728 1729 1730 1731 1732 |
# File 'lib/infrawrench/client.rb', line 1724 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" => }, body: body, request_options: ) end |