Skip to main content

Test Oracle Metric Connection

Probes a metric-provider connection without saving anything, through the same reader the platform uses for real reads. Use it while configuring a provider, before Create Oracle Metric or Update Oracle Metric.

  • For TOGG a code is required and that one series is read.
  • For SHEET with no code, the whole tab is loaded and parsed; with a code, that row is read.

A probe that reaches the source and comes back wrong is still a 200, with ok: false and the reason in error. The response never contains what the source sent back: error says only whether the source answered and with which status.

Reusing a stored secret. Set oracle_metric_id and omit connection.auth.secret (or send null) to probe with the secret stored on that provider. The stored secret is only sent to the origin (scheme, host and port) it was saved for; probing another origin with it is refused with 10002 (domain 83). Send the secret in the request to test another host.

Allowed targets. The URL must be public https, or an in-cluster host the environment lists. Plain http on the internet, private addresses and the cloud metadata endpoint are refused with 10001 (domain 83) before anything is sent.

Required permission: oracle:update

Request​

POST /v2/admin/oracle-metrics/test-connection

Headers​

NameDescription
AuthorizationRequired. Bearer <access_token>
Content-TypeRequired. application/json

Body​

FieldTypeRequiredDescription
oracle_metric_idstring | nullNoId of a stored provider whose secret fills an omitted connection.auth.secret
typestringYesSource type: TOGG or SHEET
codestringConditionalSeries to read. Required for TOGG; optional for SHEET
connectionobjectYesThe connection to probe, with the same fields as on Create Oracle Metric (url, timeout, cache_ttl_seconds, auth, headers)

Example​

curl --request POST \
--url '{{baseUrl}}/v2/admin/oracle-metrics/test-connection' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"oracle_metric_id": null,
"type": "SHEET",
"code": "",
"connection": {
"url": "https://docs.google.com/spreadsheets/d/1Q9xWmT4kLp7RzV2sN8bYc3HdF6gJ0aEu5iO/export?format=csv&gid=0",
"timeout": 30,
"cache_ttl_seconds": 300,
"auth": { "type": "NONE" },
"headers": []
}
}'

Response​

{
"ok": true,
"latency_ms": 356
}

Response Fields​

FieldTypeDescription
okbooleanWhether the probe read data the provider understands
latency_msintegerDuration of the probe in milliseconds
errorstringOnly when ok is false: the source answered HTTP <status>, the source could not be reached, or the source answered, but not with data this provider can read

Errors​

StatusCodeDescription
40010015Validation failed — see details
40010000oracle_metric_id is not a valid 24-character hex id
40010001The provider named by oracle_metric_id was not found (domain 53)
400-1The connection is incomplete (URL scheme, or the auth scheme's name, username or secret missing), or code is missing for TOGG
40010001Target refused: not https, does not resolve, or resolves to a private or metadata address (domain 83)
40010002The stored secret would be sent to a host other than the one it is stored for (domain 83)

See Errors for the error format and common codes.