flavour

package
v0.14.7-rc1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteFlavour

func DeleteFlavour(ctx *logger.RequestContext, flavourName string) error

DeleteFlavour handler for deleting flavour

func GetFlavour

func GetFlavour(name string) (model.Flavour, error)

GetFlavour handler for getting flavour

func GetFlavourWithCheck

func GetFlavourWithCheck(reqFlavour schema.Flavour) (schema.Flavour, error)

GetFlavourWithCheck get req.Flavour and check if it is valid, if exists in db, return it

func IsLastFlavourPk

func IsLastFlavourPk(pk int64) bool

IsLastFlavourPk get last flavour that usually be used for indicating last page

Types

type CreateFlavourRequest

type CreateFlavourRequest struct {
	Name            string                     `json:"name"`
	ClusterName     string                     `json:"clusterName,omitempty"`
	ClusterID       string                     `json:"-"`
	CPU             string                     `json:"cpu"`
	Mem             string                     `json:"mem"`
	ScalarResources schema.ScalarResourcesType `json:"scalarResources,omitempty"`
	UserName        string                     `json:"-"`
}

CreateFlavourRequest convey request for create flavour

type CreateFlavourResponse

type CreateFlavourResponse struct {
	FlavourName string `json:"name"`
}

CreateFlavourResponse convey response for create flavour

func CreateFlavour

func CreateFlavour(request *CreateFlavourRequest) (*CreateFlavourResponse, error)

CreateFlavour handler for creating flavour

type ListFlavourResponse

type ListFlavourResponse struct {
	common.MarkerInfo
	FlavourList []model.Flavour `json:"flavourList"`
}

ListFlavourResponse convey response for list flavour

func ListFlavour

func ListFlavour(maxKeys int, marker, clusterName, queryKey string) (*ListFlavourResponse, error)

ListFlavour handler for listing flavour

type UpdateFlavourRequest

type UpdateFlavourRequest struct {
	Name            string                     `json:"-"`
	ClusterName     string                     `json:"clusterName,omitempty"`
	ClusterID       string                     `json:"-"`
	CPU             string                     `json:"cpu,omitempty"`
	Mem             string                     `json:"mem,omitempty"`
	ScalarResources schema.ScalarResourcesType `json:"scalarResources,omitempty"`
	UserName        string                     `json:"-"`
}

UpdateFlavourRequest convey request for update flavour

type UpdateFlavourResponse

type UpdateFlavourResponse struct {
	model.Flavour
}

UpdateFlavourResponse convey response for update flavour

func UpdateFlavour

func UpdateFlavour(ctx *logger.RequestContext, request *UpdateFlavourRequest) (*UpdateFlavourResponse, error)

UpdateFlavour handler for updating flavour

Jump to

Keyboard shortcuts

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