Sysdig Documentation

Dashboard APIs

Sysdig provides some REST APIs to perform CRUD (create, read, update, and delete) operations with Dashboards. This section details how users (both admin and non-admin users) can use the APIs to create, update, list, read, and delete Dashboards.

For information on Sysdig users and system-based privileges, see User and Team Administration.

REST Resource: Dashboard

List all Dashboards

GET /api/v2/dashboards
Table 8. Request Parameters

Field

Description

Team

Integer (int32)

Gets Dashboards for a specific team.

If not provided, fetches the Dashboards owned by the team that the current user belongs to.

Shared

Boolean

Supported values are true and false. The default is False.

If true, shows all the shared Dashboards owned by the team the current user belongs to.

AutoCreated

Boolean

Supported values are true and false. The default is False.

If true, shows all the auto-created Dashboards.

light

If true, Dashboards payload in response will be a smaller version as shown below. The performance will be superior because it is loading fewer data.

When the light parameter is true, in the response body each object will only have the following attributes: id, version, name, teamId, username, schema, autoCreated, shared, public, publicToken, createdOn, modifiedOn



Sample Response

{
      dashboards: [
          {
            "id":131,
          "teamId":1,
          "username":"test@domain.com",
          ...see JSON Representation
          }
      ]
  }

Status Codes

Code

Description

200

Indicates if the Dashboard has been successfully created.

401

Indicates that the requested resource is restricted and requires authentication, but you failed to provide any such authentication.

403

Indicates you are unauthorized to access the Dashboard.

404

Indicates the Dashboard is not found.

Get a Dashboard by ID

GET /api/v2/dashboards/{id}
Table 9. Request Parameters

Field

Description

id

Integer (int64)

The unique ID of the Dashboard.



Sample Response

See JSON Representation

Status Codes

Codes

Description

200

Indicates if the Dashboard has been successfully created.

401

Indicates that the requested resource is restricted and requires authentication, but you failed to provide any such authentication.

403

Indicates you are unauthorized to access the Dashboard.

404

Indicates a Dashboard is not found.

Create a Dashboard

Create a new Dashboard.

POST /api/v2/dashboards
Table 10. Request and Response Parameters

Field

Description

AutoCreated

Boolean

Supported values are true and false. The default value is False.

Indicates whether the Dashboard is created automatically or not.

CreatedOn

The date the Dashboard is created.

CustomerId

Unique ID of the user.

domain

The domain name associated with the Dashboard.

eventsOverlaySettings

The Event overlay settings.

ID

The unique ID of the Dashboard.

migrationErrors

Returns migration errors if any.

ModifiedOn

The date when the Dashboard was last modified.

Schema

The version of the Schema associated with the Dashboard.

Scope

The scope of the Dashboard.

scopeExpressionList

Identifies the following:

  • displayName

  • isVaribale

  • operator

  • operand

  • value

  • variable

Shared

Boolean

Supported values are true and false.

Indicates if the Dashboard is shared or not.

teamid

The unique identification code of the team that owns the Dashboard.

userid

The unique identification code of the user that created the Dashboard.

username

The username of the user that created the Dashboard.

version

The version number of the Dashboard schema.

widget

The widgets associated with the Dashboard. Identifies the following:

  • customDisplayOptions

  • valueLimit

  • xAxis

  • yAxisLeftDomain

  • yAxisRightDomain

  • yAxisScale

  • gridConfiguration

  • name

  • showAs



Sample Request

{
  "dashboard": {
    "autoCreated": true,
    "createdOn": 0,
    "customerId": 0,
    "domain": "string",
    "eventsOverlaySettings": {
      "eventOverlayLimit": 0,
      "filterNotificationsResolvedFilter": "all",
      "filterNotificationsScopeFilter": true,
      "filterNotificationsSeverityFilter": "all",
      "filterNotificationsStateFilter": "all",
      "filterNotificationsTypeFilter": "all",
      "filterNotificationsUserInputFilter": "string",
      "showNotificationsEnabled": true
    },
    "id": 0,
    "migrationErrors": [
      "string"
    ],
    "modifiedOn": 0,
    "name": "string",
    "public": true,
    "publicToken": "string",
    "schema": 0,
    "scope": "string",
    "scopeExpressionList": [
      {
        "displayName": "string",
        "isVariable": true,
        "operand": "string",
        "operator": "equals",
        "value": [
          "string"
        ],
        "variable": true
      }
    ],
    "shared": true,
    "teamId": 0,
    "userId": 0,
    "username": "string",
    "version": 0,
    "widgets": [
      {
        "customDisplayOptions": {
          "histogram": {
            "numberOfBuckets": 0
          },
          "valueLimit": {
            "count": 0,
            "direction": "desc"
          },
          "xAxis": {
            "from": 0,
            "to": 0
          },
          "yAxisLeftDomain": {
            "from": 0,
            "to": 0
          },
          "yAxisRightDomain": {
            "from": 0,
            "to": 0
          },
          "yAxisScale": "linear"
        },
        "gridConfiguration": {
          "col": 0,
          "row": 0,
          "size_x": 0,
          "size_y": 0
        },
        "name": "string",
        "showAs": "timeSeries"
      }
    ]
  }
}

Status Codes

Code

Description

200

Indicates if the Dashboard has been successfully created.

401

Indicates that the requested resource is restricted and requires authentication, but you failed to provide any such authentication.

403

Indicates you are unauthorized to access the Dashboard.

422

Indicates validation errors.

Update a Dashboard

PUT /api/v2/dashboards/{id}
Table 11. Request Parameters

Field

Description

ID

Integer (int64)

The unique ID of the dashboard.



Sample Request

{
      dashboards: [
          {
            "id":131,
          "teamId":1,
          "username":"test@domain.com",
          ...see JSON Representation
          }
             
 
      ],
       "public":true
  }

Sample Response

{
      dashboards: [
          {
            "id":131,
          "teamId":1,
          "username":"test@domain.com",
          ...see JSON Representation
          }
             
 
      ],
       "public":true
  }

Status Codes

Code

Description

200

Indicates if the Dashboard has been successfully updated.

401

Indicates that the requested resource is restricted and requires authentication, but you failed to provide any such authentication.

403

Indicates you are unauthorized to access the Dashboard.

404

Indicates a Dashboard is not found.

406

Indicates validation errors.

422

Indicates conflicts while saving the Dashboard.

Delete a Dashboard

You can delete a Dashboard by a customer ID.

DELETE /api/v2/dashboards/{id}
Table 12. Request Parameters

Field

Description

Id

Integer (int32)

The unique identification code of the Dashboard.



Sample Response

See JSON Representation.

Status Codes

Code

Description

200

Indicates if the Dashboard has been successfully deleted.

401

Indicates that the requested resource is restricted and requires authentication, but you failed to provide any such authentication.

403

Indicates you are unauthorized to access the Dashboard.

404

Indicates a Dashboard is not found.

JSON Representation

The samples given below describe the JSON schema of a Dashboard.

{
    "dashboard":{
        "id":131,
        "teamId":1,
        "username":"test@domain.com",
        "schema":2,
        "autoCreated":false,
        "shared":false,
        "name":"V2 dashboard",
        "widgets":[
            {
                "showAs":"summary",
                "name":"Summary",
                "gridConfiguration":{
                    "col":1,
                    "row":1,
                    "size_x":6,
                    "size_y":4
                },
                "customDisplayOptions":{
                    "valueLimit":{
                        "count":10,
                        "direction":"desc"
                    },
                    "histogram":{
                        "numberOfBuckets":10
                    },
                    "yAxisScale":"linear",
                    "yAxisLeftDomain":{
                        "from":0,
                        "to":null
                    },
                    "yAxisRightDomain":{
                        "from":0,
                        "to":null
                    },
                    "xAxis":{
                        "from":0,
                        "to":null
                    }
                },
                "scope":null,
                "overrideScope":false,
                "metrics":[
                    {
                        "id":"cpu.used.percent",
                        "propertyName":"v0",
                        "timeAggregation":"avg",
                        "groupAggregation":"avg"
                    }
                ],
                "compareToConfig":null,
                "colorCoding":{
                    "active":true,
                    "thresholds":{
                        "worst":50,
                        "best":20
                    }
                }
            },
            {
                "showAs":"timeSeries",
                "name":"Time series",
                "gridConfiguration":{
                    "col":7,
                    "row":1,
                    "size_x":6,
                    "size_y":4
                },
                "customDisplayOptions":{
                    "valueLimit":{
                        "count":10,
                        "direction":"desc"
                    },
                    "histogram":{
                        "numberOfBuckets":10
                    },
                    "yAxisScale":"linear",
                    "yAxisLeftDomain":{
                        "from":0,
                        "to":null
                    },
                    "yAxisRightDomain":{
                        "from":0,
                        "to":null
                    },
                    "xAxis":{
                        "from":0,
                        "to":null
                    }
                },
                "scope":null,
                "overrideScope":false,
                "metrics":[
                    {
                        "id":"timestamp",
                        "propertyName":"k0"
                    },
                    {
                        "id":"container.id",
                        "propertyName":"k1"
                    },
                    {
                        "id":"cpu.used.percent",
                        "propertyName":"v0",
                        "timeAggregation":"avg",
                        "groupAggregation":"avg"
                    }
                ],
                "compareToConfig":null
            }
        ],
        "scopeExpressionList":[
            {
                "operand":"host.mac",
                "operator":"notContains",
                "displayName":"Host",
                "value":[
                    "test"
                ],
                "isVariable":false
            }
        ],
        "eventsOverlaySettings":{
            "showNotificationsEnabled":true,
            "filterNotificationsUserInputFilter":"",
            "eventOverlayLimit":1000,
            "filterNotificationsTypeFilter":"all",
            "filterNotificationsStateFilter":"all",
            "filterNotificationsSeverityFilter":"all",
            "filterNotificationsResolvedFilter":"all"
        },
        "public":false
    }
}