cmd

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommonBuyFlags added in v0.3.0

func AddCommonBuyFlags(cmd *cobra.Command)

AddCommonBuyFlags adds common flags for buy commands

func AddCommonUpdateFlags added in v0.3.0

func AddCommonUpdateFlags(cmd *cobra.Command)

AddCommonUpdateFlags adds common flags for update commands

func BuyLAGPort added in v0.1.7

func BuyLAGPort(cmd *cobra.Command, args []string) error

func BuyMCR added in v0.1.7

func BuyMCR(cmd *cobra.Command, args []string) error

func BuyMVE added in v0.1.8

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

BuyMVE handles the purchase of a new Megaport Virtual Edge device

func BuyPort added in v0.1.7

func BuyPort(cmd *cobra.Command, args []string) error

func BuyVXC added in v0.2.2

func BuyVXC(cmd *cobra.Command, args []string) error

BuyVXC purchases a new Virtual Cross Connect

func CheckPortVLANAvailability added in v0.1.7

func CheckPortVLANAvailability(cmd *cobra.Command, args []string) error

func CreateMCRPrefixFilterList added in v0.1.9

func CreateMCRPrefixFilterList(cmd *cobra.Command, args []string) error

func CreateServiceKey

func CreateServiceKey(cmd *cobra.Command, args []string) error

func DeleteMCR added in v0.1.7

func DeleteMCR(cmd *cobra.Command, args []string) error

func DeleteMCRPrefixFilterList added in v0.1.9

func DeleteMCRPrefixFilterList(cmd *cobra.Command, args []string) error

func DeleteMVE added in v0.2.1

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

func DeletePort added in v0.1.7

func DeletePort(cmd *cobra.Command, args []string) error

func DeleteVXC added in v0.2.5

func DeleteVXC(cmd *cobra.Command, args []string) error

DeleteVXC deletes a VXC with the provided UID

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func FindPartners added in v0.2.6

func FindPartners(cmd *cobra.Command, args []string) error

FindPartners implements the interactive search functionality for partner ports.

func FormatCommandName added in v0.3.0

func FormatCommandName(name string) string

FormatCommandName colorizes command names

func FormatConfirmation added in v0.3.0

func FormatConfirmation(msg string) string

FormatConfirmation returns a formatted confirmation prompt

func FormatExample added in v0.3.0

func FormatExample(example string) string

FormatExample colorizes command examples in help text

func FormatJSONExample added in v0.3.0

func FormatJSONExample(json string) string

FormatJSONExample formats JSON examples in help text

func FormatOptionalFlag added in v0.3.0

func FormatOptionalFlag(flag string, description string) string

FormatOptionalFlag formats optional flags in help text

func FormatPrompt added in v0.3.0

func FormatPrompt(msg string) string

FormatPrompt returns a formatted input prompt

func FormatRequiredFlag added in v0.3.0

func FormatRequiredFlag(flag string, description string) string

FormatRequiredFlag highlights required flags in help text

func FormatSuccess added in v0.3.0

func FormatSuccess(msg string) string

FormatSuccess returns a formatted success string

func GetLocation added in v0.1.9

func GetLocation(cmd *cobra.Command, args []string) error

func GetMCR added in v0.1.7

func GetMCR(cmd *cobra.Command, args []string) error

func GetMCRPrefixFilterList added in v0.1.9

func GetMCRPrefixFilterList(cmd *cobra.Command, args []string) error

func GetMVE added in v0.1.7

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

func GetPort added in v0.1.7

func GetPort(cmd *cobra.Command, args []string) error

func GetPortHelp added in v0.3.0

func GetPortHelp(cmd *cobra.Command, args []string) error

GetPortHelp is a placeholder function for the ports help command

func GetServiceKey

func GetServiceKey(cmd *cobra.Command, args []string) error

func GetVXC added in v0.1.7

func GetVXC(cmd *cobra.Command, args []string) error

func ListAvailableMVESizes added in v0.2.0

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

func ListLocations added in v0.1.9

func ListLocations(cmd *cobra.Command, args []string) error

func ListMCRPrefixFilterLists added in v0.1.9

func ListMCRPrefixFilterLists(cmd *cobra.Command, args []string) error

func ListMVEImages added in v0.2.0

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

func ListPartners added in v0.1.7

func ListPartners(cmd *cobra.Command, args []string) error

func ListPorts added in v0.1.7

func ListPorts(cmd *cobra.Command, args []string) error

func ListServiceKeys

func ListServiceKeys(cmd *cobra.Command, args []string) error

func LockPort added in v0.1.7

func LockPort(cmd *cobra.Command, args []string) error

func Login

func Login(ctx context.Context) (*megaport.Client, error)

func MarkFlagsRequired added in v0.3.0

func MarkFlagsRequired(cmd *cobra.Command, flags []string) error

MarkFlagsRequired marks a list of flags as required for a command

func PrintError added in v0.3.0

func PrintError(format string, args ...interface{})

PrintError prints an error message with red color

func PrintInfo added in v0.3.0

func PrintInfo(format string, args ...interface{})

PrintInfo prints an info message with blue color

func PrintResourceCreated added in v0.3.0

func PrintResourceCreated(resourceType, uid string)

PrintResourceCreated prints a standardized resource creation message

func PrintResourceDeleted added in v0.3.0

func PrintResourceDeleted(resourceType, uid string, immediate bool)

PrintResourceDeleted prints a standardized resource deletion message

func PrintResourceSuccess added in v0.3.0

func PrintResourceSuccess(resourceType, action, uid string)

PrintResourceSuccess prints a success message for a resource operation

func PrintResourceUpdated added in v0.3.0

func PrintResourceUpdated(resourceType, uid string)

PrintResourceUpdated prints a standardized resource update message

func PrintSuccess added in v0.3.0

func PrintSuccess(format string, args ...interface{})

PrintSuccess prints a success message with green color and a checkmark

func PrintWarning added in v0.3.0

func PrintWarning(format string, args ...interface{})

PrintWarning prints a warning message with yellow color

func RestoreMCR added in v0.1.7

func RestoreMCR(cmd *cobra.Command, args []string) error

func RestorePort added in v0.1.7

func RestorePort(cmd *cobra.Command, args []string) error

func RunCompletion added in v0.1.9

func RunCompletion(cmd *cobra.Command, args []string) error

func UnlockPort added in v0.1.7

func UnlockPort(cmd *cobra.Command, args []string) error

func UpdateMCR added in v0.2.1

func UpdateMCR(cmd *cobra.Command, args []string) error

func UpdateMCRPrefixFilterList added in v0.1.9

func UpdateMCRPrefixFilterList(cmd *cobra.Command, args []string) error

func UpdateMVE added in v0.2.1

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

func UpdatePort added in v0.1.7

func UpdatePort(cmd *cobra.Command, args []string) error

func UpdateServiceKey

func UpdateServiceKey(cmd *cobra.Command, args []string) error

func UpdateVXC added in v0.2.5

func UpdateVXC(cmd *cobra.Command, args []string) error

UpdateVXC updates an existing VXC with the provided configuration

func WrapRunE added in v0.1.9

func WrapRunE(runE func(cmd *cobra.Command, args []string) error) func(cmd *cobra.Command, args []string) error

WrapRunE wraps a RunE function to set SilenceUsage to true if an error occurs and formats the error message.

Types

type CommandData added in v0.2.9

type CommandData struct {
	Name               string
	Description        string
	LongDescription    string
	Usage              string
	Example            string
	HasParent          bool
	ParentCommandPath  string
	ParentCommandName  string
	ParentFilePath     string
	Aliases            []string
	Flags              []FlagInfo
	LocalFlags         []FlagInfo
	PersistentFlags    []FlagInfo
	HasSubCommands     bool
	SubCommands        []string
	IsAvailableCommand bool
	FilepathPrefix     string // Add this new field
}

type CommandHelpBuilder added in v0.3.0

type CommandHelpBuilder struct {
	CommandName    string
	ShortDesc      string
	LongDesc       string
	Examples       []string
	RequiredFlags  map[string]string // flag name -> description
	OptionalFlags  map[string]string // flag name -> description
	JSONExamples   []string
	ImportantNotes []string
	DisableColor   bool // Whether to disable colored output
}

CommandHelpBuilder helps construct formatted help text for commands

func (*CommandHelpBuilder) Build added in v0.3.0

func (b *CommandHelpBuilder) Build() string

Build constructs the full formatted help text

type CommandInfo added in v0.2.9

type CommandInfo struct {
	Name        string
	Description string
	Path        string
}

type FlagInfo added in v0.2.9

type FlagInfo struct {
	Name        string
	Shorthand   string
	Default     string
	Description string
	Required    bool
}

type IndexData added in v0.2.9

type IndexData struct {
	Commands    []CommandInfo
	GeneratedAt string
	Version     string
}

type LocationOutput

type LocationOutput struct {
	ID        int     `json:"id" header:"ID"`
	Name      string  `json:"name" header:"Name"`
	Country   string  `json:"country" header:"Country"`
	Metro     string  `json:"metro" header:"Metro"`
	SiteCode  string  `json:"site_code" header:"Site Code"`
	Market    string  `json:"market" header:"Market"`
	Latitude  float64 `json:"latitude" header:"-"`  // Exclude from table output
	Longitude float64 `json:"longitude" header:"-"` // Exclude from table output
	Status    string  `json:"status" header:"Status"`
}

LocationOutput represents the complete fields for JSON and CSV output.

func ToLocationOutput

func ToLocationOutput(l *megaport.Location) LocationOutput

ToLocationOutput converts a Location to a LocationOutput.

type LocationTableOutput added in v0.3.0

type LocationTableOutput struct {
	ID       int    `header:"ID"`
	Name     string `header:"Name"`
	Country  string `header:"Country"`
	Metro    string `header:"Metro"`
	SiteCode string `header:"Site Code"`
	Status   string `header:"Status"`
}

LocationTableOutput is a compact version for table display

func ToLocationTableOutput added in v0.3.0

func ToLocationTableOutput(l *megaport.Location) LocationTableOutput

ToLocationTableOutput converts a Location to a LocationTableOutput.

type MCROutput

type MCROutput struct {
	UID                string `json:"uid"`
	Name               string `json:"name"`
	LocationID         int    `json:"location_id"`
	ProvisioningStatus string `json:"provisioning_status"`
	// contains filtered or unexported fields
}

MCROutput represents the desired fields for JSON output of MCR details.

func ToMCROutput

func ToMCROutput(mcr *megaport.MCR) (MCROutput, error)

ToMCROutput converts a *megaport.MCR to our MCROutput struct.

type MVEOutput

type MVEOutput struct {
	UID        string `json:"uid"`
	Name       string `json:"name"`
	LocationID int    `json:"location_id"`
}

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 MockMCRService

type MockMCRService struct {
	BuyMCRResult                             *megaport.BuyMCRResponse
	BuyMCRErr                                error
	CapturedBuyMCRRequest                    *megaport.BuyMCRRequest
	ValidateMCROrderErr                      error
	GetMCRResult                             *megaport.MCR
	GetMCRErr                                error
	DeleteMCRResult                          *megaport.DeleteMCRResponse
	DeleteMCRErr                             error
	CapturedDeleteMCRUID                     string
	RestoreMCRResult                         *megaport.RestoreMCRResponse
	RestoreMCRErr                            error
	CapturedRestoreMCRUID                    string
	CreateMCRPrefixFilterListResult          *megaport.CreateMCRPrefixFilterListResponse
	CreateMCRPrefixFilterListErr             error
	CapturedCreateMCRPrefixFilterListRequest *megaport.CreateMCRPrefixFilterListRequest
	CapturedCreatePrefixFilterListRequest    *megaport.CreateMCRPrefixFilterListRequest

	CreateMCRPrefixFilterListResponse *megaport.CreateMCRPrefixFilterListResponse
	CreateMCRPrefixFilterListError    error
	CapturedCreatePrefixFilterList    *megaport.CreateMCRPrefixFilterListRequest

	ListMCRPrefixFilterListsResult           []*megaport.PrefixFilterList
	ListMCRPrefixFilterListsErr              error
	GetMCRPrefixFilterListResult             *megaport.MCRPrefixFilterList
	GetMCRPrefixFilterListErr                error
	ModifyMCRPrefixFilterListResult          *megaport.ModifyMCRPrefixFilterListResponse
	ModifyMCRPrefixFilterListErr             error
	CapturedModifyMCRPrefixFilterListRequest *megaport.MCRPrefixFilterList
	DeleteMCRPrefixFilterListResult          *megaport.DeleteMCRPrefixFilterListResponse
	DeleteMCRPrefixFilterListErr             error
	ModifyMCRResult                          *megaport.ModifyMCRResponse
	ModifyMCRErr                             error
	CapturedModifyMCRRequest                 *megaport.ModifyMCRRequest
	ListMCRResourceTagsResult                map[string]string
	ListMCRResourceTagsErr                   error
	UpdateMCRResourceTagsErr                 error
	CapturedUpdateMCRResourceTagsRequest     map[string]string
	GetMCRPrefixFilterListsResult            []*megaport.PrefixFilterList
	GetMCRPrefixFilterListsErr               error
	CapturedModifyPrefixFilterListMCRID      string
	CapturedModifyPrefixFilterListID         int
	CapturedModifyPrefixFilterList           *megaport.MCRPrefixFilterList
}

func (*MockMCRService) BuyMCR

func (*MockMCRService) CreatePrefixFilterList

CreatePrefixFilterList mocks the CreatePrefixFilterList method

func (*MockMCRService) DeleteMCR

func (*MockMCRService) DeleteMCRPrefixFilterList

func (m *MockMCRService) DeleteMCRPrefixFilterList(ctx context.Context, mcrID string, prefixFilterListID int) (*megaport.DeleteMCRPrefixFilterListResponse, error)

func (*MockMCRService) GetMCR

func (m *MockMCRService) GetMCR(ctx context.Context, mcrUID string) (*megaport.MCR, error)

func (*MockMCRService) GetMCRPrefixFilterList

func (m *MockMCRService) GetMCRPrefixFilterList(ctx context.Context, mcrID string, prefixFilterListID int) (*megaport.MCRPrefixFilterList, error)

func (*MockMCRService) GetMCRPrefixFilterLists

func (m *MockMCRService) GetMCRPrefixFilterLists(ctx context.Context, mcrID string) ([]*megaport.PrefixFilterList, error)

func (*MockMCRService) ListMCRPrefixFilterLists

func (m *MockMCRService) ListMCRPrefixFilterLists(ctx context.Context, mcrID string) ([]*megaport.PrefixFilterList, error)

func (*MockMCRService) ListMCRResourceTags

func (m *MockMCRService) ListMCRResourceTags(ctx context.Context, mcrID string) (map[string]string, error)

func (*MockMCRService) ModifyMCR

ModifyMCR mocks the ModifyMCR method of the MCR service

func (*MockMCRService) ModifyMCRPrefixFilterList

func (m *MockMCRService) ModifyMCRPrefixFilterList(ctx context.Context, mcrID string, prefixFilterListID int, prefixFilterList *megaport.MCRPrefixFilterList) (*megaport.ModifyMCRPrefixFilterListResponse, error)

ModifyMCRPrefixFilterList mocks the ModifyMCRPrefixFilterList method

func (*MockMCRService) RestoreMCR

func (m *MockMCRService) RestoreMCR(ctx context.Context, mcrUID string) (*megaport.RestoreMCRResponse, error)

func (*MockMCRService) UpdateMCRResourceTags

func (m *MockMCRService) UpdateMCRResourceTags(ctx context.Context, mcrID string, tags map[string]string) error

func (*MockMCRService) ValidateMCROrder

func (m *MockMCRService) ValidateMCROrder(ctx context.Context, req *megaport.BuyMCRRequest) error

type MockMVEService added in v0.1.8

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 added in v0.1.8

func (*MockMVEService) DeleteMVE added in v0.1.8

func (*MockMVEService) GetMVE added in v0.1.8

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

func (*MockMVEService) ListAvailableMVESizes added in v0.1.8

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

func (*MockMVEService) ListMVEImages added in v0.1.8

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

func (*MockMVEService) ListMVEResourceTags added in v0.1.8

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

func (*MockMVEService) ModifyMVE added in v0.1.8

func (*MockMVEService) Reset added in v0.2.3

func (m *MockMVEService) Reset()

func (*MockMVEService) UpdateMVEResourceTags added in v0.1.8

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

func (*MockMVEService) ValidateMVEOrder added in v0.1.8

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

type MockPortService

type MockPortService struct {
	// Optional fields to customize behavior
	GetPortErr                      error
	GetPortResult                   *megaport.Port
	ListPortsErr                    error
	ListPortsResult                 []*megaport.Port
	BuyPortErr                      error
	BuyPortResult                   *megaport.BuyPortResponse
	CapturedRequest                 *megaport.BuyPortRequest
	CheckPortVLANAvailabilityErr    error
	CheckPortVLANAvailabilityResult bool
	CapturedVLANRequest             struct {
		PortID string
		VLANID int
	}
	DeletePortErr         error
	DeletePortResult      *megaport.DeletePortResponse
	CapturedDeletePortUID string

	ListPortResourceTagsErr    error
	ListPortResourceTagsResult map[string]string
	CapturedResourceTagPortUID string

	ValidatePortOrderErr      error
	ModifyPortErr             error
	ModifyPortResult          *megaport.ModifyPortResponse
	CapturedModifyPortRequest *megaport.ModifyPortRequest
	RestorePortErr            error
	RestorePortResult         *megaport.RestorePortResponse
	CapturedRestorePortUID    string
	LockPortErr               error
	LockPortResult            *megaport.LockPortResponse
	CapturedLockPortUID       string
	UnlockPortErr             error
	UnlockPortResult          *megaport.UnlockPortResponse
	CapturedUnlockPortUID     string
	UpdatePortResourceTagsErr error
	CapturedUpdateTagsRequest struct {
		PortID string
		Tags   map[string]string
	}
	UpdatePortErr    error
	UpdatePortResult *megaport.ModifyPortResponse
}

MockPortService implements the required Port service methods for testing

func (*MockPortService) BuyPort

func (*MockPortService) CheckPortVLANAvailability

func (m *MockPortService) CheckPortVLANAvailability(ctx context.Context, portID string, vlanID int) (bool, error)

func (*MockPortService) DeletePort

func (*MockPortService) GetPort

func (m *MockPortService) GetPort(ctx context.Context, portID string) (*megaport.Port, error)

func (*MockPortService) ListPortResourceTags

func (m *MockPortService) ListPortResourceTags(ctx context.Context, portID string) (map[string]string, error)

func (*MockPortService) ListPorts

func (m *MockPortService) ListPorts(ctx context.Context) ([]*megaport.Port, error)

func (*MockPortService) LockPort

func (m *MockPortService) LockPort(ctx context.Context, portId string) (*megaport.LockPortResponse, error)

func (*MockPortService) ModifyPort

func (*MockPortService) RestorePort

func (m *MockPortService) RestorePort(ctx context.Context, portId string) (*megaport.RestorePortResponse, error)

func (*MockPortService) UnlockPort

func (m *MockPortService) UnlockPort(ctx context.Context, portId string) (*megaport.UnlockPortResponse, error)

func (*MockPortService) UpdatePortResourceTags

func (m *MockPortService) UpdatePortResourceTags(ctx context.Context, portID string, tags map[string]string) error

func (*MockPortService) ValidatePortOrder

func (m *MockPortService) ValidatePortOrder(ctx context.Context, req *megaport.BuyPortRequest) error

type MockServiceKeyService added in v0.1.8

type MockServiceKeyService struct {
	CreateServiceKeyError           error
	CreateServiceKeyResult          *megaport.CreateServiceKeyResponse
	CapturedCreateServiceKeyRequest *megaport.CreateServiceKeyRequest

	ListServiceKeysError           error
	ListServiceKeysResult          *megaport.ListServiceKeysResponse
	CapturedListServiceKeysRequest *megaport.ListServiceKeysRequest

	UpdateServiceKeyError           error
	UpdateServiceKeyResult          *megaport.UpdateServiceKeyResponse
	CapturedUpdateServiceKeyRequest *megaport.UpdateServiceKeyRequest

	GetServiceKeyError         error
	GetServiceKeyResult        *megaport.ServiceKey
	CapturedGetServiceKeyKeyID string
}

func (*MockServiceKeyService) CreateServiceKey added in v0.1.8

func (*MockServiceKeyService) GetServiceKey added in v0.1.8

func (m *MockServiceKeyService) GetServiceKey(ctx context.Context, keyId string) (*megaport.ServiceKey, error)

func (*MockServiceKeyService) ListServiceKeys added in v0.1.8

func (*MockServiceKeyService) UpdateServiceKey added in v0.1.8

type OutputFields added in v0.2.9

type OutputFields interface {
	any
}

OutputFields is a marker interface for output-formattable types

type PartnerOutput

type PartnerOutput struct {
	ProductName   string `json:"product_name"`
	UID           string `json:"uid"`
	ConnectType   string `json:"connect_type"`
	CompanyName   string `json:"company_name"`
	LocationId    int    `json:"location_id"`
	DiversityZone string `json:"diversity_zone"`
	VXCPermitted  bool   `json:"vxc_permitted"`
	// contains filtered or unexported fields
}

PartnerOutput represents the desired fields for JSON output.

func ToPartnerOutput

func ToPartnerOutput(p *megaport.PartnerMegaport) PartnerOutput

ToPartnerOutput converts a PartnerMegaport to a PartnerOutput.

type PortOutput

type PortOutput struct {
	UID                string `json:"uid"`
	Name               string `json:"name"`
	LocationID         int    `json:"location_id"`
	PortSpeed          int    `json:"port_speed"`
	ProvisioningStatus string `json:"provisioning_status"`
}

PortOutput represents the desired fields for JSON output.

func ToPortOutput

func ToPortOutput(port *megaport.Port) (PortOutput, error)

ToPortOutput converts a *megaport.Port to our PortOutput struct.

type PrefixFilterListEntryOutput added in v0.1.9

type PrefixFilterListEntryOutput struct {
	Action string `json:"action"`
	Prefix string `json:"prefix"`
	Ge     int    `json:"ge,omitempty"`
	Le     int    `json:"le,omitempty"`
}

type PrefixFilterListOutput added in v0.1.9

type PrefixFilterListOutput struct {
	ID            int                           `json:"id"`
	Description   string                        `json:"description"`
	AddressFamily string                        `json:"address_family"`
	Entries       []PrefixFilterListEntryOutput `json:"entries"`
}

PrefixFilterListOutput represents the desired fields for JSON output.

func ToPrefixFilterListOutput added in v0.1.9

func ToPrefixFilterListOutput(prefixFilterList *megaport.MCRPrefixFilterList) (PrefixFilterListOutput, error)

ToPrefixFilterListOutput converts a *megaport.MCRPrefixFilterList to our PrefixFilterListOutput struct.

type ServiceKeyOutput

type ServiceKeyOutput struct {
	KeyUID      string `json:"key_uid"`
	ProductName string `json:"product_name"`
	ProductUID  string `json:"product_uid"`
	Description string `json:"description"`
	CreateDate  string `json:"create_date"`
	// contains filtered or unexported fields
}

ServiceKeyOutput represents the desired fields for output

func ToServiceKeyOutput

func ToServiceKeyOutput(sk *megaport.ServiceKey) (ServiceKeyOutput, error)

ToServiceKeyOutput converts a ServiceKey to ServiceKeyOutput

type VXCOutput

type VXCOutput struct {
	UID     string `json:"uid"`
	Name    string `json:"name"`
	AEndUID string `json:"a_end_uid"`
	BEndUID string `json:"b_end_uid"`
	// contains filtered or unexported fields
}

VXCOutput represents the desired fields for JSON output.

func ToVXCOutput

func ToVXCOutput(v *megaport.VXC) (VXCOutput, error)

ToVXCOutput converts a VXC to a VXCOutput.

Jump to

Keyboard shortcuts

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