mve

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommandsTo

func AddCommandsTo(rootCmd *cobra.Command)

AddCommandsTo builds the mve commands and adds them to the root command

func BuyMVE

func BuyMVE(cmd *cobra.Command, args []string, noColor bool) error

BuyMVE handles the purchase of a new Megaport Virtual Edge device

func DeleteMVE

func DeleteMVE(cmd *cobra.Command, args []string, noColor bool) error

func GetMVE

func GetMVE(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error

func ListAvailableMVESizes

func ListAvailableMVESizes(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error

func ListMVEImages

func ListMVEImages(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error

func UpdateMVE

func UpdateMVE(cmd *cobra.Command, args []string, noColor bool) error

Types

type MVEOutput

type MVEOutput struct {
	output.Output `json:"-" header:"-"`
	UID           string `json:"uid" header:"UID"`
	Name          string `json:"name" header:"Name"`
	LocationID    int    `json:"location_id" header:"Location ID"`
	Status        string `json:"status" header:"Status"`
	Vendor        string `json:"vendor" header:"Vendor"`
	Size          string `json:"size" header:"Size"`
}

MVEOutput represents the desired fields for JSON output.

func ToMVEOutput

func ToMVEOutput(m *megaport.MVE) (MVEOutput, error)

ToMVEOutput converts an MVE to an MVEOutput.

type MockMVEService

type MockMVEService struct {
	mock.Mock
	BuyMVEError                       error
	BuyMVEResult                      *megaport.BuyMVEResponse
	CapturedBuyMVERequest             *megaport.BuyMVERequest
	ValidateMVEOrderError             error
	GetMVEError                       error
	GetMVEResult                      *megaport.MVE
	ModifyMVEError                    error
	ModifyMVEResult                   *megaport.ModifyMVEResponse
	CapturedModifyMVERequest          *megaport.ModifyMVERequest
	DeleteMVEError                    error
	DeleteMVEResult                   *megaport.DeleteMVEResponse
	CapturedDeleteMVERequest          *megaport.DeleteMVERequest
	ListMVEImagesError                error
	ListMVEImagesResult               []*megaport.MVEImage
	ListAvailableMVESizesError        error
	ListAvailableMVESizesResult       []*megaport.MVESize
	ListMVEResourceTagsError          error
	ListMVEResourceTagsResult         map[string]string
	CapturedListMVEResourceTagsUID    string
	UpdateMVEResourceTagsError        error
	CapturedUpdateMVEResourceTagsUID  string
	CapturedUpdateMVEResourceTagsTags map[string]string
}

func (*MockMVEService) BuyMVE

func (*MockMVEService) DeleteMVE

func (*MockMVEService) GetMVE

func (m *MockMVEService) GetMVE(ctx context.Context, mveId string) (*megaport.MVE, error)

func (*MockMVEService) ListAvailableMVESizes

func (m *MockMVEService) ListAvailableMVESizes(ctx context.Context) ([]*megaport.MVESize, error)

func (*MockMVEService) ListMVEImages

func (m *MockMVEService) ListMVEImages(ctx context.Context) ([]*megaport.MVEImage, error)

func (*MockMVEService) ListMVEResourceTags

func (m *MockMVEService) ListMVEResourceTags(ctx context.Context, mveID string) (map[string]string, error)

func (*MockMVEService) ModifyMVE

func (*MockMVEService) Reset

func (m *MockMVEService) Reset()

func (*MockMVEService) UpdateMVEResourceTags

func (m *MockMVEService) UpdateMVEResourceTags(ctx context.Context, mveID string, tags map[string]string) error

func (*MockMVEService) ValidateMVEOrder

func (m *MockMVEService) ValidateMVEOrder(ctx context.Context, req *megaport.BuyMVERequest) error

type Module added in v0.3.4

type Module struct{}

Module implements the cmdbuilder.Module interface for mve

func NewModule added in v0.3.4

func NewModule() *Module

NewModule creates a new mve module

func (*Module) Name added in v0.3.4

func (m *Module) Name() string

Name returns the module name

func (*Module) RegisterCommands added in v0.3.4

func (m *Module) RegisterCommands(rootCmd *cobra.Command)

RegisterCommands adds the mve command to the root command

Jump to

Keyboard shortcuts

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