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
TOGGacodeis required and that one series is read. - For
SHEETwith nocode, the whole tab is loaded and parsed; with acode, 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
| Name | Description |
|---|---|
Authorization | Required. Bearer <access_token> |
Content-Type | Required. application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
oracle_metric_id | string | null | No | Id of a stored provider whose secret fills an omitted connection.auth.secret |
type | string | Yes | Source type: TOGG or SHEET |
code | string | Conditional | Series to read. Required for TOGG; optional for SHEET |
connection | object | Yes | The 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
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the probe read data the provider understands |
latency_ms | integer | Duration of the probe in milliseconds |
error | string | Only 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
| Status | Code | Description |
|---|---|---|
| 400 | 10015 | Validation failed — see details |
| 400 | 10000 | oracle_metric_id is not a valid 24-character hex id |
| 400 | 10001 | The provider named by oracle_metric_id was not found (domain 53) |
| 400 | -1 | The connection is incomplete (URL scheme, or the auth scheme's name, username or secret missing), or code is missing for TOGG |
| 400 | 10001 | Target refused: not https, does not resolve, or resolves to a private or metadata address (domain 83) |
| 400 | 10002 | The 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.