namespaces
Creates, updates, deletes, gets or lists a namespaces
resource.
Overview
Name | namespaces |
Type | Resource |
Id | digitalocean.functions.namespaces |
Fields
Name | Datatype | Description |
---|---|---|
api_host | string | The namespace's API hostname. Each function in a namespace is provided an endpoint at the namespace's hostname. |
created_at | string | UTC time string. |
key | string | A random alpha numeric string. This key is used in conjunction with the namespace's UUID to authenticate a user to use the namespace via doctl , DigitalOcean's official CLI. |
label | string | The namespace's unique name. |
namespace | string | A unique string format of UUID with a prefix fn-. |
region | string | The namespace's datacenter region. |
updated_at | string | UTC time string. |
uuid | string | The namespace's Universally Unique Identifier. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
functions_get_namespace | SELECT | namespace_id | Gets the namespace details for the given namespace UUID. To get namespace details, send a GET request to /v2/functions/namespaces/$NAMESPACE_ID with no parameters. |
functions_list_namespaces | SELECT |
| Returns a list of namespaces associated with the current user. To get all namespaces, send a GET request to /v2/functions/namespaces . |
functions_create_namespace | INSERT | data__label, data__region | Creates a new serverless functions namespace in the desired region and associates it with the provided label. A namespace is a collection of functions and their associated packages, triggers, and project specifications. To create a namespace, send a POST request to /v2/functions/namespaces with the region and label properties. |
functions_delete_namespace | DELETE | namespace_id | Deletes the given namespace. When a namespace is deleted all assets, in the namespace are deleted, this includes packages, functions and triggers. Deleting a namespace is a destructive operation and assets in the namespace are not recoverable after deletion. Some metadata is retained, such as activations, or soft deleted for reporting purposes. To delete namespace, send a DELETE request to /v2/functions/namespaces/$NAMESPACE_ID . A successful deletion returns a 204 response. |
SELECT
examples
Returns a list of namespaces associated with the current user. To get all namespaces, send a GET request to /v2/functions/namespaces
.
SELECT
api_host,
created_at,
key,
label,
namespace,
region,
updated_at,
uuid
FROM digitalocean.functions.namespaces
;
INSERT
example
Use the following StackQL query and manifest file to create a new namespaces
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO digitalocean.functions.namespaces (
data__region,
data__label
)
SELECT
'{{ region }}',
'{{ label }}'
;
- name: namespaces
props:
- name: data__label
value: string
- name: data__region
value: string
- name: region
value: string
- name: label
value: string
DELETE
example
Deletes the specified namespaces
resource.
/*+ delete */
DELETE FROM digitalocean.functions.namespaces
WHERE namespace_id = '{{ namespace_id }}';