app

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Zerologger added in v0.2.4

func Zerologger(skipPatterns [][]string) echo.MiddlewareFunc

Types

type AntResponse

type AntResponse[T any] struct {
	ErrorMessage   string `json:"errorMessage,omitempty"`
	SuccessMessage string `json:"successMessage,omitempty"`
	Code           int    `json:"code,omitempty"`
	Result         T      `json:"result,omitempty"`
}

type AntServer

type AntServer struct {
	// contains filtered or unexported fields
}

AntServer represents the server instance for the CM-Ant application. It contains an Echo instance for handling HTTP requests and multiple services for validating the core functionality of cloud migration.

func NewAntServer

func NewAntServer() (*AntServer, error)

NewAntServer initializes and returns a new instance of AntServer.

func (*AntServer) InitRouter

func (server *AntServer) InitRouter() error

func (*AntServer) Start

func (a *AntServer) Start() error

Start launches the Echo HTTP server on the port specified in the application configuration. It returns an error if the server fails to start.

type AwsAdditionalInfoReq added in v0.2.2

type AwsAdditionalInfoReq struct {
	OwnerId string   `json:"ownerId"`
	Regions []string `json:"regions"`
}

type CostResourceReq added in v0.2.2

type CostResourceReq struct {
	ResourceType constant.ResourceType `json:"resourceType"`
	ResourceIds  []string              `json:"resourceIds"`
}

type GetAllLoadGeneratorInstallInfoReq

type GetAllLoadGeneratorInstallInfoReq struct {
	Page   int    `query:"page"`
	Size   int    `query:"size"`
	Status string `query:"status"`
}

type GetAllLoadTestExecutionHistoryReq

type GetAllLoadTestExecutionHistoryReq struct {
	Page int `query:"page"`
	Size int `query:"size"`
}

type GetAllLoadTestExecutionStateReq

type GetAllLoadTestExecutionStateReq struct {
	Page            int                      `query:"page"`
	Size            int                      `query:"size"`
	LoadTestKey     string                   `query:"loadTestKey"`
	ExecutionStatus constant.ExecutionStatus `query:"executionStatus"`
}

type GetAllMonitoringAgentInfosReq

type GetAllMonitoringAgentInfosReq struct {
	Page  int    `query:"page"`
	Size  int    `query:"size"`
	NsId  string `query:"nsId"`
	MciId string `query:"mciId"`
	VmId  string `query:"vmId"`
}

type GetEstimateCostInfosReq added in v0.2.4

type GetEstimateCostInfosReq struct {
	ProviderName string `query:"providerName" validate:"required"`
	RegionName   string `query:"regionName" validate:"required"`
	InstanceType string `query:"instanceType"`
	VCpu         string `query:"vCpu"`
	Memory       string `query:"memory"`
	OsType       string `query:"osType"`
	Page         int    `query:"page"`
	Size         int    `query:"size"`
}

type GetEstimateForecastCostReq added in v0.2.4

type GetEstimateForecastCostReq struct {
	Page                int                          `query:"page"`
	Size                int                          `query:"size"`
	StartDate           string                       `query:"startDate" validate:"required"`
	EndDate             string                       `query:"endDate" validate:"required"`
	NsIds               []string                     `query:"nsIds"`
	MciIds              []string                     `query:"mciIds"`
	Providers           []string                     `query:"provider"`
	ResourceTypes       []constant.ResourceType      `query:"resourceTypes"`
	ResourceIds         []string                     `query:"resourceIds"`
	CostAggregationType constant.CostAggregationType `query:"costAggregationType" validate:"required"`
	DateOrder           constant.OrderType           `query:"dateOrder"`
	ResourceTypeOrder   constant.OrderType           `query:"resourceTypeOrder"`
}

type GetLastLoadTestExecutionStateReq added in v0.2.4

type GetLastLoadTestExecutionStateReq struct {
	NsId  string `query:"nsId"`
	MciId string `query:"mciId"`
	VmId  string `query:"vmId"`
}

type GetLastLoadTestResultReq added in v0.2.6

type GetLastLoadTestResultReq struct {
	NsId   string                `query:"nsId"`
	MciId  string                `query:"mciId"`
	VmId   string                `query:"vmId"`
	Format constant.ResultFormat `query:"format"`
}

type GetLoadTestResultReq

type GetLoadTestResultReq struct {
	LoadTestKey string                `query:"loadTestKey"`
	Format      constant.ResultFormat `query:"format"`
}

type InstallLoadGeneratorReq

type InstallLoadGeneratorReq struct {
	InstallLocation constant.InstallLocation `json:"installLocation"`
}

type JsonResult

type JsonResult struct {
}

JsonResult is a dummy struct for swagger annotations.

type MonitoringAgentInstallationReq

type MonitoringAgentInstallationReq struct {
	NsId  string   `json:"nsId"`
	MciId string   `json:"mciId"`
	VmIds []string `json:"vmIds,omitempty"`
}

type RunLoadGeneratorHttpReq

type RunLoadGeneratorHttpReq struct {
	Method   string `json:"method" validate:"required"`             // GET or POST
	Protocol string `json:"protocol" validate:"required"`           // http or https
	Hostname string `json:"hostname,omitempty" validate:"required"` // xx.xx.xx.xx or asx.bbb.com
	Port     string `json:"port,omitempty" validate:"required"`     // 1 ~ 65353
	Path     string `json:"path,omitempty" validate:"required"`     // /xxx/www/sss or possibly empty
	BodyData string `json:"bodyData,omitempty" validate:"required"` // {"xxx": "tttt", "wwwww": "wotjkenr"}
}

type RunLoadTestReq

type RunLoadTestReq struct {
	// localhost for installing load generator; local | remote
	InstallLoadGenerator InstallLoadGeneratorReq `json:"installLoadGenerator"`

	// if already installed load generator simply put this field
	LoadGeneratorInstallInfoId uint `json:"loadGeneratorInstallInfoId"`

	// test scenario
	TestName     string `json:"testName"`
	VirtualUsers string `json:"virtualUsers"`
	Duration     string `json:"duration"`
	RampUpTime   string `json:"rampUpTime"`
	RampUpSteps  string `json:"rampUpSteps"`

	// for validate agent host and connect to tumblebug resources
	NsId  string `json:"nsId"`  // for metadata usage
	MciId string `json:"mciId"` // for metadata usage
	VmId  string `json:"vmId"`  // for metadata usage

	// agent tcp default port is 5555
	CollectAdditionalSystemMetrics bool   `json:"collectAdditionalSystemMetrics"`
	AgentHostname                  string `json:"agentHostname"` // basically, it is same as host for vm

	HttpReqs []RunLoadGeneratorHttpReq `json:"httpReqs,omitempty"`
}

type StopLoadTestReq

type StopLoadTestReq struct {
	LoadTestKey string `json:"loadTestKey"`
	NsId        string `json:"nsId"`
	MciId       string `json:"mciId"`
	VmId        string `json:"vmId"`
}

type UpdateAndGetEstimateCostReq added in v0.2.4

type UpdateAndGetEstimateCostReq struct {
	Specs []struct {
		ProviderName string `json:"providerName" validate:"required"`
		RegionName   string `json:"regionName" validate:"required"`
		InstanceType string `json:"instanceType" validate:"required"`
		Image        string `json:"image"`
	} `json:"specs"`

	SpecsWithFormat []struct {
		CommonSpec  string `json:"commonSpec" validate:"required"`
		CommonImage string `json:"commonImage"`
	} `json:"specsWithFormat"`
}

type UpdateEstimateForecastCostRawReq added in v0.2.4

type UpdateEstimateForecastCostRawReq struct {
	CostResources     []CostResourceReq    `json:"costResources" validate:"required"`
	AwsAdditionalInfo AwsAdditionalInfoReq `json:"awsAdditionalInfo"`
}

type UpdateEstimateForecastCostReq added in v0.2.4

type UpdateEstimateForecastCostReq struct {
	NsId  string `json:"nsId"`
	MciId string `json:"mciId"`
}

Jump to

Keyboard shortcuts

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