Skip to content

Commit

Permalink
update subhosting REST API content (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwhinnery authored Jan 10, 2024
1 parent 24e66d0 commit e61e4e4
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 2,302 deletions.
44 changes: 44 additions & 0 deletions deploy/api/rest/databases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import OpenApiEndpoint from "@site/src/components/OpenApiEndpoint";

# Databases

Database resources are [Deno KV databases](/kv/manual) that can be associated
with [deployments](./deployments.md). You can specify which databases are
available to which deployments, so you can isolate data or share data between
deployments.

## List an organization's KV databases

<OpenApiEndpoint path="/organizations/{organizationId}/databases" method="get">
<p>
This API returns a list of KV databases belonging to the specified organization in a paginated manner. The URLs for the next, previous, first, and last page are returned in the Link header of the response, if any.
</p>
</OpenApiEndpoint>

<!-- deno-fmt-ignore-end -->

## Create a KV database

<!-- deno-fmt-ignore-start -->

<OpenApiEndpoint path="/organizations/{organizationId}/databases" method="post">
<p>
This API allows you to create a new KV database under the specified organization.
You will then be able to associate the created KV database with a new deployment by specifying the KV database ID in the
<a href="./deployments">Create a deployment</a> API call.
</p>
</OpenApiEndpoint>

<!-- deno-fmt-ignore-end -->

## Update a KV database

<!-- deno-fmt-ignore-start -->

<OpenApiEndpoint path="/databases/{databaseId}" method="patch">
<p>
Update a KV database's details.
</p>
</OpenApiEndpoint>

<!-- deno-fmt-ignore-end -->
21 changes: 21 additions & 0 deletions deploy/api/rest/deployments.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,34 @@ Below is an example of `assets` that could be used to set up a deployment.
}
```

## List deployments for a project

<OpenApiEndpoint path="/projects/{projectId}/deployments" method="get">
Get a paginated list of deployments belonging to the specified project. The
URLs for the next, previous, first, and last page are returned in the
<code>Link</code> header of the response if needed.
</OpenApiEndpoint>

## Get deployment details

<OpenApiEndpoint path="/deployments/{deploymentId}" method="get">
Get details for a deployment with the given ID. This endpoint can be polled
to track the results of a serverless app deployment.
</OpenApiEndpoint>

## Redeploy a deployment with new configuration

<OpenApiEndpoint path="/deployments/{deploymentId}/redeploy" method="post">
Redeploy a deployment with different configuration. Useful for updating
environment variables and assigned KV databases.
</OpenApiEndpoint>

## Delete a deployment

<OpenApiEndpoint path="/deployments/{deploymentId}" method="delete">
Delete a deployment.
</OpenApiEndpoint>

## Get deployment build logs

<OpenApiEndpoint path="/deployments/{deploymentId}/build_logs" method="get">
Expand Down
15 changes: 0 additions & 15 deletions deploy/api/rest/organizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,6 @@ access.
Get analytics information for an organization.
</OpenApiEndpoint>

## List projects for an organization

<OpenApiEndpoint path="/organizations/{organizationId}/projects" method="get">
Get a paginated list of Projects for an organization. Links to the first,
last, next, and previous pages of results are found in the <code>Link</code>
&nbsp;header of the response.
</OpenApiEndpoint>

## Create a new project for an organization

<OpenApiEndpoint path="/organizations/{organizationId}/projects" method="post">
Create a new project within the given organization. A project is a container
for deployments, and can be associated with domains and KV databases.
</OpenApiEndpoint>

## List an organization's KV databases

<OpenApiEndpoint path="/organizations/{organizationId}/databases" method="get">
Expand Down
23 changes: 15 additions & 8 deletions deploy/api/rest/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ import OpenApiEndpoint from "@site/src/components/OpenApiEndpoint";
Projects are a container for deployments, and can be associated with domains and
KV databases in an organization.

## List projects for an organization

<OpenApiEndpoint path="/organizations/{organizationId}/projects" method="get">
Get a paginated list of Projects for an organization. Links to the first,
last, next, and previous pages of results are found in the <code>Link</code>
&nbsp;header of the response.
</OpenApiEndpoint>

## Create a new project for an organization

<OpenApiEndpoint path="/organizations/{organizationId}/projects" method="post">
Create a new project within the given organization. A project is a container
for deployments, and can be associated with domains and KV databases.
</OpenApiEndpoint>

## Get project details

<OpenApiEndpoint path="/projects/{projectId}" method="get">
Expand All @@ -30,11 +45,3 @@ KV databases in an organization.
time series data in 15 minute intervals, with the <code>time</code> field
representing the start of the interval.
</OpenApiEndpoint>

## Get project deployments

<OpenApiEndpoint path="/projects/{projectId}/deployments" method="get">
Get a paginated list of deployments belonging to the specified project. The
URLs for the next, previous, first, and last page are returned in the
<code>Link</code> header of the response if needed.
</OpenApiEndpoint>
3 changes: 2 additions & 1 deletion sidebars/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,11 @@ const sidebars = {
label: "Overview",
id: "api/rest/index",
},
"api/rest/organizations",
"api/rest/projects",
"api/rest/deployments",
"api/rest/domains",
"api/rest/databases",
"api/rest/organizations",
{
type: "html",
value: '<div style="height: 30px;"></div>',
Expand Down
Loading

0 comments on commit e61e4e4

Please sign in to comment.