Class: Infrawrench::DashboardsNamespace

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

Overview

client.dashboards

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ DashboardsNamespace

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

Parameters:



1489
1490
1491
1492
1493
1494
# File 'lib/infrawrench/client.rb', line 1489

def initialize(transport)
  @transport = transport
  @default = DashboardsDefaultNamespace.new(@transport)
  @pin = DashboardsPinNamespace.new(@transport)
  @widgets = DashboardsWidgetsNamespace.new(@transport)
end

Instance Attribute Details

#defaultDashboardsDefaultNamespace (readonly)

Returns client.dashboards.default.

Returns:



1481
1482
1483
# File 'lib/infrawrench/client.rb', line 1481

def default
  @default
end

#pinDashboardsPinNamespace (readonly)

Returns client.dashboards.pin.

Returns:



1483
1484
1485
# File 'lib/infrawrench/client.rb', line 1483

def pin
  @pin
end

#widgetsDashboardsWidgetsNamespace (readonly)

Returns client.dashboards.widgets.

Returns:



1485
1486
1487
# File 'lib/infrawrench/client.rb', line 1485

def widgets
  @widgets
end

Instance Method Details

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

Create a dashboard

Requires permission: dashboards:write.

POST /api/org/orgId/dashboards

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

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

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

  • body: ({ "name" => String })
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

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

Raises:



1508
1509
1510
1511
1512
1513
1514
1515
1516
# File 'lib/infrawrench/client.rb', line 1508

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

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

Delete a dashboard

Cannot delete the default dashboard.

Requires permission: dashboards:write.

DELETE /api/org/orgId/dashboards/id

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.

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

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

  • 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:



1536
1537
1538
1539
1540
1541
1542
1543
# File 'lib/infrawrench/client.rb', line 1536

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

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

Get a dashboard with its pins

Requires permission: dashboards:read.

GET /api/org/orgId/dashboards/id

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.

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

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

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

Returns:

  • (Hash)

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

Raises:



1559
1560
1561
1562
1563
1564
1565
1566
# File 'lib/infrawrench/client.rb', line 1559

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

#list(org_id: nil, request_options: nil) ⇒ Array<Hash>

List dashboards

Requires permission: dashboards:read.

GET /api/org/orgId/dashboards

Parameters:

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

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

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

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

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

Returns:

  • (Array<Hash>)

    Parsed JSON, shaped as Array<Dashboard> — see sig/infrawrench/sdk.rbs.

Raises:



1580
1581
1582
1583
1584
1585
1586
1587
# File 'lib/infrawrench/client.rb', line 1580

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

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

Read cached stats/metrics for dashboard cards

Requires permission: dashboards:read.

POST /api/org/orgId/dashboards/probe

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

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

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

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

Returns:

  • (Hash)

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

Raises:



1601
1602
1603
1604
1605
1606
1607
1608
1609
# File 'lib/infrawrench/client.rb', line 1601

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

#rename(id:, body:, org_id: nil, request_options: nil) ⇒ Hash

Rename a dashboard

Requires permission: dashboards:write.

POST /api/org/orgId/dashboards/id/rename

Parameters:

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

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

  • id (String)
  • body (Hash)

    Request body, shaped as Hash.

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

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

  • id: (String)
  • body: ({ "name" => 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:



1624
1625
1626
1627
1628
1629
1630
1631
1632
# File 'lib/infrawrench/client.rb', line 1624

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

#reorder(id:, body:, org_id: nil, request_options: nil) ⇒ Hash

Reorder dashboard cards

Persists the order of a dashboard's grid. Pass cards to order resource pins, workflow pins, and widgets as one sequence; resourceIds orders resource pins alone.

Requires permission: dashboards:write.

POST /api/org/orgId/dashboards/id/reorder

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.

  • id (String)
  • body (Hash)

    Request body, shaped as ReorderRequest.

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

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

  • id: (String)
  • body: (reorder_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:



1653
1654
1655
1656
1657
1658
1659
1660
1661
# File 'lib/infrawrench/client.rb', line 1653

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

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

Unpin a resource

Requires permission: dashboards:write.

POST /api/org/orgId/dashboards/unpin

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

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

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

  • body: (unpin_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:



1677
1678
1679
1680
1681
1682
1683
1684
1685
# File 'lib/infrawrench/client.rb', line 1677

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

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

Validate workspace tab targets still exist

Requires permission: dashboards:read.

POST /api/org/orgId/dashboards/validate-tabs

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

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

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

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

Returns:

  • (Hash)

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

Raises:



1700
1701
1702
1703
1704
1705
1706
1707
1708
# File 'lib/infrawrench/client.rb', line 1700

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

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

Pin a workflow's metrics to a dashboard

POST /api/org/orgId/dashboards/workflow-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 WorkflowPinRequest.

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

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

  • body: (workflow_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:



1722
1723
1724
1725
1726
1727
1728
1729
1730
# File 'lib/infrawrench/client.rb', line 1722

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

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

Unpin a workflow from a dashboard

POST /api/org/orgId/dashboards/workflow-unpin

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

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

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

  • body: (workflow_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:



1744
1745
1746
1747
1748
1749
1750
1751
1752
# File 'lib/infrawrench/client.rb', line 1744

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