update: update docs for add/update source health check for particular…

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10542
GitOrigin-RevId: 147a0310ac85a593e762f1c579367b4f08d4bc50
This commit is contained in:
Meet Zaveri 2023-12-11 18:11:59 +05:30 committed by hasura-bot
parent b47cf27f9b
commit 556ac7c768

View File

@ -75,34 +75,28 @@ hasura metadata apply
</TabItem>
<TabItem value="api" label="API">
You can add _health check_ for a database using the
[pg_add_source](/api-reference/metadata-api/source.mdx#metadata-pg-add-source) Metadata API.
You can add/update _health check_ for a database using the
[pg_update_source](/api-reference/metadata-api/source.mdx#metadata-pg-update-source) Metadata API.
```http {17-24}
```http {7-18}
POST /v1/metadata HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin
{
"type":"pg_add_source",
"args":{
"name":"<db_name>",
"replace_configuration":true,
"configuration":{
"connection_info":{
"database_url":{
"from_env":"<DATABASE_URL_ENV>"
}
{
"type": "pg_update_source",
"args": {
"name": "default",
"health_check": {
"test": {
"sql": "SELECT 1"
},
"interval": 100,
"timeout": 2,
"retries": 3,
"retry_interval": 2
}
},
"health_check": {
"test": {
"sql": "SELECT 1"
},
"interval": 300,
"timeout": 5,
"retries": 3,
"retry_interval": 5
}
}
}