/observer/edit/postgresql

Edit observer settings

Request

HTTP Method: POST
Content Type: application/json

Parameters

Property

Type

Description

Required

Property

Type

Description

Required

configuration_id

integer(int64)

configuration ID (non-negative)

required

custom_observer_scripts

object of type custom_observer_scripts

main_settings

object of type main_settings

notifications

object of type notifications

optional_alerts

object of type optional_alerts

custom_observer_scripts

Property

Type

Description

Property

Type

Description

primary_script

string

primary custom script

script_rule

string

how to use scripts to increment fail count; "disabled" to use only built-in checks, "custom-only" to use only custom scripts, "either" to increment the fail count if either built-in check or custom script fails, "both" to increment the fail count if both built-in check and custom script fails (possible values: 'disabled', 'custom-only', 'either' and 'both')

standby_script

string

standby custom script

main_settings

Property

Type

Description

Property

Type

Description

check_interval

integer(int32)

how frequently the observer checks the configuration's status, in seconds (minimum: 60)

emergency_action

string

action to perform after max failures; "notify" to send notifications only, "activate" to perform automatic activation (possible values: 'notify' and 'activate')

enable

boolean

enable or disable the observer

max_fail_count

integer

maximum number of failed checks before action is taken

notifications

Property

Type

Description

Property

Type

Description

enable_heartbeat

boolean

enable heartbeat notifications, which are sent daily to indicate that the observer is running

heartbeat_time

string

time of day to send heartbeat notifications (HH:MM)

send_email

boolean

enable email notifications

send_slack

boolean

enable slack notifications

optional_alerts

Property

Type

Description

Property

Type

Description

enable_timegap

boolean

enable time gap check

timegap_threshold

integer

maximum allowed time gap before notification, in seconds

{ "params": { "configuration_id": 1, "custom_observer_scripts": { "primary_script": "string", "script_rule": "disabled", "standby_script": "string" }, "main_settings": { "check_interval": 123, "emergency_action": "notify", "enable": false, "max_fail_count": 123 }, "notifications": { "enable_heartbeat": false, "heartbeat_time": "string", "send_email": false, "send_slack": false }, "optional_alerts": { "enable_timegap": false, "timegap_threshold": 123 } } }

Response

HTTP Status: 200

Content Type: application/json

Response

Property

Type

Description

Property

Type

Description

error

object of type error_response

error response

result

object of type observer_config

observer configuration

successful

boolean

response with error or not

error_response

Property

Type

Description

Property

Type

Description

message

string

error message

observer_config

Property

Type

Description

Property

Type

Description

check_interval_seconds

integer

the configured observer check interval in seconds

custom_script_primary

string

full path of the custom script to use on the primary host

custom_script_rule

string

whether and how to use custom scripts to affect the Observer's behavior' (possible values: 'disabled', 'custom-only', 'either' and 'both')

custom_script_standby

string

full path of the custom script to use on the standby host

emergency_action

string

action to take once the maximum number of failures has been reached (possible values: 'activate' and 'notify')

enabled

boolean

whether the observer is enabled

heartbeat_enabled

boolean

whether to send a daily notification to confirm the observer is running; you need to have send_email or send_slack enabled for this to work

heartbeat_hour

integer

the hour of the day in the Control Center timezone at which to send the heartbeat notification (0-23)

heartbeat_minute

integer

the minute of the hour at which to send the heartbeat notification (0-59)

max_fail_count

integer

once this number of failures has been reached, the emergency action is taken and the observer is disabled

send_email

boolean

whether to send notifications to the email addresses configured for notifications on the configuration

send_slack

boolean

whether to send notifications to the Slack webhooks configured for notifications on the configuration

time_gap_check_enabled

boolean

whether to send a notification if the time gap exceeds the configured threshold

time_gap_check_threshold_seconds

integer

maximum number of seconds for the time gap check

{ "error": { "message": "string" }, "result": { "check_interval_seconds": 123, "custom_script_primary": "string", "custom_script_rule": "disabled", "custom_script_standby": "string", "emergency_action": "activate", "enabled": false, "heartbeat_enabled": false, "heartbeat_hour": 123, "heartbeat_minute": 123, "max_fail_count": 123, "send_email": false, "send_slack": false, "time_gap_check_enabled": false, "time_gap_check_threshold_seconds": 123 }, "successful": true }

HTTP Status: 400

Content Type: application/json

Response

Property

Type

Description

Property

Type

Description

error

object of type error_response

error response

successful

boolean

always false

error_response

Property

Type

Description

Property

Type

Description

message

string

error message

{ "error": { "message": "string" }, "successful": false }