Skip to content

Commit

Permalink
add K8sClusterInfo, K8sClusterVersion, K8sClusterNodeImage APIs
Browse files Browse the repository at this point in the history
o New APIs
 - [GET] /tumblebug/k8sClusterInfo
 - [GET] /tumblebug/provider/:providerName/region/:regionName/k8sClusterVersion
 - [GET]
   /tumblebug/provider/:providerName/region/:regionName/k8sClusterNodeImage

related to #1562
  • Loading branch information
Sooyoung Kim committed Jun 5, 2024
1 parent 8b07b57 commit f4f23d2
Show file tree
Hide file tree
Showing 7 changed files with 688 additions and 25 deletions.
159 changes: 159 additions & 0 deletions src/api/rest/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,57 @@ const docTemplate = `{
}
}
},
"/k8sClusterInfo": {
"get": {
"description": "Get kubernetes cluster information",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Admin] Multi-Cloud environment configuration"
],
"summary": "Get kubernetes cluster information",
"parameters": [
{
"type": "string",
"description": "Name of the CSP to retrieve",
"name": "providerName",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Name of region to retrieve",
"name": "regionName",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/common.CloudInfo"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
}
},
"/loadCommonResource": {
"get": {
"description": "Load Common Resources from internal asset files (Spec, Image)",
Expand Down Expand Up @@ -8050,6 +8101,92 @@ const docTemplate = `{
}
}
},
"/provider/{providerName}/region/{regionName}/k8sClusterNodeImage": {
"get": {
"description": "Get available kubernetes cluster node image",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Admin] Multi-Cloud environment configuration"
],
"summary": "Get available kubernetes cluster node image",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/common.K8sClusterNodeImageDetailAvailable"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
}
},
"/provider/{providerName}/region/{regionName}/k8sClusterVersion": {
"get": {
"description": "Get available kubernetes cluster version",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Admin] Multi-Cloud environment configuration"
],
"summary": "Get available kubernetes cluster version",
"parameters": [
{
"type": "string",
"description": "Name of the CSP to retrieve",
"name": "providerName",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Name of region to retrieve",
"name": "regionName",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/common.K8sClusterVersionDetailAvailable"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
}
},
"/readyz": {
"get": {
"description": "Check Tumblebug is ready",
Expand Down Expand Up @@ -8771,6 +8908,28 @@ const docTemplate = `{
"common.JSONResult": {
"type": "object"
},
"common.K8sClusterNodeImageDetailAvailable": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"common.K8sClusterVersionDetailAvailable": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"common.KeyValue": {
"type": "object",
"properties": {
Expand Down
159 changes: 159 additions & 0 deletions src/api/rest/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,57 @@
}
}
},
"/k8sClusterInfo": {
"get": {
"description": "Get kubernetes cluster information",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Admin] Multi-Cloud environment configuration"
],
"summary": "Get kubernetes cluster information",
"parameters": [
{
"type": "string",
"description": "Name of the CSP to retrieve",
"name": "providerName",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Name of region to retrieve",
"name": "regionName",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/common.CloudInfo"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
}
},
"/loadCommonResource": {
"get": {
"description": "Load Common Resources from internal asset files (Spec, Image)",
Expand Down Expand Up @@ -8043,6 +8094,92 @@
}
}
},
"/provider/{providerName}/region/{regionName}/k8sClusterNodeImage": {
"get": {
"description": "Get available kubernetes cluster node image",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Admin] Multi-Cloud environment configuration"
],
"summary": "Get available kubernetes cluster node image",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/common.K8sClusterNodeImageDetailAvailable"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
}
},
"/provider/{providerName}/region/{regionName}/k8sClusterVersion": {
"get": {
"description": "Get available kubernetes cluster version",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Admin] Multi-Cloud environment configuration"
],
"summary": "Get available kubernetes cluster version",
"parameters": [
{
"type": "string",
"description": "Name of the CSP to retrieve",
"name": "providerName",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Name of region to retrieve",
"name": "regionName",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/common.K8sClusterVersionDetailAvailable"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
}
},
"/readyz": {
"get": {
"description": "Check Tumblebug is ready",
Expand Down Expand Up @@ -8764,6 +8901,28 @@
"common.JSONResult": {
"type": "object"
},
"common.K8sClusterNodeImageDetailAvailable": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"common.K8sClusterVersionDetailAvailable": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"common.KeyValue": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit f4f23d2

Please sign in to comment.