create_dns_monitor
const url = 'https://example.com/api/v1/dns-monitors';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"dns_name":"example","max_depth":1,"name":"example","parent_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","pool":"example","record_type":"A","resolver":"example","resolver_port":1,"timeout_ms":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/dns-monitors \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "dns_name": "example", "max_depth": 1, "name": "example", "parent_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "pool": "example", "record_type": "A", "resolver": "example", "resolver_port": 1, "timeout_ms": 1 }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”The check config is spelled out rather than #[serde(flatten)]ed (as [CreateUrlMonitor]
does) because both the node and the check have a name: flattening would bind them to the same
JSON key and silently force the display label to equal the resolved name.
object
The DNS name to resolve.
Display name for the node.
Which record type a DNS check resolves to. Stored as an UPPERCASE token (the record_type
column).
Cname is a legitimate terminal type: it answers “what is this name an alias for?” without
chasing on to an address.
Responses
Section titled “Responses”Monitor node created and bound to the built-in DNS profile
The id of a freshly created resource — the whole body of a 201.
Deliberately one shape for every creator. The json!({"id": …}) literal it replaces was written
out per handler, which is how {"id": …} and {"node_id": …} both ended up in this API for the
same idea; a client then needs to know which creator it called to read the id back.
object
Examplegenerated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}The name is empty, the DNS check is not usable, or the pool name is not a legal subject token
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}No valid bearer token
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Role lacks ManageConfig
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Inventory storage is unavailable (skeleton mode)
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}