{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"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.","properties":{"path":{"type":"object","properties":{"namespace_id":{"type":"string","examples":["fn-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],"description":"The ID of the namespace to be managed."}},"required":["namespace_id"],"additionalProperties":false},"body":{"$ref":"#/definitions/create_trigger"}},"required":["path","body"],"additionalProperties":false,"definitions":{"create_trigger":{"type":"object","properties":{"name":{"type":"string","description":"The trigger's unique name within the namespace.","examples":["my trigger"]},"function":{"type":"string","description":"Name of function(action) that exists in the given namespace.","examples":["hello"]},"type":{"type":"string","description":"One of different type of triggers. Currently only SCHEDULED is supported.","examples":["SCHEDULED"]},"is_enabled":{"type":"boolean","description":"Indicates weather the trigger is paused or unpaused.","examples":[true]},"scheduled_details":{"$ref":"#/definitions/scheduled_details"}},"required":["name","function","type","is_enabled","scheduled_details"]},"scheduled_details":{"type":"object","description":"Trigger details for SCHEDULED type, where body is optional.\n","properties":{"cron":{"description":"valid cron expression string which is required for SCHEDULED type triggers.","type":"string","examples":["* * * * *"]},"body":{"description":"Optional data to be sent to function while triggering the function.","type":["object","null"],"properties":{"name":{"type":"string","examples":["Welcome to DO!"]}}}},"required":["cron"]}}},"name":"Create Trigger","id":"digitalocean.functions_create_trigger","example":{"path":{"namespace_id":"fn-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"},"body":{"name":"my trigger","function":"hello","type":"SCHEDULED","is_enabled":true,"scheduled_details":{"cron":"* * * * *"}}},"maxRequests":1,"summary":false}}