From 7b8a40020adec1993ee0264aec1cc6e97fe78a36 Mon Sep 17 00:00:00 2001 From: Seungkyu Ahn Date: Tue, 9 Apr 2024 09:02:17 +0900 Subject: [PATCH 1/3] add policy-status widget --- internal/delivery/api/endpoint.go | 1 + internal/delivery/http/dashboard.go | 61 +++++++++++++++++++++++++- internal/policy-template/tkscluster.go | 41 +++++++++++------ internal/route/route.go | 1 + internal/usecase/dashboard.go | 14 ++++-- pkg/domain/dashboard.go | 10 +++++ 6 files changed, 109 insertions(+), 19 deletions(-) diff --git a/internal/delivery/api/endpoint.go b/internal/delivery/api/endpoint.go index 463b406d..645fe2a9 100644 --- a/internal/delivery/api/endpoint.go +++ b/internal/delivery/api/endpoint.go @@ -117,6 +117,7 @@ const ( GetChartDashboard // 대시보드/대시보드/조회 GetStacksDashboard // 대시보드/대시보드/조회 GetResourcesDashboard // 대시보드/대시보드/조회 + GetPolicyStatusDashboard // SystemNotificationTemplate Admin_CreateSystemNotificationTemplate diff --git a/internal/delivery/http/dashboard.go b/internal/delivery/http/dashboard.go index f299eeb4..f0294bfc 100644 --- a/internal/delivery/http/dashboard.go +++ b/internal/delivery/http/dashboard.go @@ -5,6 +5,7 @@ import ( "github.com/gorilla/mux" "github.com/openinfradev/tks-api/internal/middleware/auth/request" "github.com/openinfradev/tks-api/internal/model" + policytemplate "github.com/openinfradev/tks-api/internal/policy-template" "github.com/openinfradev/tks-api/internal/serializer" "github.com/openinfradev/tks-api/internal/usecase" "github.com/openinfradev/tks-api/pkg/domain" @@ -22,15 +23,18 @@ type IDashboardHandler interface { GetChart(w http.ResponseWriter, r *http.Request) GetStacks(w http.ResponseWriter, r *http.Request) GetResources(w http.ResponseWriter, r *http.Request) + GetPolicyStatus(w http.ResponseWriter, r *http.Request) } type DashboardHandler struct { - usecase usecase.IDashboardUsecase + usecase usecase.IDashboardUsecase + organizationUsecase usecase.IOrganizationUsecase } func NewDashboardHandler(h usecase.Usecase) IDashboardHandler { return &DashboardHandler{ - usecase: h.Dashboard, + usecase: h.Dashboard, + organizationUsecase: h.Organization, } } @@ -414,3 +418,56 @@ func (h *DashboardHandler) GetResources(w http.ResponseWriter, r *http.Request) ResponseJSON(w, r, http.StatusOK, out) } + +// GetPolicyStatus godoc +// +// @Tags Dashboards +// @Summary Get policy status +// @Description Get policy status +// @Accept json +// @Produce json +// @Param organizationId path string true "Organization ID" +// @Success 200 {object} domain.GetDashboardPolicyStatusResponse +// @Router /organizations/{organizationId}/dashboard/policy-status [get] +// @Security JWT +func (h *DashboardHandler) GetPolicyStatus(w http.ResponseWriter, r *http.Request) { + vars := mux.Vars(r) + organizationId, ok := vars["organizationId"] + if !ok { + ErrorJSON(w, r, httpErrors.NewBadRequestError(fmt.Errorf("%s: invalid organizationId", organizationId), + "C_INVALID_ORGANIZATION_ID", "")) + return + } + + organization, err := h.organizationUsecase.Get(r.Context(), organizationId) + if err != nil { + log.Error(r.Context(), "Failed to retrieve organization") + ErrorJSON(w, r, fmt.Errorf("failed to retrieve organization")) + return + } + + tksClusters, err := policytemplate.GetTksClusterCRs(r.Context(), organization.PrimaryClusterId) + if err != nil { + log.Error(r.Context(), "Failed to retrieve tkscluster list", err) + ErrorJSON(w, r, err) + return + } + + var policyStatus domain.DashboardPolicyStatus + for _, c := range tksClusters { + switch status := c.Status.TKSProxy.Status; status { + case "ready": + policyStatus.Normal++ + case "warn": + policyStatus.Warning++ + case "error": + policyStatus.Error++ + default: + continue + } + } + + var out domain.GetDashboardPolicyStatusResponse + out.PolicyStatus = policyStatus + ResponseJSON(w, r, http.StatusOK, out) +} diff --git a/internal/policy-template/tkscluster.go b/internal/policy-template/tkscluster.go index c2bbc826..2a6cd1df 100644 --- a/internal/policy-template/tkscluster.go +++ b/internal/policy-template/tkscluster.go @@ -2,10 +2,10 @@ package policytemplate import ( "context" - "encoding/json" "github.com/openinfradev/tks-api/pkg/kubernetes" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) @@ -14,7 +14,7 @@ var TKSClusterGVR = schema.GroupVersionResource{ Resource: "tksclusters", } -// ============== Copied Fron Operator Start ============== +// ============== Copied From Operator Start ============== // TemplateReference defines the desired state of TKSCluster type TemplateReference struct { @@ -70,35 +70,50 @@ type TKSClusterList struct { Items []TKSCluster `json:"items"` } -// ============== Copied Fron Operator End ============== +// ============== Copied From Operator End ============== -func GetTksClusterCR(ctx context.Context, primaryClusterId string, name string) (*TKSCluster, error) { +func GetTksClusterCR(ctx context.Context, primaryClusterId string, resourceName string) (*TKSCluster, error) { dynamicClient, err := kubernetes.GetDynamicClientAdminCluster(ctx) - if err != nil { return nil, err } - result, err := dynamicClient.Resource(TKSClusterGVR).Namespace(primaryClusterId). - Get(ctx, name, metav1.GetOptions{}) + resource, err := dynamicClient.Resource(TKSClusterGVR).Namespace(primaryClusterId). + Get(ctx, resourceName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + var tksCluster TKSCluster + unstructuredObj := resource.UnstructuredContent() + err = runtime.DefaultUnstructuredConverter.FromUnstructured(unstructuredObj, &tksCluster) if err != nil { return nil, err } - // Unstructured를 바로 TKSPolicyTemplate으로 컨버팅할 수 없기 때문에 json으로 변환 - jsonBytes, err := json.Marshal(result.Object) + return &tksCluster, nil +} +func GetTksClusterCRs(ctx context.Context, primaryClusterId string) (tksClusters []TKSCluster, err error) { + dynamicClient, err := kubernetes.GetDynamicClientAdminCluster(ctx) if err != nil { return nil, err } - var tksCluster TKSCluster - err = json.Unmarshal(jsonBytes, &tksCluster) - + resources, err := dynamicClient.Resource(TKSClusterGVR).Namespace(primaryClusterId). + List(context.TODO(), metav1.ListOptions{}) if err != nil { return nil, err } - return &tksCluster, nil + var tksCluster TKSCluster + for _, resource := range resources.Items { + if err = runtime.DefaultUnstructuredConverter. + FromUnstructured(resource.UnstructuredContent(), &tksCluster); err != nil { + return nil, err + } + tksClusters = append(tksClusters, tksCluster) + } + + return tksClusters, nil } diff --git a/internal/route/route.go b/internal/route/route.go index 2b0de38c..8f1a0604 100644 --- a/internal/route/route.go +++ b/internal/route/route.go @@ -205,6 +205,7 @@ func SetupRouter(db *gorm.DB, argoClient argowf.ArgoClient, kc keycloak.IKeycloa r.Handle(API_PREFIX+API_VERSION+"/organizations/{organizationId}/dashboard/charts/{chartType}", customMiddleware.Handle(internalApi.GetChartDashboard, http.HandlerFunc(dashboardHandler.GetChart))).Methods(http.MethodGet) r.Handle(API_PREFIX+API_VERSION+"/organizations/{organizationId}/dashboard/stacks", customMiddleware.Handle(internalApi.GetStacksDashboard, http.HandlerFunc(dashboardHandler.GetStacks))).Methods(http.MethodGet) r.Handle(API_PREFIX+API_VERSION+"/organizations/{organizationId}/dashboard/resources", customMiddleware.Handle(internalApi.GetResourcesDashboard, http.HandlerFunc(dashboardHandler.GetResources))).Methods(http.MethodGet) + r.Handle(API_PREFIX+API_VERSION+"/organizations/{organizationId}/dashboard/policy-status", customMiddleware.Handle(internalApi.GetPolicyStatusDashboard, http.HandlerFunc(dashboardHandler.GetPolicyStatus))).Methods(http.MethodGet) r.Handle(API_PREFIX+API_VERSION+"/organizations/{organizationId}/dashboards", customMiddleware.Handle(internalApi.CreateDashboard, http.HandlerFunc(dashboardHandler.CreateDashboard))).Methods(http.MethodPost) r.Handle(API_PREFIX+API_VERSION+"/organizations/{organizationId}/dashboards", customMiddleware.Handle(internalApi.GetDashboard, http.HandlerFunc(dashboardHandler.GetDashboard))).Methods(http.MethodGet) r.Handle(API_PREFIX+API_VERSION+"/organizations/{organizationId}/dashboards", customMiddleware.Handle(internalApi.UpdateDashboard, http.HandlerFunc(dashboardHandler.UpdateDashboard))).Methods(http.MethodPut) diff --git a/internal/usecase/dashboard.go b/internal/usecase/dashboard.go index 176ae035..e404e2f7 100644 --- a/internal/usecase/dashboard.go +++ b/internal/usecase/dashboard.go @@ -180,6 +180,7 @@ func (u *DashboardUsecase) GetResources(ctx context.Context, organizationId stri // Stack clusters, err := u.clusterRepo.FetchByOrganizationId(ctx, organizationId, uuid.Nil, nil) if err != nil { + log.Error(ctx, err) return out, err } @@ -201,10 +202,12 @@ func (u *DashboardUsecase) GetResources(ctx context.Context, organizationId stri log.Debugf(ctx, "Failed to get cluster info: %v\n", err) continue } - if clusterInfo.Items[0].ObjectMeta.Labels["kubernetes.io/cluster-service"] == "true" { - normal++ - } else { - abnormal++ + if clusterInfo != nil && len(clusterInfo.Items) > 0 { + if clusterInfo.Items[0].ObjectMeta.Labels["kubernetes.io/cluster-service"] == "true" { + normal++ + } else { + abnormal++ + } } } } @@ -217,6 +220,7 @@ func (u *DashboardUsecase) GetResources(ctx context.Context, organizationId stri */ result, err := thanosClient.Get(ctx, "sum by (taco_cluster) (machine_cpu_cores)") if err != nil { + log.Error(ctx, err) return out, err } cpu := 0 @@ -234,6 +238,7 @@ func (u *DashboardUsecase) GetResources(ctx context.Context, organizationId stri // Memory result, err = thanosClient.Get(ctx, "sum by (taco_cluster) (machine_memory_bytes)") if err != nil { + log.Error(ctx, err) return out, err } memory := float64(0) @@ -252,6 +257,7 @@ func (u *DashboardUsecase) GetResources(ctx context.Context, organizationId stri // Storage result, err = thanosClient.Get(ctx, "sum by (taco_cluster) (kubelet_volume_stats_capacity_bytes)") if err != nil { + log.Error(ctx, err) return out, err } storage := float64(0) diff --git a/pkg/domain/dashboard.go b/pkg/domain/dashboard.go index bbdb1229..6574c428 100644 --- a/pkg/domain/dashboard.go +++ b/pkg/domain/dashboard.go @@ -178,3 +178,13 @@ type UpdateDashboardRequest struct { type CommonDashboardResponse struct { Result string `json:"result"` } + +type DashboardPolicyStatus struct { + Normal int `json:"normal"` + Warning int `json:"warning"` + Error int `json:"error"` +} + +type GetDashboardPolicyStatusResponse struct { + PolicyStatus DashboardPolicyStatus `json:"statuses"` +} From 29d1a3eb21a1a382047cea086bdf4c3a51f42886 Mon Sep 17 00:00:00 2001 From: Seungkyu Ahn Date: Tue, 9 Apr 2024 09:03:27 +0900 Subject: [PATCH 2/3] add policy-status widget\n endpoint generate --- internal/delivery/api/generated_endpoints.go.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/delivery/api/generated_endpoints.go.go b/internal/delivery/api/generated_endpoints.go.go index 74b792b2..bc02779f 100644 --- a/internal/delivery/api/generated_endpoints.go.go +++ b/internal/delivery/api/generated_endpoints.go.go @@ -355,6 +355,10 @@ var ApiMap = map[Endpoint]EndpointInfo{ Name: "GetResourcesDashboard", Group: "Dashboard", }, + GetPolicyStatusDashboard: { + Name: "GetPolicyStatusDashboard", + Group: "Dashboard", + }, Admin_CreateSystemNotificationTemplate: { Name: "Admin_CreateSystemNotificationTemplate", Group: "SystemNotificationTemplate", @@ -1054,6 +1058,8 @@ func (e Endpoint) String() string { return "GetStacksDashboard" case GetResourcesDashboard: return "GetResourcesDashboard" + case GetPolicyStatusDashboard: + return "GetPolicyStatusDashboard" case Admin_CreateSystemNotificationTemplate: return "Admin_CreateSystemNotificationTemplate" case Admin_UpdateSystemNotificationTemplate: @@ -1496,6 +1502,8 @@ func GetEndpoint(name string) Endpoint { return GetStacksDashboard case "GetResourcesDashboard": return GetResourcesDashboard + case "GetPolicyStatusDashboard": + return GetPolicyStatusDashboard case "Admin_CreateSystemNotificationTemplate": return Admin_CreateSystemNotificationTemplate case "Admin_UpdateSystemNotificationTemplate": From 30f4809ec82a5c2a829572e41fe46f97797f8523 Mon Sep 17 00:00:00 2001 From: Seungkyu Ahn Date: Tue, 9 Apr 2024 09:04:34 +0900 Subject: [PATCH 3/3] add policy-status widget\n swag init --- api/swagger/docs.go | 856 ++++++++++++++++++++++++++------------- api/swagger/swagger.json | 856 ++++++++++++++++++++++++++------------- api/swagger/swagger.yaml | 563 ++++++++++++++++--------- 3 files changed, 1546 insertions(+), 729 deletions(-) diff --git a/api/swagger/docs.go b/api/swagger/docs.go index 46656d28..8a1a4c9e 100644 --- a/api/swagger/docs.go +++ b/api/swagger/docs.go @@ -241,6 +241,90 @@ const docTemplate = `{ } } }, + "/admin/organizations/{organizationId}/policyTemplates": { + "put": { + "security": [ + { + "JWT": [] + } + ], + "description": "특정 조직에 대해 허용된 tks 템플릿의 허용 상태를 해제(제거)한다. tks 우형 템플릿에 대해서만 동작하고 organization 유형 템플릿에 대해서는 거부된다.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "PolicyTemplate" + ], + "summary": "[Admin_DeletePermittedPolicyTemplatesForOrganization] 특정 조직에 대해 허용된 tks 템플릿 목록 제거", + "parameters": [ + { + "type": "string", + "description": "조직 식별자(o로 시작)", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "description": "delete pemitted policy template request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain_admin.DeletePermittedPolicyTemplatesForOrganizationRequest" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + }, + "post": { + "security": [ + { + "JWT": [] + } + ], + "description": "특정 조직에 대해 허용된 tks 템플릿 목록을 추가한다.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "PolicyTemplate" + ], + "summary": "[Admin_AddPermittedPolicyTemplatesForOrganization] 특정 조직에 대해 허용된 tks 템플릿 목록 추가", + "parameters": [ + { + "type": "string", + "description": "조직 식별자(o로 시작)", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "description": "update pemitted policy template request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain_admin.AddPermittedPolicyTemplatesForOrganizationRequest" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, "/admin/organizations/{organizationId}/projects": { "get": { "security": [ @@ -2426,169 +2510,6 @@ const docTemplate = `{ } } }, - "/clusters/{clusterId}/policy-status": { - "get": { - "security": [ - { - "JWT": [] - } - ], - "description": "클러스터의 정책과 정책 템플릿, 버전 등을 포함한 상태 목록을 조회한다.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ClusterPolicyStatus" - ], - "summary": "[ListClusterPolicyStatus] 클러스터의 정책과 정책 템플릿, 버전 조회", - "parameters": [ - { - "type": "string", - "description": "클러스터 식별자(uuid)", - "name": "clusterId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "pageSize", - "name": "pageSize", - "in": "query" - }, - { - "type": "string", - "description": "pageNumber", - "name": "pageNumber", - "in": "query" - }, - { - "type": "string", - "description": "sortColumn", - "name": "sortColumn", - "in": "query" - }, - { - "type": "string", - "description": "sortOrder", - "name": "sortOrder", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "csv", - "description": "filters", - "name": "filters", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.ListClusterPolicyStatusResponse" - } - } - } - } - }, - "/clusters/{clusterId}/policy-templates/{templateId}": { - "get": { - "security": [ - { - "JWT": [] - } - ], - "description": "템플릿의 클러스터 버전 등 상태를 조회한다.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ClusterPolicyStatus" - ], - "summary": "[GetClusterPolicyTemplateStatus] 클러스터 템플릿 상태 상세 조회", - "parameters": [ - { - "type": "string", - "description": "클러스터 식별자(uuid)", - "name": "clusterId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "정책 템플릿 식별자(uuid)", - "name": "templateId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.GetClusterPolicyTemplateStatusResponse" - } - } - } - }, - "patch": { - "security": [ - { - "JWT": [] - } - ], - "description": "해당 템플릿의 버전 업데이트 및 연관된 정책의 새 기본값을 설정한다.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ClusterPolicyStatus" - ], - "summary": "[UpdateClusterPolicyTemplateStatus] 템플릿 버전 업데이트", - "parameters": [ - { - "type": "string", - "description": "클러스터 식별자(uuid)", - "name": "clusterId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "정책 템플릿 식별자(uuid)", - "name": "templateId", - "in": "path", - "required": true - }, - { - "description": "update cluster policy template status request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.UpdateClusterPolicyTemplateStatusRequest" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - } - } - }, "/clusters/{clusterId}/site-values": { "get": { "security": [ @@ -3379,6 +3300,43 @@ const docTemplate = `{ } } }, + "/organizations/{organizationId}/dashboard/policy-status": { + "get": { + "security": [ + { + "JWT": [] + } + ], + "description": "Get policy status", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Dashboards" + ], + "summary": "Get policy status", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organizationId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.GetDashboardPolicyStatusResponse" + } + } + } + } + }, "/organizations/{organizationId}/dashboard/resources": { "get": { "security": [ @@ -8095,8 +8053,286 @@ const docTemplate = `{ } } }, - "/organizations/{organizationId}/stacks/{stackId}/status": { - "get": { + "/organizations/{organizationId}/stacks/{stackId}/policies": { + "put": { + "security": [ + { + "JWT": [] + } + ], + "description": "특정 스택에서 정책 식별자로 지정된 정책을 제거한다.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Policy" + ], + "summary": "[DeletePoliciesForStack] 특정 스택의 정책 제거", + "parameters": [ + { + "type": "string", + "description": "조직 식별자(o로 시작)", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "스택 식별자", + "name": "stackId", + "in": "path", + "required": true + }, + { + "description": "delete policies for stack request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.DeletePoliciesForStackRequest" + } + } + ], + "responses": {} + }, + "post": { + "security": [ + { + "JWT": [] + } + ], + "description": "특정 스택의 정책 목록을 정책 식별자 리스트로 지정해서 추가한다.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Policy" + ], + "summary": "[AddPoliciesForStack] 특정 스택의 정책 목록 추가", + "parameters": [ + { + "type": "string", + "description": "조직 식별자(o로 시작)", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "스택 식별자", + "name": "stackId", + "in": "path", + "required": true + }, + { + "description": "add policies for stack request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.AddPoliciesForStackRequest" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/organizations/{organizationId}/stacks/{stackId}/policy-status": { + "get": { + "security": [ + { + "JWT": [] + } + ], + "description": "클러스터의 정책과 정책 템플릿, 버전 등을 포함한 상태 목록을 조회한다.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "StackPolicyStatus" + ], + "summary": "[ListStackPolicyStatus] 클러스터의 정책과 정책 템플릿, 버전 조회", + "parameters": [ + { + "type": "string", + "description": "조직 식별자(o로 시작)", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "스택 식별자", + "name": "stackId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "pageSize", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "pageNumber", + "name": "pageNumber", + "in": "query" + }, + { + "type": "string", + "description": "sortColumn", + "name": "sortColumn", + "in": "query" + }, + { + "type": "string", + "description": "sortOrder", + "name": "sortOrder", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "csv", + "description": "filters", + "name": "filters", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.ListStackPolicyStatusResponse" + } + } + } + } + }, + "/organizations/{organizationId}/stacks/{stackId}/policy-templates/{policyTemplateId}": { + "get": { + "security": [ + { + "JWT": [] + } + ], + "description": "템플릿의 클러스터 버전 등 상태를 조회한다.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "StackPolicyStatus" + ], + "summary": "[GetStackPolicyTemplateStatus] 클러스터 템플릿 상태 상세 조회", + "parameters": [ + { + "type": "string", + "description": "조직 식별자(o로 시작)", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "스택 식별자", + "name": "stackId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "정책 템플릿 식별자(uuid)", + "name": "policyTemplateId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.GetStackPolicyTemplateStatusResponse" + } + } + } + }, + "patch": { + "security": [ + { + "JWT": [] + } + ], + "description": "해당 템플릿의 버전 업데이트 및 연관된 정책의 새 기본값을 설정한다.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "StackPolicyStatus" + ], + "summary": "[UpdateStackPolicyTemplateStatus] 템플릿 버전 업데이트", + "parameters": [ + { + "type": "string", + "description": "조직 식별자(o로 시작)", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "스택 식별자", + "name": "stackId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "정책 템플릿 식별자(uuid)", + "name": "policyTemplateId", + "in": "path", + "required": true + }, + { + "description": "update stack policy template status request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.UpdateStackPolicyTemplateStatusRequest" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/organizations/{organizationId}/stacks/{stackId}/status": { + "get": { "security": [ { "JWT": [] @@ -9638,7 +9874,18 @@ const docTemplate = `{ "systemNotificationTemplateIds" ], "properties": { - "systemNotificationTemplateIds": { + "systemNotificationTemplateIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "github_com_openinfradev_tks-api_pkg_domain.AddPoliciesForStackRequest": { + "type": "object", + "properties": { + "policyIds": { "type": "array", "items": { "type": "string" @@ -10350,46 +10597,6 @@ const docTemplate = `{ } } }, - "github_com_openinfradev_tks-api_pkg_domain.ClusterPolicyStatusResponse": { - "type": "object", - "properties": { - "policyDescription": { - "type": "string", - "example": "org 레이블 설정 여부 검사" - }, - "policyId": { - "type": "string", - "example": "0091fe9b-e44b-423d-9562-ac2b73089593" - }, - "policyMandatory": { - "type": "boolean" - }, - "policyName": { - "type": "string", - "example": "org 레이블 요구" - }, - "templateCurrentVersion": { - "type": "string", - "example": "v1.0.1" - }, - "templateDescription": { - "type": "string", - "example": "파라미터로 설정된 레이블 검사" - }, - "templateId": { - "type": "string", - "example": "708d1e5b-4e6f-40e9-87a3-329e2fd051a5" - }, - "templateLatestVerson": { - "type": "string", - "example": "v1.0.3" - }, - "templateName": { - "type": "string", - "example": "레이블 요구" - } - } - }, "github_com_openinfradev_tks-api_pkg_domain.ClusterResponse": { "type": "object", "properties": { @@ -11445,6 +11652,20 @@ const docTemplate = `{ } } }, + "github_com_openinfradev_tks-api_pkg_domain.DashboardPolicyStatus": { + "type": "object", + "properties": { + "error": { + "type": "integer" + }, + "normal": { + "type": "integer" + }, + "warning": { + "type": "integer" + } + } + }, "github_com_openinfradev_tks-api_pkg_domain.DashboardResource": { "type": "object", "properties": { @@ -11536,6 +11757,17 @@ const docTemplate = `{ } } }, + "github_com_openinfradev_tks-api_pkg_domain.DeletePoliciesForStackRequest": { + "type": "object", + "properties": { + "policyIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "github_com_openinfradev_tks-api_pkg_domain.DeleteUserRequest": { "type": "object", "properties": { @@ -11822,50 +12054,6 @@ const docTemplate = `{ } } }, - "github_com_openinfradev_tks-api_pkg_domain.GetClusterPolicyTemplateStatusResponse": { - "type": "object", - "properties": { - "affectedPolicies": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.PolicyStatus" - } - }, - "templateCurrentVersion": { - "type": "string", - "example": "v1.0.1" - }, - "templateDescription": { - "type": "string", - "example": "파라미터로 설정된 레이블 검사" - }, - "templateId": { - "type": "string", - "example": "708d1e5b-4e6f-40e9-87a3-329e2fd051a5" - }, - "templateLatestVerson": { - "type": "string", - "example": "v1.0.3" - }, - "templateLatestVersonReleaseDate": { - "type": "string", - "format": "date-time" - }, - "templateMandatory": { - "type": "boolean" - }, - "templateName": { - "type": "string", - "example": "레이블 요구" - }, - "updatedPolicyParameters": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.UpdatedPolicyTemplateParameter" - } - } - } - }, "github_com_openinfradev_tks-api_pkg_domain.GetClusterResponse": { "type": "object", "properties": { @@ -11907,6 +12095,14 @@ const docTemplate = `{ } } }, + "github_com_openinfradev_tks-api_pkg_domain.GetDashboardPolicyStatusResponse": { + "type": "object", + "properties": { + "statuses": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.DashboardPolicyStatus" + } + } + }, "github_com_openinfradev_tks-api_pkg_domain.GetDashboardResourcesResponse": { "type": "object", "properties": { @@ -12189,6 +12385,50 @@ const docTemplate = `{ } } }, + "github_com_openinfradev_tks-api_pkg_domain.GetStackPolicyTemplateStatusResponse": { + "type": "object", + "properties": { + "affectedPolicies": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.PolicyStatus" + } + }, + "templateCurrentVersion": { + "type": "string", + "example": "v1.0.1" + }, + "templateDescription": { + "type": "string", + "example": "파라미터로 설정된 레이블 검사" + }, + "templateId": { + "type": "string", + "example": "708d1e5b-4e6f-40e9-87a3-329e2fd051a5" + }, + "templateLatestVerson": { + "type": "string", + "example": "v1.0.3" + }, + "templateLatestVersonReleaseDate": { + "type": "string", + "format": "date-time" + }, + "templateMandatory": { + "type": "boolean" + }, + "templateName": { + "type": "string", + "example": "레이블 요구" + }, + "updatedPolicyParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.UpdatedPolicyTemplateParameter" + } + } + } + }, "github_com_openinfradev_tks-api_pkg_domain.GetStackResponse": { "type": "object", "properties": { @@ -12481,17 +12721,6 @@ const docTemplate = `{ } } }, - "github_com_openinfradev_tks-api_pkg_domain.ListClusterPolicyStatusResponse": { - "type": "object", - "properties": { - "polices": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.ClusterPolicyStatusResponse" - } - } - } - }, "github_com_openinfradev_tks-api_pkg_domain.ListOrganizationResponse": { "type": "object", "properties": { @@ -12561,6 +12790,17 @@ const docTemplate = `{ } } }, + "github_com_openinfradev_tks-api_pkg_domain.ListStackPolicyStatusResponse": { + "type": "object", + "properties": { + "polices": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.StackPolicyStatusResponse" + } + } + } + }, "github_com_openinfradev_tks-api_pkg_domain.ListTksRoleResponse": { "type": "object", "properties": { @@ -13761,6 +14001,46 @@ const docTemplate = `{ } } }, + "github_com_openinfradev_tks-api_pkg_domain.StackPolicyStatusResponse": { + "type": "object", + "properties": { + "policyDescription": { + "type": "string", + "example": "org 레이블 설정 여부 검사" + }, + "policyId": { + "type": "string", + "example": "0091fe9b-e44b-423d-9562-ac2b73089593" + }, + "policyMandatory": { + "type": "boolean" + }, + "policyName": { + "type": "string", + "example": "org 레이블 요구" + }, + "templateCurrentVersion": { + "type": "string", + "example": "v1.0.1" + }, + "templateDescription": { + "type": "string", + "example": "파라미터로 설정된 레이블 검사" + }, + "templateId": { + "type": "string", + "example": "708d1e5b-4e6f-40e9-87a3-329e2fd051a5" + }, + "templateLatestVerson": { + "type": "string", + "example": "v1.0.3" + }, + "templateName": { + "type": "string", + "example": "레이블 요구" + } + } + }, "github_com_openinfradev_tks-api_pkg_domain.StackResponse": { "type": "object", "properties": { @@ -14113,6 +14393,9 @@ const docTemplate = `{ "id": { "type": "string" }, + "isSystem": { + "type": "boolean" + }, "messageActionProposal": { "type": "string" }, @@ -14163,6 +14446,9 @@ const docTemplate = `{ "id": { "type": "string" }, + "isSystem": { + "type": "boolean" + }, "metricParameters": { "type": "array", "items": { @@ -14326,19 +14612,6 @@ const docTemplate = `{ } } }, - "github_com_openinfradev_tks-api_pkg_domain.UpdateClusterPolicyTemplateStatusRequest": { - "type": "object", - "properties": { - "templateCurrentVersion": { - "type": "string", - "example": "v1.0.1" - }, - "templateTargetVerson": { - "type": "string", - "example": "v1.0.3" - } - } - }, "github_com_openinfradev_tks-api_pkg_domain.UpdateDashboardRequest": { "type": "object", "properties": { @@ -14648,6 +14921,19 @@ const docTemplate = `{ } } }, + "github_com_openinfradev_tks-api_pkg_domain.UpdateStackPolicyTemplateStatusRequest": { + "type": "object", + "properties": { + "templateCurrentVersion": { + "type": "string", + "example": "v1.0.1" + }, + "templateTargetVerson": { + "type": "string", + "example": "v1.0.3" + } + } + }, "github_com_openinfradev_tks-api_pkg_domain.UpdateStackRequest": { "type": "object", "properties": { @@ -15045,6 +15331,17 @@ const docTemplate = `{ } } }, + "github_com_openinfradev_tks-api_pkg_domain_admin.AddPermittedPolicyTemplatesForOrganizationRequest": { + "type": "object", + "properties": { + "policyTemplateIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "github_com_openinfradev_tks-api_pkg_domain_admin.CreatePolicyTemplateReponse": { "type": "object", "properties": { @@ -15169,6 +15466,17 @@ const docTemplate = `{ } } }, + "github_com_openinfradev_tks-api_pkg_domain_admin.DeletePermittedPolicyTemplatesForOrganizationRequest": { + "type": "object", + "properties": { + "policyTemplateIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "github_com_openinfradev_tks-api_pkg_domain_admin.ExistsPolicyTemplateKindResponse": { "type": "object", "properties": { diff --git a/api/swagger/swagger.json b/api/swagger/swagger.json index 130baeed..dcd3e390 100644 --- a/api/swagger/swagger.json +++ b/api/swagger/swagger.json @@ -235,6 +235,90 @@ } } }, + "/admin/organizations/{organizationId}/policyTemplates": { + "put": { + "security": [ + { + "JWT": [] + } + ], + "description": "특정 조직에 대해 허용된 tks 템플릿의 허용 상태를 해제(제거)한다. tks 우형 템플릿에 대해서만 동작하고 organization 유형 템플릿에 대해서는 거부된다.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "PolicyTemplate" + ], + "summary": "[Admin_DeletePermittedPolicyTemplatesForOrganization] 특정 조직에 대해 허용된 tks 템플릿 목록 제거", + "parameters": [ + { + "type": "string", + "description": "조직 식별자(o로 시작)", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "description": "delete pemitted policy template request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain_admin.DeletePermittedPolicyTemplatesForOrganizationRequest" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + }, + "post": { + "security": [ + { + "JWT": [] + } + ], + "description": "특정 조직에 대해 허용된 tks 템플릿 목록을 추가한다.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "PolicyTemplate" + ], + "summary": "[Admin_AddPermittedPolicyTemplatesForOrganization] 특정 조직에 대해 허용된 tks 템플릿 목록 추가", + "parameters": [ + { + "type": "string", + "description": "조직 식별자(o로 시작)", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "description": "update pemitted policy template request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain_admin.AddPermittedPolicyTemplatesForOrganizationRequest" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, "/admin/organizations/{organizationId}/projects": { "get": { "security": [ @@ -2420,169 +2504,6 @@ } } }, - "/clusters/{clusterId}/policy-status": { - "get": { - "security": [ - { - "JWT": [] - } - ], - "description": "클러스터의 정책과 정책 템플릿, 버전 등을 포함한 상태 목록을 조회한다.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ClusterPolicyStatus" - ], - "summary": "[ListClusterPolicyStatus] 클러스터의 정책과 정책 템플릿, 버전 조회", - "parameters": [ - { - "type": "string", - "description": "클러스터 식별자(uuid)", - "name": "clusterId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "pageSize", - "name": "pageSize", - "in": "query" - }, - { - "type": "string", - "description": "pageNumber", - "name": "pageNumber", - "in": "query" - }, - { - "type": "string", - "description": "sortColumn", - "name": "sortColumn", - "in": "query" - }, - { - "type": "string", - "description": "sortOrder", - "name": "sortOrder", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "csv", - "description": "filters", - "name": "filters", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.ListClusterPolicyStatusResponse" - } - } - } - } - }, - "/clusters/{clusterId}/policy-templates/{templateId}": { - "get": { - "security": [ - { - "JWT": [] - } - ], - "description": "템플릿의 클러스터 버전 등 상태를 조회한다.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ClusterPolicyStatus" - ], - "summary": "[GetClusterPolicyTemplateStatus] 클러스터 템플릿 상태 상세 조회", - "parameters": [ - { - "type": "string", - "description": "클러스터 식별자(uuid)", - "name": "clusterId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "정책 템플릿 식별자(uuid)", - "name": "templateId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.GetClusterPolicyTemplateStatusResponse" - } - } - } - }, - "patch": { - "security": [ - { - "JWT": [] - } - ], - "description": "해당 템플릿의 버전 업데이트 및 연관된 정책의 새 기본값을 설정한다.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ClusterPolicyStatus" - ], - "summary": "[UpdateClusterPolicyTemplateStatus] 템플릿 버전 업데이트", - "parameters": [ - { - "type": "string", - "description": "클러스터 식별자(uuid)", - "name": "clusterId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "정책 템플릿 식별자(uuid)", - "name": "templateId", - "in": "path", - "required": true - }, - { - "description": "update cluster policy template status request", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.UpdateClusterPolicyTemplateStatusRequest" - } - } - ], - "responses": { - "200": { - "description": "OK" - } - } - } - }, "/clusters/{clusterId}/site-values": { "get": { "security": [ @@ -3373,6 +3294,43 @@ } } }, + "/organizations/{organizationId}/dashboard/policy-status": { + "get": { + "security": [ + { + "JWT": [] + } + ], + "description": "Get policy status", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Dashboards" + ], + "summary": "Get policy status", + "parameters": [ + { + "type": "string", + "description": "Organization ID", + "name": "organizationId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.GetDashboardPolicyStatusResponse" + } + } + } + } + }, "/organizations/{organizationId}/dashboard/resources": { "get": { "security": [ @@ -8089,8 +8047,286 @@ } } }, - "/organizations/{organizationId}/stacks/{stackId}/status": { - "get": { + "/organizations/{organizationId}/stacks/{stackId}/policies": { + "put": { + "security": [ + { + "JWT": [] + } + ], + "description": "특정 스택에서 정책 식별자로 지정된 정책을 제거한다.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Policy" + ], + "summary": "[DeletePoliciesForStack] 특정 스택의 정책 제거", + "parameters": [ + { + "type": "string", + "description": "조직 식별자(o로 시작)", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "스택 식별자", + "name": "stackId", + "in": "path", + "required": true + }, + { + "description": "delete policies for stack request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.DeletePoliciesForStackRequest" + } + } + ], + "responses": {} + }, + "post": { + "security": [ + { + "JWT": [] + } + ], + "description": "특정 스택의 정책 목록을 정책 식별자 리스트로 지정해서 추가한다.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Policy" + ], + "summary": "[AddPoliciesForStack] 특정 스택의 정책 목록 추가", + "parameters": [ + { + "type": "string", + "description": "조직 식별자(o로 시작)", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "스택 식별자", + "name": "stackId", + "in": "path", + "required": true + }, + { + "description": "add policies for stack request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.AddPoliciesForStackRequest" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/organizations/{organizationId}/stacks/{stackId}/policy-status": { + "get": { + "security": [ + { + "JWT": [] + } + ], + "description": "클러스터의 정책과 정책 템플릿, 버전 등을 포함한 상태 목록을 조회한다.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "StackPolicyStatus" + ], + "summary": "[ListStackPolicyStatus] 클러스터의 정책과 정책 템플릿, 버전 조회", + "parameters": [ + { + "type": "string", + "description": "조직 식별자(o로 시작)", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "스택 식별자", + "name": "stackId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "pageSize", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "pageNumber", + "name": "pageNumber", + "in": "query" + }, + { + "type": "string", + "description": "sortColumn", + "name": "sortColumn", + "in": "query" + }, + { + "type": "string", + "description": "sortOrder", + "name": "sortOrder", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "csv", + "description": "filters", + "name": "filters", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.ListStackPolicyStatusResponse" + } + } + } + } + }, + "/organizations/{organizationId}/stacks/{stackId}/policy-templates/{policyTemplateId}": { + "get": { + "security": [ + { + "JWT": [] + } + ], + "description": "템플릿의 클러스터 버전 등 상태를 조회한다.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "StackPolicyStatus" + ], + "summary": "[GetStackPolicyTemplateStatus] 클러스터 템플릿 상태 상세 조회", + "parameters": [ + { + "type": "string", + "description": "조직 식별자(o로 시작)", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "스택 식별자", + "name": "stackId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "정책 템플릿 식별자(uuid)", + "name": "policyTemplateId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.GetStackPolicyTemplateStatusResponse" + } + } + } + }, + "patch": { + "security": [ + { + "JWT": [] + } + ], + "description": "해당 템플릿의 버전 업데이트 및 연관된 정책의 새 기본값을 설정한다.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "StackPolicyStatus" + ], + "summary": "[UpdateStackPolicyTemplateStatus] 템플릿 버전 업데이트", + "parameters": [ + { + "type": "string", + "description": "조직 식별자(o로 시작)", + "name": "organizationId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "스택 식별자", + "name": "stackId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "정책 템플릿 식별자(uuid)", + "name": "policyTemplateId", + "in": "path", + "required": true + }, + { + "description": "update stack policy template status request", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.UpdateStackPolicyTemplateStatusRequest" + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/organizations/{organizationId}/stacks/{stackId}/status": { + "get": { "security": [ { "JWT": [] @@ -9632,7 +9868,18 @@ "systemNotificationTemplateIds" ], "properties": { - "systemNotificationTemplateIds": { + "systemNotificationTemplateIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "github_com_openinfradev_tks-api_pkg_domain.AddPoliciesForStackRequest": { + "type": "object", + "properties": { + "policyIds": { "type": "array", "items": { "type": "string" @@ -10344,46 +10591,6 @@ } } }, - "github_com_openinfradev_tks-api_pkg_domain.ClusterPolicyStatusResponse": { - "type": "object", - "properties": { - "policyDescription": { - "type": "string", - "example": "org 레이블 설정 여부 검사" - }, - "policyId": { - "type": "string", - "example": "0091fe9b-e44b-423d-9562-ac2b73089593" - }, - "policyMandatory": { - "type": "boolean" - }, - "policyName": { - "type": "string", - "example": "org 레이블 요구" - }, - "templateCurrentVersion": { - "type": "string", - "example": "v1.0.1" - }, - "templateDescription": { - "type": "string", - "example": "파라미터로 설정된 레이블 검사" - }, - "templateId": { - "type": "string", - "example": "708d1e5b-4e6f-40e9-87a3-329e2fd051a5" - }, - "templateLatestVerson": { - "type": "string", - "example": "v1.0.3" - }, - "templateName": { - "type": "string", - "example": "레이블 요구" - } - } - }, "github_com_openinfradev_tks-api_pkg_domain.ClusterResponse": { "type": "object", "properties": { @@ -11439,6 +11646,20 @@ } } }, + "github_com_openinfradev_tks-api_pkg_domain.DashboardPolicyStatus": { + "type": "object", + "properties": { + "error": { + "type": "integer" + }, + "normal": { + "type": "integer" + }, + "warning": { + "type": "integer" + } + } + }, "github_com_openinfradev_tks-api_pkg_domain.DashboardResource": { "type": "object", "properties": { @@ -11530,6 +11751,17 @@ } } }, + "github_com_openinfradev_tks-api_pkg_domain.DeletePoliciesForStackRequest": { + "type": "object", + "properties": { + "policyIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "github_com_openinfradev_tks-api_pkg_domain.DeleteUserRequest": { "type": "object", "properties": { @@ -11816,50 +12048,6 @@ } } }, - "github_com_openinfradev_tks-api_pkg_domain.GetClusterPolicyTemplateStatusResponse": { - "type": "object", - "properties": { - "affectedPolicies": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.PolicyStatus" - } - }, - "templateCurrentVersion": { - "type": "string", - "example": "v1.0.1" - }, - "templateDescription": { - "type": "string", - "example": "파라미터로 설정된 레이블 검사" - }, - "templateId": { - "type": "string", - "example": "708d1e5b-4e6f-40e9-87a3-329e2fd051a5" - }, - "templateLatestVerson": { - "type": "string", - "example": "v1.0.3" - }, - "templateLatestVersonReleaseDate": { - "type": "string", - "format": "date-time" - }, - "templateMandatory": { - "type": "boolean" - }, - "templateName": { - "type": "string", - "example": "레이블 요구" - }, - "updatedPolicyParameters": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.UpdatedPolicyTemplateParameter" - } - } - } - }, "github_com_openinfradev_tks-api_pkg_domain.GetClusterResponse": { "type": "object", "properties": { @@ -11901,6 +12089,14 @@ } } }, + "github_com_openinfradev_tks-api_pkg_domain.GetDashboardPolicyStatusResponse": { + "type": "object", + "properties": { + "statuses": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.DashboardPolicyStatus" + } + } + }, "github_com_openinfradev_tks-api_pkg_domain.GetDashboardResourcesResponse": { "type": "object", "properties": { @@ -12183,6 +12379,50 @@ } } }, + "github_com_openinfradev_tks-api_pkg_domain.GetStackPolicyTemplateStatusResponse": { + "type": "object", + "properties": { + "affectedPolicies": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.PolicyStatus" + } + }, + "templateCurrentVersion": { + "type": "string", + "example": "v1.0.1" + }, + "templateDescription": { + "type": "string", + "example": "파라미터로 설정된 레이블 검사" + }, + "templateId": { + "type": "string", + "example": "708d1e5b-4e6f-40e9-87a3-329e2fd051a5" + }, + "templateLatestVerson": { + "type": "string", + "example": "v1.0.3" + }, + "templateLatestVersonReleaseDate": { + "type": "string", + "format": "date-time" + }, + "templateMandatory": { + "type": "boolean" + }, + "templateName": { + "type": "string", + "example": "레이블 요구" + }, + "updatedPolicyParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.UpdatedPolicyTemplateParameter" + } + } + } + }, "github_com_openinfradev_tks-api_pkg_domain.GetStackResponse": { "type": "object", "properties": { @@ -12475,17 +12715,6 @@ } } }, - "github_com_openinfradev_tks-api_pkg_domain.ListClusterPolicyStatusResponse": { - "type": "object", - "properties": { - "polices": { - "type": "array", - "items": { - "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.ClusterPolicyStatusResponse" - } - } - } - }, "github_com_openinfradev_tks-api_pkg_domain.ListOrganizationResponse": { "type": "object", "properties": { @@ -12555,6 +12784,17 @@ } } }, + "github_com_openinfradev_tks-api_pkg_domain.ListStackPolicyStatusResponse": { + "type": "object", + "properties": { + "polices": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_openinfradev_tks-api_pkg_domain.StackPolicyStatusResponse" + } + } + } + }, "github_com_openinfradev_tks-api_pkg_domain.ListTksRoleResponse": { "type": "object", "properties": { @@ -13755,6 +13995,46 @@ } } }, + "github_com_openinfradev_tks-api_pkg_domain.StackPolicyStatusResponse": { + "type": "object", + "properties": { + "policyDescription": { + "type": "string", + "example": "org 레이블 설정 여부 검사" + }, + "policyId": { + "type": "string", + "example": "0091fe9b-e44b-423d-9562-ac2b73089593" + }, + "policyMandatory": { + "type": "boolean" + }, + "policyName": { + "type": "string", + "example": "org 레이블 요구" + }, + "templateCurrentVersion": { + "type": "string", + "example": "v1.0.1" + }, + "templateDescription": { + "type": "string", + "example": "파라미터로 설정된 레이블 검사" + }, + "templateId": { + "type": "string", + "example": "708d1e5b-4e6f-40e9-87a3-329e2fd051a5" + }, + "templateLatestVerson": { + "type": "string", + "example": "v1.0.3" + }, + "templateName": { + "type": "string", + "example": "레이블 요구" + } + } + }, "github_com_openinfradev_tks-api_pkg_domain.StackResponse": { "type": "object", "properties": { @@ -14107,6 +14387,9 @@ "id": { "type": "string" }, + "isSystem": { + "type": "boolean" + }, "messageActionProposal": { "type": "string" }, @@ -14157,6 +14440,9 @@ "id": { "type": "string" }, + "isSystem": { + "type": "boolean" + }, "metricParameters": { "type": "array", "items": { @@ -14320,19 +14606,6 @@ } } }, - "github_com_openinfradev_tks-api_pkg_domain.UpdateClusterPolicyTemplateStatusRequest": { - "type": "object", - "properties": { - "templateCurrentVersion": { - "type": "string", - "example": "v1.0.1" - }, - "templateTargetVerson": { - "type": "string", - "example": "v1.0.3" - } - } - }, "github_com_openinfradev_tks-api_pkg_domain.UpdateDashboardRequest": { "type": "object", "properties": { @@ -14642,6 +14915,19 @@ } } }, + "github_com_openinfradev_tks-api_pkg_domain.UpdateStackPolicyTemplateStatusRequest": { + "type": "object", + "properties": { + "templateCurrentVersion": { + "type": "string", + "example": "v1.0.1" + }, + "templateTargetVerson": { + "type": "string", + "example": "v1.0.3" + } + } + }, "github_com_openinfradev_tks-api_pkg_domain.UpdateStackRequest": { "type": "object", "properties": { @@ -15039,6 +15325,17 @@ } } }, + "github_com_openinfradev_tks-api_pkg_domain_admin.AddPermittedPolicyTemplatesForOrganizationRequest": { + "type": "object", + "properties": { + "policyTemplateIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "github_com_openinfradev_tks-api_pkg_domain_admin.CreatePolicyTemplateReponse": { "type": "object", "properties": { @@ -15163,6 +15460,17 @@ } } }, + "github_com_openinfradev_tks-api_pkg_domain_admin.DeletePermittedPolicyTemplatesForOrganizationRequest": { + "type": "object", + "properties": { + "policyTemplateIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "github_com_openinfradev_tks-api_pkg_domain_admin.ExistsPolicyTemplateKindResponse": { "type": "object", "properties": { diff --git a/api/swagger/swagger.yaml b/api/swagger/swagger.yaml index 529fffb5..b1940af1 100644 --- a/api/swagger/swagger.yaml +++ b/api/swagger/swagger.yaml @@ -158,6 +158,13 @@ definitions: required: - systemNotificationTemplateIds type: object + github_com_openinfradev_tks-api_pkg_domain.AddPoliciesForStackRequest: + properties: + policyIds: + items: + type: string + type: array + type: object github_com_openinfradev_tks-api_pkg_domain.AddProjectMemberRequest: properties: projectMembers: @@ -644,35 +651,6 @@ definitions: validity: type: integer type: object - github_com_openinfradev_tks-api_pkg_domain.ClusterPolicyStatusResponse: - properties: - policyDescription: - example: org 레이블 설정 여부 검사 - type: string - policyId: - example: 0091fe9b-e44b-423d-9562-ac2b73089593 - type: string - policyMandatory: - type: boolean - policyName: - example: org 레이블 요구 - type: string - templateCurrentVersion: - example: v1.0.1 - type: string - templateDescription: - example: 파라미터로 설정된 레이블 검사 - type: string - templateId: - example: 708d1e5b-4e6f-40e9-87a3-329e2fd051a5 - type: string - templateLatestVerson: - example: v1.0.3 - type: string - templateName: - example: 레이블 요구 - type: string - type: object github_com_openinfradev_tks-api_pkg_domain.ClusterResponse: properties: byoClusterEndpointHost: @@ -1391,6 +1369,15 @@ definitions: year: type: string type: object + github_com_openinfradev_tks-api_pkg_domain.DashboardPolicyStatus: + properties: + error: + type: integer + normal: + type: integer + warning: + type: integer + type: object github_com_openinfradev_tks-api_pkg_domain.DashboardResource: properties: cpu: @@ -1452,6 +1439,13 @@ definitions: id: type: string type: object + github_com_openinfradev_tks-api_pkg_domain.DeletePoliciesForStackRequest: + properties: + policyIds: + items: + type: string + type: array + type: object github_com_openinfradev_tks-api_pkg_domain.DeleteUserRequest: properties: adminPassword: @@ -1638,37 +1632,6 @@ definitions: $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.ClusterNode' type: array type: object - github_com_openinfradev_tks-api_pkg_domain.GetClusterPolicyTemplateStatusResponse: - properties: - affectedPolicies: - items: - $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.PolicyStatus' - type: array - templateCurrentVersion: - example: v1.0.1 - type: string - templateDescription: - example: 파라미터로 설정된 레이블 검사 - type: string - templateId: - example: 708d1e5b-4e6f-40e9-87a3-329e2fd051a5 - type: string - templateLatestVerson: - example: v1.0.3 - type: string - templateLatestVersonReleaseDate: - format: date-time - type: string - templateMandatory: - type: boolean - templateName: - example: 레이블 요구 - type: string - updatedPolicyParameters: - items: - $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.UpdatedPolicyTemplateParameter' - type: array - type: object github_com_openinfradev_tks-api_pkg_domain.GetClusterResponse: properties: cluster: @@ -1695,6 +1658,11 @@ definitions: $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.DashboardChartResponse' type: array type: object + github_com_openinfradev_tks-api_pkg_domain.GetDashboardPolicyStatusResponse: + properties: + statuses: + $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.DashboardPolicyStatus' + type: object github_com_openinfradev_tks-api_pkg_domain.GetDashboardResourcesResponse: properties: resources: @@ -1875,6 +1843,37 @@ definitions: kubeConfig: type: string type: object + github_com_openinfradev_tks-api_pkg_domain.GetStackPolicyTemplateStatusResponse: + properties: + affectedPolicies: + items: + $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.PolicyStatus' + type: array + templateCurrentVersion: + example: v1.0.1 + type: string + templateDescription: + example: 파라미터로 설정된 레이블 검사 + type: string + templateId: + example: 708d1e5b-4e6f-40e9-87a3-329e2fd051a5 + type: string + templateLatestVerson: + example: v1.0.3 + type: string + templateLatestVersonReleaseDate: + format: date-time + type: string + templateMandatory: + type: boolean + templateName: + example: 레이블 요구 + type: string + updatedPolicyParameters: + items: + $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.UpdatedPolicyTemplateParameter' + type: array + type: object github_com_openinfradev_tks-api_pkg_domain.GetStackResponse: properties: stack: @@ -2064,13 +2063,6 @@ definitions: type: string type: array type: object - github_com_openinfradev_tks-api_pkg_domain.ListClusterPolicyStatusResponse: - properties: - polices: - items: - $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.ClusterPolicyStatusResponse' - type: array - type: object github_com_openinfradev_tks-api_pkg_domain.ListOrganizationResponse: properties: organizations: @@ -2116,6 +2108,13 @@ definitions: type: string type: array type: object + github_com_openinfradev_tks-api_pkg_domain.ListStackPolicyStatusResponse: + properties: + polices: + items: + $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.StackPolicyStatusResponse' + type: array + type: object github_com_openinfradev_tks-api_pkg_domain.ListTksRoleResponse: properties: pagination: @@ -2920,6 +2919,35 @@ definitions: - tksInfraNode - tksUserNode type: object + github_com_openinfradev_tks-api_pkg_domain.StackPolicyStatusResponse: + properties: + policyDescription: + example: org 레이블 설정 여부 검사 + type: string + policyId: + example: 0091fe9b-e44b-423d-9562-ac2b73089593 + type: string + policyMandatory: + type: boolean + policyName: + example: org 레이블 요구 + type: string + templateCurrentVersion: + example: v1.0.1 + type: string + templateDescription: + example: 파라미터로 설정된 레이블 검사 + type: string + templateId: + example: 708d1e5b-4e6f-40e9-87a3-329e2fd051a5 + type: string + templateLatestVerson: + example: v1.0.3 + type: string + templateName: + example: 레이블 요구 + type: string + type: object github_com_openinfradev_tks-api_pkg_domain.StackResponse: properties: cloudAccount: @@ -3152,6 +3180,8 @@ definitions: type: string id: type: string + isSystem: + type: boolean messageActionProposal: type: string messageContent: @@ -3183,6 +3213,8 @@ definitions: type: string id: type: string + isSystem: + type: boolean metricParameters: items: $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.SystemNotificationMetricParameterResponse' @@ -3292,15 +3324,6 @@ definitions: description: type: string type: object - github_com_openinfradev_tks-api_pkg_domain.UpdateClusterPolicyTemplateStatusRequest: - properties: - templateCurrentVersion: - example: v1.0.1 - type: string - templateTargetVerson: - example: v1.0.3 - type: string - type: object github_com_openinfradev_tks-api_pkg_domain.UpdateDashboardRequest: properties: groupName: @@ -3509,6 +3532,15 @@ definitions: required: - name type: object + github_com_openinfradev_tks-api_pkg_domain.UpdateStackPolicyTemplateStatusRequest: + properties: + templateCurrentVersion: + example: v1.0.1 + type: string + templateTargetVerson: + example: v1.0.3 + type: string + type: object github_com_openinfradev_tks-api_pkg_domain.UpdateStackRequest: properties: description: @@ -3776,6 +3808,13 @@ definitions: startY: type: integer type: object + github_com_openinfradev_tks-api_pkg_domain_admin.AddPermittedPolicyTemplatesForOrganizationRequest: + properties: + policyTemplateIds: + items: + type: string + type: array + type: object github_com_openinfradev_tks-api_pkg_domain_admin.CreatePolicyTemplateReponse: properties: id: @@ -3864,6 +3903,13 @@ definitions: example: v1.1.1 type: string type: object + github_com_openinfradev_tks-api_pkg_domain_admin.DeletePermittedPolicyTemplatesForOrganizationRequest: + properties: + policyTemplateIds: + items: + type: string + type: array + type: object github_com_openinfradev_tks-api_pkg_domain_admin.ExistsPolicyTemplateKindResponse: properties: existed: @@ -4201,6 +4247,62 @@ paths: summary: Create organization in Admin portal tags: - Organizations + /admin/organizations/{organizationId}/policyTemplates: + post: + consumes: + - application/json + description: 특정 조직에 대해 허용된 tks 템플릿 목록을 추가한다. + parameters: + - description: 조직 식별자(o로 시작) + in: path + name: organizationId + required: true + type: string + - description: update pemitted policy template request + in: body + name: body + required: true + schema: + $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain_admin.AddPermittedPolicyTemplatesForOrganizationRequest' + produces: + - application/json + responses: + "200": + description: OK + security: + - JWT: [] + summary: '[Admin_AddPermittedPolicyTemplatesForOrganization] 특정 조직에 대해 허용된 tks + 템플릿 목록 추가' + tags: + - PolicyTemplate + put: + consumes: + - application/json + description: 특정 조직에 대해 허용된 tks 템플릿의 허용 상태를 해제(제거)한다. tks 우형 템플릿에 대해서만 동작하고 organization + 유형 템플릿에 대해서는 거부된다. + parameters: + - description: 조직 식별자(o로 시작) + in: path + name: organizationId + required: true + type: string + - description: delete pemitted policy template request + in: body + name: body + required: true + schema: + $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain_admin.DeletePermittedPolicyTemplatesForOrganizationRequest' + produces: + - application/json + responses: + "200": + description: OK + security: + - JWT: [] + summary: '[Admin_DeletePermittedPolicyTemplatesForOrganization] 특정 조직에 대해 허용된 + tks 템플릿 목록 제거' + tags: + - PolicyTemplate /admin/organizations/{organizationId}/projects: get: consumes: @@ -5562,111 +5664,6 @@ paths: summary: Get nodes information for BYOH tags: - Clusters - /clusters/{clusterId}/policy-status: - get: - consumes: - - application/json - description: 클러스터의 정책과 정책 템플릿, 버전 등을 포함한 상태 목록을 조회한다. - parameters: - - description: 클러스터 식별자(uuid) - in: path - name: clusterId - required: true - type: string - - description: pageSize - in: query - name: pageSize - type: string - - description: pageNumber - in: query - name: pageNumber - type: string - - description: sortColumn - in: query - name: sortColumn - type: string - - description: sortOrder - in: query - name: sortOrder - type: string - - collectionFormat: csv - description: filters - in: query - items: - type: string - name: filters - type: array - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.ListClusterPolicyStatusResponse' - security: - - JWT: [] - summary: '[ListClusterPolicyStatus] 클러스터의 정책과 정책 템플릿, 버전 조회' - tags: - - ClusterPolicyStatus - /clusters/{clusterId}/policy-templates/{templateId}: - get: - consumes: - - application/json - description: 템플릿의 클러스터 버전 등 상태를 조회한다. - parameters: - - description: 클러스터 식별자(uuid) - in: path - name: clusterId - required: true - type: string - - description: 정책 템플릿 식별자(uuid) - in: path - name: templateId - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.GetClusterPolicyTemplateStatusResponse' - security: - - JWT: [] - summary: '[GetClusterPolicyTemplateStatus] 클러스터 템플릿 상태 상세 조회' - tags: - - ClusterPolicyStatus - patch: - consumes: - - application/json - description: 해당 템플릿의 버전 업데이트 및 연관된 정책의 새 기본값을 설정한다. - parameters: - - description: 클러스터 식별자(uuid) - in: path - name: clusterId - required: true - type: string - - description: 정책 템플릿 식별자(uuid) - in: path - name: templateId - required: true - type: string - - description: update cluster policy template status request - in: body - name: body - required: true - schema: - $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.UpdateClusterPolicyTemplateStatusRequest' - produces: - - application/json - responses: - "200": - description: OK - security: - - JWT: [] - summary: '[UpdateClusterPolicyTemplateStatus] 템플릿 버전 업데이트' - tags: - - ClusterPolicyStatus /clusters/{clusterId}/site-values: get: consumes: @@ -6174,6 +6171,29 @@ paths: summary: Get chart data tags: - Dashboards + /organizations/{organizationId}/dashboard/policy-status: + get: + consumes: + - application/json + description: Get policy status + parameters: + - description: Organization ID + in: path + name: organizationId + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.GetDashboardPolicyStatusResponse' + security: + - JWT: [] + summary: Get policy status + tags: + - Dashboards /organizations/{organizationId}/dashboard/resources: get: consumes: @@ -9175,6 +9195,187 @@ paths: summary: Get KubeConfig by stack tags: - Stacks + /organizations/{organizationId}/stacks/{stackId}/policies: + post: + consumes: + - application/json + description: 특정 스택의 정책 목록을 정책 식별자 리스트로 지정해서 추가한다. + parameters: + - description: 조직 식별자(o로 시작) + in: path + name: organizationId + required: true + type: string + - description: 스택 식별자 + in: path + name: stackId + required: true + type: string + - description: add policies for stack request + in: body + name: body + required: true + schema: + $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.AddPoliciesForStackRequest' + produces: + - application/json + responses: + "200": + description: OK + security: + - JWT: [] + summary: '[AddPoliciesForStack] 특정 스택의 정책 목록 추가' + tags: + - Policy + put: + consumes: + - application/json + description: 특정 스택에서 정책 식별자로 지정된 정책을 제거한다. + parameters: + - description: 조직 식별자(o로 시작) + in: path + name: organizationId + required: true + type: string + - description: 스택 식별자 + in: path + name: stackId + required: true + type: string + - description: delete policies for stack request + in: body + name: body + required: true + schema: + $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.DeletePoliciesForStackRequest' + produces: + - application/json + responses: {} + security: + - JWT: [] + summary: '[DeletePoliciesForStack] 특정 스택의 정책 제거' + tags: + - Policy + /organizations/{organizationId}/stacks/{stackId}/policy-status: + get: + consumes: + - application/json + description: 클러스터의 정책과 정책 템플릿, 버전 등을 포함한 상태 목록을 조회한다. + parameters: + - description: 조직 식별자(o로 시작) + in: path + name: organizationId + required: true + type: string + - description: 스택 식별자 + in: path + name: stackId + required: true + type: string + - description: pageSize + in: query + name: pageSize + type: string + - description: pageNumber + in: query + name: pageNumber + type: string + - description: sortColumn + in: query + name: sortColumn + type: string + - description: sortOrder + in: query + name: sortOrder + type: string + - collectionFormat: csv + description: filters + in: query + items: + type: string + name: filters + type: array + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.ListStackPolicyStatusResponse' + security: + - JWT: [] + summary: '[ListStackPolicyStatus] 클러스터의 정책과 정책 템플릿, 버전 조회' + tags: + - StackPolicyStatus + /organizations/{organizationId}/stacks/{stackId}/policy-templates/{policyTemplateId}: + get: + consumes: + - application/json + description: 템플릿의 클러스터 버전 등 상태를 조회한다. + parameters: + - description: 조직 식별자(o로 시작) + in: path + name: organizationId + required: true + type: string + - description: 스택 식별자 + in: path + name: stackId + required: true + type: string + - description: 정책 템플릿 식별자(uuid) + in: path + name: policyTemplateId + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.GetStackPolicyTemplateStatusResponse' + security: + - JWT: [] + summary: '[GetStackPolicyTemplateStatus] 클러스터 템플릿 상태 상세 조회' + tags: + - StackPolicyStatus + patch: + consumes: + - application/json + description: 해당 템플릿의 버전 업데이트 및 연관된 정책의 새 기본값을 설정한다. + parameters: + - description: 조직 식별자(o로 시작) + in: path + name: organizationId + required: true + type: string + - description: 스택 식별자 + in: path + name: stackId + required: true + type: string + - description: 정책 템플릿 식별자(uuid) + in: path + name: policyTemplateId + required: true + type: string + - description: update stack policy template status request + in: body + name: body + required: true + schema: + $ref: '#/definitions/github_com_openinfradev_tks-api_pkg_domain.UpdateStackPolicyTemplateStatusRequest' + produces: + - application/json + responses: + "200": + description: OK + security: + - JWT: [] + summary: '[UpdateStackPolicyTemplateStatus] 템플릿 버전 업데이트' + tags: + - StackPolicyStatus /organizations/{organizationId}/stacks/{stackId}/status: get: consumes: