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

Arrange API resource group tags #1762

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
309 changes: 155 additions & 154 deletions src/api/rest/docs/docs.go

Large diffs are not rendered by default.

309 changes: 155 additions & 154 deletions src/api/rest/docs/swagger.json

Large diffs are not rendered by default.

309 changes: 155 additions & 154 deletions src/api/rest/docs/swagger.yaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/api/rest/server/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ type AuthsInfo struct {
}

// TestJWTAuth godoc
// @ID TestJWTAuth
// @Summary Test JWT authentication
// @Description Test JWT authentication
// @Tags [Auth] Test JWT authentication
// @Tags [Admin] API Request Management
// @Accept json
// @Produce json
// @Success 200 {object} AuthsInfo "Information of JWT authentication"
Expand Down
18 changes: 9 additions & 9 deletions src/api/rest/server/common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
// @ID InitConfig
// @Summary Init config
// @Description Init config
// @Tags [Admin] System environment
// @Tags [Admin] System Configuration
// @Accept json
// @Produce json
// @Param configId path string true "Config ID"
Expand Down Expand Up @@ -67,7 +67,7 @@ func RestInitConfig(c echo.Context) error {
// @ID GetConfig
// @Summary Get config
// @Description Get config
// @Tags [Admin] System environment
// @Tags [Admin] System Configuration
// @Accept json
// @Produce json
// @Param configId path string true "Config ID"
Expand Down Expand Up @@ -104,7 +104,7 @@ type RestGetAllConfigResponse struct {
// @ID GetAllConfig
// @Summary List all configs
// @Description List all configs
// @Tags [Admin] System environment
// @Tags [Admin] System Configuration
// @Accept json
// @Produce json
// @Success 200 {object} RestGetAllConfigResponse
Expand All @@ -127,7 +127,7 @@ func RestGetAllConfig(c echo.Context) error {
// @ID PostConfig
// @Summary Create or Update config
// @Description Create or Update config (TB_SPIDER_REST_URL, TB_DRAGONFLY_REST_URL, ...)
// @Tags [Admin] System environment
// @Tags [Admin] System Configuration
// @Accept json
// @Produce json
// @Param config body common.ConfigReq true "Key and Value for configuration"
Expand Down Expand Up @@ -155,7 +155,7 @@ func RestPostConfig(c echo.Context) error {
// @ID InitAllConfig
// @Summary Init all configs
// @Description Init all configs
// @Tags [Admin] System environment
// @Tags [Admin] System Configuration
// @Accept json
// @Produce json
// @Success 200 {object} common.SimpleMsg
Expand All @@ -176,7 +176,7 @@ func RestInitAllConfig(c echo.Context) error {
// @ID GetRequest
// @Summary Get request details
// @Description Get details of a specific request
// @Tags [Admin] Request tracking
// @Tags [Admin] API Request Management
// @Accept json
// @Produce json
// @Param reqId path string true "Request ID acquired from X-Request-ID header"
Expand All @@ -198,7 +198,7 @@ func RestGetRequest(c echo.Context) error {
// @ID GetAllRequests
// @Summary Get all requests
// @Description Get details of all requests with optional filters.
// @Tags [Admin] Request tracking
// @Tags [Admin] API Request Management
// @Accept json
// @Produce json
// @Param status query string false "Filter by request status (Handling, Error, Success)"
Expand Down Expand Up @@ -260,7 +260,7 @@ func RestGetAllRequests(c echo.Context) error {
// @ID DeleteRequest
// @Summary Delete a specific request's details
// @Description Delete details of a specific request
// @Tags [Admin] Request tracking
// @Tags [Admin] API Request Management
// @Accept json
// @Produce json
// @Param reqId path string true "Request ID to delete"
Expand All @@ -281,7 +281,7 @@ func RestDeleteRequest(c echo.Context) error {
// @ID DeleteAllRequests
// @Summary Delete all requests' details
// @Description Delete details of all requests
// @Tags [Admin] Request tracking
// @Tags [Admin] API Request Management
// @Accept json
// @Produce json
// @Success 200 {object} 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 @@ -44,7 +44,7 @@ func RestCheckNs(c echo.Context) error {
// @ID DelAllNs
// @Summary Delete all namespaces
// @Description Delete all namespaces
// @Tags [Namespace] Namespace management
// @Tags [Admin] System Configuration
// @Accept json
// @Produce json
// @Success 200 {object} common.SimpleMsg
Expand All @@ -64,7 +64,7 @@ func RestDelAllNs(c echo.Context) error {
// @ID DelNs
// @Summary Delete namespace
// @Description Delete namespace
// @Tags [Namespace] Namespace management
// @Tags [Admin] System Configuration
// @Accept json
// @Produce json
// @Param nsId path string true "Namespace ID" default(default)
Expand Down Expand Up @@ -102,7 +102,7 @@ type RestGetAllNsResponse struct {
// @ID GetAllNs
// @Summary List all namespaces or namespaces' ID
// @Description List all namespaces or namespaces' ID
// @Tags [Namespace] Namespace management
// @Tags [Admin] System Configuration
// @Accept json
// @Produce json
// @Param option query string false "Option" Enums(id)
Expand Down Expand Up @@ -134,7 +134,7 @@ func RestGetAllNs(c echo.Context) error {
// @ID GetNs
// @Summary Get namespace
// @Description Get namespace
// @Tags [Namespace] Namespace management
// @Tags [Admin] System Configuration
// @Accept json
// @Produce json
// @Param nsId path string true "Namespace ID" default(default)
Expand All @@ -160,7 +160,7 @@ func RestGetNs(c echo.Context) error {
// @ID PostNs
// @Summary Create namespace
// @Description Create namespace
// @Tags [Namespace] Namespace management
// @Tags [Admin] System Configuration
// @Accept json
// @Produce json
// @Param nsReq body common.NsReq true "Details for a new namespace"
Expand All @@ -187,7 +187,7 @@ func RestPostNs(c echo.Context) error {
// @ID PutNs
// @Summary Update namespace
// @Description Update namespace
// @Tags [Namespace] Namespace management
// @Tags [Admin] System Configuration
// @Accept json
// @Produce json
// @Param nsId path string true "Namespace ID" default(default)
Expand Down
32 changes: 16 additions & 16 deletions src/api/rest/server/common/utility.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func Validate(c echo.Context, params []string) error {
// RestGetReadyz godoc
// @Summary Check Tumblebug is ready
// @Description Check Tumblebug is ready
// @Tags [Admin] System management
// @Tags [Admin] System Management
// @Accept json
// @Produce json
// @Success 200 {object} common.SimpleMsg
Expand All @@ -96,7 +96,7 @@ func RestGetReadyz(c echo.Context) error {
// @ID CheckHTTPVersion
// @Summary Check HTTP version of incoming request
// @Description Checks and logs the HTTP version of the incoming request to the server console.
// @Tags [Admin] System management
// @Tags [Admin] API Request Management
// @Accept json
// @Produce json
// @Success 200 {object} common.SimpleMsg
Expand Down Expand Up @@ -229,7 +229,7 @@ func RestGetConnConfigList(c echo.Context) error {
// @ID GetProviderList
// @Summary List all registered Providers
// @Description List all registered Providers
// @Tags [Admin] Multi-Cloud environment configuration
// @Tags [Admin] Multi-Cloud Information
// @Accept json
// @Produce json
// @Success 200 {object} common.IdList
Expand All @@ -251,7 +251,7 @@ func RestGetProviderList(c echo.Context) error {
// @ID GetRegion
// @Summary Get registered region info
// @Description Get registered region info
// @Tags [Admin] Multi-Cloud environment configuration
// @Tags [Admin] Multi-Cloud Information
// @Accept json
// @Produce json
// @Param providerName path string true "Name of the CSP to retrieve"
Expand All @@ -278,7 +278,7 @@ func RestGetRegion(c echo.Context) error {
// @ID GetRegionList
// @Summary List all registered regions
// @Description List all registered regions
// @Tags [Admin] Multi-Cloud environment configuration
// @Tags [Admin] Multi-Cloud Information
// @Accept json
// @Produce json
// @Success 200 {object} common.RegionList
Expand All @@ -300,7 +300,7 @@ func RestGetRegionList(c echo.Context) error {
// @ID GetCloudInfo
// @Summary Get cloud information
// @Description Get cloud information
// @Tags [Admin] Multi-Cloud environment configuration
// @Tags [Admin] Multi-Cloud Information
// @Accept json
// @Produce json
// @Success 200 {object} common.CloudInfo
Expand All @@ -321,7 +321,7 @@ func RestGetCloudInfo(c echo.Context) error {
// @ID GetK8sClusterInfo
// @Summary Get kubernetes cluster information
// @Description Get kubernetes cluster information
// @Tags [Admin] Multi-Cloud environment configuration
// @Tags [Kubernetes] Cluster Management
// @Accept json
// @Produce json
// @Success 200 {object} common.K8sClusterInfo
Expand All @@ -347,7 +347,7 @@ type ObjectList struct {
// @ID GetObjects
// @Summary List all objects for a given key
// @Description List all objects for a given key
// @Tags [Admin] System management
// @Tags [Admin] System Management
// @Accept json
// @Produce json
// @Param key query string true "retrieve objects by key"
Expand All @@ -371,7 +371,7 @@ func RestGetObjects(c echo.Context) error {
// @ID GetObject
// @Summary Get value of an object
// @Description Get value of an object
// @Tags [Admin] System management
// @Tags [Admin] System Management
// @Accept json
// @Produce json
// @Param key query string true "get object value by key"
Expand Down Expand Up @@ -399,7 +399,7 @@ func RestGetObject(c echo.Context) error {
// @ID DeleteObject
// @Summary Delete an object
// @Description Delete an object
// @Tags [Admin] System management
// @Tags [Admin] System Management
// @Accept json
// @Produce json
// @Param key query string true "delete object value by key"
Expand Down Expand Up @@ -429,7 +429,7 @@ func RestDeleteObject(c echo.Context) error {
// @ID DeleteObjects
// @Summary Delete child objects along with the given object
// @Description Delete child objects along with the given object
// @Tags [Admin] System management
// @Tags [Admin] System Management
// @Accept json
// @Produce json
// @Param key query string true "Delete child objects based on the given key string"
Expand Down Expand Up @@ -459,7 +459,7 @@ type RestInspectResourcesRequest struct {
// @ID InspectResources
// @Summary Inspect Resources (vNet, securityGroup, sshKey, vm) registered in CB-Tumblebug, CB-Spider, CSP
// @Description Inspect Resources (vNet, securityGroup, sshKey, vm) registered in CB-Tumblebug, CB-Spider, CSP
// @Tags [Admin] System management
// @Tags [Admin] System Management
// @Accept json
// @Produce json
// @Param connectionName body RestInspectResourcesRequest true "Specify connectionName and resource type"
Expand Down Expand Up @@ -495,7 +495,7 @@ func RestInspectResources(c echo.Context) error {
// @ID InspectResourcesOverview
// @Summary Inspect Resources Overview (vNet, securityGroup, sshKey, vm) registered in CB-Tumblebug and CSP for all connections
// @Description Inspect Resources Overview (vNet, securityGroup, sshKey, vm) registered in CB-Tumblebug and CSP for all connections
// @Tags [Admin] System management
// @Tags [Admin] System Management
// @Accept json
// @Produce json
// @Success 200 {object} mci.InspectResourceAllResult
Expand All @@ -522,7 +522,7 @@ type RestRegisterCspNativeResourcesRequest struct {
// @ID RegisterCspNativeResources
// @Summary Register CSP Native Resources (vNet, securityGroup, sshKey, vm) to CB-Tumblebug
// @Description Register CSP Native Resources (vNet, securityGroup, sshKey, vm) to CB-Tumblebug
// @Tags [Admin] System management
// @Tags [Admin] System Management
// @Accept json
// @Produce json
// @Param Request body RestRegisterCspNativeResourcesRequest true "Specify connectionName, NS Id, and MCI Name""
Expand Down Expand Up @@ -559,7 +559,7 @@ type RestRegisterCspNativeResourcesRequestAll struct {
// @ID RegisterCspNativeResourcesAll
// @Summary Register CSP Native Resources (vNet, securityGroup, sshKey, vm) from all Clouds to CB-Tumblebug
// @Description Register CSP Native Resources (vNet, securityGroup, sshKey, vm) from all Clouds to CB-Tumblebug
// @Tags [Admin] System management
// @Tags [Admin] System Management
// @Accept json
// @Produce json
// @Param Request body RestRegisterCspNativeResourcesRequestAll true "Specify NS Id and MCI Name"
Expand Down Expand Up @@ -589,7 +589,7 @@ func RestRegisterCspNativeResourcesAll(c echo.Context) error {
// @ID ForwardAnyReqToAny
// @Summary Forward any (GET) request to CB-Spider
// @Description Forward any (GET) request to CB-Spider
// @Tags [Admin] System utility
// @Tags [Admin] API Request Management
// @Accept json
// @Produce json
// @Param path path string true "Internal call path to CB-Spider (path without /spider/ prefix) - see [https://documenter.getpostman.com/view/24786935/2s9Ykq8Lpf#231eec23-b0ab-4966-83ce-a0ef92ead7bc] for more details"" default(vmspec)
Expand Down
8 changes: 4 additions & 4 deletions src/api/rest/server/mci/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
// @ID PostInstallBenchmarkAgentToMci
// @Summary Install the benchmark agent to specified MCI
// @Description Install the benchmark agent to specified MCI
// @Tags [MC-Infra] MCI Performance benchmarking (WIP)
// @Tags [MC-Infra] MCI Performance Benchmarking (WIP)
// @Accept json
// @Produce json
// @Param nsId path string true "Namespace ID" default(default)
Expand Down Expand Up @@ -75,7 +75,7 @@ type RestGetAllBenchmarkRequest struct {
// @ID GetAllBenchmark
// @Summary Run MCI benchmark for all performance metrics and return results
// @Description Run MCI benchmark for all performance metrics and return results
// @Tags [MC-Infra] MCI Performance benchmarking (WIP)
// @Tags [MC-Infra] MCI Performance Benchmarking (WIP)
// @Accept json
// @Produce json
// @Param nsId path string true "Namespace ID" default(default)
Expand Down Expand Up @@ -107,7 +107,7 @@ func RestGetAllBenchmark(c echo.Context) error {
// @ID GetLatencyBenchmark
// @Summary Run MCI benchmark for network latency
// @Description Run MCI benchmark for network latency
// @Tags [MC-Infra] MCI Performance benchmarking (WIP)
// @Tags [MC-Infra] MCI Performance Benchmarking (WIP)
// @Accept json
// @Produce json
// @Param nsId path string true "Namespace ID" default(system)
Expand Down Expand Up @@ -136,7 +136,7 @@ type RestGetBenchmarkRequest struct {
// @ID GetBenchmark
// @Summary Run MCI benchmark for a single performance metric and return results
// @Description Run MCI benchmark for a single performance metric and return results
// @Tags [MC-Infra] MCI Performance benchmarking (WIP)
// @Tags [MC-Infra] MCI Performance Benchmarking (WIP)
// @Accept json
// @Produce json
// @Param nsId path string true "Namespace ID" default(default)
Expand Down
6 changes: 3 additions & 3 deletions src/api/rest/server/mci/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
// @ID GetControlMci
// @Summary Control the lifecycle of MCI (refine, suspend, resume, reboot, terminate)
// @Description Control the lifecycle of MCI (refine, suspend, resume, reboot, terminate)
// @Tags [MC-Infra] MCI Control lifecycle
// @Tags [MC-Infra] MCI Provisioning and Management
// @Accept json
// @Produce json
// @Param nsId path string true "Namespace ID" default(default)
Expand Down Expand Up @@ -73,7 +73,7 @@ func RestGetControlMci(c echo.Context) error {
// @ID GetControlMciVm
// @Summary Control the lifecycle of VM (suspend, resume, reboot, terminate)
// @Description Control the lifecycle of VM (suspend, resume, reboot, terminate)
// @Tags [MC-Infra] MCI Control lifecycle
// @Tags [MC-Infra] MCI Provisioning and Management
// @Accept json
// @Produce json
// @Param nsId path string true "Namespace ID" default(default)
Expand Down Expand Up @@ -122,7 +122,7 @@ func RestGetControlMciVm(c echo.Context) error {
// @ID PostMciVmSnapshot
// @Summary Snapshot VM and create a Custom Image Object using the Snapshot
// @Description Snapshot VM and create a Custom Image Object using the Snapshot
// @Tags [Infra resource] Snapshot and Custom Image Management
// @Tags [Infra Resource] Image Management
// @Accept json
// @Produce json
// @Param vmSnapshotReq body mci.TbVmSnapshotReq true "Request body to create VM snapshot"
Expand Down
Loading
Loading