Documentation
¶
Index ¶
- func AddCommonBuyFlags(cmd *cobra.Command)
- func AddCommonUpdateFlags(cmd *cobra.Command)
- func BuyLAGPort(cmd *cobra.Command, args []string) error
- func BuyMCR(cmd *cobra.Command, args []string) error
- func BuyMVE(cmd *cobra.Command, args []string) error
- func BuyPort(cmd *cobra.Command, args []string) error
- func BuyVXC(cmd *cobra.Command, args []string) error
- func CheckPortVLANAvailability(cmd *cobra.Command, args []string) error
- func CreateMCRPrefixFilterList(cmd *cobra.Command, args []string) error
- func CreateServiceKey(cmd *cobra.Command, args []string) error
- func DeleteMCR(cmd *cobra.Command, args []string) error
- func DeleteMCRPrefixFilterList(cmd *cobra.Command, args []string) error
- func DeleteMVE(cmd *cobra.Command, args []string) error
- func DeletePort(cmd *cobra.Command, args []string) error
- func DeleteVXC(cmd *cobra.Command, args []string) error
- func Execute()
- func FindPartners(cmd *cobra.Command, args []string) error
- func FormatCommandName(name string) string
- func FormatConfirmation(msg string) string
- func FormatExample(example string) string
- func FormatJSONExample(json string) string
- func FormatOptionalFlag(flag string, description string) string
- func FormatPrompt(msg string) string
- func FormatRequiredFlag(flag string, description string) string
- func FormatSuccess(msg string) string
- func GetLocation(cmd *cobra.Command, args []string) error
- func GetMCR(cmd *cobra.Command, args []string) error
- func GetMCRPrefixFilterList(cmd *cobra.Command, args []string) error
- func GetMVE(cmd *cobra.Command, args []string) error
- func GetPort(cmd *cobra.Command, args []string) error
- func GetPortHelp(cmd *cobra.Command, args []string) error
- func GetServiceKey(cmd *cobra.Command, args []string) error
- func GetVXC(cmd *cobra.Command, args []string) error
- func ListAvailableMVESizes(cmd *cobra.Command, args []string) error
- func ListLocations(cmd *cobra.Command, args []string) error
- func ListMCRPrefixFilterLists(cmd *cobra.Command, args []string) error
- func ListMVEImages(cmd *cobra.Command, args []string) error
- func ListPartners(cmd *cobra.Command, args []string) error
- func ListPorts(cmd *cobra.Command, args []string) error
- func ListServiceKeys(cmd *cobra.Command, args []string) error
- func LockPort(cmd *cobra.Command, args []string) error
- func Login(ctx context.Context) (*megaport.Client, error)
- func MarkFlagsRequired(cmd *cobra.Command, flags []string) error
- func PrintError(format string, args ...interface{})
- func PrintInfo(format string, args ...interface{})
- func PrintResourceCreated(resourceType, uid string)
- func PrintResourceDeleted(resourceType, uid string, immediate bool)
- func PrintResourceSuccess(resourceType, action, uid string)
- func PrintResourceUpdated(resourceType, uid string)
- func PrintSuccess(format string, args ...interface{})
- func PrintWarning(format string, args ...interface{})
- func RestoreMCR(cmd *cobra.Command, args []string) error
- func RestorePort(cmd *cobra.Command, args []string) error
- func RunCompletion(cmd *cobra.Command, args []string) error
- func UnlockPort(cmd *cobra.Command, args []string) error
- func UpdateMCR(cmd *cobra.Command, args []string) error
- func UpdateMCRPrefixFilterList(cmd *cobra.Command, args []string) error
- func UpdateMVE(cmd *cobra.Command, args []string) error
- func UpdatePort(cmd *cobra.Command, args []string) error
- func UpdateServiceKey(cmd *cobra.Command, args []string) error
- func UpdateVXC(cmd *cobra.Command, args []string) error
- func WrapRunE(runE func(cmd *cobra.Command, args []string) error) func(cmd *cobra.Command, args []string) error
- type CommandData
- type CommandHelpBuilder
- type CommandInfo
- type FlagInfo
- type IndexData
- type LocationOutput
- type LocationTableOutput
- type MCROutput
- type MVEOutput
- type MockMCRService
- func (m *MockMCRService) BuyMCR(ctx context.Context, req *megaport.BuyMCRRequest) (*megaport.BuyMCRResponse, error)
- func (m *MockMCRService) CreatePrefixFilterList(ctx context.Context, req *megaport.CreateMCRPrefixFilterListRequest) (*megaport.CreateMCRPrefixFilterListResponse, error)
- func (m *MockMCRService) DeleteMCR(ctx context.Context, req *megaport.DeleteMCRRequest) (*megaport.DeleteMCRResponse, error)
- func (m *MockMCRService) DeleteMCRPrefixFilterList(ctx context.Context, mcrID string, prefixFilterListID int) (*megaport.DeleteMCRPrefixFilterListResponse, error)
- func (m *MockMCRService) GetMCR(ctx context.Context, mcrUID string) (*megaport.MCR, error)
- func (m *MockMCRService) GetMCRPrefixFilterList(ctx context.Context, mcrID string, prefixFilterListID int) (*megaport.MCRPrefixFilterList, error)
- func (m *MockMCRService) GetMCRPrefixFilterLists(ctx context.Context, mcrID string) ([]*megaport.PrefixFilterList, error)
- func (m *MockMCRService) ListMCRPrefixFilterLists(ctx context.Context, mcrID string) ([]*megaport.PrefixFilterList, error)
- func (m *MockMCRService) ListMCRResourceTags(ctx context.Context, mcrID string) (map[string]string, error)
- func (m *MockMCRService) ModifyMCR(ctx context.Context, req *megaport.ModifyMCRRequest) (*megaport.ModifyMCRResponse, error)
- func (m *MockMCRService) ModifyMCRPrefixFilterList(ctx context.Context, mcrID string, prefixFilterListID int, ...) (*megaport.ModifyMCRPrefixFilterListResponse, error)
- func (m *MockMCRService) RestoreMCR(ctx context.Context, mcrUID string) (*megaport.RestoreMCRResponse, error)
- func (m *MockMCRService) UpdateMCRResourceTags(ctx context.Context, mcrID string, tags map[string]string) error
- func (m *MockMCRService) ValidateMCROrder(ctx context.Context, req *megaport.BuyMCRRequest) error
- type MockMVEService
- func (m *MockMVEService) BuyMVE(ctx context.Context, req *megaport.BuyMVERequest) (*megaport.BuyMVEResponse, error)
- func (m *MockMVEService) DeleteMVE(ctx context.Context, req *megaport.DeleteMVERequest) (*megaport.DeleteMVEResponse, error)
- func (m *MockMVEService) GetMVE(ctx context.Context, mveId string) (*megaport.MVE, error)
- func (m *MockMVEService) ListAvailableMVESizes(ctx context.Context) ([]*megaport.MVESize, error)
- func (m *MockMVEService) ListMVEImages(ctx context.Context) ([]*megaport.MVEImage, error)
- func (m *MockMVEService) ListMVEResourceTags(ctx context.Context, mveID string) (map[string]string, error)
- func (m *MockMVEService) ModifyMVE(ctx context.Context, req *megaport.ModifyMVERequest) (*megaport.ModifyMVEResponse, error)
- func (m *MockMVEService) Reset()
- func (m *MockMVEService) UpdateMVEResourceTags(ctx context.Context, mveID string, tags map[string]string) error
- func (m *MockMVEService) ValidateMVEOrder(ctx context.Context, req *megaport.BuyMVERequest) error
- type MockPortService
- func (m *MockPortService) BuyPort(ctx context.Context, req *megaport.BuyPortRequest) (*megaport.BuyPortResponse, error)
- func (m *MockPortService) CheckPortVLANAvailability(ctx context.Context, portID string, vlanID int) (bool, error)
- func (m *MockPortService) DeletePort(ctx context.Context, req *megaport.DeletePortRequest) (*megaport.DeletePortResponse, error)
- func (m *MockPortService) GetPort(ctx context.Context, portID string) (*megaport.Port, error)
- func (m *MockPortService) ListPortResourceTags(ctx context.Context, portID string) (map[string]string, error)
- func (m *MockPortService) ListPorts(ctx context.Context) ([]*megaport.Port, error)
- func (m *MockPortService) LockPort(ctx context.Context, portId string) (*megaport.LockPortResponse, error)
- func (m *MockPortService) ModifyPort(ctx context.Context, req *megaport.ModifyPortRequest) (*megaport.ModifyPortResponse, error)
- func (m *MockPortService) RestorePort(ctx context.Context, portId string) (*megaport.RestorePortResponse, error)
- func (m *MockPortService) UnlockPort(ctx context.Context, portId string) (*megaport.UnlockPortResponse, error)
- func (m *MockPortService) UpdatePortResourceTags(ctx context.Context, portID string, tags map[string]string) error
- func (m *MockPortService) ValidatePortOrder(ctx context.Context, req *megaport.BuyPortRequest) error
- type MockServiceKeyService
- func (m *MockServiceKeyService) CreateServiceKey(ctx context.Context, req *megaport.CreateServiceKeyRequest) (*megaport.CreateServiceKeyResponse, error)
- func (m *MockServiceKeyService) GetServiceKey(ctx context.Context, keyId string) (*megaport.ServiceKey, error)
- func (m *MockServiceKeyService) ListServiceKeys(ctx context.Context, req *megaport.ListServiceKeysRequest) (*megaport.ListServiceKeysResponse, error)
- func (m *MockServiceKeyService) UpdateServiceKey(ctx context.Context, req *megaport.UpdateServiceKeyRequest) (*megaport.UpdateServiceKeyResponse, error)
- type OutputFields
- type PartnerOutput
- type PortOutput
- type PrefixFilterListEntryOutput
- type PrefixFilterListOutput
- type ServiceKeyOutput
- type VXCOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommonBuyFlags ¶ added in v0.3.0
AddCommonBuyFlags adds common flags for buy commands
func AddCommonUpdateFlags ¶ added in v0.3.0
AddCommonUpdateFlags adds common flags for update commands
func CheckPortVLANAvailability ¶ added in v0.1.7
func CreateMCRPrefixFilterList ¶ added in v0.1.9
func DeleteMCRPrefixFilterList ¶ added in v0.1.9
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
FindPartners implements the interactive search functionality for partner ports.
func FormatCommandName ¶ added in v0.3.0
FormatCommandName colorizes command names
func FormatConfirmation ¶ added in v0.3.0
FormatConfirmation returns a formatted confirmation prompt
func FormatExample ¶ added in v0.3.0
FormatExample colorizes command examples in help text
func FormatJSONExample ¶ added in v0.3.0
FormatJSONExample formats JSON examples in help text
func FormatOptionalFlag ¶ added in v0.3.0
FormatOptionalFlag formats optional flags in help text
func FormatPrompt ¶ added in v0.3.0
FormatPrompt returns a formatted input prompt
func FormatRequiredFlag ¶ added in v0.3.0
FormatRequiredFlag highlights required flags in help text
func FormatSuccess ¶ added in v0.3.0
FormatSuccess returns a formatted success string
func GetMCRPrefixFilterList ¶ added in v0.1.9
func GetPortHelp ¶ added in v0.3.0
GetPortHelp is a placeholder function for the ports help command
func ListAvailableMVESizes ¶ added in v0.2.0
func ListMCRPrefixFilterLists ¶ added in v0.1.9
func MarkFlagsRequired ¶ added in v0.3.0
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
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 UpdateMCRPrefixFilterList ¶ added in v0.1.9
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 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.
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.
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 (m *MockMCRService) BuyMCR(ctx context.Context, req *megaport.BuyMCRRequest) (*megaport.BuyMCRResponse, error)
func (*MockMCRService) CreatePrefixFilterList ¶
func (m *MockMCRService) CreatePrefixFilterList(ctx context.Context, req *megaport.CreateMCRPrefixFilterListRequest) (*megaport.CreateMCRPrefixFilterListResponse, error)
CreatePrefixFilterList mocks the CreatePrefixFilterList method
func (*MockMCRService) DeleteMCR ¶
func (m *MockMCRService) DeleteMCR(ctx context.Context, req *megaport.DeleteMCRRequest) (*megaport.DeleteMCRResponse, error)
func (*MockMCRService) DeleteMCRPrefixFilterList ¶
func (m *MockMCRService) DeleteMCRPrefixFilterList(ctx context.Context, mcrID string, prefixFilterListID int) (*megaport.DeleteMCRPrefixFilterListResponse, 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 (*MockMCRService) ModifyMCR ¶
func (m *MockMCRService) ModifyMCR(ctx context.Context, req *megaport.ModifyMCRRequest) (*megaport.ModifyMCRResponse, error)
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 (*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 (m *MockMVEService) BuyMVE(ctx context.Context, req *megaport.BuyMVERequest) (*megaport.BuyMVEResponse, error)
func (*MockMVEService) DeleteMVE ¶ added in v0.1.8
func (m *MockMVEService) DeleteMVE(ctx context.Context, req *megaport.DeleteMVERequest) (*megaport.DeleteMVEResponse, error)
func (*MockMVEService) ListAvailableMVESizes ¶ added in v0.1.8
func (*MockMVEService) ListMVEImages ¶ added in v0.1.8
func (*MockMVEService) ListMVEResourceTags ¶ added in v0.1.8
func (*MockMVEService) ModifyMVE ¶ added in v0.1.8
func (m *MockMVEService) ModifyMVE(ctx context.Context, req *megaport.ModifyMVERequest) (*megaport.ModifyMVEResponse, error)
func (*MockMVEService) Reset ¶ added in v0.2.3
func (m *MockMVEService) Reset()
func (*MockMVEService) UpdateMVEResourceTags ¶ added in v0.1.8
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 (m *MockPortService) BuyPort(ctx context.Context, req *megaport.BuyPortRequest) (*megaport.BuyPortResponse, error)
func (*MockPortService) CheckPortVLANAvailability ¶
func (*MockPortService) DeletePort ¶
func (m *MockPortService) DeletePort(ctx context.Context, req *megaport.DeletePortRequest) (*megaport.DeletePortResponse, error)
func (*MockPortService) ListPortResourceTags ¶
func (*MockPortService) LockPort ¶
func (m *MockPortService) LockPort(ctx context.Context, portId string) (*megaport.LockPortResponse, error)
func (*MockPortService) ModifyPort ¶
func (m *MockPortService) ModifyPort(ctx context.Context, req *megaport.ModifyPortRequest) (*megaport.ModifyPortResponse, error)
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 (*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 (m *MockServiceKeyService) CreateServiceKey(ctx context.Context, req *megaport.CreateServiceKeyRequest) (*megaport.CreateServiceKeyResponse, error)
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 (m *MockServiceKeyService) ListServiceKeys(ctx context.Context, req *megaport.ListServiceKeysRequest) (*megaport.ListServiceKeysResponse, error)
func (*MockServiceKeyService) UpdateServiceKey ¶ added in v0.1.8
func (m *MockServiceKeyService) UpdateServiceKey(ctx context.Context, req *megaport.UpdateServiceKeyRequest) (*megaport.UpdateServiceKeyResponse, error)
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 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
Source Files
¶
- completion.go
- flags.go
- generate_docs.go
- help_builder.go
- locations.go
- locations_actions.go
- locations_utils.go
- mcr.go
- mcr_actions.go
- mcr_mock.go
- mcr_utils.go
- megaport.go
- messages.go
- mve.go
- mve_actions.go
- mve_mock.go
- mve_utils.go
- output.go
- partners.go
- partners_actions.go
- partners_mock.go
- partners_utils.go
- ports.go
- ports_actions.go
- ports_mock.go
- ports_utils.go
- root.go
- servicekeys.go
- servicekeys_actions.go
- servicekeys_mock.go
- servicekeys_utils.go
- utils.go
- vxc.go
- vxc_actions.go
- vxc_mock.go
- vxc_utils.go