Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make admonitions use InlineAlert component #128

Merged
merged 5 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/api/howtos/change-systemsoftware-version.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ import OperationHint from "@site/src/components/OperationHint";

## Prerequisites

This article assumes that you have already created an app installation and that you have the ID of that app installation. You can also use the <OperationLink tag="App" operation="app-get-appinstallation">`GET /v2/appinstallations/{appInstallationId}` endpoint</OperationLink> to inspect the current configuration of said app installation. Relevant for this article is the `.systemSoftware` property, which is a map that contains the ID of the system software (as key) and the version that is currently installed.
This article assumes that you have already created an app installation and that you have the ID of that app installation. You can also use the <OperationLink tag="App" operation="app-get-appinstallation" /> endpoint to inspect the current configuration of said app installation. Relevant for this article is the `.systemSoftware` property, which is a map that contains the ID of the system software (as key) and the version that is currently installed.

## Determine the system software and version IDs

First, you need to determine the IDs of the system software and the version you want to change to. You can do this by calling the <OperationLink tag="App" operation="app-list-systemsoftwares">`GET /v2/systemsoftwares` endpoint</OperationLink> and filtering the result set by the desired `.name` property.
First, you need to determine the IDs of the system software and the version you want to change to. You can do this by calling the <OperationLink tag="App" operation="app-list-systemsoftwares" /> endpoint and filtering the result set by the desired `.name` property.

Using that ID, you can then call the <OperationLink tag="App" operation="app-list-systemsoftwareversions">`GET /v2/systemsoftwares/{systemSoftwareId}/versions` endpoint</OperationLink> to get a list of all available versions for that system software. To only select specific versions, you can use the `versionRange` query parameter. This parameter accepts any valid [semantic versioning constraint](https://devhints.io/semver), like `>= 14.0.0` or `^14.0.0`.
Using that ID, you can then call the <OperationLink tag="App" operation="app-list-systemsoftwareversions" /> endpoint to get a list of all available versions for that system software. To only select specific versions, you can use the `versionRange` query parameter. This parameter accepts any valid [semantic versioning constraint](https://devhints.io/semver), like `>= 14.0.0` or `^14.0.0`.

## Changing the system software version

To change the system software version, use the <OperationLink tag="App" operation="app-patch-appinstallation">`PATCH /v2/appinstallations/{appinstallationId}` endpoint</OperationLink>. You only need to provide the `.systemSoftware` property in the request body, which should contain the ID of the system software and the version you want to change to:
To change the system software version, use the <OperationLink operation="app-patch-appinstallation" />. You only need to provide the `.systemSoftware` property in the request body, which should contain the ID of the system software and the version you want to change to:

```
PATCH /v2/appinstallations/{appInstallationId} HTTP/1.1
Expand Down
9 changes: 5 additions & 4 deletions docs/api/howtos/create-nodejs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tags:
---

import OperationHint from "@site/src/components/OperationHint";
import OperationLink from "@site/src/components/OperationLink";

## Prerequisites

Expand All @@ -20,18 +21,18 @@ To install a Node.js or Python application, you will need to have the following:

Before installing a Node.js or Python application, you will need to determine the application ID and version ID of the generic custom Node.js (or Python, respectively) application.

For this, call the `/v2/apps` endpoint, and find the "Node.js" or "Python" application. These should have the following stable IDs:
For this, call the <OperationLink operation="app-list-apps" /> endpoint, and find the "Node.js" or "Python" application. These should have the following stable IDs:

- Node.js: `3e7f920b-a711-4d2f-9871-661e1b41a2f0`
- Python: `be57d166-dae9-4480-bae2-da3f3c6f0a2e`

Use the respective ID, depending on whether you want to install a Node.js or Python application. You can then use that ID to retrieve the recommended version to install for this app, by calling the `/v2/apps/{appID}/versions` endpoint. You can filter the returned versions by the `recommended` property.
Use the respective ID, depending on whether you want to install a Node.js or Python application. You can then use that ID to retrieve the recommended version to install for this app, by calling the <OperationLink operation="app-list-appversions" /> endpoint. You can filter the returned versions by the `recommended` property.

Please note that the actual version is rather inconsequential, as it refers only to the starter template used to create the application. The actual version of the application will be determined by your own code.

## Install the application

To deploy your application, you will need to call the `POST /v2/projects/{projectID}/appinstallations` endpoint. The relevant fields are the following:
To deploy your application, you will need to call the <OperationLink operation="app-request-appinstallation" /> endpoint. The relevant fields are the following:

- `appVersionId` needs to be the app version ID that you retrieved in the previous step.
- `userInputs` needs to be an array of objects, each containing a `name` and `value` property. The allowed values for `name` are contained in the `userInputs` array of the app version object. In the case of Node.js, the only allowed value is `entrypoint`, which is the command that will be run to start your application.
Expand All @@ -58,4 +59,4 @@ The response will contain the installation ID, that you can subsequently use to

<OperationHint tag="App" operation="app-request-appinstallation" />

To observe the installation status, you can call the `/v2/appinstallations/{installationID}` endpoint. Pay special attention to the `installationPath` field; this will contain the directory in your project file system that you should deploy your application to.
To observe the installation status, you can call the <OperationLink operation="app-get-appinstallation" /> endpoint. Pay special attention to the `installationPath` field; this will contain the directory in your project file system that you should deploy your application to.
7 changes: 4 additions & 3 deletions docs/api/howtos/create-php.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tags:
---

import OperationHint from "@site/src/components/OperationHint";
import OperationLink from "@site/src/components/OperationLink";

## Prerequisites

Expand All @@ -19,13 +20,13 @@ To install a PHP application, you will need to have the following:

Before installing a PHP application, you will need to determine the application ID and version ID of the generic custom PHP application.

For this, call the `/v2/apps` endpoint, and find the "PHP" application. It should have a stable ID of `34220303-cb87-4592-8a95-2eb20a97b2ac`. You can then use that ID to retrieve the recommended version to install for this app, by calling the `/v2/apps/{appID}/versions` endpoint. You can filter the returned versions by the `recommended` property.
For this, call the <OperationLink operation="app-list-apps" /> endpoint, and find the "PHP" application. It should have a stable ID of `34220303-cb87-4592-8a95-2eb20a97b2ac`. You can then use that ID to retrieve the recommended version to install for this app, by calling the <OperationLink operation="app-list-appversions" /> endpoint. You can filter the returned versions by the `recommended` property.

Please note that the actual version is rather inconsequential, as it refers only to the starter template used to create the application. The actual version of the application will be determined by your own code.

## Install the application

To deploy your application, you will need to call the `POST /v2/projects/{projectID}/appinstallations` endpoint. The relevant fields are the following:
To deploy your application, you will need to call the <OperationLink operation="app-request-appinstallation" /> endpoint. The relevant fields are the following:

- `appVersionId` needs to be the app version ID that you retrieved in the previous step.
- `updatePolicy` needs to be set to `none`, as you will typically want to update your application by yourself.
Expand All @@ -47,4 +48,4 @@ The response will contain the installation ID, that you can subsequently use to

<OperationHint tag="App" operation="app-request-appinstallation" />

To observe the installation status, you can call the `/v2/appinstallations/{installationID}` endpoint. Pay special attention to the `installationPath` field; this will contain the directory in your project file system that you should deploy your application to.
To observe the installation status, you can call the <OperationLink operation="app-get-appinstallation" /> endpoint. Pay special attention to the `installationPath` field; this will contain the directory in your project file system that you should deploy your application to.
8 changes: 4 additions & 4 deletions docs/api/howtos/create-project.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ There are different ways to deploy a new project:

### …on a server

To create a project on an existing server, you will require that server’s ID. You can find all servers you have access to using the <OperationLink tag="Project" operation="project-list-servers">`GET /v2/servers` API endpoint</OperationLink>.
To create a project on an existing server, you will require that server’s ID. You can find all servers you have access to using the <OperationLink operation="project-list-servers" /> endpoint.

To create a new project, send a `POST` request to the `/v2/placementgroups/{serverId}/projects` endpoint. The request body must contain a JSON object with the following properties:
To create a new project, send a request to the <OperationLink operation="project-create-project" /> endpoint. The request body must contain a JSON object with the following properties:

- `description` should contain a human-readable description of the project. This is a required value.

The response, when successful, will contain a JSON object with the following properties:

- `id` is the ID of the newly created project.

<OperationHint tag="Project" operation="project-create-project" />
<OperationHint operation="project-create-project" />

### …as a stand-alone project

Expand All @@ -43,7 +43,7 @@ Creating stand-alone projects is not supported, as of yet.

## Observing project readiness

A newly created project will not be available immediately (however, it should be available within a few seconds). To check whether a project is ready, send a `GET` request to the `/v2/projects/{projectID}` endpoint. Among other properties, the response will contain an `isReady` property. This property will be `true` when the project is ready, and `false` otherwise.
A newly created project will not be available immediately (however, it should be available within a few seconds). To check whether a project is ready, send a request to the <OperationLink operation="project-get-project" /> endpoint. Among other properties, the response will contain an `isReady` property. This property will be `true` when the project is ready, and `false` otherwise.

<OperationHint tag="Project" operation="project-get-project" />

Expand Down
8 changes: 4 additions & 4 deletions docs/api/howtos/create-redis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ To create a Redis database, you will need to have access to a project. Refer to

## List available Redis versions

Set a `GET` request to the `/v2/redis-versions` endpoint to get a list of available Redis versions. (<OperationLink tag="database" operation="database-list-redis-versions">endpoint documentation for `database-list-redis-versions`</OperationLink>)
Set a request to the <OperationLink operation="database-list-redis-versions" /> endpoint to get a list of available Redis versions.

## Creating a Redis database

To create a Redis database, send a `POST` request to the `/v2/projects/{projectID}/redis-databases` endpoint. The request body must contain a JSON object with the following properties:
To create a Redis database, send a request to the <OperationLink operation="database-create-redis-database" /> endpoint. The request body must contain a JSON object with the following properties:

- `description` should contain a human-readable description of the database. This is a required value.
- `version` should contain the version of the database. This is a required value, and must reference an existing version as returned by the `/v2/redis-versions` endpoint.
- `version` should contain the version of the database. This is a required value, and must reference an existing version as returned by the <OperationLink operation="database-list-redis-versions" /> endpoint.

The response will contain the following properties:

Expand All @@ -35,7 +35,7 @@ The response will contain the following properties:

## Accessing the database

After creating a database, you can send a `GET` request to the `/v2/redis-databases/{id}` route.
After creating a database, you can send a request to the <OperationLink operation="database-get-redis-database" /> route.

Among others, the response will contain the following values:

Expand Down
13 changes: 8 additions & 5 deletions docs/api/howtos/manage-mailbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tags:
---

import OperationHint from "@site/src/components/OperationHint";
import OperationLink from "@site/src/components/OperationLink";
import SchemaFromSpec from "@site/src/components/openapi/SchemaFromSpec";

## Types of mailboxes
Expand All @@ -23,7 +24,7 @@ To manage email accounts, you will need an existing project. You can create a ne

## Create a new email account

To create a new email account, send a `POST` request to the `/v2/projects/{projectID}/mailaddresses` endpoint. The request body must contain a JSON object with the following properties:
To create a new email account, send a request to the <OperationLink operation="mail-create-mail-address" /> endpoint. The request body must contain a JSON object with the following properties:

<SchemaFromSpec
apiVersion="v2"
Expand All @@ -37,11 +38,11 @@ Take note of the password you set for the email account. You will not be able to

:::

<OperationHint tag="Mail" operation="mail-create-mail-address" />
<OperationHint operation="mail-create-mail-address" />

## Create a new forwarding address

A forwarding address is an email address that forwards all incoming emails to one or more other email addresses. To create a new forwarding address, send a `POST` request to the `/v2/projects/{projectID}/mailaddresses` endpoint. The request body must contain a JSON object with the following properties:
A forwarding address is an email address that forwards all incoming emails to one or more other email addresses. To create a new forwarding address, send a request to the <OperationLink operation="mail-create-mail-address" /> endpoint. The request body must contain a JSON object with the following properties:

<SchemaFromSpec
apiVersion="v2"
Expand All @@ -51,7 +52,7 @@ A forwarding address is an email address that forwards all incoming emails to on

## Create a new delivery box

A delivery box is an email address that can be used to send emails from a web application or a script. To create a new delivery box, send a `POST` request to the `/v2/projects/{projectID}/deliveryboxes` endpoint. The request body must contain a JSON object with the following properties:
A delivery box is an email address that can be used to send emails from a web application or a script. To create a new delivery box, send a request to the <OperationLink operation="mail-create-deliverybox" /> endpoint. The request body must contain a JSON object with the following properties:

- `description` (string, required): A description for the delivery box. This description will be displayed in the web interface.
- `password` (string, required): The password for the delivery box. This password will be used to authenticate against the SMTP server.
Expand All @@ -66,4 +67,6 @@ Take note of the password you set for the delivery box. You will not be able to

## Deleting email accounts

To delete an email address or a delivery box, send a `DELETE` request to the `/v2/mailaddresses/{id}` or `/v2/deliveryboxes/{id}` endpoint, respectively. The `id` parameter must contain the ID of the email address or delivery box you want to delete. No request body is needed.
To delete an email address or a delivery box, send a request to the <OperationLink operation="mail-delete-mail-address" /> or <OperationLink operation="mail-delete-delivery-box" /> endpoint, respectively. The `id` parameter must contain the ID of the email address or delivery box you want to delete. No request body is needed.

<OperationHint tag="Mail" operation={["mail-delete-mail-address", "mail-delete-delivery-box"]} />
6 changes: 4 additions & 2 deletions docs/api/intro.md → docs/api/intro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ description: |
This page provides an introduction to the mStudio v2 API and its concepts.
---

import OperationLink from "@site/src/components/OperationLink";

## Base URLs

The mStudio v2 API uses `https://api.mittwald.de/v2/` as base URL for all API endpoints.
Expand All @@ -23,10 +25,10 @@ You can find the full API specification in the [OpenAPI 3.0 format](https://spec
To authenticate to the API, you will need an **API Token**. You can obtain one either via the mittwald mStudio Web UI or via the API itself (if you already have another API token).

1. **In the UI**, go to your user profile and choose the [API tokens](https://studio.mittwald.de/app/profile/api-tokens) menu item.
2. Alternatively, **via the API**, use the `/v2/signup/token/api` endpoint. This requires you to already have an existing API token:
2. Alternatively, **via the API**, use the <OperationLink operation="user-create-api-token" /> endpoint. This requires you to already have an existing API token:

```http
POST /v2/signup/token/api HTTP/1.1
POST /v2/users/self/api-tokens HTTP/1.1
Host: api.mittwald.de
Content-Type: application/json
Authorization: Bearer <EXISTING_API_TOKEN>
Expand Down
12 changes: 12 additions & 0 deletions i18n/de/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,9 @@
"components.OperationHint.text": {
"message": "Für Details siehe auch die Endpoint-Dokumentation für den folgenden API-Endpoint"
},
"components.OperationHint.text.plural": {
"message": "Für Details siehe auch die Endpoint-Dokumentationen für die folgenden API-Endpoints"
},
"theme.admonition.warning": {
"message": "warnung",
"description": "The default label used for the Warning admonition (:::warning)"
Expand Down Expand Up @@ -450,5 +453,14 @@
},
"openapi.example": {
"message": "Beispiel"
},
"openapi.operation.metadata.deprecationnotice.text": {
"message": "This operation is deprecated and should not be used anymore. Please refer to this operation's description for alternatives."
},
"components.OperationHint.heading.plural": {
"message": "components.OperationHint.heading.plural"
},
"components.OperationHint.heading": {
"message": "components.OperationHint.heading"
}
}
Loading