From e0d5a84f5e8a04a6ff90f3fa460839489a434c89 Mon Sep 17 00:00:00 2001 From: hongming Date: Fri, 5 Jul 2019 18:18:57 +0800 Subject: [PATCH 1/2] docs: update api docs Signed-off-by: hongming --- pkg/models/applications/applications.go | 2 +- pkg/simple/client/openpitrix/applications.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/models/applications/applications.go b/pkg/models/applications/applications.go index 80fb63528..6fca03dd1 100644 --- a/pkg/models/applications/applications.go +++ b/pkg/models/applications/applications.go @@ -41,7 +41,7 @@ type Application struct { Name string `json:"name" description:"application name"` RepoName string `json:"repoName" description:"repo name"` Runtime string `json:"namespace" description:"namespace"` - RuntimeId string `json:"runtime_id" description:"runtime id"` + RuntimeId string `json:"runtime_id" description:"originates from OpenPitrix and represents k8s namespace, it's the value of the annotation in each namespace, e.g. openpitrix_runtime: runtime-xEg1LGZQYN93"` Version string `json:"version" description:"application version"` VersionId string `json:"version_id" description:"application version id"` Status string `json:"status" description:"application status"` diff --git a/pkg/simple/client/openpitrix/applications.go b/pkg/simple/client/openpitrix/applications.go index 71f86a0c0..1326ba54c 100644 --- a/pkg/simple/client/openpitrix/applications.go +++ b/pkg/simple/client/openpitrix/applications.go @@ -102,14 +102,14 @@ type repoList struct { } type CreateClusterRequest struct { - AppId string `json:"app_id"` - VersionId string `json:"version_id"` - RuntimeId string `json:"runtime_id"` - Conf string `json:"conf"` + AppId string `json:"app_id" description:"ID of app to run in cluster, e.g. app-AA3A3y3zEgEM"` + VersionId string `json:"version_id" description:"app version, e.g. appv-154gXYx5RKRp"` + RuntimeId string `json:"runtime_id" description:"ID of runtime, e.g. runtime-wWwXL0LzWqEr"` + Conf string `json:"conf" description:"conf a json string, include cpu, memory info of cluster"` } type DeleteClusterRequest struct { - ClusterId []string `json:"cluster_id"` + ClusterId []string `json:"cluster_id" description:"cluster ID"` } func GetAppInfo(appId string) (string, string, string, error) { From 08e801a57330961d300304052799115fb5e09563 Mon Sep 17 00:00:00 2001 From: rayzhou2017 Date: Fri, 5 Jul 2019 20:17:44 +0800 Subject: [PATCH 2/2] Update applications.go --- pkg/models/applications/applications.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/models/applications/applications.go b/pkg/models/applications/applications.go index 6fca03dd1..a800ffd9d 100644 --- a/pkg/models/applications/applications.go +++ b/pkg/models/applications/applications.go @@ -40,8 +40,8 @@ import ( type Application struct { Name string `json:"name" description:"application name"` RepoName string `json:"repoName" description:"repo name"` - Runtime string `json:"namespace" description:"namespace"` - RuntimeId string `json:"runtime_id" description:"originates from OpenPitrix and represents k8s namespace, it's the value of the annotation in each namespace, e.g. openpitrix_runtime: runtime-xEg1LGZQYN93"` + Runtime string `json:"namespace" description:"namespace name"` + RuntimeId string `json:"runtime_id" description:"It is the application runtime in OpenPitrix and represents k8s namespace by annotating the namespace"` Version string `json:"version" description:"application version"` VersionId string `json:"version_id" description:"application version id"` Status string `json:"status" description:"application status"`