Updates the details of the given trigger. To update a trigger, send a PUT request to /v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME
with new values for the is_enabled
or scheduled_details
properties.
Name | Type | Required | Description | Default Value |
---|---|---|---|---|
namespace_id |
string | True | The ID of the namespace to be managed. | |
trigger_name |
string | True | The name of the trigger to be managed. | |
body |
JSON or IO[bytes] | True |
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"is_enabled": true,
"scheduled_details": {
"cron": "* * * * *",
"body": {
"name": "Welcome to DO!"
}
}
}
resp = client.functions.update_trigger(namespace_id="39f3ca", trigger_name="trig_name", body=req)
See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.