controller

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

Package controller has handlers and their request/response bodies for migration APIs

Package common is to handle REST API for common funcitonalities

Package common is to handle REST API for common funcitonalities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUser

func CreateUser(c echo.Context) error

CreateUser godoc @ID CreateUser @Summary Create a new user @Description Create a new user with the given information. @Tags [Sample API] Users @Accept json @Produce json @Param User body CreateUserRequest true "User information" @Param X-Request-Id header string false "Custom request ID (NOTE: It will be used as a trace ID.)" @Success 201 {object} GetUserResponse "(Sample) This is a sample description for success response in Swagger UI" @Failure 400 {object} object "Invalid Request" @Router /sample/users [post]

func DeleteInfra added in v0.1.1

func DeleteInfra(c echo.Context) error

DeleteInfra godoc @ID DeleteInfra @Summary Delete the migrated mult-cloud infrastructure (MCI) @Description Delete the migrated mult-cloud infrastructure (MCI) @Tags [Migration] Infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param mciId path string true "Migrated Multi-Cloud Infrastructure (MCI) ID" default(mmci01) @Param action query string false "Action for deletion" Enums(terminate,force) default(terminate) @Param X-Request-Id header string false "Custom request ID (NOTE: It will be used as a trace ID.)" @Success 200 {object} model.Response "The result of deleting the migrated multi-cloud infrastructure (MCI)" @Failure 404 {object} model.Response @Failure 500 {object} model.Response @Router /migration/ns/{nsId}/mci/{mciId} [delete]

func DeleteUser

func DeleteUser(c echo.Context) error

DeleteUser godoc @ID DeleteUser @Summary Delete a user @Description Delete a user with the given information. @Tags [Sample API] Users @Accept json @Produce json @Param id path int true "User ID" @Param X-Request-Id header string false "Custom request ID (NOTE: It will be used as a trace ID.)" @Success 200 {string} string "User deletion successful" @Failure 400 {object} object "Invalid Request" @Failure 404 {object} object "User Not Found" @Router /sample/users/{id} [delete]

func GetInfra added in v0.1.1

func GetInfra(c echo.Context) error

GetInfra godoc @ID GetInfra @Summary Get the migrated multi-cloud infrastructure (MCI) @Description Get the migrated multi-cloud infrastructure (MCI) @Tags [Migration] Infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param mciId path string true "Migrated Multi-Cloud Infrastructure (MCI) ID" default(mmci01) @Param X-Request-Id header string false "Custom request ID (NOTE: It will be used as a trace ID.)" @Success 200 {object} MigrateInfraResponse "The migrated multi-cloud infrastructure (MCI) information" @Failure 404 {object} model.Response @Failure 500 {object} model.Response @Router /migration/ns/{nsId}/mci/{mciId} [get]

func GetUser

func GetUser(c echo.Context) error

GetUser godoc @ID GetUser @Summary Get specific user information @Description Get information of a user with a specific ID. @Tags [Sample API] Users @Accept json @Produce json @Param id path int true "User ID" @Param X-Request-Id header string false "Custom request ID (NOTE: It will be used as a trace ID.)" @Success 200 {object} GetUserResponse "(Sample) This is a sample description for success response in Swagger UI" @Failure 404 {object} object "User Not Found" @Router /sample/users/{id} [get]

func GetUsers

func GetUsers(c echo.Context) error

GetUsers godoc @ID GetUsers @Summary Get a list of users @Description Get information of all users. @Tags [Sample API] Users @Accept json @Produce json @Param X-Request-Id header string false "Custom request ID (NOTE: It will be used as a trace ID.)" @Success 200 {object} GetUsersResponse "(sample) This is a sample description for success response in Swagger UI" @Failure 404 {object} object "User Not Found" @Router /sample/users [get]

func ListInfra added in v0.2.4

func ListInfra(c echo.Context) error

ListInfra godoc @ID ListInfra @Summary Get the migrated multi-cloud infrastructure (MCI) @Description Get the migrated multi-cloud infrastructure (MCI) @Tags [Migration] Infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param option query string false "Option for getting the migrated multi-cloud infrastructure" Enums(status,id) default(status) @Param X-Request-Id header string false "Custom request ID (NOTE: It will be used as a trace ID.)" @Success 200 {object} migration.IdList "The ID list of The migrated multi-cloud infrastructure (MCI)" @Success 200 {object} migration.MciInfoList "The info list of the migrated multi-cloud infrastructure (MCI)" @Failure 404 {object} model.Response @Failure 500 {object} model.Response @Router /migration/ns/{nsId}/mci [get]

func MigrateInfra

func MigrateInfra(c echo.Context) error

MigrateInfra godoc @ID MigrateInfra @Summary Migrate an infrastructure to the multi-cloud infrastructure (MCI) @Description Migrate an infrastructure to the multi-cloud infrastructure (MCI) @Tags [Migration] Infrastructure @Accept json @Produce json @Param nsId path string true "Namespace ID" default(mig01) @Param mciInfo body MigrateInfraRequest true "Specify the information for the targeted mulci-cloud infrastructure (MCI)" @Param X-Request-Id header string false "Custom request ID (NOTE: It will be used as a trace ID.)" @Success 200 {object} MigrateInfraResponse "Successfully migrated to the multi-cloud infrastructure" @Failure 404 {object} model.Response @Failure 500 {object} model.Response @Router /migration/ns/{nsId}/mci [post]

func PatchUser

func PatchUser(c echo.Context) error

PatchUser godoc @ID PatchUser @Summary Patch a user @Description Patch a user with the given information. @Tags [Sample API] Users @Accept json @Produce json @Param id path int true "User ID" @Param User body PatchUserRequest true "User information to update" @Param X-Request-Id header string false "Custom request ID (NOTE: It will be used as a trace ID.)" @Success 200 {object} PatchUserResponse "(Sample) This is a sample description for success response in Swagger UI" @Failure 400 {object} object "Invalid Request" @Failure 404 {object} object "User Not Found" @Router /sample/users/{id} [patch]

func RecommendInfra

func RecommendInfra(c echo.Context) error

RecommendInfra godoc @ID RecommendInfra @Summary Recommend an appropriate multi-cloud infrastructure (MCI) for cloud migration @Description Recommend an appropriate multi-cloud infrastructure (MCI) for cloud migration @Description @Description [Note] `desiredProvider` and `desiredRegion` are required. @Description - `desiredProvider` and `desiredRegion` can set on the query parameter or the request body. @Description @Description - If desiredProvider and desiredRegion are set on request body, the values in the query parameter will be ignored. @Tags [Recommendation] Infrastructure @Accept json @Produce json @Param UserInfra body RecommendInfraRequest true "Specify the your infrastructure to be migrated" @Param desiredProvider query string false "Provider (e.g., aws, azure, gcp)" Enums(aws,azure,gcp,ncp) default(aws) @Param desiredRegion query string false "Region (e.g., ap-northeast-2)" default(ap-northeast-2) @Param X-Request-Id header string false "Custom request ID (NOTE: It will be used as a trace ID.)" @Success 200 {object} RecommendInfraResponse "The result of recommended infrastructure" @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /recommendation/mci [post]

func UpdateUser

func UpdateUser(c echo.Context) error

UpdateUser godoc @ID UpdateUser @Summary Update a user @Description Update a user with the given information. @Tags [Sample API] Users @Accept json @Produce json @Param id path int true "User ID" @Param User body UpdateUserRequest true "User information to update" @Param X-Request-Id header string false "Custom request ID (NOTE: It will be used as a trace ID.)" @Success 201 {object} UpdateUserResponse "(Sample) This is a sample description for success response in Swagger UI" @Failure 400 {object} object "Invalid Request" @Router /sample/users/{id} [put]

Types

type CreateUserRequest

type CreateUserRequest struct {
	model.MyUser
}

[Note] Struct Embedding is used to inherit the fields of MyUser

type CreateUserResponse

type CreateUserResponse struct {
	model.MyUser
}

[Note] Struct Embedding is used to inherit the fields of MyUser

type GetUserResponse

type GetUserResponse struct {
	model.MyUser
}

[Note] Struct Embedding is used to inherit the fields of MyUser

type GetUsersResponse

type GetUsersResponse struct {
	Users []model.MyUser `json:"users"`
}

type MigrateInfraRequest

type MigrateInfraRequest struct {
	tbmodel.TbMciDynamicReq
}

type MigrateInfraResponse

type MigrateInfraResponse struct {
	tbmodel.TbMciDynamicReq
}

type PatchUserRequest

type PatchUserRequest struct {
	model.MyUser
}

[Note] Struct Embedding is used to inherit the fields of MyUser

type PatchUserResponse

type PatchUserResponse struct {
	model.MyUser
}

[Note] Struct Embedding is used to inherit the fields of MyUser

type RecommendInfraRequest

type RecommendInfraRequest struct {
	DesiredProvider string `json:"desiredProvider" example:"aws"`
	DesiredRegion   string `json:"desiredRegion" example:"ap-northeast-2"`
	inframodel.OnpremiseInfraModel
}

type RecommendInfraResponse

type RecommendInfraResponse struct {
	recommendation.RecommendedInfraInfo
}

type UpdateUserRequest

type UpdateUserRequest struct {
	model.MyUser
}

[Note] Struct Embedding is used to inherit the fields of MyUser

type UpdateUserResponse

type UpdateUserResponse struct {
	model.MyUser
}

[Note] Struct Embedding is used to inherit the fields of MyUser

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL