pydo.functions.list_triggers()

Description

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.

Parameters

Name Type Required Description Default Value
namespace_id string True The ID of the namespace to be managed.

Request Sample

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

resp = client.functions.list_triggers(namespace_id="39f3ca")

Responses

See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.

An array of JSON objects with a key called namespaces. Each object represents a namespace and contains the properties associated with it.

Click to expand an example response.
{
  "triggers": [
    {
      "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"
      }
    },
    {
      "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"
      }
    }
  ]
}

Unauthorized

Click to expand an example response.
{
  "id": "unauthorized",
  "message": "Unable to authenticate you."
}

Bad Request.

Click to expand an example response.
{
  "id": "not_found",
  "message": "namespace not found",
  "request_id": "88d17b7a-630b-4083-99ce-5b91045efdb4"
}

API Rate limit exceeded

Click to expand an example response.
{
  "id": "too_many_requests",
  "message": "API Rate limit exceeded."
}

Server error.

Click to expand an example response.
{
  "id": "server_error",
  "message": "Unexpected server-side error"
}

Unexpected error

Click to expand an example response.
{
  "id": "example_error",
  "message": "some error message"
}