Skip to content
v1
Docs

API reference

Databases

Monitored databases: collectors, queries, findings, storage and the advice drawn from them.

Its operations need the scopes database.edit, database.view or database.delete.

The Database object

Attributes

  • uuidstring

    The database’s uuid.

  • namestring

    The database’s name.

  • descriptionstring or null

    The description set for the database; null when none is set.

  • providerstring or null

    The hosting provider’s key, such as aws_rds_mysql.

  • provider_editionstring or null

    The provider’s edition of the service, such as aurora; null when none applies.

  • enginestring or null

    The database engine, such as mysql; null until it is known.

  • engine_versionstring or null

    The engine’s version as the collector reported it; null until a report arrives.

  • engine_flavourstring or null

    The engine’s flavour, such as mariadb; null until it is known.

  • privacy_modestring

    How much of the database’s text the monitor keeps: hashed, identifiers or counts.

  • tls_modestring or null

    How the collector secures its connection to the database with TLS; null when not set.

  • connection_typestring or null

    One of socket, loopback, private_network, public_endpoint.

  • ca_sourcestring or null

    Where the database’s CA comes from; the engine’s vocabulary.

  • auth_methodstring or null

    How the collector signs in; the engine’s vocabulary.

  • credentialsobject or null

    Where the collector’s credentials come from, by reference, never a secret: the method and, by method, the names it reads (file {method}, socket and aws_iam {method, user}, aws_secrets_manager {method, secret, keys}, aws_ssm_parameter {method, user, password_parameter, redaction_key_parameter}); null when none is set. With file the collector reads /etc/wt15-server-agent/databases.d/<database uuid>.cnf on its server, a path WatchTower15 does not record. PUT takes the same object as credential_ref, so it can be sent back.

  • collector_poolobject

    The rule that picks the database’s collectors, as stored; GET /v1/databases/{database_uuid}/collectors lists the servers it picks now, and PUT takes the same rule as collectors, by uuid.

  • reference_key_fingerprintstring or null

    The reference key check value: a fingerprint, never the key.

  • reported_key_fingerprintsarray of strings

    The distinct key check values the collectors report; databases.acceptKey takes one. Never a collector or its server.

  • health_statusstring

    One of unknown, healthy, warning, critical.

  • statusstring

    One of draft, awaiting_collector, verifying, active, failing, paused.

  • status_reasonstring or null

    Why the status is what it is: words on a draft or on a database no server can collect, the collector’s reason code on a failing one, such as dns, tls_failed or auth_failed (unreachable when it gave none); null otherwise. More codes may be added.

  • over_privilegedboolean

    Whether a collector holds more privilege than it needs.

  • layers_availableobject or null

    What the collector’s probe found it can read, by layer; null before the first probe.

  • storageobject

    The database’s storage: its size, growth and forecast.

  • schemaobject

    The schema collector’s state; its first seven fields are null while no pass has run.

  • last_received_atinteger or null

    Epoch milliseconds. When a report last arrived; null if none ever did.

    An instant: epoch milliseconds, UTC.
  • tagsarray of objects

    The tags set on the database.

  • console_urlstring

    The database’s page in the console.

Create a database

POST/v1/databases

Creates a database in the draft state with its default alarms, from a name, a description and a provider. Finish its connection, collectors and tags with databases.update, which also completes the setup. Refused when the organisation’s database limit is reached or its payment status does not allow it. Answers the database as databases.view does.

Needs the scope database.edit.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Body parameters

  • namestringRequired

    The database’s name.

  • descriptionstring or nullOptional

    A description of the database; null for none.

  • providerstringRequired

    The hosting provider’s key, such as aws_rds_mysql.

Returns

201 Created:

The database that was created.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Update a database

PUT/v1/databases/{database_uuid}

Changes a database’s name, description, provider, connection, TLS and credential references, privacy mode, collector pool, host server, tags and storage ceiling; only the fields sent change. setup_complete leaves the draft state. The connection fields, credential references and TLS server name are accepted and never returned. Answers the database as databases.view does.

Needs the scope database.edit.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Body parameters

  • namestringOptional

    The database’s name.

  • descriptionstring or nullOptional

    A description of the database; null clears it.

  • providerstringOptional

    The hosting provider’s key, such as aws_rds_mysql.

  • provider_editionstring or nullOptional

    The provider’s edition of the service, by its catalogue key; it must belong to the provider. Null clears it.

  • connection_typestring or nullOptional

    How the collector reaches the database: socket, loopback, private_network or public_endpoint.

    Values:socketloopbackprivate_networkpublic_endpoint(an open set: new values may be added)
  • endpoint_hoststring or nullOptional

    The host name the collector connects to. Accepted, never returned.

  • endpoint_portinteger or nullOptional

    The TCP port the collector connects to, from 1 to 65535. Accepted, never returned.

  • socket_pathstring or nullOptional

    The absolute path of the Unix socket the collector connects to. Accepted, never returned.

  • tls_modestring or nullOptional

    How the collector secures its connection with TLS; one of the modes the database’s engine supports.

    Values:noneverify_identityverify_caskip_verify(an open set: new values may be added)
  • tls_server_namestring or nullOptional

    The server name the collector expects in the database’s TLS certificate. Accepted, never returned.

  • ca_sourcestring or nullOptional

    Where the certificate authority for the connection comes from; one of the sources the database’s engine supports.

    Values:systemrds_bundlefile(an open set: new values may be added)
  • auth_methodstring or nullOptional

    How the collector signs in to the database; one of the methods the database’s engine supports.

    Values:passwordsocketaws_iam(an open set: new values may be added)
  • credential_refarray of strings or nullOptional

    A reference to the credential the collector uses, in the shape the authentication method needs; identifiers only, never a secret. Accepted; the view answers it as credentials.

  • redaction_key_refarray of strings or nullOptional

    A reference to the key that redacts the database’s text, in the shape the privacy mode needs; identifiers only, never a secret. Accepted, never returned.

  • privacy_modestring or nullOptional

    How much of the database’s text the monitor keeps: hashed, identifiers or counts.

    Values:hashedidentifierscounts(an open set: new values may be added)
  • collectorsobject or nullOptional

    The rule that picks the servers running the database’s collectors: explicit servers in order of preference, or a tag rule.

  • host_server_uuidstring (uuid) or nullOptional

    The uuid of the monitored server that runs the database, for a self-managed database reached over the network; null clears it.

  • tag_uuidsarray of strings or nullOptional

    The uuids of the tags to set on the database.

  • setup_completeboolean or nullOptional

    Whether the setup is complete; true leaves the draft state, after the payment status and the organisation’s database limit are checked.

  • storageobjectOptional

    The database’s storage settings.

Returns

200 OK:

The database after the update.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Get a database

GET/v1/databases/{database_uuid}

Returns one database with its engine, storage and forecast, schema pass state, tags and the key check values its collectors report. Reading a database also adds any default alarm the catalogue gained since it was created, as opening it in the console does.

Needs the scope database.view.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Returns

200 OK:

The database.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

List databases

GET/v1/databases

Lists the organisation’s databases, worst health first unless sort says otherwise, one page at a time. Filter by name or endpoint, status, provider, health or tags. The current queries per second and connection use are null when the database sent no report in the last 2 minutes. Pages by page and per_page (limit is the same as per_page); every page carries current_page, per_page, last_page and total.

Needs the scope database.view.

Query parameters

  • searchstring or nullOptional

    Only databases whose name or endpoint host contains this text.

  • statusarray of strings or nullOptional

    Only databases in one of these statuses: draft, awaiting_collector, verifying, active, failing or paused. A list: repeat the parameter (status=draft&status=awaiting_collector) or send one value (status=draft); status[]=draft is accepted too.

    Values:draftawaiting_collectorverifyingactivefailingpaused(an open set: new values may be added)
  • providerarray of strings or nullOptional

    Only databases of one of these providers, by the provider’s key. A list: repeat the parameter (provider=<value>&provider=<value>) or send one value (provider=<value>); provider[]=<value> is accepted too.

  • healtharray of strings or nullOptional

    Only databases with one of these health statuses: unknown, healthy, warning or critical. A list: repeat the parameter (health=unknown&health=healthy) or send one value (health=unknown); health[]=unknown is accepted too.

    Values:unknownhealthywarningcritical(an open set: new values may be added)
  • tag_uuidsarray of strings or nullOptional

    Only databases carrying all of these tags, by uuid. A list: repeat the parameter (tag_uuids=<uuid>&tag_uuids=<uuid>) or send one value (tag_uuids=<uuid>); tag_uuids[]=<uuid> is accepted too.

  • sortstring or nullOptional

    The field to sort by: name, health_status, status or last_received_at; the worst health first when omitted.

    Values:namehealth_statusstatuslast_received_at(an open set: new values may be added)
  • directionstring or nullOptional

    The sort direction: asc or desc.

    Values:ascdesc(an open set: new values may be added)
  • limitinteger or nullOptional

    The same as per_page, kept for existing clients.

  • include_totalstring or nullOptional

    Ignored: total is always present.

    Values:truefalse10(an open set: new values may be added)
  • per_pageinteger or nullOptional

    The number of items in a page, from 1 to 100; 25 when omitted.

  • pageinteger or nullOptional

    The page to read, from 1; 1 when omitted. A page past the last answers no rows.

Returns

200 OK:

One page of the organisation’s databases.

Each item of the page:

  • uuidstring

    The database’s uuid.

  • namestring

    The database’s name.

  • enginestring or null

    The database engine, such as mysql; null until it is known.

  • engine_versionstring or null

    The engine’s version as the collector reported it; null until a report arrives.

  • providerstring or null

    The hosting provider’s key, such as aws_rds_mysql.

  • health_statusstring

    One of unknown, healthy, warning, critical.

  • statusstring

    One of draft, awaiting_collector, verifying, active, failing, paused.

  • status_reasonstring or null

    Why the status is what it is: words on a draft or on a database no server can collect, the collector’s reason code on a failing one, such as dns, tls_failed or auth_failed (unreachable when it gave none); null otherwise. More codes may be added.

  • activeboolean

    Whether monitoring is switched on.

  • privacy_modestring

    How much of the database’s text the monitor keeps: hashed, identifiers or counts.

  • qpsnumber or null

    Queries per second, the latest value; null without a report in the last 2 minutes.

  • connections_percentnumber or null

    Connections in use as a percentage of the maximum; null without a report in the last 2 minutes.

  • storage_size_bytesinteger or null

    The database’s size in bytes; null before the first measurement.

  • storage_growth_30d_bytesinteger or null

    The 30-day projection less the size, while the forecast is ok.

  • storage_days_to_fullinteger or null

    The forecast number of days until the storage is full; null when it cannot be forecast.

  • storage_forecast_statusstring or null

    The forecast’s status; null before the first forecast.

  • over_privilegedboolean

    Whether a collector holds more privilege than it needs.

  • last_received_atinteger or null

    Epoch milliseconds. When a report last arrived; null if none ever did.

    An instant: epoch milliseconds, UTC.
  • tagsarray of objects

    The tags set on the database.

  • console_urlstring

    The database’s page in the console.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Delete a database

DELETE/v1/databases/{database_uuid}

Deletes a database. Its collectors are told to stop, its open incidents resolve, and its stored storage inventory is removed. The answer has no body.

Needs the scope database.delete.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Returns

204 No Content:

The database was deleted.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Accept a new key check value

POST/v1/databases/{database_uuid}/accept-key

Makes one of the key check values the collectors report (reported_key_fingerprints) the database’s reference, as a deliberate key rotation. Collectors that report it become eligible again, collectors still on the old key are flagged until they hold the new one, every collector probes again, and the advisor’s per-object findings are evaluated afresh. Answers the database as databases.view does.

Needs the scope database.edit.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Body parameters

  • fingerprintstringRequired

    One of the database’s reported_key_fingerprints: a key check value (an HMAC cut to 16 hex characters), never the key.

Returns

200 OK:

The database after the new key was accepted.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Get a database's capabilities

GET/v1/databases/{database_uuid}/capabilities

Returns, for each monitoring layer of a database, whether it is available, not applicable or not collected, with the scope of a not applicable layer and the remedy of a layer that is not collected. Reading a database’s layers also adds any default alarm the catalogue gained since the database was created, as opening it in the console does.

Needs the scope database.view.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Returns

200 OK:

The database’s monitoring layers.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Get a database's cloud section

GET/v1/databases/{database_uuid}/cloud

Returns the state of the cloud section the database’s collector reports and the facts it holds about the cloud instance: its role, class, storage, whether it is Multi-AZ and when the facts were stored. It never returns what identifies the cloud account or the instance. A database with no cloud section yet answers every field null.

Needs the scope database.view.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Returns

200 OK:

The database’s cloud section.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

List a database's collector history

GET/v1/databases/{database_uuid}/collectors/history

Lists the moves of a database’s collector lease, newest first, one page at a time, over an optional time window; without a window every move is listed. A server is identified by its uuid only. Pages by page and per_page (limit is the same as per_page); every page carries current_page, per_page, last_page and total.

Needs the scope database.view.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Query parameters

  • periodstring or nullOptional

    A relative window ending now: 1 to 9999 minutes, hours, days or weeks (3h, 2w). Not with from and to. The operation names its longest window and its default.

  • fromstring or nullOptional

    The start of a pinned window, epoch milliseconds or RFC 3339 with an offset. Needs to. A start before the oldest data kept is served from it.

  • tostring or nullOptional

    The end of a pinned window, epoch milliseconds or RFC 3339 with an offset, after from. A window that ends before the oldest data kept, or in the future, is refused.

  • limitinteger or nullOptional

    The same as per_page, kept for existing clients.

  • include_totalstring or nullOptional

    Ignored: total is always present.

    Values:truefalse10(an open set: new values may be added)
  • per_pageinteger or nullOptional

    The number of items in a page, from 1 to 100; 25 when omitted.

  • pageinteger or nullOptional

    The page to read, from 1; 1 when omitted. A page past the last answers no rows.

Returns

200 OK:

One page of the lease’s moves.

Each item of the page:

  • atinteger

    Epoch milliseconds. When the move was recorded, to the second.

    An instant: epoch milliseconds, UTC.
  • actionstring

    What happened: promoted (a standby became the active collector), assigned (a server was given a role), demoted (the active collector stopped) or none (the database was left with no collector).

  • server_uuidstring or null

    The uuid of the server the row is about; null when the row has none, as on every none row and on rows recorded before the uuid was kept.

  • rolestring or null

    active or standby on an assigned row; null on every other.

  • epochinteger or null

    The lease epoch the row carries: on promoted and on assigned as active; null otherwise.

  • reasonstring or null

    Why the lease moved, in a fixed sentence; null where the row has none.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Preview a collector pool

POST/v1/databases/collector-preview

Lists the servers that a collector selection would make candidates for a database, by hand-picked servers or by tags, with the role each would get and why a server is left out. Read-only: nothing is saved and no database is changed. Also warns about weak pools, such as a pool of one that never fails over.

Needs the scope database.edit.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Body parameters

  • selectionstringRequired

    servers for a hand-picked list, tags for servers chosen by their tags.

    Values:serverstags(an open set: new values may be added)
  • serversarray of strings or nullOptional

    The uuids of the servers to preview, with selection servers.

  • allarray of strings or nullOptional

    Servers must carry ALL of these tags.

  • anyarray of strings or nullOptional

    Servers must carry ANY of these tags.

Returns

200 OK:

The candidate servers and the warnings for the selection.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Get a database's collectors

GET/v1/databases/{database_uuid}/collectors

Returns the servers that collect a database: the lease epoch, and for each server its role (active, standby or cold), whether it is eligible, when it last probed the database and what the probe found, and why it cannot collect right now when it cannot. The active collector comes first, then the standby, then the other candidates. A server’s name is returned only to a key that also holds the servers.view scope; its uuid always.

Needs the scope database.view.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Returns

200 OK:

The database’s lease epoch and its collectors.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Get a database's data coverage

GET/v1/databases/{database_uuid}/coverage

Returns how much of the time a database should have reported it did over a window, as a share, and every band where data is missing or accounted for, each with its cause: monitoring paused, no collector, database unreachable, a collector handover, a WatchTower15 outage, no report from the collector, and the collector-side causes. The window defaults to the last 30 days, which is also how far back coverage reaches, and is at most 31 days. When the data store does not answer, the answer says coverage is unavailable instead of failing.

Needs the scope database.view.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Query parameters

  • periodstring or nullOptional

    A relative window ending now: 1 to 9999 minutes, hours, days or weeks (3h, 2w). Not with from and to. The operation names its longest window and its default.

  • fromstring or nullOptional

    The start of a pinned window, epoch milliseconds or RFC 3339 with an offset. Needs to. A start before the oldest data kept is served from it.

  • tostring or nullOptional

    The end of a pinned window, epoch milliseconds or RFC 3339 with an offset, after from. A window that ends before the oldest data kept, or in the future, is refused.

Returns

200 OK:

The database’s coverage share and bands for the window.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Dismiss an advisor finding

POST/v1/databases/{database_uuid}/findings/{finding_uuid}/dismiss

Dismisses an open advisor finding with a reason. It stays dismissed while it keeps firing and is resolved when it stops applying. Refused when the finding belongs to another database or is not open. Answers the finding as databases.findings lists it.

Needs the scope database.edit.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

  • finding_uuidstring (uuid)Required

    The uuid of the finding.

Body parameters

  • reasonstringRequired

    Why the finding is dismissed.

Returns

200 OK:

The finding after it was dismissed.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

List a database's failovers

GET/v1/databases/{database_uuid}/failovers

Lists the failovers detected on a database, newest first, one page at a time, over an optional time window; without a window every failover is listed. A server is identified by its uuid only. Pages by page and per_page (limit is the same as per_page); every page carries current_page, per_page, last_page and total.

Needs the scope database.view.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Query parameters

  • periodstring or nullOptional

    A relative window ending now: 1 to 9999 minutes, hours, days or weeks (3h, 2w). Not with from and to. The operation names its longest window and its default.

  • fromstring or nullOptional

    The start of a pinned window, epoch milliseconds or RFC 3339 with an offset. Needs to. A start before the oldest data kept is served from it.

  • tostring or nullOptional

    The end of a pinned window, epoch milliseconds or RFC 3339 with an offset, after from. A window that ends before the oldest data kept, or in the future, is refused.

  • limitinteger or nullOptional

    The same as per_page, kept for existing clients.

  • include_totalstring or nullOptional

    Ignored: total is always present.

    Values:truefalse10(an open set: new values may be added)
  • per_pageinteger or nullOptional

    The number of items in a page, from 1 to 100; 25 when omitted.

  • pageinteger or nullOptional

    The page to read, from 1; 1 when omitted. A page past the last answers no rows.

Returns

200 OK:

One page of the database’s failovers.

Each item of the page:

  • atinteger

    Epoch milliseconds. When the failover was recorded, to the second; the window and the order follow it.

    An instant: epoch milliseconds, UTC.
  • observed_atinteger or null

    Epoch milliseconds. When the collector’s snapshot that showed the failover was taken; null on a failover whose snapshot did not carry it.

    An instant: epoch milliseconds, UTC.
  • server_uuidstring or null

    The uuid of the server whose collector reported the failover; null when the row has none.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

List advisor findings

GET/v1/databases/{database_uuid}/findings

Lists the advisor’s findings on one database, one page at a time. Without a status filter only the open findings are returned. Filter by severity, rule group or rule. Object names and statement texts are returned only when the database shows identifiers. Pages by page and per_page (limit is the same as per_page); every page carries current_page, per_page, last_page and total.

Needs the scope database.view.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Query parameters

  • statusstring or nullOptional

    Only findings in this status: open, resolved or dismissed; the open findings when omitted.

    Values:openresolveddismissed(an open set: new values may be added)
  • severitystring or nullOptional

    Only findings of this severity: critical, warning or info.

    Values:criticalwarninginfo(an open set: new values may be added)
  • groupstring or nullOptional

    Only findings of rules in this group: config, schema, workload or hardening.

    Values:configurationschemaworkloadhardening(an open set: new values may be added)
  • rulestring or nullOptional

    Only findings of this advisor rule, by its key.

    Values:config.buffer_pool_smallconfig.connections_headroomconfig.tmp_disk_tables_highconfig.redo_capacity_lowconfig.binlog_retention_shortconfig.durability_relaxedconfig.table_open_cache_smallschema.no_primary_keyschema.redundant_indexschema.unused_indexschema.row_versions_near_limitschema.digest_table_fullworkload.no_index_statementsworkload.examined_vs_sentworkload.full_joinshardening.secure_transport_offhardening.local_infile_onhardening.secure_file_priv_emptyhardening.replica_writablehardening.open_accountshardening.tls_certificate_expiring(an open set: new values may be added)
  • limitinteger or nullOptional

    The same as per_page, kept for existing clients.

  • include_totalstring or nullOptional

    Ignored: total is always present.

    Values:truefalse10(an open set: new values may be added)
  • per_pageinteger or nullOptional

    The number of items in a page, from 1 to 100; 25 when omitted.

  • pageinteger or nullOptional

    The page to read, from 1; 1 when omitted. A page past the last answers no rows.

Returns

200 OK:

One page of the database’s advisor findings.

Each item of the page:

  • uuidstring

    The finding’s uuid.

  • rule_keystring

    The advisor rule’s key, such as schema.no_primary_key.

  • groupstring or null

    The rule’s group: config, schema, workload or hardening.

  • object_kindstring

    What the finding is about: instance, table, index, statement, account and so on.

  • object_keystring

    The object’s key, which tells objects apart when their names are hidden.

  • object_namesobject or null

    The object’s names; null unless the database shows identifiers.

  • severitystring

    One of critical, warning, info.

  • statusstring

    One of open, resolved, dismissed.

  • statement_textstring or null

    A statement’s text; null unless the database shows identifiers.

  • first_seen_atinteger or null

    Epoch milliseconds. When the item was first seen.

    An instant: epoch milliseconds, UTC.
  • last_seen_atinteger or null

    Epoch milliseconds. When the item was last seen.

    An instant: epoch milliseconds, UTC.
  • resolved_atinteger or null

    Epoch milliseconds. When it stopped applying; null while it is open.

    An instant: epoch milliseconds, UTC.
  • dismissed_atinteger or null

    Epoch milliseconds. When it was dismissed; null otherwise.

    An instant: epoch milliseconds, UTC.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Get a database's metric series

GET/v1/databases/{database_uuid}/metrics

Returns the series of a database’s telemetry over a time window, in the one shape every series read answers: each series has its name, unit, labels, what a point means and [t, value] points, with t in epoch milliseconds. Every series of the database’s engine is present, with no points when the window holds none. The window defaults to one day and is at most 31 days. Fails with a 503 when the metric store does not answer.

Needs the scope database.view.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Query parameters

  • setstring or nullOptional

    cloud reads the cloud provider’s series of the database’s host (for a database that runs on a cloud service); omit it for the database’s own series.

    Values:cloud(an open set: new values may be added)
  • periodstring or nullOptional

    A relative window ending now: 1 to 9999 minutes, hours, days or weeks (3h, 2w). Not with from and to. The operation names its longest window and its default.

  • fromstring or nullOptional

    The start of a pinned window, epoch milliseconds or RFC 3339 with an offset. Needs to. A start before the oldest data kept is served from it.

  • tostring or nullOptional

    The end of a pinned window, epoch milliseconds or RFC 3339 with an offset, after from. A window that ends before the oldest data kept, or in the future, is refused.

Returns

200 OK:

The database’s series for the window.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Pause a database

POST/v1/databases/{database_uuid}/pause

Pauses a database: nothing is collected, no alarm evaluates and nothing is billed until it is resumed, and its setup is kept. Refused for a draft and for a database that is already paused. Answers the database as databases.view does.

Needs the scope database.edit.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Returns

200 OK:

The database after it was paused.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

List a database's top queries

GET/v1/databases/{database_uuid}/queries

Returns the top 50 statements of a database in a time window, ranked by the chosen sort, with the totals of all the other statements and of the whole window. The window defaults to the last day and spans at most 7 days. A database that keeps counts only answers available: false with reason: counts_only and no statements. Statement texts and schema names are returned only when the database shows identifiers.

Needs the scope database.view.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Query parameters

  • periodstring or nullOptional

    A relative window ending now: 1 to 9999 minutes, hours, days or weeks (3h, 2w). Not with from and to. The operation names its longest window and its default.

  • fromstring or nullOptional

    The start of a pinned window, epoch milliseconds or RFC 3339 with an offset. Needs to. A start before the oldest data kept is served from it.

  • tostring or nullOptional

    The end of a pinned window, epoch milliseconds or RFC 3339 with an offset, after from. A window that ends before the oldest data kept, or in the future, is refused.

  • sortstring or nullOptional

    What the top 50 statements are ranked by: total_time, calls, avg_time, rows_examined, no_index, errors or impact; total_time when omitted.

    Values:total_timecallsavg_timerows_examinedno_indexerrorsimpact(an open set: new values may be added)
  • orderstring or nullOptional

    The ranking direction: asc for the lowest first or desc for the highest first; desc when omitted.

    Values:ascdesc(an open set: new values may be added)

Returns

200 OK:

The top statements of the window, the other statements and the totals.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Reassign a database's collector

POST/v1/databases/{database_uuid}/reassign

Moves collection to the warm standby collector at once, and the old active collector becomes the standby. Expect one gap of about 15 seconds in the rates. Refused when there is no eligible standby. Answers the database as databases.view does.

Needs the scope database.edit.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Returns

200 OK:

The database after collection was moved.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Refresh a database's schema

POST/v1/databases/{database_uuid}/schema-refresh

Queues one schema pass on the database’s active collector, to run now. The pass runs when the collector’s agent next checks in, so the answer is the database as it stands, not the result. Refused while a refresh was requested in the last 10 minutes or when the collector cannot run it. Answers the database as databases.view does.

Needs the scope database.edit.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Returns

202 Accepted:

The schema refresh was queued; the body is the database as it stands.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Restore a dismissed advisor finding

POST/v1/databases/{database_uuid}/findings/{finding_uuid}/restore

Restores a dismissed advisor finding, so it counts again while it keeps firing. Refused when the finding belongs to another database or is not dismissed. Answers the finding as databases.findings lists it.

Needs the scope database.edit.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

  • finding_uuidstring (uuid)Required

    The uuid of the finding.

Returns

200 OK:

The finding after it was restored.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Resume a database

POST/v1/databases/{database_uuid}/resume

Resumes a paused database: collection and billing start again and the payment status is checked first. The time of the last report is cleared, so nothing alarms until the first report after the resume. Refused when the database is not paused. Answers the database as databases.view does.

Needs the scope database.edit.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Returns

200 OK:

The database after it was resumed.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Run a database's advisor

POST/v1/databases/{database_uuid}/advisor-run

Queues one advisor pass on the database’s active collector, to run now. The pass runs when the collector’s agent next checks in, so the answer is the database as it stands, not the findings. Refused when the advisor cannot run it now. Answers the database as databases.view does.

Needs the scope database.edit.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Returns

202 Accepted:

The advisor run was queued; the body is the database as it stands.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

List a database's schema changes

GET/v1/databases/{database_uuid}/schema-changes

Lists the changes detected in a database’s schema, newest first, one page at a time. Filter by kind, action or schema, and by a time window; without a window every change is listed. Object names are returned only when the database shows identifiers; the keys always tell objects apart. Pages by page and per_page (limit is the same as per_page); every page carries current_page, per_page, last_page and total.

Needs the scope database.view.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Query parameters

  • kindstring or nullOptional

    Only changes to this kind of object: table, view or routine; without it the history markers are listed too.

    Values:tableviewroutine(an open set: new values may be added)
  • actionstring or nullOptional

    Only changes of this action: created, altered, renamed or dropped.

    Values:createdalteredrenameddropped(an open set: new values may be added)
  • schema_keystring or nullOptional

    Only changes in the schema with this key, as databases.storage and a change’s schema_key give it.

  • periodstring or nullOptional

    A relative window ending now: 1 to 9999 minutes, hours, days or weeks (3h, 2w). Not with from and to. The operation names its longest window and its default.

  • fromstring or nullOptional

    The start of a pinned window, epoch milliseconds or RFC 3339 with an offset. Needs to. A start before the oldest data kept is served from it.

  • tostring or nullOptional

    The end of a pinned window, epoch milliseconds or RFC 3339 with an offset, after from. A window that ends before the oldest data kept, or in the future, is refused.

  • limitinteger or nullOptional

    The same as per_page, kept for existing clients.

  • include_totalstring or nullOptional

    Ignored: total is always present.

    Values:truefalse10(an open set: new values may be added)
  • per_pageinteger or nullOptional

    The number of items in a page, from 1 to 100; 25 when omitted.

  • pageinteger or nullOptional

    The page to read, from 1; 1 when omitted. A page past the last answers no rows.

Returns

200 OK:

One page of the database’s schema changes.

Each item of the page:

  • detected_atinteger or null

    Epoch milliseconds. When the pass detected the change.

    An instant: epoch milliseconds, UTC.
  • kindstring

    What changed: table, view or routine; marker for a history marker, listed only without a filter.

  • actionstring

    What happened to it: created, altered, renamed or dropped; a marker’s own action otherwise.

  • object_keystring or null

    The changed object’s key, which tells objects apart when their names are hidden; null on a marker.

  • previous_object_keystring or null

    The key the object had before a rename; null otherwise.

  • schema_keystring or null

    The key of the object’s schema; null on a marker.

  • namesobject or null

    The names of the keys involved; null unless the database shows identifiers.

  • details_unavailableboolean or null

    Whether the change’s details could not be kept; null when not applicable.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Get a database's storage

GET/v1/databases/{database_uuid}/storage

Returns a database’s size, growth and forecast, the projected size after 30, 90, 180 and 365 days, its ceiling, and its current schemas and tables by size, largest first. Schemas and tables are empty for a database that keeps counts only, and names are returned only when the database shows identifiers.

Needs the scope database.view.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Returns

200 OK:

The database’s storage, forecast, schemas and tables.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.

Verify a database's collectors

POST/v1/databases/{database_uuid}/verify

Asks every collector that can currently collect to probe the database again. The probes run when each agent next checks in, about 15 to 35 seconds later, and their results appear on the database. Refused for a draft and for a paused database. Answers the database as databases.view does.

Needs the scope database.edit.

Headers

  • Idempotency-KeystringOptional

    Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries Idempotent-Replayed: true); the same key on a different request is refused 422 invalid_request.

Path parameters

  • database_uuidstring (uuid)Required

    The uuid of the database.

Returns

200 OK:

The database as it stands while the collectors probe again.

Each failure is a problem document with a stable code; the response panel's status selector shows each one this operation can answer, and errors lists them all.