controller

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

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

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 @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" @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 @Summary Delete the migrated infrastructure on a cloud platform @Description It deletes the migrated infrastructure on a cloud platform. @Tags [Migration] Infrastructure @Accept json @Produce json @Param infraId path string true "a infrastructure ID created for migration" @Success 200 {object} model.Response "Successfully deleted the migrated infrastructure on a cloud platform" @Failure 404 {object} model.Response @Failure 500 {object} model.Response @Router /migration/infra/{infraId} [delete]

func DeleteUser

func DeleteUser(c echo.Context) error

DeleteUser godoc @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" @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 @Summary Get the migrated infrastructure on a cloud platform @Description It gets the migrated infrastructure on a cloud platform. @Tags [Migration] Infrastructure @Accept json @Produce json @Param infraId path string true "a infrastructure ID created for migration" @Success 200 {object} MigrateInfraResponse "Successfully got the migrated infrastructure on a cloud platform" @Failure 404 {object} model.Response @Failure 500 {object} model.Response @Router /migration/infra/{infraId} [get]

func GetUser

func GetUser(c echo.Context) error

GetUser godoc @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" @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 @Summary Get a list of users @Description Get information of all users. @Tags [Sample API] Users @Accept json @Produce json @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 MigrateInfra

func MigrateInfra(c echo.Context) error

MigrateInfra godoc @Summary Migrate an infrastructure on a cloud platform @Description It migrates an infrastructure on a cloud platform. @Tags [Migration] Infrastructure @Accept json @Produce json @Param InfrastructureInfo body MigrateInfraRequest true "Specify network, disk, compute, security group, virtual machine, etc." @Success 200 {object} MigrateInfraResponse "Successfully migrated infrastructure on a cloud platform" @Failure 404 {object} model.Response @Failure 500 {object} model.Response @Router /migration/infra [post]

func PatchUser

func PatchUser(c echo.Context) error

PatchUser godoc @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" @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 @Summary Recommend an appropriate infrastructure for cloud migration @Description It recommends a cloud infrastructure most similar to the input. Infrastructure includes network, storage, compute, and so on. @Tags [Recommendation] Infrastructure @Accept json @Produce json @Param UserInfrastructure body RecommendInfraRequest true "Specify network, disk, compute, security group, virtual machine, etc." @Success 200 {object} RecommendInfraResponse "Successfully recommended an appropriate infrastructure for cloud migration" @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /recommendation/infra [post]

func UpdateUser

func UpdateUser(c echo.Context) error

UpdateUser godoc @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" @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 {
	cloudmodel.InfraMigrationReq
}

type MigrateInfraResponse

type MigrateInfraResponse struct {
	cloudmodel.TbMcisInfo
}

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 {
	Servers []infra.Infra `json:"servers" validate:"required"`
}

type RecommendInfraResponse

type RecommendInfraResponse struct {
	cloudmodel.InfraMigrationReq
}

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