MongoDB Atlas
30 min
the mongodb atlas connector enables seamless integration with swimlane turbine, allowing for the automation of database management tasks and trigger creation mongodb atlas is a fully managed cloud database developed by the same people that build mongodb the mongodb atlas connector for swimlane turbine allows users to automate complex database operations, such as creating triggers for authentication, database, and scheduled events, as well as running queries and retrieving configurations this integration empowers security teams to streamline their database related workflows, enhance real time data processing, and enforce security measures directly within their security automation playbooks mongodb atlas is a fully managed cloud database service that allows you to deploy, manage, and scale mongodb databases easily it offers various features and tools to ensure your database operates efficiently, securely, and reliably prerequisites to effectively utilize the mongodb atlas connector with swimlane turbine, ensure you have the following username and api key authentication with the following parameters url the base endpoint for mongodb atlas api access public api key your mongodb atlas account's public api key private api key your mongodb atlas account's private api key capabilities this connector provides the following capabilities create a authentication trigger create a database trigger create a scheduled trigger get all triggers get graphql api configuration run a mongodb query configurations mongodb atlas authentication authenticates using username and api key configuration parameters parameter description type required url a url to the target host string required username public api key string required apikey private api key string required verify ssl verify ssl certificate boolean optional http proxy a proxy to route requests through string optional actions create a authentication trigger creates a new authentication trigger in mongodb atlas using the provided groupid, appid, name, type, and configuration endpoint url /api/admin/v3 0/groups/{{groupid}}/apps/{{appid}}/triggers method post input argument name type required description groupid string required an atlas project/group id appid string required the objectid of your application name string required the trigger's name type string required the trigger type for authentication triggers, this value is always "authentication" disabled boolean optional if true, the trigger is disabled and does not listen for events or execute config object required an object that defines configuration values for the trigger operation type array required the type of authentication event that the trigger listens for providers array required the type(s) of authentication provider that the trigger listens to function id string optional the id of the function that the trigger calls when it fires function name string optional the name of the function that the trigger calls when it fires, i e the function described by function id event processors object optional an object where each field name is an event processor id and each value is an object that configures its corresponding event processor function object optional parameter for create a authentication trigger config object optional parameter for create a authentication trigger function id string optional the id of the function that the trigger calls when it fires function name string optional the name of the function that the trigger calls when it fires, i e the function described by function id aws eventbridge object optional unique identifier config object optional parameter for create a authentication trigger account id string optional an aws account id region string optional an aws region extended json enabled boolean optional if true, event objects are serialized using ejson id string optional the trigger's unique id output parameter type description status code number http status code of the response reason string response reason phrase name string name of the resource type string type of the resource function id string unique identifier config object output field config operation type array type of the resource providers array unique identifier example \[ { "status code" 201, "response headers" {}, "reason" "successfully created", "json body" { "name" "onnewapikey", "type" "authentication", "function id" "5eea9ca4ca0e356e2c2a148a", "config" {} } } ] create a database trigger creates a new database trigger in mongodb atlas with specified group and app ids, allowing customization of name, type, and config endpoint url /api/admin/v3 0/groups/{{groupid}}/apps/{{appid}}/triggers method post input argument name type required description groupid string required an atlas project/group id appid string required the objectid of your application name string required the trigger's name type string required the trigger type for database triggers, this value is always "database" disabled boolean optional if true, the trigger is disabled and does not listen for events or execute config object required an object that defines configuration values for the trigger service id string required the id value of a linked mongodb data source database string required the name of a database in the linked data source collection string required the name of a collection in the specified database the trigger listens to events from this collection operation types array required the type(s) of mongodb change event that the trigger listens for match object required a $match expression filters change events the trigger will only fire if the expression evaluates to true for a given change event project object optional a $project expression returns only the specified fields you can include or exclude specific fields, or include newly computed fields full document boolean required if true, indicates that update change events should include the most current majority committed version of the modified document in the fulldocument field full document before change boolean required if true, indicates that update change events should include a snapshot of the modified document from immediately before the update was applied skip catchup events boolean optional if true, enabling the trigger after it was disabled will not invoke events that occurred while the trigger was disabled tolerate resume errors boolean optional if true, when this trigger's resume token cannot be found in the cluster's oplog, the trigger automatically resumes processing events at the next relevant change stream event maximum throughput boolean optional if true, the trigger will use the maximize throughput option unordered boolean required if true, event ordering is disabled and this trigger can process events in parallel if false, event ordering is enabled and the trigger executes events serially function id string optional the id of the function that the trigger calls when it fires function name string optional the name of the function that the trigger calls when it fires, i e the function described by function id event processors object optional an object where each field name is an event processor id and each value is an object that configures its corresponding event processor function object optional parameter for create a database trigger config object optional parameter for create a database trigger function id string optional the id of the function that the trigger calls when it fires function name string optional the name of the function that the trigger calls when it fires, i e the function described by function id output parameter type description status code number http status code of the response reason string response reason phrase name string name of the resource type string type of the resource function id string unique identifier config object output field config operation types array type of the resource database string response data collection string output field collection service id string unique identifier match object output field match project object output field project full document boolean output field full document example \[ { "status code" 201, "response headers" {}, "reason" "successfully created", "json body" { "name" "onnewemployee", "type" "database", "function id" "5eea9ca4ca0e356e2c2a148a", "config" {} } } ] create a scheduled trigger creates a new scheduled trigger in mongodb atlas using the provided name, type, and configuration along with groupid and appid endpoint url /api/admin/v3 0/groups/{{groupid}}/apps/{{appid}}/triggers method post input argument name type required description groupid string required an atlas project/group id appid string required the objectid of your application name string required the trigger's name type string required the trigger type for scheduled triggers, this value is always "scheduled" disabled boolean optional if true, the trigger is disabled and does not listen for events or execute config object required an object that defines configuration values for the trigger schedule string required a cron expression that specifies when the trigger executes skip catchup events boolean optional if true, enabling the trigger after it was disabled will not invoke events that occurred while the trigger was disabled function id string optional the id of the function that the trigger calls when it fires function name string optional the name of the function that the trigger calls when it fires, i e the function described by function id event processors object optional an object where each field name is an event processor id and each value is an object that configures its corresponding event processor function object optional parameter for create a scheduled trigger config object optional parameter for create a scheduled trigger function id string optional the id of the function that the trigger calls when it fires function name string optional the name of the function that the trigger calls when it fires, i e the function described by function id aws eventbridge object optional unique identifier config object optional parameter for create a scheduled trigger account id string optional an aws account id region string optional an aws region extended json enabled boolean optional if true, event objects are serialized using ejson id string optional the trigger's unique id output parameter type description status code number http status code of the response reason string response reason phrase name string name of the resource type string type of the resource function id string unique identifier config object output field config schedule string output field schedule example \[ { "status code" 201, "response headers" {}, "reason" "successfully created", "json body" { "name" "createdailyreport", "type" "scheduled", "function id" "5eea9ca4ca0e356e2c2a148a", "config" {} } } ] get all triggers retrieve all triggers for a given group and application in mongodb atlas, requiring 'groupid' and 'appid' as path parameters endpoint url /api/admin/v3 0/groups/{{groupid}}/apps/{{appid}}/triggers method get input argument name type required description groupid string required an atlas project/group id appid string required the objectid of your application output parameter type description status code number http status code of the response reason string response reason phrase example \[ { "status code" 200, "response headers" {}, "reason" "successfully listed triggers", "json body" \[ {} ] } ] get graphql api configuration retrieve the graphql api configuration for a specified app in a mongodb atlas project, using group and app ids endpoint url /api/admin/v3 0/groups/{{groupid}}/apps/{{appid}}/graphql/config method get input argument name type required description groupid string required an atlas project/group id appid string required the objectid of your application output parameter type description status code number http status code of the response reason string response reason phrase use natural pluralization boolean output field use natural pluralization disable schema introspection boolean output field disable schema introspection example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" { "use natural pluralization" true, "disable schema introspection" true } } ] run a mongodb query executes a specified query or mutation directly in mongodb atlas with system level privileges, requiring groupid, appid, and the query endpoint url /api/admin/v3 0/groups/{{groupid}}/apps/{{appid}}/graphql method post input argument name type required description groupid string required an atlas project/group id appid string required he objectid of your application query string required a stringified graphql file that contains one or more valid graphql operations for your api variables string optional a stringified json object where each field name maps a value to a variable in the specified operation operationname string optional he name of the graphql operation specified in query to run output parameter type description status code number http status code of the response reason string response reason phrase data object response data errors array error message if any message string response message locations array output field locations line number output field line column number output field column example \[ { "status code" 200, "response headers" {}, "reason" "ok", "json body" { "data" {}, "errors" \[] } } ] notes api documentation https //www mongodb com/docs/atlas/app services/admin/api/v3/#section/get an admin api session access token