Saltar al contenido principal

Referencia GraphQL: dashboard-management

Generada a partir del esquema que sirve este servicio, así que no puede quedarse atrás. El mismo esquema se publica como archivo para herramientas y agentes.

Endpointhttps://<your-host>/api/dashboard-management/graphql
Plano de autenticacióntenant — The ordinary application plane. Obtain a tenant access token by calling login then selectTenant on user-management, and authorize each call with the capability it names (for example device:write).
Autorizacióntenant access token
Archivo del esquema/schema/dashboard-management.graphql
Descritos94 de 94 elementos
nota

La referencia que sigue se genera a partir del esquema y está solo en inglés.

Queries​

dashboard · dashboardVersion · dashboardVersions · dashboards · publishedDashboard

dashboard​

Returns the dashboard with the given token, or null if there is none. Requires dashboard:read.

Returns Dashboard

ArgumentTypeDescription
tokenString!Token of the dashboard.

dashboardVersion​

Returns one published version of a dashboard including its definition. Fails if the dashboard or the version does not exist. Requires dashboard:write.

Returns DashboardVersionDetail

ArgumentTypeDescription
tokenString!Token of the dashboard.
versionInt!Version number to read.

dashboardVersions​

Lists a dashboard's published versions, newest first, one page at a time. Fails if no dashboard has the token. Requires dashboard:read.

Returns [DashboardVersion!]!

ArgumentTypeDescription
limitIntMaximum number of versions to return. Omitted or below 1 means 100; above 1000 is capped at 1000.
offsetIntNumber of the newest versions to skip before the page starts. Omitted or below 1 means 0.
tokenString!Token of the dashboard.

dashboards​

Searches the tenant's dashboards, one page at a time. Results carry metadata only; read a definition with the dashboard query. Requires dashboard:read.

Returns DashboardSearchResults!

ArgumentTypeDescription
criteriaDashboardSearchCriteria!Filter and page to return.

publishedDashboard​

Returns the version of the dashboard that viewers are served, with its definition, or null if there is no dashboard with the token. Fails with code NOT_PUBLISHED if the dashboard exists but has never been published. Requires dashboard:read.

Returns PublishedDashboard

ArgumentTypeDescription
tokenString!Token of the dashboard.

Mutations​

activateDashboardVersion · createDashboard · deleteDashboard · publishDashboard · rollbackDashboard · updateDashboard

activateDashboardVersion​

Makes an existing published version the one viewers are served, without touching the draft (its definition and updatedAt are unchanged). Use it to re-serve an older version; rollbackDashboard, by contrast, overwrites the draft. Fails if the dashboard or the version does not exist. Requires dashboard:write.

Returns DashboardSummary!

ArgumentTypeDescription
tokenString!Token of the dashboard.
versionInt!Version number to serve.

createDashboard​

Creates a dashboard and returns it. Requires dashboard:write.

Returns Dashboard!

ArgumentTypeDescription
requestDashboardCreateRequest!The new dashboard's fields.

deleteDashboard​

Permanently deletes a dashboard and all of its published versions. Returns false if no dashboard has the token. The token can be reused immediately. Requires dashboard:write.

Returns Boolean!

ArgumentTypeDescription
tokenString!Token of the dashboard to delete.

publishDashboard​

Freezes the current draft into a new immutable version, numbered one above the latest, makes it the version viewers are served, and returns the version together with the dashboard. The draft's updatedAt is not moved by a publish. Requires dashboard:write.

Returns DashboardPublication!

ArgumentTypeDescription
descriptionStringOptional notes for the version.
expectedUpdatedAtStringOptional precondition: the updatedAt you last read. If the draft has changed since, publishing is refused with the same error as updateDashboard.
labelStringOptional label for the version, such as a release name.
tokenString!Token of the dashboard to publish.

rollbackDashboard​

Copies a published version's definition back into the draft, replacing the whole draft definition, and returns the dashboard. The version history is unchanged. Requires dashboard:write.

Returns Dashboard!

ArgumentTypeDescription
expectedUpdatedAtStringOptional precondition: the updatedAt you last read. Because a rollback replaces the whole draft, it is refused with the same error as updateDashboard if the draft has changed since.
tokenString!Token of the dashboard.
versionInt!The published version to restore into the draft.

updateDashboard​

Partially updates a dashboard's draft and returns it. Requires dashboard:write. An update that names no field writes nothing and leaves updatedAt unchanged.

Returns Dashboard!

ArgumentTypeDescription
expectedUpdatedAtStringOptional optimistic-concurrency precondition: the updatedAt you last read. If the dashboard has changed since, the update is refused with "dashboard was modified by another writer; reload and try again" (not the CONFLICT error code) — even when the request names no field.
requestDashboardUpdateRequest!The fields to change; see DashboardUpdateRequest for omit, set and clear.
tokenString!Token of the dashboard to update.

Objects​

Dashboard · DashboardPublication · DashboardSearchResults · DashboardSummary · DashboardVersion · DashboardVersionDetail · PublishedDashboard · SearchResultsPagination

Dashboard​

object

A dashboard: a named, tenant-owned layout of widgets and the data each widget shows. What you edit is the draft; publishDashboard freezes it into an immutable DashboardVersion.

FieldTypeDescription
createdAtStringWhen the dashboard was created, as an RFC 3339 timestamp.
definitionString!The current DRAFT definition. The draft is author-only: reading it requires dashboard:write, and a caller holding only dashboard:read is refused with an authorization error rather than served an empty string. Viewers read the published snapshot with the publishedDashboard query instead.
descriptionStringFree-text description of what the dashboard is for.
idID!Server-assigned identifier. Address a dashboard by its token, not by this.
nameStringHuman-readable name shown in dashboard lists.
publishedAtStringWhen the served version was published, as an RFC 3339 timestamp; null if never published.
publishedVersionIntThe version number viewers are served, or null if the dashboard has never been published.
tokenString!Unique, caller-chosen identifier of the dashboard within the tenant.
updatedAtStringWhen the dashboard was last written, as an RFC 3339 timestamp. Pass it back as expectedUpdatedAt to make an update, publish or rollback conditional on nobody else having changed the dashboard since you read it.

DashboardPublication​

object

What a publish returns: the version it minted, and the dashboard as it stands. A publish does not edit the draft, so the dashboard's updatedAt is unchanged by it; keep using it as your expectedUpdatedAt baseline.

FieldTypeDescription
dashboardDashboardSummary!The dashboard after the publish, with its unchanged updatedAt and its new publishedVersion.
versionDashboardVersion!The version the publish created; it is now the version viewers are served.

DashboardSearchResults​

object

One page of dashboards matching a search.

FieldTypeDescription
paginationSearchResultsPagination!Where this page sits in the full result set.
results[DashboardSummary!]!The dashboards on this page, without their definitions.

DashboardSummary​

object

A dashboard as listed by the dashboards search: the same metadata as Dashboard, without the definition document. Look a dashboard up by token with the dashboard query to read its definition.

FieldTypeDescription
createdAtStringWhen the dashboard was created, as an RFC 3339 timestamp.
descriptionStringFree-text description of what the dashboard is for.
idID!Server-assigned identifier. Address a dashboard by its token, not by this.
nameStringHuman-readable name shown in dashboard lists.
publishedVersionIntThe version number viewers are served, or null if the dashboard has never been published.
tokenString!Unique, caller-chosen identifier of the dashboard within the tenant.
updatedAtStringWhen the dashboard was last written, as an RFC 3339 timestamp.

DashboardVersion​

object

An immutable published snapshot of a dashboard's definition. Versions are append-only: rolling back copies a version into the draft and deletes nothing.

FieldTypeDescription
descriptionStringOptional notes given at publish time.
labelStringOptional label given at publish time, such as a release name. Not interpreted.
publishedAtString!When the version was published, as an RFC 3339 timestamp.
publishedByStringWho published it: their username, or their email when there is no username.
versionInt!Version number, increasing by one with each publish of this dashboard.

DashboardVersionDetail​

object

One published version including its definition snapshot. Reading a version body is author-only and requires dashboard:write.

FieldTypeDescription
definitionString!The frozen definition of this version, as a JSON document.
descriptionStringOptional notes given at publish time.
labelStringOptional label given at publish time. Not interpreted.
publishedAtString!When the version was published, as an RFC 3339 timestamp.
publishedByStringWho published it: their username, or their email when there is no username.
versionInt!Version number, increasing by one with each publish of this dashboard.

PublishedDashboard​

object

The snapshot of a dashboard that viewers are served: the version the dashboard's published pointer names, with its definition. Unlike the draft, this is readable with dashboard:read.

FieldTypeDescription
definitionString!The served version's definition: a JSON document in the format defined by the @devicechain/dashboards package.
descriptionStringFree-text description of the dashboard, as it is now.
nameStringHuman-readable name of the dashboard, as it is now.
publishedAtString!When the served version was published, as an RFC 3339 timestamp.
tokenString!Token of the dashboard.
versionInt!The served version number.

SearchResultsPagination​

object

Where a page of search results sits in the full result set. Positions are 1-based and inclusive.

FieldTypeDescription
pageEndIntPosition of the last result on this page within the full result set (1-based, inclusive).
pageStartIntPosition of the first result on this page within the full result set (1-based).
totalRecordsIntNumber of records matching the criteria across all pages.

Input types​

DashboardCreateRequest · DashboardSearchCriteria · DashboardUpdateRequest

DashboardCreateRequest​

input

Fields for a new dashboard.

Input fieldTypeDescription
definitionString!The initial draft definition, as a JSON document of at most 1 MiB.
descriptionStringFree-text description of what the dashboard is for.
nameStringHuman-readable name shown in dashboard lists.
tokenString!Unique identifier for the new dashboard within the tenant.

DashboardSearchCriteria​

input

Criteria for searching dashboards.

Input fieldTypeDescription
nameStringReturn only dashboards whose name contains this text. The match is a case-sensitive literal substring match: % and _ in the text are ordinary characters, not wildcards.
pageNumberInt!Page to return, starting at 1.
pageSizeInt!Results per page. Below 1 means the default of 100; above 1000 is capped at 1000.

DashboardUpdateRequest​

input

A partial update to a dashboard's draft. Omit a field to leave the stored value alone, send a value to set it, or send an explicit null to clear it. The dashboard is named by the mutation's token argument, so there is no token here.

Input fieldTypeDescription
definitionStringNew draft definition (JSON, at most 1 MiB). Omit it to keep the stored definition; an explicit null is refused, because a dashboard must have a definition.
descriptionStringNew description, or null to clear it.
nameStringNew name, or null to clear it.