otdr

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	OTDR_Initiate_FullMethodName = "/gnoi.optical.OTDR/Initiate"
)

Variables

View Source
var (
	FiberTypeProfile_name = map[int32]string{
		0: "FTP_UNKNOWN",
		1: "FTP_DSF",
		2: "FTP_LEAF",
		3: "FTP_SSMF",
		4: "FTP_TWC",
		5: "FTP_TWRS",
		6: "FTP_LS",
		7: "FTP_TERAWAVE",
		8: "FTP_TERALIGHT",
	}
	FiberTypeProfile_value = map[string]int32{
		"FTP_UNKNOWN":   0,
		"FTP_DSF":       1,
		"FTP_LEAF":      2,
		"FTP_SSMF":      3,
		"FTP_TWC":       4,
		"FTP_TWRS":      5,
		"FTP_LS":        6,
		"FTP_TERAWAVE":  7,
		"FTP_TERALIGHT": 8,
	}
)

Enum value maps for FiberTypeProfile.

View Source
var (
	InitiateRequest_ResultsMethod_name = map[int32]string{
		0: "RESULTS_UNKNOWN",
		1: "RESULTS_TO_LOCAL_DISK",
		2: "RESULTS_IN_RESPONSE",
	}
	InitiateRequest_ResultsMethod_value = map[string]int32{
		"RESULTS_UNKNOWN":       0,
		"RESULTS_TO_LOCAL_DISK": 1,
		"RESULTS_IN_RESPONSE":   2,
	}
)

Enum value maps for InitiateRequest_ResultsMethod.

View Source
var (
	InitiateProgress_State_name = map[int32]string{
		0: "UNKNOWN",
		1: "RUNNING",
		2: "PENDING",
		3: "COMPLETE",
	}
	InitiateProgress_State_value = map[string]int32{
		"UNKNOWN":  0,
		"RUNNING":  1,
		"PENDING":  2,
		"COMPLETE": 3,
	}
)

Enum value maps for InitiateProgress_State.

View Source
var (
	InitiateError_Type_name = map[int32]string{
		0: "UNSPECIFIED",
		1: "ALREADY_IN_PROGRESS",
		2: "HARDWARE_FAILURE",
	}
	InitiateError_Type_value = map[string]int32{
		"UNSPECIFIED":         0,
		"ALREADY_IN_PROGRESS": 1,
		"HARDWARE_FAILURE":    2,
	}
)

Enum value maps for InitiateError_Type.

View Source
var File_otdr_otdr_proto protoreflect.FileDescriptor
View Source
var OTDR_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gnoi.optical.OTDR",
	HandlerType: (*OTDRServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Initiate",
			Handler:       _OTDR_Initiate_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "otdr/otdr.proto",
}

OTDR_ServiceDesc is the grpc.ServiceDesc for OTDR service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterOTDRServer

func RegisterOTDRServer(s grpc.ServiceRegistrar, srv OTDRServer)

Types

type Event

type Event struct {

	// Distance at which the event occurred in meters.
	DistanceM float32 `protobuf:"fixed32,1,opt,name=distance_m,json=distanceM,proto3" json:"distance_m,omitempty"`
	// The fiber loss that occurred at the event in dB.
	LossDb float32 `protobuf:"fixed32,2,opt,name=loss_db,json=lossDb,proto3" json:"loss_db,omitempty"`
	// The reflection that occurred at the event in dB.
	ReflectionDb float32 `protobuf:"fixed32,3,opt,name=reflection_db,json=reflectionDb,proto3" json:"reflection_db,omitempty"`
	// contains filtered or unexported fields
}

func (*Event) Descriptor deprecated

func (*Event) Descriptor() ([]byte, []int)

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetDistanceM

func (x *Event) GetDistanceM() float32

func (*Event) GetLossDb

func (x *Event) GetLossDb() float32

func (*Event) GetReflectionDb

func (x *Event) GetReflectionDb() float32

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

func (x *Event) ProtoReflect() protoreflect.Message

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

type FiberTypeProfile

type FiberTypeProfile int32

Type definition for different profiles of fiber types. These match what is already defined in OpenConfig under the FIBER_TYPE_PROFILE identityref in openconfig-optical-amplifier.yang model.

const (
	FiberTypeProfile_FTP_UNKNOWN   FiberTypeProfile = 0
	FiberTypeProfile_FTP_DSF       FiberTypeProfile = 1 // Dispersion shifted fiber.
	FiberTypeProfile_FTP_LEAF      FiberTypeProfile = 2 // Large effective area fiber.
	FiberTypeProfile_FTP_SSMF      FiberTypeProfile = 3 // Standard single mode fiber.
	FiberTypeProfile_FTP_TWC       FiberTypeProfile = 4 // True wave classic fiber.
	FiberTypeProfile_FTP_TWRS      FiberTypeProfile = 5 // True wave reduced slope fiber.
	FiberTypeProfile_FTP_LS        FiberTypeProfile = 6 // LEAF Submarine fiber.
	FiberTypeProfile_FTP_TERAWAVE  FiberTypeProfile = 7 // TeraWave fiber.
	FiberTypeProfile_FTP_TERALIGHT FiberTypeProfile = 8 // TeraLight fiber.
)

func (FiberTypeProfile) Descriptor

func (FiberTypeProfile) Enum

func (FiberTypeProfile) EnumDescriptor deprecated

func (FiberTypeProfile) EnumDescriptor() ([]byte, []int)

Deprecated: Use FiberTypeProfile.Descriptor instead.

func (FiberTypeProfile) Number

func (FiberTypeProfile) String

func (x FiberTypeProfile) String() string

func (FiberTypeProfile) Type

type InitiateError

type InitiateError struct {
	Type   InitiateError_Type `protobuf:"varint,1,opt,name=type,proto3,enum=gnoi.optical.InitiateError_Type" json:"type,omitempty"`
	Detail string             `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"`
	// contains filtered or unexported fields
}

func (*InitiateError) Descriptor deprecated

func (*InitiateError) Descriptor() ([]byte, []int)

Deprecated: Use InitiateError.ProtoReflect.Descriptor instead.

func (*InitiateError) GetDetail

func (x *InitiateError) GetDetail() string

func (*InitiateError) GetType

func (x *InitiateError) GetType() InitiateError_Type

func (*InitiateError) ProtoMessage

func (*InitiateError) ProtoMessage()

func (*InitiateError) ProtoReflect

func (x *InitiateError) ProtoReflect() protoreflect.Message

func (*InitiateError) Reset

func (x *InitiateError) Reset()

func (*InitiateError) String

func (x *InitiateError) String() string

type InitiateError_Type

type InitiateError_Type int32
const (
	// An unspecified error. Must use the detail value to describe the issue.
	InitiateError_UNSPECIFIED InitiateError_Type = 0
	// An existing OTDR trace is already in progress.
	InitiateError_ALREADY_IN_PROGRESS InitiateError_Type = 1
	// The OTDR hardware has failed and cannot complete an OTDR trace.
	InitiateError_HARDWARE_FAILURE InitiateError_Type = 2
)

func (InitiateError_Type) Descriptor

func (InitiateError_Type) Enum

func (InitiateError_Type) EnumDescriptor deprecated

func (InitiateError_Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use InitiateError_Type.Descriptor instead.

func (InitiateError_Type) Number

func (InitiateError_Type) String

func (x InitiateError_Type) String() string

func (InitiateError_Type) Type

type InitiateProgress

type InitiateProgress struct {

	// The state of the OTDR trace requested. Note that this does not include
	// error states as these should be returned as a gRPC error.
	State InitiateProgress_State `protobuf:"varint,1,opt,name=state,proto3,enum=gnoi.optical.InitiateProgress_State" json:"state,omitempty"`
	// contains filtered or unexported fields
}

func (*InitiateProgress) Descriptor deprecated

func (*InitiateProgress) Descriptor() ([]byte, []int)

Deprecated: Use InitiateProgress.ProtoReflect.Descriptor instead.

func (*InitiateProgress) GetState

func (*InitiateProgress) ProtoMessage

func (*InitiateProgress) ProtoMessage()

func (*InitiateProgress) ProtoReflect

func (x *InitiateProgress) ProtoReflect() protoreflect.Message

func (*InitiateProgress) Reset

func (x *InitiateProgress) Reset()

func (*InitiateProgress) String

func (x *InitiateProgress) String() string

type InitiateProgress_State

type InitiateProgress_State int32

The State enum defines possible states that the OTDR trace may be in while running the operation.

const (
	InitiateProgress_UNKNOWN  InitiateProgress_State = 0
	InitiateProgress_RUNNING  InitiateProgress_State = 1 // The OTDR is currently performing an OTDR trace.
	InitiateProgress_PENDING  InitiateProgress_State = 2 // The OTDR is pending underlying resources being available.
	InitiateProgress_COMPLETE InitiateProgress_State = 3 // The OTDR trace was completed.
)

func (InitiateProgress_State) Descriptor

func (InitiateProgress_State) Enum

func (InitiateProgress_State) EnumDescriptor deprecated

func (InitiateProgress_State) EnumDescriptor() ([]byte, []int)

Deprecated: Use InitiateProgress_State.Descriptor instead.

func (InitiateProgress_State) Number

func (InitiateProgress_State) String

func (x InitiateProgress_State) String() string

func (InitiateProgress_State) Type

type InitiateRequest

type InitiateRequest struct {

	// Absolute path to the /components/component list member in the OpenConfig
	// model corresponding to the port to perform the OTDR trace from.
	// (e.g., /components/component[name=otdr-1-1])
	Component *types.Path `protobuf:"bytes,1,opt,name=component,proto3" json:"component,omitempty"`
	// Describes how the results of the OTDR trace should be made available. More
	// than one option may be specified if desired.
	ResultsMethod []InitiateRequest_ResultsMethod `` /* 156-byte string literal not displayed */
	// Describes the configuration used to perform an OTDR trace.
	Configuration *OTDRConfiguration `protobuf:"bytes,3,opt,name=configuration,proto3" json:"configuration,omitempty"`
	// If specified, the device will label the OTDR trace so it can be recalled
	// later. For example, the initial OTDR trace measured during span
	// commissioning might be labeled "baseline".
	Label string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`
	// contains filtered or unexported fields
}

func (*InitiateRequest) Descriptor deprecated

func (*InitiateRequest) Descriptor() ([]byte, []int)

Deprecated: Use InitiateRequest.ProtoReflect.Descriptor instead.

func (*InitiateRequest) GetComponent

func (x *InitiateRequest) GetComponent() *types.Path

func (*InitiateRequest) GetConfiguration

func (x *InitiateRequest) GetConfiguration() *OTDRConfiguration

func (*InitiateRequest) GetLabel

func (x *InitiateRequest) GetLabel() string

func (*InitiateRequest) GetResultsMethod

func (x *InitiateRequest) GetResultsMethod() []InitiateRequest_ResultsMethod

func (*InitiateRequest) ProtoMessage

func (*InitiateRequest) ProtoMessage()

func (*InitiateRequest) ProtoReflect

func (x *InitiateRequest) ProtoReflect() protoreflect.Message

func (*InitiateRequest) Reset

func (x *InitiateRequest) Reset()

func (*InitiateRequest) String

func (x *InitiateRequest) String() string

type InitiateRequest_ResultsMethod

type InitiateRequest_ResultsMethod int32
const (
	InitiateRequest_RESULTS_UNKNOWN       InitiateRequest_ResultsMethod = 0
	InitiateRequest_RESULTS_TO_LOCAL_DISK InitiateRequest_ResultsMethod = 1 // Results saved to a file on the device.
	InitiateRequest_RESULTS_IN_RESPONSE   InitiateRequest_ResultsMethod = 2 // Results sent back in the response.
)

func (InitiateRequest_ResultsMethod) Descriptor

func (InitiateRequest_ResultsMethod) Enum

func (InitiateRequest_ResultsMethod) EnumDescriptor deprecated

func (InitiateRequest_ResultsMethod) EnumDescriptor() ([]byte, []int)

Deprecated: Use InitiateRequest_ResultsMethod.Descriptor instead.

func (InitiateRequest_ResultsMethod) Number

func (InitiateRequest_ResultsMethod) String

func (InitiateRequest_ResultsMethod) Type

type InitiateResponse

type InitiateResponse struct {

	// Types that are assignable to Response:
	//
	//	*InitiateResponse_Progress
	//	*InitiateResponse_Results
	//	*InitiateResponse_Error
	Response isInitiateResponse_Response `protobuf_oneof:"response"`
	// contains filtered or unexported fields
}

IntitiateResponse describes the possible response messages that will be streamed after the RPC is initiated. While the OTDR is running, "progress" messages should be sent at a regular interval. When the OTDR trace is completed, a final "results" or "error" message should be streamed before the RPC is terminated.

func (*InitiateResponse) Descriptor deprecated

func (*InitiateResponse) Descriptor() ([]byte, []int)

Deprecated: Use InitiateResponse.ProtoReflect.Descriptor instead.

func (*InitiateResponse) GetError

func (x *InitiateResponse) GetError() *InitiateError

func (*InitiateResponse) GetProgress

func (x *InitiateResponse) GetProgress() *InitiateProgress

func (*InitiateResponse) GetResponse

func (m *InitiateResponse) GetResponse() isInitiateResponse_Response

func (*InitiateResponse) GetResults

func (x *InitiateResponse) GetResults() *InitiateResults

func (*InitiateResponse) ProtoMessage

func (*InitiateResponse) ProtoMessage()

func (*InitiateResponse) ProtoReflect

func (x *InitiateResponse) ProtoReflect() protoreflect.Message

func (*InitiateResponse) Reset

func (x *InitiateResponse) Reset()

func (*InitiateResponse) String

func (x *InitiateResponse) String() string

type InitiateResponse_Error

type InitiateResponse_Error struct {
	Error *InitiateError `protobuf:"bytes,3,opt,name=error,proto3,oneof"`
}

type InitiateResponse_Progress

type InitiateResponse_Progress struct {
	Progress *InitiateProgress `protobuf:"bytes,1,opt,name=progress,proto3,oneof"`
}

type InitiateResponse_Results

type InitiateResponse_Results struct {
	Results *InitiateResults `protobuf:"bytes,2,opt,name=results,proto3,oneof"`
}

type InitiateResults

type InitiateResults struct {

	// The local path in which the OTDR file is saved on the device.
	LocalPath string `protobuf:"bytes,1,opt,name=local_path,json=localPath,proto3" json:"local_path,omitempty"`
	// The OTDR trace details in a structured format.
	OtdrTrace *OTDRTrace `protobuf:"bytes,2,opt,name=otdr_trace,json=otdrTrace,proto3" json:"otdr_trace,omitempty"`
	// contains filtered or unexported fields
}

func (*InitiateResults) Descriptor deprecated

func (*InitiateResults) Descriptor() ([]byte, []int)

Deprecated: Use InitiateResults.ProtoReflect.Descriptor instead.

func (*InitiateResults) GetLocalPath

func (x *InitiateResults) GetLocalPath() string

func (*InitiateResults) GetOtdrTrace

func (x *InitiateResults) GetOtdrTrace() *OTDRTrace

func (*InitiateResults) ProtoMessage

func (*InitiateResults) ProtoMessage()

func (*InitiateResults) ProtoReflect

func (x *InitiateResults) ProtoReflect() protoreflect.Message

func (*InitiateResults) Reset

func (x *InitiateResults) Reset()

func (*InitiateResults) String

func (x *InitiateResults) String() string

type OTDRClient

type OTDRClient interface {
	// Initiate triggers an optical time domain reflectometer (OTDR) trace to
	// be run on a specified port. The results of the trace may be sent back in
	// the response or saved on the device to be retrieved later. If the
	// information is saved on the device a path to the file must be returned
	// which can later be used by File.Get or File.TransferToRemote. The RPC
	// should initiate the OTDR trace and wait until the OTDR trace has completed
	// and the device has processed the results before returning. If the RPC is
	// cancelled while in operation, the running OTDR trace should stop.
	Initiate(ctx context.Context, in *InitiateRequest, opts ...grpc.CallOption) (OTDR_InitiateClient, error)
}

OTDRClient is the client API for OTDR service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewOTDRClient

func NewOTDRClient(cc grpc.ClientConnInterface) OTDRClient

type OTDRConfiguration

type OTDRConfiguration struct {

	// The time in seconds in which the OTDR trace will run continuously to
	// collect data.
	AcquisitionTimeS uint32 `protobuf:"varint,1,opt,name=acquisition_time_s,json=acquisitionTimeS,proto3" json:"acquisition_time_s,omitempty"`
	// The pulse width in nanoseconds which defines how long pulses sent by the
	// OTDR will be during the test.
	PulseWidthNs float32 `protobuf:"fixed32,2,opt,name=pulse_width_ns,json=pulseWidthNs,proto3" json:"pulse_width_ns,omitempty"`
	// The wavelength in MHz that will be sent by the OTDR. This may be left blank
	// if the OTDR only supports one wavelength.
	WavelengthMhz uint64 `protobuf:"varint,3,opt,name=wavelength_mhz,json=wavelengthMhz,proto3" json:"wavelength_mhz,omitempty"`
	// The maximum fiber distance range in meters that the OTDR trace will
	// support.
	RangeM float32 `protobuf:"fixed32,4,opt,name=range_m,json=rangeM,proto3" json:"range_m,omitempty"`
	// The type of fiber that is being measured.
	FiberType FiberTypeProfile `protobuf:"varint,5,opt,name=fiber_type,json=fiberType,proto3,enum=gnoi.optical.FiberTypeProfile" json:"fiber_type,omitempty"`
	// The sampling resolution in meters.
	SamplingResolutionM float32 `protobuf:"fixed32,6,opt,name=sampling_resolution_m,json=samplingResolutionM,proto3" json:"sampling_resolution_m,omitempty"`
	// contains filtered or unexported fields
}

OTDR configuration options which can be set on the device. It is not required that every field be set as some fields may not apply for a given implementation.

func (*OTDRConfiguration) Descriptor deprecated

func (*OTDRConfiguration) Descriptor() ([]byte, []int)

Deprecated: Use OTDRConfiguration.ProtoReflect.Descriptor instead.

func (*OTDRConfiguration) GetAcquisitionTimeS

func (x *OTDRConfiguration) GetAcquisitionTimeS() uint32

func (*OTDRConfiguration) GetFiberType

func (x *OTDRConfiguration) GetFiberType() FiberTypeProfile

func (*OTDRConfiguration) GetPulseWidthNs

func (x *OTDRConfiguration) GetPulseWidthNs() float32

func (*OTDRConfiguration) GetRangeM

func (x *OTDRConfiguration) GetRangeM() float32

func (*OTDRConfiguration) GetSamplingResolutionM

func (x *OTDRConfiguration) GetSamplingResolutionM() float32

func (*OTDRConfiguration) GetWavelengthMhz

func (x *OTDRConfiguration) GetWavelengthMhz() uint64

func (*OTDRConfiguration) ProtoMessage

func (*OTDRConfiguration) ProtoMessage()

func (*OTDRConfiguration) ProtoReflect

func (x *OTDRConfiguration) ProtoReflect() protoreflect.Message

func (*OTDRConfiguration) Reset

func (x *OTDRConfiguration) Reset()

func (*OTDRConfiguration) String

func (x *OTDRConfiguration) String() string

type OTDRServer

type OTDRServer interface {
	// Initiate triggers an optical time domain reflectometer (OTDR) trace to
	// be run on a specified port. The results of the trace may be sent back in
	// the response or saved on the device to be retrieved later. If the
	// information is saved on the device a path to the file must be returned
	// which can later be used by File.Get or File.TransferToRemote. The RPC
	// should initiate the OTDR trace and wait until the OTDR trace has completed
	// and the device has processed the results before returning. If the RPC is
	// cancelled while in operation, the running OTDR trace should stop.
	Initiate(*InitiateRequest, OTDR_InitiateServer) error
	// contains filtered or unexported methods
}

OTDRServer is the server API for OTDR service. All implementations must embed UnimplementedOTDRServer for forward compatibility

type OTDRTrace

type OTDRTrace struct {

	// Total measured loss of the fiber.
	TotalLossDb float32 `protobuf:"fixed32,1,opt,name=total_loss_db,json=totalLossDb,proto3" json:"total_loss_db,omitempty"`
	// Total measured length of the fiber in meters.
	TotalLengthM float32 `protobuf:"fixed32,2,opt,name=total_length_m,json=totalLengthM,proto3" json:"total_length_m,omitempty"`
	// Optical return loss of the fiber in dB.
	OpticalReturnLossDb float32 `protobuf:"fixed32,3,opt,name=optical_return_loss_db,json=opticalReturnLossDb,proto3" json:"optical_return_loss_db,omitempty"`
	// Average fiber loss (dB/km)
	AverageLossDbKm float32 `protobuf:"fixed32,4,opt,name=average_loss_db_km,json=averageLossDbKm,proto3" json:"average_loss_db_km,omitempty"`
	// Discovered fiber type, if the OTDR can infer this information.
	DiscoveredFiberType FiberTypeProfile `` /* 156-byte string literal not displayed */
	Events              []*Event         `protobuf:"bytes,6,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

func (*OTDRTrace) Descriptor deprecated

func (*OTDRTrace) Descriptor() ([]byte, []int)

Deprecated: Use OTDRTrace.ProtoReflect.Descriptor instead.

func (*OTDRTrace) GetAverageLossDbKm

func (x *OTDRTrace) GetAverageLossDbKm() float32

func (*OTDRTrace) GetDiscoveredFiberType

func (x *OTDRTrace) GetDiscoveredFiberType() FiberTypeProfile

func (*OTDRTrace) GetEvents

func (x *OTDRTrace) GetEvents() []*Event

func (*OTDRTrace) GetOpticalReturnLossDb

func (x *OTDRTrace) GetOpticalReturnLossDb() float32

func (*OTDRTrace) GetTotalLengthM

func (x *OTDRTrace) GetTotalLengthM() float32

func (*OTDRTrace) GetTotalLossDb

func (x *OTDRTrace) GetTotalLossDb() float32

func (*OTDRTrace) ProtoMessage

func (*OTDRTrace) ProtoMessage()

func (*OTDRTrace) ProtoReflect

func (x *OTDRTrace) ProtoReflect() protoreflect.Message

func (*OTDRTrace) Reset

func (x *OTDRTrace) Reset()

func (*OTDRTrace) String

func (x *OTDRTrace) String() string

type OTDR_InitiateClient

type OTDR_InitiateClient interface {
	Recv() (*InitiateResponse, error)
	grpc.ClientStream
}

type OTDR_InitiateServer

type OTDR_InitiateServer interface {
	Send(*InitiateResponse) error
	grpc.ServerStream
}

type UnimplementedOTDRServer

type UnimplementedOTDRServer struct {
}

UnimplementedOTDRServer must be embedded to have forward compatible implementations.

func (UnimplementedOTDRServer) Initiate

type UnsafeOTDRServer

type UnsafeOTDRServer interface {
	// contains filtered or unexported methods
}

UnsafeOTDRServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OTDRServer will result in compilation errors.

Jump to

Keyboard shortcuts

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