Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

Commit

Permalink
chore: work on http docs (which http service isn't available lmao)
Browse files Browse the repository at this point in the history
  • Loading branch information
auguwu authored Dec 8, 2021
1 parent 6c4a7ca commit 7064034
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions docs/http.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: HTTP Interface
description: Describes on how the HTTP service works with Kanata

---

Kanata has a HTTP overlay using [rocket](https://rocket.rs), it have a RESTful API and an administration dashboard for authorized users to access
and check on the state of Kanata, and this is a reference sheet on the RESTful API.

## Authentication
Authentication is not usually required to query pods that Kanata is managing, but for the administration dashboard, you will have to authenticate
with a email and password defined in **/opt/noel/kanata/users.yml**:

```yml
users:
- <username>: <password>
```
To generate a password, you can run the `create-user` command with the **kanata** binary to add it to `users.yml`:

```sh
$ kanata create-user <user> <password>
```

> {{warn}} (If `user` and/or `password` are not added, it will be prompted.) {{/warn}}

Now, you can login at `http://localhost:2934/admin` to go in and view it!

## Routes
All routes will be prefixed with `/{version}` depending on version changes and releases.

| Version | Available? |
|---------|------------|
| `v1` | Yes |

### %{path: /, method: GET}
> Returns the base endpoint, which will return a JSON object.

#### Responses
##### 200

```json
{
"hello": "world",
"version": "v{version} (commit: {commit}, build date: {build-date})"
}
```

### %{path: /pods, method: GET}
> Returns the list of the in-memory cached pods available.

#### Responses
##### 503
> If the server is still bootstrapping the Kubernetes service.

##### 200
> Returns a JSON array of a [Pod](/types/pod) available.

### %{path: /pods/watch, method: GET}
> Creates a stream of the pods watching, read more on the [Watching](/watching) guide on how to.

0 comments on commit 7064034

Please sign in to comment.