mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
chore(peerdb): expand notes
This commit is contained in:
@@ -88,11 +88,11 @@ docker restart 'dblab_clone_6000'
|
||||
|
||||
# Reset clones
|
||||
# Only available via the '/api' endpoints, no direct ones
|
||||
dblab clone reset --async='true' --latest='true' 'some-clone'
|
||||
curl -X 'POST' 'https://dblab.example.org:1234/api/clone/some-clone/reset' \
|
||||
-H "Verification-Token: $(gopass show -o 'dblab')" \
|
||||
-H 'accept: application/json' -H 'content-type: application/json' \
|
||||
-d '{ "latest": true }'
|
||||
dblab clone reset --async='true' --latest='true' 'some-clone'
|
||||
# Reset all protected clones
|
||||
curl --url 'https://dblab.example.org:2345/status' --header 'verification-token: somePassword' \
|
||||
| jq -r '.cloning.clones[]|select(.protected = "true")|.id' \
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
# Connect to PeerDB server in SQL mode
|
||||
psql 'host=localhost port=9900 password=peerdb'
|
||||
psql 'postgresql://peerdb.example.org:9900/?password=peerdb'
|
||||
|
||||
|
||||
# List peers
|
||||
psql "host=localhost port=9900 password=$(gopass show -o 'peerdb/instance')" \
|
||||
@@ -13,6 +15,14 @@ curl -fsS --url 'http://localhost:3000/api/v1/peers/list' \
|
||||
# postgres: peer.type=3|'POSTGRES' + postgres_config={…}
|
||||
# clickhouse: peer.type=8 + clickhouse_config={…}
|
||||
# kafka: peer.type=9 + kafka_config={…}
|
||||
psql "host=localhost port=9900 password=$(gopass show -o 'peerdb/instance')" \
|
||||
-c "CREATE PEER some_pg_peer FROM POSTGRES WITH (
|
||||
host = 'localhost',
|
||||
port = '5432',
|
||||
user = 'peerdb',
|
||||
password = '$(gopass show -o 'peerdb/db-user')',
|
||||
database = 'sales'
|
||||
);"
|
||||
curl -fsS --url 'http://localhost:3000/api/v1/peers/create' -X 'POST' \
|
||||
-H "Authorization: Basic $(gopass show -o 'peerdb/instance' | xargs printf '%s' ':' | base64)" \
|
||||
-H 'Content-Type: application/json' \
|
||||
@@ -29,14 +39,6 @@ curl -fsS --url 'http://localhost:3000/api/v1/peers/create' -X 'POST' \
|
||||
}
|
||||
}
|
||||
}"
|
||||
psql "host=localhost port=9900 password=$(gopass show -o 'peerdb/instance')" \
|
||||
-c "CREATE PEER some_pg_peer FROM POSTGRES WITH (
|
||||
host = 'localhost',
|
||||
port = '5432',
|
||||
user = 'peerdb',
|
||||
password = '$(gopass show -o 'peerdb/db-user')',
|
||||
database = 'sales'
|
||||
);"
|
||||
|
||||
# Update peers
|
||||
# Reuse the command for creation but add 'allow_update: true' to the data
|
||||
@@ -46,6 +48,11 @@ curl -fsS --url 'http://localhost:3000/api/v1/peers/create' -X 'POST' … \
|
||||
allow_update: true
|
||||
}"
|
||||
|
||||
# Delete peers
|
||||
psql "host=localhost port=9900 password=$(gopass show -o 'peerdb/instance')" \
|
||||
-c "DELETE FROM peers WHERE name == 'some_pg_peer';"
|
||||
|
||||
|
||||
# List mirrors
|
||||
curl -fsS --url 'http://localhost:3000/api/v1/mirrors/list' \
|
||||
-H "Authorization: Basic $(gopass show -o 'peerdb/instance' | xargs printf '%s' ':' | base64)" \
|
||||
@@ -104,6 +111,7 @@ curl -fsS 'http://localhost:3000/api/v1/flows/cdc/create' -X 'POST' \
|
||||
}
|
||||
}'
|
||||
|
||||
|
||||
# Show alerts' configuration
|
||||
curl -fsS --url 'http://localhost:3000/api/v1/alerts/config' \
|
||||
-H "Authorization: Basic $(gopass show -o 'peerdb/instance' | xargs printf '%s' ':' | base64)" \
|
||||
|
||||
Reference in New Issue
Block a user