namespaces_triggers
Creates, updates, deletes, gets or lists a namespaces_triggers
resource.
Overview
Name | namespaces_triggers |
Type | Resource |
Id | digitalocean.functions.namespaces_triggers |
Fields
Name | Datatype | Description |
---|---|---|
name | string | The trigger's unique name within the namespace. |
created_at | string | UTC time string. |
function | string | Name of function(action) that exists in the given namespace. |
is_enabled | boolean | Indicates weather the trigger is paused or unpaused. |
namespace | string | A unique string format of UUID with a prefix fn-. |
scheduled_details | object | Trigger details for SCHEDULED type, where body is optional. |
scheduled_runs | object | |
type | string | String which indicates the type of trigger source like SCHEDULED. |
updated_at | string | UTC time string. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
functions_get_trigger | SELECT | namespace_id, trigger_name | Gets the trigger details. To get the trigger details, send a GET request to /v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME . |
functions_list_triggers | SELECT | namespace_id | Returns a list of triggers associated with the current user and namespace. To get all triggers, send a GET request to /v2/functions/namespaces/$NAMESPACE_ID/triggers . |
functions_create_trigger | INSERT | namespace_id, data__function, data__is_enabled, data__name, data__scheduled_details, data__type | Creates a new trigger for a given function in a namespace. To create a trigger, send a POST request to /v2/functions/namespaces/$NAMESPACE_ID/triggers with the name , function , type , is_enabled and scheduled_details properties. |
functions_delete_trigger | DELETE | namespace_id, trigger_name | Deletes the given trigger. To delete trigger, send a DELETE request to /v2/functions/namespaces/$NAMESPACE_ID/triggers/$TRIGGER_NAME . A successful deletion returns a 204 response. |
functions_update_trigger | EXEC | namespace_id, trigger_name | 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. |
SELECT
examples
Returns a list of triggers associated with the current user and namespace. To get all triggers, send a GET request to /v2/functions/namespaces/$NAMESPACE_ID/triggers
.
SELECT
name,
created_at,
function,
is_enabled,
namespace,
scheduled_details,
scheduled_runs,
type,
updated_at
FROM digitalocean.functions.namespaces_triggers
WHERE namespace_id = '{{ namespace_id }}';
INSERT
example
Use the following StackQL query and manifest file to create a new namespaces_triggers
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO digitalocean.functions.namespaces_triggers (
data__name,
data__function,
data__type,
data__is_enabled,
data__scheduled_details,
namespace_id
)
SELECT
'{{ name }}',
'{{ function }}',
'{{ type }}',
'{{ is_enabled }}',
'{{ scheduled_details }}',
'{{ namespace_id }}'
;
- name: namespaces_triggers
props:
- name: namespace_id
value: string
- name: data__function
value: string
- name: data__is_enabled
value: string
- name: data__name
value: string
- name: data__scheduled_details
value: string
- name: data__type
value: string
- name: name
value: string
- name: function
value: string
- name: type
value: string
- name: is_enabled
value: boolean
- name: scheduled_details
props:
- name: cron
value: string
- name: body
props:
- name: name
value: string
DELETE
example
Deletes the specified namespaces_triggers
resource.
/*+ delete */
DELETE FROM digitalocean.functions.namespaces_triggers
WHERE namespace_id = '{{ namespace_id }}'
AND trigger_name = '{{ trigger_name }}';