mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
chore(dblab): curl the apis to achieve greatness
This commit is contained in:
30
snippets/dblab.fish
Normal file
30
snippets/dblab.fish
Normal 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')"
|
||||
Reference in New Issue
Block a user