Skip to content

Commit

Permalink
Add swagger API documentation for VM Management APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
powerkimhub committed Aug 27, 2024
1 parent 531b49c commit b6da765
Show file tree
Hide file tree
Showing 8 changed files with 4,168 additions and 588 deletions.
9 changes: 0 additions & 9 deletions api-runtime/rest-runtime/CBSpiderRuntime.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,6 @@ func init() {
cr.ServicePort = getServicePort("SERVICE_ADDRESS")
}

// REST API Return struct for boolean type
type BooleanInfo struct {
Result string // true or false
}

type StatusInfo struct {
Status string // PENDING | RUNNING | SUSPENDING | SUSPENDED | REBOOTING | TERMINATING | TERMINATED
}

// ex) {"POST", "/driver", registerCloudDriver}
type route struct {
method, path string
Expand Down
16 changes: 16 additions & 0 deletions api-runtime/rest-runtime/CommonRest.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@ const (
NODEGROUP string = string(cres.NODEGROUP)
)

//================ Common Request & Response

// ConnectionRequest represents the request body for common use.
type ConnectionRequest struct {
ConnectionName string `json:"ConnectionName" validate:"required" example:"aws-connection"`
}

// REST API Return struct for boolean type
type BooleanInfo struct {
Result string `json:"Result" validate:"required" example:"true"` // true or false
}

type StatusInfo struct {
Status string `json:"Status" validate:"required" example:"RUNNING"` // "RUNNING,SUSPENDING,SUSPENDED,REBOOTING,TERMINATING,TERMINATED,NOTEXIST,FAILED"
}

//================ Get CSP Resource Name

func GetCSPResourceName(c echo.Context) error {
Expand Down
Loading

0 comments on commit b6da765

Please sign in to comment.