Skip to content

Commit

Permalink
updating subhosting doc navigation, moving resources to API section
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisjofrank committed May 3, 2024
1 parent e1293ce commit 691e51f
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 68 deletions.
35 changes: 2 additions & 33 deletions sidebars/subhosting.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,48 +22,17 @@ const sidebars = {
label: "Planning your implementation",
id: "manual/planning_your_implementation",
},
{
type: "doc",
label: "Subhosting Usecases",
id: "manual/usecases",
},

{
type: "html",
value: "<div>Subhosting Platform</div>",
value: "<div>REST API</div>",
className: "section-header",
},
{
type: "doc",
label: "Organizations",
label: "Resources",
id: "manual/subhosting",
},
{
type: "link",
label: "Projects",
href: "/subhosting/manual/subhosting#projects",
},
{
type: "link",
label: "Deployments",
href: "/subhosting/manual/subhosting#deployments",
},
{
type: "link",
label: "Custom Domains",
href: "/subhosting/manual/subhosting#domains",
},
{
type: "link",
label: "Connecting a Database",
href: "/subhosting/manual/subhosting#database",
},
"manual/events",
{
type: "html",
value: "<div>REST API</div>",
className: "section-header",
},
"api/index",
{
type: "link",
Expand Down
17 changes: 1 addition & 16 deletions subhosting/api/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Subhosting REST API
# Authentication

Developers can provision projects, domains, KV databases, and other resources
using the Subhosting REST API.
Expand Down Expand Up @@ -42,18 +42,3 @@ const res = await fetch(
const response = await res.json();
console.log(response);
```

## OpenAPI specification and tooling

The [OpenAPI specification](https://www.openapis.org/) for the Deploy API can be
found here:

```console
https://api.deno.com/v1/openapi.json
```

This spec document can be used with a
[large number of OpenAPI-compatible tools](https://openapi.tools/). In addition
to the documentation for the REST API maintained here, you can find
auto-generated API documentation (including a browser-based testing tool)
[here](https://apidocs.deno.com/).
10 changes: 5 additions & 5 deletions subhosting/manual/planning_your_implementation.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Planning your implementation

For example - let's say that you were building a SaaS CRM platform like
Salesforce, and you wanted to empower your customers to write JavaScript code
that would be executed every time a new lead was captured.
Let's say, for example, that you are building a SaaS CRM platform like
Salesforce. You want to empower your customers to write JavaScript code that
would be executed every time a new lead was captured.

If you were going to implement this feature using Deno Deploy, here's how you
might think about building it:
Expand All @@ -26,8 +26,8 @@ Let's look at an example of the API endpoint required to make this happen.

## Creating a deployment for a project

In the [previous chapter](./quick_start.md), you created a new project and
noted its `id` property. In the example in the previous chapter, the ID was:
In the [previous chapter](./quick_start.md), you created a new project and noted
its `id` property. In the example in the previous chapter, the ID was:

```console
f084712a-b23b-4aba-accc-3c2de0bfa26a
Expand Down
15 changes: 10 additions & 5 deletions subhosting/manual/pricing_and_limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@

## Deployment size

Deployments should be less than 1GB across all source code and assets in aggregate, per deployment.
Deployments should be less than 1GB across all source code and assets in
aggregate, per deployment.

## Deployment frequency

Bert to define, varies based on pricing tier.
The maximum number of deployments per hour that a subhosting user can make is
either 60 (on the free tier) or 300 (on the builder tier). Higher limits are
available for organizations on the enterprise plan.

## CPU time per request

* 50ms or 200ms, depending on tier.
* CPU time limit per request is limited on the average across many requests. It is not strictly enforced on a per-request basis.
* Does not include time that a deployment is waiting for I/O (e.g. while waiting for the remote server while making a fetch() request)
- 50ms or 200ms, depending on tier.
- CPU time limit per request is limited on the average across many requests. It
is not strictly enforced on a per-request basis.
- Does not include time that a deployment is waiting for I/O (e.g. while waiting
for the remote server while making a fetch() request)

## Blocking the event loop

Expand Down
3 changes: 1 addition & 2 deletions subhosting/manual/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const dr = await fetch(`${API}/projects/${project.id}/deployments`, {
console.log(dr.status);
```

<br/>
<a name="getting_started"></a>

## Getting started with subhosting
Expand All @@ -54,7 +53,7 @@ instructions to create a new organization for subhosting.

Going through the onboarding flow, you will likely also generate an **access
token**, which you will use to access the [REST API](../api/index.md). If you
didn't do this (or lost the token you generated), you can
didn't do this (or your token has expired), you can
[generate a new one here](https://dash.deno.com/account#access-tokens).

:::caution Save your token in a safe place
Expand Down
30 changes: 23 additions & 7 deletions subhosting/manual/subhosting.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Subhosting Concepts
# Subhosting Resources

To build Subhosting with Deno Deploy, it helps to understand some key resources
within the system. These resources are also represented in the
[REST API](../api/index.md).

![overview of subhosting resources](./subhosting-org-structure.svg)

<a style={{height: '3rem', display: 'block'}} id="organizations"></a>
<a id="organizations"></a>

## Organizations

Expand All @@ -22,7 +22,7 @@ with organization access the ability to modify resources within the org via API.
New organizations can be created in the
[Deploy dashboard](https://dash.deno.com/orgs/new).

<a style={{height: '3rem', display: 'block'}} id="projects"></a>
<a id="projects"></a>

## Projects

Expand All @@ -42,7 +42,7 @@ minute granularity.
> if you have multiple tenants we recommend setting up a project for each.
> Particularly if you expect to bill your users for their usage.
<a style={{height: '3rem', display: 'block'}} id="deployments"></a>
<a id="deployments"></a>

## Deployments

Expand Down Expand Up @@ -79,7 +79,7 @@ deployments and make them unreachable.
> and then remap its domain to the new deployment. The redeploy endpoint can
> create a new deployment from an existing one with different settings.
<a style={{height: '3rem', display: 'block'}} id="domains"></a>
<a id="domains"></a>

## Custom domains

Expand Down Expand Up @@ -107,9 +107,9 @@ automatically turned into production deployments. Although subhosting does not
provide github integration out of the box, it has all the primitives you need to
define your own semantics for creating preview and production deployments.

<a style={{height: '3rem', display: 'block'}} id="database"></a>
<a id="database"></a>

## Connecting a Database
## Connecting a KV Database

A (KV) database stores key-value pairs You can make a database accessible to a
deployment when you make the deployment. KV databases can be used by multiple
Expand All @@ -122,3 +122,19 @@ To use KV with Subhosting:
you created.

> NB. Deno Cron and Queues do not currently work for Subhosting.

## OpenAPI specification and tooling

The [OpenAPI specification](https://www.openapis.org/) for the Deploy API can be
found here:

```console
https://api.deno.com/v1/openapi.json
```

This spec document can be used with a
[large number of OpenAPI-compatible tools](https://openapi.tools/). In addition
to the documentation for the REST API maintained here, you can find
auto-generated API documentation (including a browser-based testing tool)
[here](https://apidocs.deno.com/).

0 comments on commit 691e51f

Please sign in to comment.