Documentation ¶
Index ¶
- func DeleteFlavour(ctx *logger.RequestContext, flavourName string) error
- func GetFlavour(name string) (model.Flavour, error)
- func GetFlavourWithCheck(reqFlavour schema.Flavour) (schema.Flavour, error)
- func IsLastFlavourPk(pk int64) bool
- type CreateFlavourRequest
- type CreateFlavourResponse
- type ListFlavourResponse
- type UpdateFlavourRequest
- type UpdateFlavourResponse
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 ¶
GetFlavour handler for getting flavour
func GetFlavourWithCheck ¶
GetFlavourWithCheck get req.Flavour and check if it is valid, if exists in db, return it
func IsLastFlavourPk ¶
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 ¶
UpdateFlavourResponse convey response for update flavour
func UpdateFlavour ¶
func UpdateFlavour(ctx *logger.RequestContext, request *UpdateFlavourRequest) (*UpdateFlavourResponse, error)
UpdateFlavour handler for updating flavour