Documentation
¶
Index ¶
- func AddCommandsTo(rootCmd *cobra.Command)
- func BuyLAGPort(cmd *cobra.Command, args []string, noColor bool) error
- func BuyPort(cmd *cobra.Command, args []string, noColor bool) error
- func CheckPortVLANAvailability(cmd *cobra.Command, args []string, noColor bool) error
- func DeletePort(cmd *cobra.Command, args []string, noColor bool) error
- func GetPort(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error
- func GetPortHelp(cmd *cobra.Command, args []string) error
- func ListPorts(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error
- func LockPort(cmd *cobra.Command, args []string, noColor bool) error
- func RestorePort(cmd *cobra.Command, args []string, noColor bool) error
- func UnlockPort(cmd *cobra.Command, args []string, noColor bool) error
- func UpdatePort(cmd *cobra.Command, args []string, noColor bool) 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 PortOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommandsTo ¶
func GetPortHelp ¶
GetPortHelp is a placeholder function for the ports help command
Types ¶
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 PortOutput ¶
type PortOutput struct {
output.Output `json:"-" header:"-"`
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.
Click to show internal directories.
Click to hide internal directories.