commands

package
v1.16.5 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

* Copyright 2019-present Ciena Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

View Source
const (
	DEFAULT_OLT_DEVICE_HEADER_FORMAT    = "table{{ .ID }}\t{{ .SerialNumber }}\t{{ .OperState }}\t{{ .InternalState }}\t{{ .IP }}\t{{ .NniDhcpTrapVid }}"
	DEFAULT_OLT_RESOURCES_HEADER_FORMAT = "table{{ .Type }}\t{{ .PonPortId }}\t{{ .OnuId }}\t{{ .PortNo }}\t{{ .ResourceId }}\t{{ .FlowId }}"
	DEFAULT_NNI_PORT_HEADER_FORMAT      = "table{{ .ID }}\t{{ .OperState }}\t{{ .InternalState }}\t{{ .PacketCount }}"
	DEFAULT_PON_PORT_HEADER_FORMAT      = "" /* 169-byte string literal not displayed */
)
View Source
const (
	DEFAULT_ONU_DEVICE_HEADER_FORMAT               = "" /* 228-byte string literal not displayed */
	DEFAULT_ONU_DEVICE_HEADER_FORMAT_WITH_SERVICES = "" /* 241-byte string literal not displayed */
)
View Source
const (
	DEFAULT_UNI_HEADER_FORMAT               = "table{{ .OnuSn }}\t{{ .OnuID }}\t{{ .ID }}\t{{ .MeID }}\t{{ .PortNo }}\t{{ .OperState }}\t{{ .Type }}"
	DEFAULT_UNI_HEADER_FORMAT_WITH_SERVICES = "table{{ .OnuSn }}\t{{ .OnuID }}\t{{ .ID }}\t{{ .MeID }}\t{{ .PortNo }}\t{{ .OperState }}\t{{ .Type }}\t{{ .Services }}"
)
View Source
const (
	DEFAULT_OLT_ALARM_LIST_FORMAT = "table{{ .Name }}"
)
View Source
const (
	DEFAULT_SERVICE_HEADER_FORMAT = "" /* 421-byte string literal not displayed */
)
View Source
const (
	DEFAULT_TRANSCEIVER_HEADER_FORMAT = "table{{ .ID }}\t{{ .UUID }}\t{{ .Name }}\t{{ .Technology }}\t{{ .PluggedIn }}\t{{ .PonIds }}"
)
View Source
const IgmpJoinKey string = "join"
View Source
const IgmpJoinKeyV3 string = "joinv3"
View Source
const IgmpLeaveKey string = "leave"

Variables

View Source
var IgmpAllowedActions = []string{IgmpJoinKey, IgmpLeaveKey, IgmpJoinKeyV3}

Functions

func RegisterCompletionCommands

func RegisterCompletionCommands(parent *flags.Parser)

func RegisterConfigCommands

func RegisterConfigCommands(parent *flags.Parser)

func RegisterDMICommands added in v1.4.3

func RegisterDMICommands(parser *flags.Parser)

func RegisterLoggingCommands

func RegisterLoggingCommands(parent *flags.Parser)

func RegisterONUCommands

func RegisterONUCommands(parser *flags.Parser)

func RegisterOltCommands

func RegisterOltCommands(parser *flags.Parser)

func RegisterPonCommands added in v0.0.19

func RegisterPonCommands(parser *flags.Parser)

func RegisterServiceCommands added in v1.0.0

func RegisterServiceCommands(parser *flags.Parser)

func RegisterUNICommands added in v1.9.0

func RegisterUNICommands(parser *flags.Parser)

Types

type AlarmClear added in v0.0.12

type AlarmClear struct {
	Parameters []string `short:"p" description:"Additional Alarm Parameter in name=value form"`
	Args       struct {
		Name         AlarmNameString
		SerialNumber OnuSnString
	} `positional-args:"yes" required:"yes"`
}

func (*AlarmClear) Execute added in v0.0.12

func (o *AlarmClear) Execute(args []string) error

Execute alarm clear

type AlarmList added in v0.0.12

type AlarmList struct{}

func (*AlarmList) Execute added in v0.0.12

func (o *AlarmList) Execute(args []string) error

Execute ONU alarm list

type AlarmListOutput added in v0.0.12

type AlarmListOutput struct {
	Name string
}

type AlarmNameString added in v0.0.13

type AlarmNameString string

func (*AlarmNameString) Complete added in v0.0.13

func (onuSn *AlarmNameString) Complete(match string) []flags.Completion

type AlarmOptions added in v0.0.12

type AlarmOptions struct {
	Raise AlarmRaise `command:"raise"`
	Clear AlarmClear `command:"clear"`
	List  AlarmList  `command:"list"`
}

type AlarmRaise added in v0.0.12

type AlarmRaise struct {
	Parameters []string `short:"p" description:"Additional Alarm Parameter in name=value form"`
	Args       struct {
		Name         AlarmNameString
		SerialNumber OnuSnString
	} `positional-args:"yes" required:"yes"`
}

func (*AlarmRaise) Execute added in v0.0.12

func (o *AlarmRaise) Execute(args []string) error

Execute alarm raise

type BashOptions

type BashOptions struct{}

func (*BashOptions) Execute

func (options *BashOptions) Execute(args []string) error

type CompletionOptions

type CompletionOptions struct {
	BashOptions `command:"bash"`
}

type ConfigOptions

type ConfigOptions struct{}

func (*ConfigOptions) Execute

func (options *ConfigOptions) Execute(args []string) error

type DMIOptions added in v1.4.3

type DMIOptions struct {
	Events      DmiEventOptions       `command:"events"`
	Transceiver DmiTransceiverOptions `command:"transceiver"`
}

type DmiEventCreate added in v1.4.3

type DmiEventCreate struct {
	Args struct {
		Name string
	} `positional-args:"yes" required:"yes"`
}

func (*DmiEventCreate) Execute added in v1.4.3

func (o *DmiEventCreate) Execute(args []string) error

Execute create event

type DmiEventOptions added in v1.4.3

type DmiEventOptions struct {
	Create DmiEventCreate `command:"create"`
}

type DmiTransceiverOptions added in v1.12.5

type DmiTransceiverOptions struct {
	PlugIn  DmiTransceiverPlugIn  `command:"plug_in"`
	PlugOut DmiTransceiverPlugOut `command:"plug_out"`
	List    DmiTransceiversList   `command:"list"`
}

type DmiTransceiverPlugIn added in v1.12.5

type DmiTransceiverPlugIn struct {
	Args struct {
		TransceiverId uint32
	} `positional-args:"yes" required:"yes"`
}

func (*DmiTransceiverPlugIn) Execute added in v1.12.5

func (pon *DmiTransceiverPlugIn) Execute(args []string) error

Plug in the specified transceiver

type DmiTransceiverPlugOut added in v1.12.5

type DmiTransceiverPlugOut struct {
	Args struct {
		TransceiverId uint32
	} `positional-args:"yes" required:"yes"`
}

func (*DmiTransceiverPlugOut) Execute added in v1.12.5

func (pon *DmiTransceiverPlugOut) Execute(args []string) error

Plug out the specified transceiver

type DmiTransceiversList added in v1.12.5

type DmiTransceiversList struct {
}

func (*DmiTransceiversList) Execute added in v1.12.5

func (pon *DmiTransceiversList) Execute(args []string) error

Print a list of the transceivers and their state

type GroupAddress added in v1.5.0

type GroupAddress string

type IgmpSubAction added in v0.0.15

type IgmpSubAction string

func (*IgmpSubAction) Complete added in v1.0.0

func (onuSn *IgmpSubAction) Complete(match string) []flags.Completion

type LoggingOptions

type LoggingOptions struct {
	Args struct {
		Level  string
		Caller bool
	} `positional-args:"yes" required:"yes"`
}

func (*LoggingOptions) Execute

func (options *LoggingOptions) Execute(args []string) error

type ONUDhcpRestart added in v0.0.5

type ONUDhcpRestart struct {
	Args struct {
		OnuSn OnuSnString
	} `positional-args:"yes" required:"yes"`
}

func (*ONUDhcpRestart) Execute added in v0.0.5

func (options *ONUDhcpRestart) Execute(args []string) error

type ONUEapolRestart added in v0.0.5

type ONUEapolRestart struct {
	Args struct {
		OnuSn OnuSnString
	} `positional-args:"yes" required:"yes"`
}

func (*ONUEapolRestart) Execute added in v0.0.5

func (options *ONUEapolRestart) Execute(args []string) error

type ONUFlows added in v0.0.18

type ONUFlows struct {
	Args struct {
		OnuSn OnuSnString
	} `positional-args:"yes" required:"yes"`
}

func (*ONUFlows) Execute added in v0.0.18

func (options *ONUFlows) Execute(args []string) error

type ONUGet

type ONUGet struct {
	Verbose bool `short:"v" long:"verbose" description:"Print all the informations we have about ONUs"`
	Args    struct {
		OnuSn OnuSnString
	} `positional-args:"yes" required:"yes"`
}

func (*ONUGet) Execute

func (options *ONUGet) Execute(args []string) error

type ONUIgmp added in v0.0.15

type ONUIgmp struct {
	Args struct {
		OnuSn        OnuSnString
		UniId        UniId
		SubAction    IgmpSubAction
		GroupAddress GroupAddress
	} `positional-args:"yes" required:"yes"`
	VLAN VLAN `short:"v" long:"vlan" description:"VLAN to set"`
}

func (*ONUIgmp) Execute added in v0.0.15

func (options *ONUIgmp) Execute(args []string) error

type ONUInvalidateMds added in v1.10.0

type ONUInvalidateMds struct {
	Args struct {
		OnuSn OnuSnString
	} `positional-args:"yes" required:"yes"`
}

func (*ONUInvalidateMds) Execute added in v1.10.0

func (options *ONUInvalidateMds) Execute(args []string) error

type ONUList

type ONUList struct {
	Verbose bool `short:"v" long:"verbose" description:"Print all the informations we have about ONUs"`
}

func (*ONUList) Execute

func (options *ONUList) Execute(args []string) error

type ONUOptions

type ONUOptions struct {
	List              ONUList              `command:"list"`
	Get               ONUGet               `command:"get"`
	ShutDown          ONUShutDown          `command:"shutdown"`
	PowerOn           ONUPowerOn           `command:"poweron"`
	RestartEapol      ONUEapolRestart      `command:"auth_restart"`
	RestartDchp       ONUDhcpRestart       `command:"dhcp_restart"`
	Igmp              ONUIgmp              `command:"igmp"`
	TrafficSchedulers ONUTrafficSchedulers `command:"traffic_schedulers"`
	Alarms            AlarmOptions         `command:"alarms"`
	Flows             ONUFlows             `command:"flows"`
	Services          ONUServices          `command:"services"`
	InvalidateMds     ONUInvalidateMds     `command:"invalidate_mds"`
}

type ONUPowerOn

type ONUPowerOn struct {
	Args struct {
		OnuSn OnuSnString
	} `positional-args:"yes" required:"yes"`
}

func (*ONUPowerOn) Execute

func (options *ONUPowerOn) Execute(args []string) error

type ONUServices added in v1.0.0

type ONUServices struct {
	Args struct {
		OnuSn OnuSnString
	} `positional-args:"yes"`
}

func (*ONUServices) Execute added in v1.0.0

func (options *ONUServices) Execute(args []string) error

type ONUShutDown

type ONUShutDown struct {
	Args struct {
		OnuSn OnuSnString
	} `positional-args:"yes" required:"yes"`
}

func (*ONUShutDown) Execute

func (options *ONUShutDown) Execute(args []string) error

type ONUTrafficSchedulers added in v0.0.18

type ONUTrafficSchedulers struct {
	Args struct {
		OnuSn OnuSnString
	} `positional-args:"yes" required:"yes"`
}

func (*ONUTrafficSchedulers) Execute added in v0.0.18

func (options *ONUTrafficSchedulers) Execute(args []string) error

type ONUUnis added in v1.8.0

type ONUUnis struct {
	Verbose bool `short:"v" long:"verbose" description:"Print all the informations we have about UNIs"`
	Args    struct {
		OnuSn OnuSnString
	} `positional-args:"yes" required:"yes"`
}

type OltAlarmClear added in v0.0.18

type OltAlarmClear struct {
	Args struct {
		Name   OltAlarmNameString
		IntfID OltInterfaceID
	} `positional-args:"yes" required:"yes"`
}

func (*OltAlarmClear) Execute added in v0.0.18

func (o *OltAlarmClear) Execute(args []string) error

Execute alarm clear

type OltAlarmList added in v0.0.18

type OltAlarmList struct{}

func (*OltAlarmList) Execute added in v0.0.18

func (o *OltAlarmList) Execute(args []string) error

Execute OLT alarm list

type OltAlarmListOutput added in v0.0.18

type OltAlarmListOutput struct {
	Name string
}

type OltAlarmNameString added in v0.0.18

type OltAlarmNameString string

func (*OltAlarmNameString) Complete added in v0.0.18

func (o *OltAlarmNameString) Complete(match string) []flags.Completion

type OltAlarmOptions added in v0.0.18

type OltAlarmOptions struct {
	Raise OltAlarmRaise `command:"raise"`
	Clear OltAlarmClear `command:"clear"`
	List  OltAlarmList  `command:"list"`
}

type OltAlarmRaise added in v0.0.18

type OltAlarmRaise struct {
	Args struct {
		Name   OltAlarmNameString
		IntfID OltInterfaceID
	} `positional-args:"yes" required:"yes"`
}

func (*OltAlarmRaise) Execute added in v0.0.18

func (o *OltAlarmRaise) Execute(args []string) error

Execute alarm raise

type OltFlows added in v0.0.18

type OltFlows struct{}

func (*OltFlows) Execute added in v0.0.18

func (o *OltFlows) Execute(args []string) error

type OltGet

type OltGet struct{}

func (*OltGet) Execute

func (o *OltGet) Execute(args []string) error

type OltInterfaceID added in v0.0.18

type OltInterfaceID uint32

type OltInterfaceStatus added in v0.0.18

type OltInterfaceStatus string

type OltNNIs

type OltNNIs struct{}

func (*OltNNIs) Execute

func (o *OltNNIs) Execute(args []string) error

type OltPONs

type OltPONs struct{}

func (*OltPONs) Execute

func (o *OltPONs) Execute(args []string) error

type OltPoweron added in v0.0.7

type OltPoweron struct{}

func (*OltPoweron) Execute added in v0.0.7

func (o *OltPoweron) Execute(args []string) error

type OltPoweronAllOnus added in v0.0.19

type OltPoweronAllOnus struct{}

func (*OltPoweronAllOnus) Execute added in v0.0.19

func (o *OltPoweronAllOnus) Execute(args []string) error

type OltReboot added in v0.0.7

type OltReboot struct{}

func (*OltReboot) Execute added in v0.0.7

func (o *OltReboot) Execute(args []string) error

type OltResources added in v1.5.2

type OltResources struct {
	Args struct {
		Type oltResourcesType
	} `positional-args:"yes" required:"yes"`
}

func (*OltResources) Execute added in v1.5.2

func (o *OltResources) Execute(args []string) error

type OltShutdown added in v0.0.7

type OltShutdown struct{}

func (*OltShutdown) Execute added in v0.0.7

func (o *OltShutdown) Execute(args []string) error

type OltShutdownAllOnus added in v0.0.19

type OltShutdownAllOnus struct{}

func (*OltShutdownAllOnus) Execute added in v0.0.19

func (o *OltShutdownAllOnus) Execute(args []string) error

type OnuSnString

type OnuSnString string

func (*OnuSnString) Complete

func (onuSn *OnuSnString) Complete(match string) []flags.Completion

type PONOptions added in v0.0.19

type PONOptions struct {
	PoweronAllOnus  PonPoweronAllOnus  `command:"poweronAllONUs"`
	ShutdownAllOnus PonShutdownAllOnus `command:"shutdownAllONUs"`
}

type PonPoweronAllOnus added in v0.0.19

type PonPoweronAllOnus struct {
	Args struct {
		IntfID OltInterfaceID
	} `positional-args:"yes" required:"yes"`
}

func (*PonPoweronAllOnus) Execute added in v0.0.19

func (pon *PonPoweronAllOnus) Execute(args []string) error

type PonShutdownAllOnus added in v0.0.19

type PonShutdownAllOnus struct {
	Args struct {
		IntfID OltInterfaceID
	} `positional-args:"yes" required:"yes"`
}

func (*PonShutdownAllOnus) Execute added in v0.0.19

func (pon *PonShutdownAllOnus) Execute(args []string) error

type RestartGrpcServer added in v1.4.1

type RestartGrpcServer struct {
	Args struct {
		Delay uint32
	} `positional-args:"yes" required:"yes"`
}

func (*RestartGrpcServer) Execute added in v1.4.1

func (o *RestartGrpcServer) Execute(args []string) error

type ServiceList added in v1.0.0

type ServiceList struct{}

func (*ServiceList) Execute added in v1.0.0

func (options *ServiceList) Execute(args []string) error

type ServiceOptions added in v1.0.0

type ServiceOptions struct {
	List ServiceList `command:"list"`
}

type StartGrpcServer added in v1.4.1

type StartGrpcServer struct{}

func (*StartGrpcServer) Execute added in v1.4.1

func (o *StartGrpcServer) Execute(args []string) error

type StopGrpcServer added in v1.4.1

type StopGrpcServer struct{}

func (*StopGrpcServer) Execute added in v1.4.1

func (o *StopGrpcServer) Execute(args []string) error

type UNIDhcpRestart added in v1.9.0

type UNIDhcpRestart struct {
	Args struct {
		OnuSn OnuSnString
		UniId UniIdInt
	} `positional-args:"yes" required:"yes"`
}

func (*UNIDhcpRestart) Execute added in v1.9.0

func (options *UNIDhcpRestart) Execute(args []string) error

type UNIEapolRestart added in v1.9.0

type UNIEapolRestart struct {
	Args struct {
		OnuSn OnuSnString
		UniId UniIdInt
	} `positional-args:"yes" required:"yes"`
}

func (*UNIEapolRestart) Execute added in v1.9.0

func (options *UNIEapolRestart) Execute(args []string) error

type UNIGet added in v1.9.0

type UNIGet struct {
	Verbose bool `short:"v" long:"verbose" description:"Print all the informations we have about UNIs"`
	Args    struct {
		OnuSn OnuSnString
	} `positional-args:"yes" required:"yes"`
}

func (*UNIGet) Execute added in v1.9.0

func (options *UNIGet) Execute(args []string) error

type UNIList added in v1.9.0

type UNIList struct {
	Verbose bool `short:"v" long:"verbose" description:"Print all the Unis from all the ONUs"`
}

func (*UNIList) Execute added in v1.9.0

func (options *UNIList) Execute(args []string) error

type UNIOptions added in v1.9.0

type UNIOptions struct {
	List         UNIList         `command:"list"`
	Get          UNIGet          `command:"get"`
	Services     UNIServices     `command:"services"`
	RestartEapol UNIEapolRestart `command:"auth_restart"`
	RestartDchp  UNIDhcpRestart  `command:"dhcp_restart"`
}

type UNIServices added in v1.9.0

type UNIServices struct {
	Verbose bool `short:"v" long:"verbose" description:"Print all the Services from the specified UNI"`
	Args    struct {
		OnuSn OnuSnString
		UniId UniIdInt
	} `positional-args:"yes"`
}

func (*UNIServices) Execute added in v1.9.0

func (options *UNIServices) Execute(args []string) error

Get Services for specified UNI First get UNIs from specified ONU SN Then get Services from appropriate UNI

type UniId added in v1.15.5

type UniId int

type UniIdInt added in v1.9.0

type UniIdInt string

func (*UniIdInt) Complete added in v1.9.0

func (uniId *UniIdInt) Complete(match string) []flags.Completion

type VLAN added in v1.15.5

type VLAN int

Jump to

Keyboard shortcuts

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