Skip to content

Commit

Permalink
(DOCSP-37062): Update Trigger config & Admin API details (#864)
Browse files Browse the repository at this point in the history
* Update Triggers Admin API reference

* Update config reference

* Enumerate complications of database triggers

* Actually it's more complicated than that

* Apply suggestions from review

Co-authored-by: cbullinger <[email protected]>

---------

Co-authored-by: cbullinger <[email protected]>
  • Loading branch information
dacharyc and cbullinger authored Oct 8, 2024
1 parent 23b81fa commit 94a904c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 22 deletions.
59 changes: 41 additions & 18 deletions source/openapi-admin-v3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ paths:
content:
application/json:
schema:
"$ref": "#/components/schemas/Trigger"
"$ref": "#/components/schemas/TriggerConstructor"
responses:
"201":
description: Successfully created.
Expand Down Expand Up @@ -7839,18 +7839,13 @@ components:
config:
required:
- service_id
- database
- collection
- operation_types
- full_document
- full_document_before_change
- unordered
- match
properties:
service_id:
type: string
description: |
The _id value of a linked MongoDB data source.
The `_id` value of a linked MongoDB data source that
contains the watched collection.
You can list services with the
[Get all services endpoint](#operation/adminListServices).
Expand All @@ -7860,23 +7855,51 @@ components:
the Trigger.
database:
type: string
description: The name of a database in the linked data source.
description: |-
The name of a database in the linked data source. If you
omit this parameter, the Source Type changes to
"Deployment," unless you are on a shared tier, in which
case App Services will not let you save the trigger.
collection:
type: string
description: |-
The name of a collection in the specified database. The
trigger listens to events from this collection.
trigger listens to events from this collection. If you omit
this parameter, the Source Type changes to "Database."
operation_types:
type: array
minItems: 1
items:
type: string
enum:
- INSERT
- UPDATE
- REPLACE
- DELETE
description: The type(s) of MongoDB change event that the trigger listens for.
description: |-
The types of MongoDB change event that the trigger
listens for.
Valid operation types for all triggers include:
- `"INSERT"`
- `"UPDATE"`
- `"REPLACE"`
- `"DELETE"`
Additional valid operation types for database and
deployment triggers include:
- `"CREATE_COLLECTION"`
- `"MODIFY_COLLECTION"`
- `"RENAME_COLLECTION"`
- `"DROP_COLLECTION"`
- `"SHARD_COLLECTION"`
- `"RESHARD_COLLECTION"`
- `"REFINE_COLLECTION_SHARD_KEY"`
Additional valid operation types for deployment triggers
include:
- `"DROP_DATABASE"`
For more information, refer to
[Trigger Configuration](https://www.mongodb.com/docs/atlas/app-services/triggers/database-triggers/#configuration).
match:
type: object
description: |-
Expand Down Expand Up @@ -7935,6 +7958,7 @@ components:
option.
unordered:
type: boolean
default: false
description: |-
If `true`, event ordering is disabled and this Trigger
can process events in parallel. If `false`, event
Expand Down Expand Up @@ -7964,8 +7988,7 @@ components:
type: AUTHENTICATION
function_id: 5eea9ca4ca0e356e2c2a148a
config:
operation_type:
- CREATE
operation_type: CREATE
providers:
- api-key
allOf:
Expand Down
8 changes: 4 additions & 4 deletions source/reference/config/triggers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ two possible configurations depending on the event processor type:
"type": "DATABASE",
"disabled": <boolean>,
"config": {
"service_name": "<MongoDB Service Name>",
"service_id": "<MongoDB Data Source Service ID>",
"database": "<Database Name>",
"collection": "<Collection Name>",
"operation_types": ["<Operation Type>", ...],
Expand Down Expand Up @@ -179,7 +179,7 @@ two possible configurations depending on the event processor type:
"type": "DATABASE",
"disabled": <boolean>,
"config": {
"service_name": "<MongoDB Service Name>",
"service_id": "<MongoDB Data Source Service ID>",
"database": "<Database Name>",
"collection": "<Collection Name>",
"operation_types": ["<Operation Type>", ...],
Expand Down Expand Up @@ -216,10 +216,10 @@ two possible configurations depending on the event processor type:
* - Field
- Description

* - | ``config.service_name``
* - | ``config.service_id``
| ``string``

- The name of the :ref:`MongoDB data source <appconfig-data_sources>`
- The unique identifier of the :ref:`MongoDB data source <appconfig-data_sources>`
that contains the watched collection. You cannot define a database
trigger on a :ref:`serverless instance <serverless-caveats>` or
:ref:`{+adf-instance+} <data-federation-caveats>`.
Expand Down

0 comments on commit 94a904c

Please sign in to comment.