controller

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 8 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

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] 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 DeleteUser

func DeleteUser(c echo.Context) error

DeleteUser godoc @Summary Delete a user @Description Delete a user with the given information. @Tags [Sample] 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 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] 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] 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. Infrastructure includes network, storage, compute, and so on. @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} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /migration/infra [post]

func MigrateInstance

func MigrateInstance(c echo.Context) error

MigrateInstance godoc @Summary (Skeleton) Migrate instance on a cloud platform @Description It migrates instance on a cloud platform. Storage includes name, spec, OS, and so on. @Tags [Migration] Infrastructure @Accept json @Produce json @Param InstanceInfo body MigrateInstanceRequest true "Specify name, spec, OS, and so on." @Success 200 {object} MigrateInstanceResponse "Successfully migrated storage on a cloud platform" @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /migration/infra/instance [post]

func MigrateNetwork

func MigrateNetwork(c echo.Context) error

MigrateNetwork godoc @Summary (Skeleton) Migrate network on a cloud platform @Description It migrates network on a cloud platform. Network includes name, ID, IPv4 CIDR block, IPv6 CIDR block, and so on. @Tags [Migration] Infrastructure @Accept json @Produce json @Param NetworkInfo body MigrateNetworkRequest true "Specify name, IPv4 CIDR block, etc." @Success 200 {object} MigrateNetworkResponse "Successfully migrated network on a cloud platform" @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /migration/infra/network [post]

func MigrateStorage

func MigrateStorage(c echo.Context) error

MigrateStorage godoc @Summary (Skeleton) Migrate storage on a cloud platform @Description It migrates storage on a cloud platform. Storage includes name, ID, type, size, and so on. @Tags [Migration] Infrastructure @Accept json @Produce json @Param StorageInfo body MigrateStorageRequest true "Specify name, type, size, affiliated Network ID, and so on." @Success 200 {object} MigrateStorageResponse "Successfully migrated storage on a cloud platform" @Failure 404 {object} common.SimpleMsg @Failure 500 {object} common.SimpleMsg @Router /migration/infra/storage [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] 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] 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 Infrastructure

type Infrastructure struct {
	Network        string
	Disk           string
	Compute        string
	SecurityGroup  string
	VirtualMachine string
}

type MigrateInfraRequest

type MigrateInfraRequest struct {
	model.TbMcisDynamicReq
}

type MigrateInfraResponse

type MigrateInfraResponse struct {
	model.TbMcisInfo
}

type MigrateInstanceRequest

type MigrateInstanceRequest struct {
	model.DummyInstance
}

type MigrateInstanceResponse

type MigrateInstanceResponse struct {
	model.DummyInstance
}

type MigrateNetworkRequest

type MigrateNetworkRequest struct {
	model.DummyNetwork
}

type MigrateNetworkResponse

type MigrateNetworkResponse struct {
	model.DummyNetwork
}

type MigrateStorageRequest

type MigrateStorageRequest struct {
	model.DummyStorage
}

type MigrateStorageResponse

type MigrateStorageResponse struct {
	model.DummyStorage
}

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 {
	Infrastructure
}

type RecommendInfraResponse

type RecommendInfraResponse struct {
	Infrastructure
}

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