curl --request POST \
--url http://localhost:3000/api/v1/peers/create \
--header 'Authorization: Basic OmJsYWNrU3dhbpEyMw==' \
--header 'Content-Type: application/json' \
--data '{
"peer": {
"name": "pg_peer_via_api",
"type": 3,
"postgres_config": {
"host": "localhost",
"port": 5432,
"user": "postgres",
"password": "postgres",
"database": "postgres"
}
},
"allow_update":false
}'
{
"status": "CREATED",
"message": ""
}
Here is the request and response format for creating a Postgres peer. SSH tunneling is optional for peer creation.
Request Fields
Configuration of the peer to be created.
The name of the peer to be created.
The type of peer to be created. The value for Postgres is 3.
Port on which the PG server is running. Ex: 5432
The user to connect to the PG server.
The password associated with the user.
The database to connect to.
Configuration for SSH tunneling
The host of the SSH server.
The port on which the SSH server is running.
The user to connect to the SSH server.
The password associated with the user.
The private key as a string to connect to the SSH server.
Whether you wish to update a peer with this name if it already exists. Default is false
.
Response Fields
Whether the creation/update was successful. If yes, the value will be CREATED
. Else it will be FAILED
.
curl --request POST \
--url http://localhost:3000/api/v1/peers/create \
--header 'Authorization: Basic OmJsYWNrU3dhbpEyMw==' \
--header 'Content-Type: application/json' \
--data '{
"peer": {
"name": "pg_peer_via_api",
"type": 3,
"postgres_config": {
"host": "localhost",
"port": 5432,
"user": "postgres",
"password": "postgres",
"database": "postgres"
}
},
"allow_update":false
}'
{
"status": "CREATED",
"message": ""
}