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