-
Notifications
You must be signed in to change notification settings - Fork 47
/
SPLockRest.go
37 lines (27 loc) · 944 Bytes
/
SPLockRest.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Cloud Control Manager's Rest Runtime of CB-Spider.
// The CB-Spider is a sub-Framework of the Cloud-Barista Multi-Cloud Project.
// The CB-Spider Mission is to connect all the clouds with a single interface.
//
// * Cloud-Barista: https://github.com/cloud-barista
//
// by CB-Spider Team, 2022.06.
package restruntime
import (
cmrt "github.com/cloud-barista/cb-spider/api-runtime/common-runtime"
// REST API (echo)
"net/http"
"github.com/labstack/echo/v4"
)
//================ Get All SPLock Infos
func GetAllSPLockInfo(c echo.Context) error {
cblog.Info("call GetAllSPLockInfo()")
infoList := cmrt.GetAllSPLockInfo()
var jsonResult struct {
Result []string `json:"splockinfo"`
}
if infoList == nil {
infoList = []string{}
}
jsonResult.Result = infoList
return c.JSON(http.StatusOK, &jsonResult)
}