Skip to main content

deployments

Creates, updates, deletes, gets or lists a deployments resource.

Overview

Namedeployments
TypeResource
Iddeno.deployment.deployments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringA deployment ID Note that this is not UUID v4, as opposed to organization ID and project ID. (example: abcde12vwxyz)
createdAtstring (date-time) (example: 2021-08-01T00:00:00Z)
databasesobjectThe KV databases that this deployment has access to. Currently, only "default" database is supported.
descriptionstringThe description of this deployment. This is present only when the status is success. (example: My deployment)
domainsarray
permissionsobjectPermissions to be set for the deployment. Currently only net is supported, where you can specify a list of IP addresses and/or hostnames that the deployment is allowed to make outbound network requests to.
projectIdstring (uuid) (example: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11)
requestTimeoutinteger (int32)The wall-clock timeout in milliseconds for requests to the deployment. This becomes null when no timeout is set, or the deployment has not been done successfully yet.
statusstringThe status of a deployment. (example: success)
updatedAtstring (date-time) (example: 2021-08-01T00:00:00Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_deploymentsselectprojectIdpage, limit, q, sort, orderThis API returns a list of deployments belonging to the specified project in
a pagenated manner.

The URLs for the next, previous, first, and last page are returned in the
Link header of the response, if any.
get_deploymentselectdeploymentId
create_deploymentinsertprojectId, data__entryPointUrl, data__assets, data__envVarsThis API initiates a build process for a new deployment.

Note that this process is asynchronous; the completion of this API doesn't
mean the deployment is ready. In order to keep track of the progress of the
build, call the "Get build logs of a deployment" API or the "Get deployment
details" API.
delete_deploymentdeletedeploymentId
redeploy_deploymentexecdeploymentId

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deploymentIdstringDeployment ID
projectIdstring (uuid)Project ID
limitintegerThe maximum number of items to return per page.
orderstringSort order, either asc or desc. Defaults to asc.
pageintegerThe page number to return.
qstringQuery by deployment ID
sortstringThe field to sort by, either id or created_at. Defaults to created_at.

SELECT examples

This API returns a list of deployments belonging to the specified project in
a pagenated manner.

The URLs for the next, previous, first, and last page are returned in the
Link header of the response, if any.

SELECT
id,
createdAt,
databases,
description,
domains,
permissions,
projectId,
requestTimeout,
status,
updatedAt
FROM deno.deployment.deployments
WHERE projectId = '{{ projectId }}' -- required
AND page = '{{ page }}'
AND limit = '{{ limit }}'
AND q = '{{ q }}'
AND sort = '{{ sort }}'
AND order = '{{ order }}'
;

INSERT examples

This API initiates a build process for a new deployment.

Note that this process is asynchronous; the completion of this API doesn't
mean the deployment is ready. In order to keep track of the progress of the
build, call the "Get build logs of a deployment" API or the "Get deployment
details" API.

INSERT INTO deno.deployment.deployments (
data__entryPointUrl,
data__importMapUrl,
data__lockFileUrl,
data__compilerOptions,
data__assets,
data__domains,
data__envVars,
data__databases,
data__requestTimeout,
data__permissions,
data__description,
data__enableCron,
projectId
)
SELECT
'{{ entryPointUrl }}' /* required */,
'{{ importMapUrl }}',
'{{ lockFileUrl }}',
'{{ compilerOptions }}',
'{{ assets }}' /* required */,
'{{ domains }}',
'{{ envVars }}' /* required */,
'{{ databases }}',
{{ requestTimeout }},
'{{ permissions }}',
'{{ description }}',
{{ enableCron }},
'{{ projectId }}'
RETURNING
id,
createdAt,
databases,
description,
domains,
permissions,
projectId,
requestTimeout,
status,
updatedAt
;

DELETE examples

No description available.

DELETE FROM deno.deployment.deployments
WHERE deploymentId = '{{ deploymentId }}' --required
;

Lifecycle Methods

Success

EXEC deno.deployment.deployments.redeploy_deployment 
@deploymentId='{{ deploymentId }}' --required
@@json=
'{
"envVars": "{{ envVars }}",
"databases": "{{ databases }}",
"requestTimeout": {{ requestTimeout }},
"permissions": "{{ permissions }}",
"description": "{{ description }}"
}'
;