Mongosh CLI
- POST
- /workspaces
- /:workspace
- /projects
- /:project_name
- /pipelines
- /:pipeline_id
- /actions
Creates a new Mongosh CLI action in the pipeline
Request example
curl -X POST "https://api.buddy.works/workspaces/:workspace/projects/:project_name/pipelines/:pipeline_id/actions" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "Run MongoDB queries",
"type": "MONGOSH_CLI",
"trigger_time": "ON_EVERY_EXECUTION",
"version": "8.0",
"shell": "BASH",
"execute_commands": [
"mongosh --quiet \"$MONGOSH_URI\" --eval 'db.stats()'",
"mongosh --quiet \"$MONGOSH_URI\" script.js"
],
"targets": [
{
"identifier": "my_mongo",
"type": "MONGO",
"scope": "ACTION",
"host": "mongo.example.com",
"database": "myapp",
"auth_source": "admin",
"auth": {
"method": "PASSWORD",
"username": "user",
"password": "pass"
}
}
]
}'STATUS200 OK