-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
agent: api: rest: Add missing kubernetes controller files
- Loading branch information
Showing
2 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, " ") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters