v1

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the ndd v1 API group +kubebuilder:object:generate=true +groupName=ndd.henderiw.be

Index

Constants

View Source
const (
	// NetworkNodeFinalizer is the name of the finalizer added to
	// network node to block delete operations until the physical node can be
	// deprovisioned.
	NetworkNodeFinalizer string = "networknode.ndd.henderiw.be"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "ndd.henderiw.be", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type DeviceDetails added in v0.1.1

type DeviceDetails struct {
	// Host name
	HostName *string `json:"hostname,omitempty"`

	// the Kind of hardware
	Kind *string `json:"kind,omitempty"`

	// SW version
	SwVersion *string `json:"swVersion,omitempty"`

	// the Mac address of the hardware
	MacAddress *string `json:"macAddress,omitempty"`

	// the Serial Number of the hardware
	SerialNumber *string `json:"serialNumber,omitempty"`
}

DeviceDetails collects information about the deiscovered device

func (*DeviceDetails) DeepCopy added in v0.1.1

func (in *DeviceDetails) DeepCopy() *DeviceDetails

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceDetails.

func (*DeviceDetails) DeepCopyInto added in v0.1.1

func (in *DeviceDetails) DeepCopyInto(out *DeviceDetails)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DeviceDriver

type DeviceDriver struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec DeviceDriverSpec `json:"spec,omitempty"`
}

DeviceDriver is the Schema for the devicedrivers API

func (*DeviceDriver) DeepCopy

func (in *DeviceDriver) DeepCopy() *DeviceDriver

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceDriver.

func (*DeviceDriver) DeepCopyInto

func (in *DeviceDriver) DeepCopyInto(out *DeviceDriver)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DeviceDriver) DeepCopyObject

func (in *DeviceDriver) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type DeviceDriverDetails

type DeviceDriverDetails struct {
	// Kind defines the device driver kind
	// +kubebuilder:default:=gnmi
	Kind *DeviceDriverKind `json:"kind"`
}

DeviceDriverDetails defines the device driver details to connect to the network node

func (*DeviceDriverDetails) DeepCopy

func (in *DeviceDriverDetails) DeepCopy() *DeviceDriverDetails

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceDriverDetails.

func (*DeviceDriverDetails) DeepCopyInto

func (in *DeviceDriverDetails) DeepCopyInto(out *DeviceDriverDetails)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DeviceDriverKind

type DeviceDriverKind string

DeviceDriverKind represents the state of the network node

const (
	// DeviceDriverKindGnmi operates using the gnmi specification
	DeviceDriverKindGnmi DeviceDriverKind = "gnmi"

	// DeviceDriverKindNetconf operates using the netconf specification
	DeviceDriverKindNetconf DeviceDriverKind = "netconf"
)

type DeviceDriverList

type DeviceDriverList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []DeviceDriver `json:"items"`
}

DeviceDriverList contains a list of DeviceDriver

func (*DeviceDriverList) DeepCopy

func (in *DeviceDriverList) DeepCopy() *DeviceDriverList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceDriverList.

func (*DeviceDriverList) DeepCopyInto

func (in *DeviceDriverList) DeepCopyInto(out *DeviceDriverList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DeviceDriverList) DeepCopyObject

func (in *DeviceDriverList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type DeviceDriverSpec

type DeviceDriverSpec struct {
	// Container defines the container parameters for the device driver
	Container *corev1.Container `json:"container,omitempty"`
}

DeviceDriverSpec defines the desired state of DeviceDriver

func (*DeviceDriverSpec) DeepCopy

func (in *DeviceDriverSpec) DeepCopy() *DeviceDriverSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceDriverSpec.

func (*DeviceDriverSpec) DeepCopyInto

func (in *DeviceDriverSpec) DeepCopyInto(out *DeviceDriverSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DiscoveryStatus

type DiscoveryStatus string

DiscoveryStatus defines the states the device driver will report

const (
	// DiscoveryStatusNone means the state is unknown
	DiscoveryStatusNone DiscoveryStatus = ""

	// DiscoveryStatusNotReady means there is insufficient information available to
	// discover the networkDevice
	DiscoveryStatusNotReady DiscoveryStatus = "Not Ready"

	// DiscoveryStatusDiscovery means we are running the discovery on the networkDevice to
	// learn about the hardware components
	DiscoveryStatusDiscovery DiscoveryStatus = "Discovery"

	// DiscoveryStatusReady means the networkDevice can be consumed
	DiscoveryStatusReady DiscoveryStatus = "Ready"
)

func DiscoveryStatusPtr added in v0.1.4

func DiscoveryStatusPtr(c DiscoveryStatus) *DiscoveryStatus

func String2DiscoveryStatus added in v0.1.2

func String2DiscoveryStatus(s string) *DiscoveryStatus

String2DiscoveryStatus retuns pointer to enum

func (DiscoveryStatus) IsValid added in v0.1.2

func (ds DiscoveryStatus) IsValid() bool

IsValid discovery status

type ErrorType

type ErrorType string

ErrorType indicates the class of problem that has caused the Network Node resource to enter an error state.

const (
	// NoneError is an error type when no error exists
	NoneError ErrorType = ""

	// TargetError is an error condition occurring when the
	// target supplied are not correct or not existing
	TargetError ErrorType = "target error"

	// CredentialError is an error condition occurring when the
	// credentials supplied are not correct or not existing
	CredentialError ErrorType = "credential error"

	// DeploymentError is an error condition occuring when the controller
	// fails to provision or deprovision the ddriver deployment.
	DeploymentError ErrorType = "deployment error"

	// DeviceDriverError is an error condition occuring when the controller
	// fails to retrieve the ddriver information.
	DeviceDriverError ErrorType = "device driver error"
)

func String2ErrorType added in v0.1.2

func String2ErrorType(s string) *ErrorType

String2ErrorType retuns pointer to enum

func (ErrorType) IsValid added in v0.1.2

func (et ErrorType) IsValid() bool

IsValid discovery status

type GrpcServerDetails added in v0.1.2

type GrpcServerDetails struct {
	// Port defines the port of the GRPC server for the device driver
	// +kubebuilder:default:=9999
	Port *int `json:"port"`
}

func (*GrpcServerDetails) DeepCopy added in v0.1.2

func (in *GrpcServerDetails) DeepCopy() *GrpcServerDetails

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GrpcServerDetails.

func (*GrpcServerDetails) DeepCopyInto added in v0.1.2

func (in *GrpcServerDetails) DeepCopyInto(out *GrpcServerDetails)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NetworkNode

type NetworkNode struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   NetworkNodeSpec   `json:"spec,omitempty"`
	Status NetworkNodeStatus `json:"status,omitempty"`
}

NetworkNode is the Schema for the networknodes API

func (*NetworkNode) CredentialsKey

func (nn *NetworkNode) CredentialsKey() types.NamespacedName

CredentialsKey returns a NamespacedName suitable for loading the Secret containing the credentials associated with the host.

func (*NetworkNode) DeepCopy

func (in *NetworkNode) DeepCopy() *NetworkNode

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkNode.

func (*NetworkNode) DeepCopyInto

func (in *NetworkNode) DeepCopyInto(out *NetworkNode)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*NetworkNode) DeepCopyObject

func (in *NetworkNode) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*NetworkNode) NewEvent

func (nn *NetworkNode) NewEvent(reason, message string) corev1.Event

NewEvent creates a new event associated with the object and ready to be published to the kubernetes API.

func (*NetworkNode) SetDiscoveryStatus added in v0.1.5

func (nn *NetworkNode) SetDiscoveryStatus(status DiscoveryStatus) bool

SetDiscoveryStatus updates the DiscoveryStatus field and returns true when a change is made or false when no change is made.

func (*NetworkNode) SetErrorMessage added in v0.1.2

func (nn *NetworkNode) SetErrorMessage(errorMessage *string) bool

SetErrorMessage updates the Error message field and returns true when a change is made or false when no change is made.

func (*NetworkNode) SetErrorType

func (nn *NetworkNode) SetErrorType(errorType ErrorType) bool

SetErrorType updates the Error Type field and returns true when a change is made or false when no change is made.

func (*NetworkNode) SetOperationalStatus

func (nn *NetworkNode) SetOperationalStatus(status OperationalStatus) bool

SetOperationalStatus updates the OperationalStatus field and returns true when a change is made or false when no change is made.

func (*NetworkNode) SetUsedDeviceDriverSpec

func (nn *NetworkNode) SetUsedDeviceDriverSpec(c *corev1.Container)

SetUsedDeviceDriverSpec updates the used device driver spec

func (*NetworkNode) SetUsedNetworkNodeSpec

func (nn *NetworkNode) SetUsedNetworkNodeSpec(nnSpec *NetworkNodeSpec)

SetUsedNetworkNodeSpec updates the used network node spec

type NetworkNodeList

type NetworkNodeList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []NetworkNode `json:"items"`
}

NetworkNodeList contains a list of NetworkNode

func (*NetworkNodeList) DeepCopy

func (in *NetworkNodeList) DeepCopy() *NetworkNodeList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkNodeList.

func (*NetworkNodeList) DeepCopyInto

func (in *NetworkNodeList) DeepCopyInto(out *NetworkNodeList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*NetworkNodeList) DeepCopyObject

func (in *NetworkNodeList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type NetworkNodeSpec

type NetworkNodeSpec struct {
	// Target defines how we connect to the network node
	Target *TargetDetails `json:"target,omitempty"`

	// DeviceDriver defines the device driver details to connect to the network node
	DeviceDriver *DeviceDriverDetails `json:"deviceDriver,omitempty"`

	// GrpcServerPort defines the grpc server port
	GrpcServer *GrpcServerDetails `json:"grpcServer,omitempty"`
}

NetworkNodeSpec defines the desired state of NetworkNode

func (*NetworkNodeSpec) DeepCopy

func (in *NetworkNodeSpec) DeepCopy() *NetworkNodeSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkNodeSpec.

func (*NetworkNodeSpec) DeepCopyInto

func (in *NetworkNodeSpec) DeepCopyInto(out *NetworkNodeSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NetworkNodeStatus

type NetworkNodeStatus struct {
	// OperationalStatus holds the operational status of the networkNode
	// +kubebuilder:validation:Enum="";Up;Down
	// +kubebuilder:default:=Down
	OperationalStatus *OperationalStatus `json:"operationalStatus"`

	// ErrorType indicates the type of failure encountered when the
	// OperationalStatus is OperationalStatusDown
	// +kubebuilder:validation:Enum="";target error;credential error;container error;device driver error
	// +kubebuilder:default:=""
	ErrorType *ErrorType `json:"errorType,omitempty"`

	// ErrorCount records how many times the host has encoutered an error since the last successful operation
	// +kubebuilder:default:=0
	ErrorCount *int `json:"errorCount"`

	// the last error message reported by the provisioning subsystem
	// +kubebuilder:default:=""
	ErrorMessage *string `json:"errorMessage"`

	// DiscoveryStatus holds the discovery status of the networkNode
	// +kubebuilder:validation:Enum="";Ready;Not Ready;Discovery
	// +kubebuilder:default:="Not Ready"
	DiscoveryStatus *DiscoveryStatus `json:"discoveryStatus"`

	// The discovered DeviceDetails
	DeviceDetails *DeviceDetails `json:"deviceDetails,omitempty"`

	// GrpcServerPort defines the grpc server port
	GrpcServer *GrpcServerDetails `json:"grpcServer,omitempty"`

	// LastUpdated identifies when this status was last observed.
	// +optional
	LastUpdated *metav1.Time `json:"lastUpdated,omitempty"`

	// UsedNetworkNodeSpec identifies the used networkNode spec when operational state up
	UsedNetworkNodeSpec *NetworkNodeSpec `json:"usedNetworkNodeSpec,omitempty"`

	// UsedDeviceDriverSpec identifies the used deviceDriver spec in operational state up
	UsedDeviceDriverSpec *DeviceDriverSpec `json:"usedDeviceDriverSpec,omitempty"`
}

NetworkNodeStatus defines the observed state of NetworkNode

func (*NetworkNodeStatus) DeepCopy

func (in *NetworkNodeStatus) DeepCopy() *NetworkNodeStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkNodeStatus.

func (*NetworkNodeStatus) DeepCopyInto

func (in *NetworkNodeStatus) DeepCopyInto(out *NetworkNodeStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OperationalStatus

type OperationalStatus string

OperationalStatus represents the state of the network node

const (
	// OperationalStatusNone means the state is unknown
	OperationalStatusNone OperationalStatus = ""

	// OperationalStatusUp is the status value for when the network node is
	// configured correctly and is manageable/operational.
	OperationalStatusUp OperationalStatus = "Up"

	// OperationalStatusDown is the status value for when the network node
	// has any sort of error.
	OperationalStatusDown OperationalStatus = "Down"
)

func String2OperationalStatus added in v0.1.2

func String2OperationalStatus(s string) *OperationalStatus

String2OperationalStatus retuns pointer to enum

func (OperationalStatus) IsValid added in v0.1.2

func (os OperationalStatus) IsValid() bool

IsValid discovery status

type TargetDetails

type TargetDetails struct {
	// Address holds the IP:port for accessing the network node
	Address *string `json:"address"`

	// Proxy used to communicate to the target network node
	Proxy *string `json:"proxy,omitempty"`

	// The name of the secret containing the credentials (requires
	// keys "username" and "password").
	CredentialsName *string `json:"credentialsName"`

	// The name of the secret containing the credentials (requires
	// keys "TLSCA" and "TLSCert", " TLSKey").
	TLSCredentialsName *string `json:"tlsCredentialsName,omitempty"`

	// SkipVerify disables verification of server certificates when using
	// HTTPS to connect to the Target. This is required when the server
	// certificate is self-signed, but is insecure because it allows a
	// man-in-the-middle to intercept the connection.
	SkipVerify *bool `json:"skpVerify,omitempty"`

	// Insecure runs the communication in an insecure manner
	Insecure *bool `json:"insecure,omitempty"`

	// Encoding defines the gnmi encoding
	Encoding *string `json:"encoding,omitempty"`
}

TargetDetails contains the information necessary to communicate with the network node.

func (*TargetDetails) DeepCopy

func (in *TargetDetails) DeepCopy() *TargetDetails

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetDetails.

func (*TargetDetails) DeepCopyInto

func (in *TargetDetails) DeepCopyInto(out *TargetDetails)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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