Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance swagger documentation and UI mechanism #485

Merged
merged 29 commits into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6645cd3
Add API comment RestGetRegionList
seokho-son Apr 29, 2021
9f0c36f
Add API comment get RestGetRegion
seokho-son Apr 29, 2021
f323934
Add API comment get RestGetConnConfig
seokho-son Apr 29, 2021
0c42422
Add API comment for HealthCheck
seokho-son Apr 29, 2021
43fa134
Change get health message string to json
seokho-son Apr 29, 2021
fa3c541
Remove Korean comments in grpc test_api.go
seokho-son Apr 29, 2021
4f756da
Remove not valid comment in server.go
seokho-son Apr 29, 2021
2549877
Remove not valid comments in server.go
seokho-son Apr 29, 2021
e3cf15d
Change not valide exteneral variables to internal
seokho-son Apr 29, 2021
610ff53
Add comments in server.go
seokho-son Apr 29, 2021
4070773
Provide active swagger dashboard
seokho-son Apr 29, 2021
4eee47f
Print active swagger api dashboard link
seokho-son Apr 29, 2021
5ac565f
Enhance tags for APIs
seokho-son Apr 29, 2021
b7d55c8
Enhance tags for cloud APIs
seokho-son Apr 29, 2021
d835153
Change tags for system env conf
seokho-son Apr 29, 2021
9fd3349
Change tags for mcir image
seokho-son Apr 29, 2021
41a0be6
Change tags for mcir spec
seokho-son Apr 29, 2021
e0aaba4
Change tags for mcir sg
seokho-son Apr 29, 2021
b3d94c4
Change tags for mcir access key
seokho-son Apr 29, 2021
a4d828a
Change tags for mcir vnet
seokho-son Apr 29, 2021
a6dd6f4
Change tags for mcis policy
seokho-son Apr 29, 2021
de6501a
Change tags for mcis all
seokho-son Apr 29, 2021
71796b0
Check basicAuth works
seokho-son Apr 29, 2021
ccb8b67
Fix typo in Tags mcis provisioning
seokho-son Apr 29, 2021
ef31e7c
Mark WIP and Dev in API
seokho-son Apr 29, 2021
0f84bf1
Change tags for cloud level operation
seokho-son Apr 29, 2021
37378d7
Modify SELF_ENDPOINT in setup.env
seokho-son Apr 29, 2021
cef024b
Clean tag name
seokho-son Apr 29, 2021
c0b2e94
Add description for get MCIS API
seokho-son Apr 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions conf/setup.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ export API_USERNAME=default
export API_PASSWORD=default

export AUTOCONTROL_DURATION_MS=10000

export API_DOC_PATH=$GOPATH/src/github.com/cloud-barista/cb-tumblebug/src/docs/swagger.json

# Set SELF_ENDPOINT, if you want to access Swagger API dashboard from outside.
# Ex) export SELF_ENDPOINT=xxx.xxx.xxx.xxx:1323
export SELF_ENDPOINT=localhost:1323
38 changes: 19 additions & 19 deletions src/api/grpc/request/test/test_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func main() {
time.Sleep(3 * time.Second)
}

// SimpleNSApiTest - 간단한 NS API 호출
// SimpleNSApiTest
func SimpleNSApiTest() {

fmt.Print("\n\n============= SimpleNSApiTest() =============\n")
Expand All @@ -69,14 +69,14 @@ func SimpleNSApiTest() {
logger.Fatal(err)
}

/* 서버가 TLS 가 설정된 경우
/* TLS enabled
err = ns.SetTLSCA(os.Getenv("CBTUMBLEBUG_ROOT") + "/certs/ca.crt")
if err != nil {
logger.Fatal(err)
}
*/

/* 서버가 JWT 인증이 설정된 경우
/* JWT enabled
err = ns.SetJWTToken("xxxxxxxxxxxxxxxxxxx")
if err != nil {
logger.Fatal(err)
Expand All @@ -98,7 +98,7 @@ func SimpleNSApiTest() {
ns.Close()
}

// ConfigNSApiTest - 환경설정파일을 이용한 NS API 호출
// ConfigNSApiTest - Call NS API using env config file
func ConfigNSApiTest() {

fmt.Print("\n\n============= ConfigNSApiTest() =============\n")
Expand Down Expand Up @@ -127,7 +127,7 @@ func ConfigNSApiTest() {
ns.Close()
}

// DocTypeNSApiTest - 입력/출력 타입을 이용한 NS API 호출
// DocTypeNSApiTest - Call NS API using input/output
func DocTypeNSApiTest() {

fmt.Print("\n\n============= DocTypeNSApiTest() =============\n")
Expand All @@ -146,7 +146,7 @@ func DocTypeNSApiTest() {
logger.Fatal(err)
}

// 입력타입이 json 이고 출력타입이 Json 경우
// for JSON input JSON output
err = ns.SetInType("json")
if err != nil {
logger.Fatal(err)
Expand Down Expand Up @@ -175,7 +175,7 @@ func DocTypeNSApiTest() {

fmt.Printf("\njson result :\n%s\n", result)

// 출력타입을 yaml 로 변경
// Change output into yaml
err = ns.SetOutType("yaml")
if err != nil {
logger.Fatal(err)
Expand All @@ -188,7 +188,7 @@ func DocTypeNSApiTest() {

fmt.Printf("\nyaml result :\n%s\n", result)

// 입력타입을 yaml 로 변경
// Change input into yaml
err = ns.SetInType("yaml")
if err != nil {
logger.Fatal(err)
Expand All @@ -204,7 +204,7 @@ nsId: ns-test

fmt.Printf("\nyaml result :\n%s\n", result)

// 출력타입을 json 로 변경하고 파라미터로 정보 입력
// Change output into JSON and provide parameter info
err = ns.SetOutType("json")
if err != nil {
logger.Fatal(err)
Expand All @@ -230,7 +230,7 @@ nsId: ns-test
ns.Close()
}

// ConfigMCIRApiTest - 환경설정파일을 이용한 MCIR API 호출
// ConfigMCIRApiTest - Call MCIR API using env config file
func ConfigMCIRApiTest() {

fmt.Print("\n\n============= ConfigMCIRApiTest() =============\n")
Expand Down Expand Up @@ -259,7 +259,7 @@ func ConfigMCIRApiTest() {
mcir.Close()
}

// ConfigMCISApiTest - 환경설정파일을 이용한 MCIS API 호출
// ConfigMCISApiTest - Call MCIS API using env config file
func ConfigMCISApiTest() {

fmt.Print("\n\n============= ConfigMCISApiTest() =============\n")
Expand Down Expand Up @@ -288,7 +288,7 @@ func ConfigMCISApiTest() {
mcis.Close()
}

// CreateCIMApiTest - 파라미터를 이용한 Create CIM API 호출
// CreateCIMApiTest - Call Create CIM API using parameter
func CreateCIMApiTest() {

fmt.Print("\n\n============= CreateCIMApiTest() =============\n")
Expand Down Expand Up @@ -368,7 +368,7 @@ func CreateCIMApiTest() {
cim.Close()
}

// CreateNSApiTest - 파라미터를 이용한 Create NS API 호출
// CreateNSApiTest - Call Create NS API using parameter
func CreateNSApiTest() {

fmt.Print("\n\n============= CreateNSApiTest() =============\n")
Expand Down Expand Up @@ -401,7 +401,7 @@ func CreateNSApiTest() {
ns.Close()
}

// CreateMCIRApiTest - 파라미터를 이용한 Create MCIR API 호출
// CreateMCIRApiTest - Call Create MCIR API using parameter
func CreateMCIRApiTest() {

fmt.Print("\n\n============= CreateMCIRApiTest() =============\n")
Expand Down Expand Up @@ -539,7 +539,7 @@ func CreateMCIRApiTest() {
mcir.Close()
}

// CreateMCISApiTest - 파라미터를 이용한 Create MCIS API 호출
// CreateMCISApiTest - Call Create MCIS API using parameter
func CreateMCISApiTest() {

fmt.Print("\n\n============= CreateMCISApiTest() =============\n")
Expand Down Expand Up @@ -609,7 +609,7 @@ func CreateMCISApiTest() {
mcis.Close()
}

// DeleteMCISApiTest - 파라미터를 이용한 Delete MCIS API 호출
// DeleteMCISApiTest - Call Delete MCIS API using parameter
func DeleteMCISApiTest() {

fmt.Print("\n\n============= DeleteMCISApiTest() =============\n")
Expand Down Expand Up @@ -638,7 +638,7 @@ func DeleteMCISApiTest() {
mcis.Close()
}

// DeleteMCIRApiTest - 파라미터를 이용한 Delete MCIR API 호출
// DeleteMCIRApiTest - Call Delete MCIR API using parameter
func DeleteMCIRApiTest() {

fmt.Print("\n\n============= DeleteMCIRApiTest() =============\n")
Expand Down Expand Up @@ -695,7 +695,7 @@ func DeleteMCIRApiTest() {
mcir.Close()
}

// DeleteNSApiTest - 파라미터를 이용한 Delete NS API 호출
// DeleteNSApiTest - Call Delete NS API using parameter
func DeleteNSApiTest() {

fmt.Print("\n\n============= DeleteNSApiTest() =============\n")
Expand Down Expand Up @@ -724,7 +724,7 @@ func DeleteNSApiTest() {
ns.Close()
}

// DeleteCIMApiTest - 파라미터를 이용한 Delete CIM API 호출
// DeleteCIMApiTest - Call Delete CIM API using parameter
func DeleteCIMApiTest() {

fmt.Print("\n\n============= DeleteCIMApiTest() =============\n")
Expand Down
8 changes: 4 additions & 4 deletions src/api/rest/server/common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type RestGetAllConfigResponse struct {
// RestGetConfig godoc
// @Summary Get config
// @Description Get config
// @Tags Config
// @Tags [Admin] System environment
// @Accept json
// @Produce json
// @Param configId path string true "Config ID"
Expand Down Expand Up @@ -47,7 +47,7 @@ func RestGetConfig(c echo.Context) error {
// RestGetAllConfig godoc
// @Summary List all configs
// @Description List all configs
// @Tags Config
// @Tags [Admin] System environment
// @Accept json
// @Produce json
// @Success 200 {object} RestGetAllConfigResponse
Expand Down Expand Up @@ -80,7 +80,7 @@ func RestGetAllConfig(c echo.Context) error {
// RestPostConfig godoc
// @Summary Create or Update config
// @Description Create or Update config (SPIDER_REST_URL, DRAGONFLY_REST_URL, ...)
// @Tags Config
// @Tags [Admin] System environment
// @Accept json
// @Produce json
// @Param config body common.ConfigInfo true "Key and Value for configuration"
Expand Down Expand Up @@ -113,7 +113,7 @@ func RestPostConfig(c echo.Context) error {
// RestDelAllConfig godoc
// @Summary Delete all configs
// @Description Delete all configs
// @Tags Config
// @Tags [Admin] System environment
// @Accept json
// @Produce json
// @Success 200 {object} common.SimpleMsg
Expand Down
12 changes: 6 additions & 6 deletions src/api/rest/server/common/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func RestCheckNs(c echo.Context) error {
// RestDelAllNs godoc
// @Summary Delete all namespaces
// @Description Delete all namespaces
// @Tags Namespace
// @Tags [Namespace] Namespace management
// @Accept json
// @Produce json
// @Success 200 {object} common.SimpleMsg
Expand Down Expand Up @@ -82,7 +82,7 @@ func RestDelAllNs(c echo.Context) error {
// RestDelNs godoc
// @Summary Delete namespace
// @Description Delete namespace
// @Tags Namespace
// @Tags [Namespace] Namespace management
// @Accept json
// @Produce json
// @Param nsId path string true "Namespace ID"
Expand Down Expand Up @@ -128,7 +128,7 @@ type RestGetAllNsResponse struct {
// RestGetAllNs godoc
// @Summary List all namespaces
// @Description List all namespaces
// @Tags Namespace
// @Tags [Namespace] Namespace management
// @Accept json
// @Produce json
// @Success 200 {object} RestGetAllNsResponse
Expand Down Expand Up @@ -161,7 +161,7 @@ func RestGetAllNs(c echo.Context) error {
// RestGetNs godoc
// @Summary Get namespace
// @Description Get namespace
// @Tags Namespace
// @Tags [Namespace] Namespace management
// @Accept json
// @Produce json
// @Param nsId path string true "Namespace ID"
Expand Down Expand Up @@ -190,7 +190,7 @@ func RestGetNs(c echo.Context) error {
// RestPostNs godoc
// @Summary Create namespace
// @Description Create namespace
// @Tags Namespace
// @Tags [Namespace] Namespace management
// @Accept json
// @Produce json
// @Param nsReq body common.NsReq true "Details for a new namespace"
Expand Down Expand Up @@ -224,7 +224,7 @@ func RestPostNs(c echo.Context) error {
// RestPutNs godoc
// @Summary Update namespace
// @Description Update namespace
// @Tags Namespace
// @Tags [Namespace] Namespace management
// @Accept json
// @Produce json
// @Param namespace body common.NsInfo true "Details to update existing namespace"
Expand Down
Loading