Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(DOCSP-37062): Update Trigger config & Admin API details #864

Merged
merged 5 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just confirming this should go to the /database-triggers page

Copy link
Collaborator Author

@dacharyc dacharyc Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was the plan, because this is specific to Database Triggers, and there is more info there. There's also info on the config reference page. But I think the main "Database Triggers" page is more likely to be actively maintained - for better or worse, we tend to forget the config reference pages exist and forget to update them.

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
Loading