Skip to content

Commit

Permalink
agent: api: rest: Add missing kubernetes controller files
Browse files Browse the repository at this point in the history
  • Loading branch information
taking committed Oct 30, 2024
1 parent 2fb3424 commit ccacb77
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
31 changes: 31 additions & 0 deletions agent/pkg/api/rest/controller/kubernetesInfo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package controller

import (
"github.com/cloud-barista/cm-honeybee/agent/driver/kubernetes"
"github.com/cloud-barista/cm-honeybee/agent/pkg/api/rest/common"
_ "github.com/cloud-barista/cm-honeybee/agent/pkg/api/rest/model/onprem/kubernetes" // Need for swag
"github.com/labstack/echo/v4"
"net/http"
)

// GetKubernetesInfo godoc
//
// @ID get-kubernetes-info
// @Summary Get a list of integrated kubernetes information
// @Description Get kubernetes information.
// @Tags [Kubernetes] Get kubernetes info
// @Accept json
// @Produce json
// @Success 200 {object} kubernetes.Kubernetes "Successfully get information of the kubernetes."
// @Failure 400 {object} common.ErrorResponse "Sent bad request."
// @Failure 500 {object} common.ErrorResponse "Failed to get information of the kubernetes."
// @Router /kubernetes [get]
func GetKubernetesInfo(c echo.Context) error {

kubernetesInfo, err := kubernetes.GetKubernetesInfo()
if err != nil {
return common.ReturnInternalError(c, err, "Failed to get information of the kubernetes.")
}

return c.JSONPretty(http.StatusOK, kubernetesInfo, " ")
}
2 changes: 0 additions & 2 deletions server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/cloud-barista/cm-honeybee/server

go 1.23.0

replace github.com/cloud-barista/cm-honeybee/agent => ../agent

require (
github.com/glebarez/go-sqlite v1.22.0 // indirect
github.com/google/uuid v1.6.0
Expand Down

0 comments on commit ccacb77

Please sign in to comment.