Alexander Belanger пре 5 година
родитељ
комит
4a5d3cf22f
1 измењених фајлова са 92 додато и 0 уклоњено
  1. 92 0
      docs/API.md

+ 92 - 0
docs/API.md

@@ -13,6 +13,8 @@
   - [`POST /api/logout`](#post-apilogout)
   - [`PUT /api/users/{id}`](#put-apiusersid)
   - [`DELETE /api/users/{id}`](#delete-apiusersid)
+- [`/api/charts`](#apicharts)
+  - [`GET /api/charts`](#get-apicharts)
 
 ### Overview
 
@@ -392,3 +394,93 @@ User{
     }
     ```
 
+### `/api/charts`
+
+#### `GET /api/charts`
+
+**Description:** Gets a list of charts for a current context and a kubeconfig retrieved from the user's ID. 
+
+**URL parameters:** N/A
+
+**Query parameters:** N/A
+
+**Request Body**:
+
+```js
+{
+  "user_id": Number,
+  "helm": {
+    // The namespace of the cluster to be used
+    "namespace": String,
+    // The name of the context in the kubeconfig being used
+    "context": String,
+    // The Helm storage option to use
+    "storage": String("secret"|"configmap"|"memory")
+  },
+  "filter": {
+    "namespace": String,
+    "limit": Number,
+    "skip": Number,
+    "byDate": Boolean,
+    "statusFilter": []String
+  }
+}
+```
+
+**Successful Response Body**: the full body is determined by the [release specification](https://pkg.go.dev/helm.sh/helm/v3@v3.3.4/pkg/release#Release): listed here is a subset of fields deemed to be most relevant. Note that all of the top-level fields are optional.
+
+```js
+{
+  // Name is the name of the release
+  "name": String,
+  "info": Info{
+    // LastDeployed is when the release was last deployed.
+    "last_deployed": String,
+    // Deleted tracks when this object was deleted.
+    "deleted": String,
+    // Description is human-friendly "log entry" about this release.
+    "description": String,
+    // Status is the current state of the release
+    "status": String("unknown"|"deployed"|"uninstalled"|"superseded"|"failed"|"uninstalling"|"pending-install"|"pending-upgrade"|"pending-rollback")
+  },
+  "chart": Chart{
+    "metadata": Metadata{
+      // The name of the chart
+      "name": String,
+      // The URL to a relevant project page, git repo, or contact person
+      "home": String,
+      // Sources is a list of URLs to the source code of this chart
+      "sources": []String,
+      // A SemVer 2 conformant version string of the chart
+      "version": String,
+      // A one-sentence description of the chart
+      "description": String,
+      // The URL to an icon file.
+      "icon": String,
+      // The API Version of this chart.
+      "apiVersion": String,
+    },
+    "templates": []File{
+      // Name is the path-like name of the template.
+      "name": String,
+      // Data is the template as byte data.
+      "data": String
+    },
+    // Values are default config for this chart.
+    "values": Map[String]{}
+  },
+  // The set of extra Values added to the chart, which override the 
+  // default values inside of the chart
+  "config": Map[String]{},
+  // Manifest is the string representation of the rendered template
+  "manifest": String,
+  // Version is an int which represents the revision of the release.
+  "version": Number,
+  // Namespace is the kubernetes namespace of the release.
+  "namespace": String
+}
+```
+
+**Successful Status Code**: `200`
+
+**Errors:** TBD