DigitalOcean-public.v2-new_Functions
Update Trigger
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.
put/v2/functions/namespaces/{namespace_id}/triggers/{trigger_name}
Path parameters
namespace_idstring required
The ID of the namespace to be managed.
trigger_namestring required
The name of the trigger to be managed.
Request body
Example request
{
"is_enabled": true,
"scheduled_details": {
"cron": "* * * * *",
"body": {
"name": "Welcome to DO!"
}
}
}Response
A JSON response object with a key called trigger. The object contains the properties associated with the trigger.
Example response
{
"trigger": {
"namespace": "fn-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"name": "my trigger",
"function": "hello",
"type": "SCHEDULED",
"is_enabled": true,
"created_at": "2022-11-11T04:16:45Z",
"updated_at": "2022-11-11T04:16:45Z",
"scheduled_details": {
"cron": "* * * * *",
"body": {
"name": "Welcome to DO!"
}
},
"scheduled_runs": {
"last_run_at": "2022-11-11T04:16:45Z",
"next_run_at": "2022-11-11T04:16:45Z"
}
}
}