chore(dblab): curl the apis to achieve greatness

This commit is contained in:
Michele Cereda
2024-10-08 23:40:20 +02:00
parent a0bf5c4aab
commit 2c278edbd5
2 changed files with 79 additions and 3 deletions

30
snippets/dblab.fish Normal file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env fish
# Create clones
curl -X 'POST' 'https://dblab.company.com:1234/api/clone' -H "Verification-Token: $(gopass show -o 'dblab')" \
-H 'accept: application/json' -H 'content-type: application/json' \
-d '{
"id": "smth",
"protected": true,
"db": {
"username": "master",
"password": "ofPuppets",
"db_name": "puppet"
}
}'
# Get clones' information
curl 'https://dblab.company.com:1234/api/clone/smth' -H "Verification-Token: $(gopass show -o 'dblab')"
# Reset clones
curl -X 'POST' 'https://dblab.company.com:1234/api/clone/smth/reset' -H "Verification-Token: $(gopass show -o 'dblab')" \
-H 'accept: application/json' -H 'content-type: application/json' \
-d '{ "latest": true }'
# Unprotect clones
curl -X 'PATCH' 'https://dblab.company.com:1234/api/clone/smth' -H "Verification-Token: $(gopass show -o 'dblab')" \
-H 'accept: application/json' -H 'content-type: application/json' \
-d '{ "protected": false }'
# Delete clones
curl -X 'DELETE' 'https://dblab.company.com:1234/api/clone/smth' -H "Verification-Token: $(gopass show -o 'dblab')"