v1

package
v0.2.14-test Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the netbox v1 API group +kubebuilder:object:generate=true +groupName=netbox.dev

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "netbox.dev", 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
)
View Source
var ConditionIpAssignedFalse = metav1.Condition{
	Type:    "IPAssigned",
	Status:  "False",
	Reason:  "IPAddressCRNotCreated",
	Message: "Failed to fetch new IP from NetBox",
}
View Source
var ConditionIpAssignedTrue = metav1.Condition{
	Type:    "IPAssigned",
	Status:  "True",
	Reason:  "IPAddressCRCreated",
	Message: "New IP fetched from NetBox and IPAddress CR was created",
}
View Source
var ConditionIpClaimReadyFalse = metav1.Condition{
	Type:    "Ready",
	Status:  "False",
	Reason:  "IPAddressResourceNotReady",
	Message: "IPAddress Resource is not ready",
}
View Source
var ConditionIpClaimReadyTrue = metav1.Condition{
	Type:    "Ready",
	Status:  "True",
	Reason:  "IPAddressResourceReady",
	Message: "IPAddress Resource is ready",
}
View Source
var ConditionIpRangeAssignedFalse = metav1.Condition{
	Type:    "IPRangeAssigned",
	Status:  "False",
	Reason:  "IPRangeCRNotCreated",
	Message: "Failed to fetch new IP Range from NetBox",
}
View Source
var ConditionIpRangeAssignedFalseSizeMismatch = metav1.Condition{
	Type:    "IPRangeAssigned",
	Status:  "False",
	Reason:  "IPRangeCRNotCreated",
	Message: "Assigned/Restored IP range has less available IP addresses than requested",
}
View Source
var ConditionIpRangeAssignedTrue = metav1.Condition{
	Type:    "IPRangeAssigned",
	Status:  "True",
	Reason:  "IPRangeCRCreated",
	Message: "New IP Range fetched from NetBox and IpRange CR was created",
}
View Source
var ConditionIpRangeClaimReadyFalse = metav1.Condition{
	Type:    "Ready",
	Status:  "False",
	Reason:  "IPRangeResourceNotReady",
	Message: "IP Range Resource is not ready",
}
View Source
var ConditionIpRangeClaimReadyFalseStatusGen = metav1.Condition{
	Type:    "Ready",
	Status:  "False",
	Reason:  "IPRangeClaimStatusGenerationFailed",
	Message: "Failed to generate IP Range Status",
}
View Source
var ConditionIpRangeClaimReadyTrue = metav1.Condition{
	Type:    "Ready",
	Status:  "True",
	Reason:  "IPRangeResourceReady",
	Message: "IP Range Resource is ready",
}
View Source
var ConditionIpRangeReadyFalse = metav1.Condition{
	Type:    "Ready",
	Status:  "False",
	Reason:  "FailedToReserveIPRangeInNetbox",
	Message: "Failed to reserve IP Range in NetBox",
}
View Source
var ConditionIpRangeReadyFalseDeletionFailed = metav1.Condition{
	Type:    "Ready",
	Status:  "False",
	Reason:  "FailedToDeleteIPRangeInNetbox",
	Message: "Failed to delete IP Range in NetBox",
}
View Source
var ConditionIpRangeReadyTrue = metav1.Condition{
	Type:    "Ready",
	Status:  "True",
	Reason:  "IPRangeReservedInNetbox",
	Message: "IP Range was reserved/updated in NetBox",
}
View Source
var ConditionIpaddressReadyFalse = metav1.Condition{
	Type:    "Ready",
	Status:  "False",
	Reason:  "FailedToReserveIpInNetbox",
	Message: "Failed to reserve IP in NetBox",
}
View Source
var ConditionIpaddressReadyFalseDeletionFailed = metav1.Condition{
	Type:    "Ready",
	Status:  "False",
	Reason:  "FailedToDeleteIpInNetbox",
	Message: "Failed to delete IP in NetBox",
}
View Source
var ConditionIpaddressReadyTrue = metav1.Condition{
	Type:    "Ready",
	Status:  "True",
	Reason:  "IpReservedInNetbox",
	Message: "IP was reserved/updated in NetBox",
}
View Source
var ConditionParentPrefixSelectedFalse = metav1.Condition{
	Type:    "ParentPrefixSelected",
	Status:  "False",
	Reason:  "ParentPrefixNotSelected",
	Message: "The parent prefix was not able to be selected",
}
View Source
var ConditionParentPrefixSelectedTrue = metav1.Condition{
	Type:    "ParentPrefixSelected",
	Status:  "True",
	Reason:  "ParentPrefixSelected",
	Message: "The parent prefix was selected successfully",
}
View Source
var ConditionPrefixAssignedFalse = metav1.Condition{
	Type:    "PrefixAssigned",
	Status:  "False",
	Reason:  "PrefixCRNotCreated",
	Message: "Failed to assign prefix, prefix CR creation skipped",
}
View Source
var ConditionPrefixAssignedTrue = metav1.Condition{
	Type:    "PrefixAssigned",
	Status:  "True",
	Reason:  "PrefixCRCreated",
	Message: "New prefix fetched from NetBox and prefix CR was created",
}
View Source
var ConditionPrefixClaimReadyFalse = metav1.Condition{
	Type:    "Ready",
	Status:  "False",
	Reason:  "PrefixClaimResourceNotReady",
	Message: "PrefixClaim Resource is not ready",
}
View Source
var ConditionPrefixClaimReadyTrue = metav1.Condition{
	Type:    "Ready",
	Status:  "True",
	Reason:  "PrefixClaimResourceReady",
	Message: "PrefixClaim Resource is ready",
}
View Source
var ConditionPrefixReadyFalse = metav1.Condition{
	Type:    "Ready",
	Status:  "False",
	Reason:  "FailedToReservePrefixInNetbox",
	Message: "Failed to reserve prefix in NetBox",
}
View Source
var ConditionPrefixReadyFalseDeletionFailed = metav1.Condition{
	Type:    "Ready",
	Status:  "False",
	Reason:  "FailedToDeletePrefixInNetbox",
	Message: "Failed to delete prefix in Netbox",
}
View Source
var ConditionPrefixReadyTrue = metav1.Condition{
	Type:    "Ready",
	Status:  "True",
	Reason:  "PrefixReservedInNetbox",
	Message: "Prefix was reserved in NetBox",
}
View Source
var ConditionReadyFalseNewResource = metav1.Condition{
	Type:    "Ready",
	Status:  "False",
	Reason:  "NewResource",
	Message: "Pending Reconciliation",
}

Functions

This section is empty.

Types

type IpAddress

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

	Spec   IpAddressSpec   `json:"spec,omitempty"`
	Status IpAddressStatus `json:"status,omitempty"`
}

IpAddress allows to create a NetBox IP Address. More info about NetBox IP Addresses: https://github.com/netbox-community/netbox/blob/main/docs/models/ipam/ipaddress.md

func (*IpAddress) Conditions

func (i *IpAddress) Conditions() *[]metav1.Condition

func (*IpAddress) DeepCopy

func (in *IpAddress) DeepCopy() *IpAddress

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

func (*IpAddress) DeepCopyInto

func (in *IpAddress) DeepCopyInto(out *IpAddress)

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

func (*IpAddress) DeepCopyObject

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

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

type IpAddressClaim

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

	Spec   IpAddressClaimSpec   `json:"spec,omitempty"`
	Status IpAddressClaimStatus `json:"status,omitempty"`
}

IpAddressClaim allows to claim a NetBox IP Address from an existing Prefix. The IpAddressClaim Controller will try to assign an available IP Address from the Prefix that is defined in the spec and if successful it will create the IpAddress CR. More info about NetBox IP Addresses: https://github.com/netbox-community/netbox/blob/main/docs/models/ipam/ipaddress.md

func (*IpAddressClaim) Conditions

func (i *IpAddressClaim) Conditions() *[]metav1.Condition

func (*IpAddressClaim) DeepCopy

func (in *IpAddressClaim) DeepCopy() *IpAddressClaim

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

func (*IpAddressClaim) DeepCopyInto

func (in *IpAddressClaim) DeepCopyInto(out *IpAddressClaim)

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

func (*IpAddressClaim) DeepCopyObject

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

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

type IpAddressClaimList

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

IpAddressClaimList contains a list of IpAddressClaim

func (*IpAddressClaimList) DeepCopy

func (in *IpAddressClaimList) DeepCopy() *IpAddressClaimList

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

func (*IpAddressClaimList) DeepCopyInto

func (in *IpAddressClaimList) DeepCopyInto(out *IpAddressClaimList)

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

func (*IpAddressClaimList) DeepCopyObject

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

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

type IpAddressClaimSpec

type IpAddressClaimSpec struct {
	// The NetBox Prefix from which this IP Address should be claimed from
	// Field is immutable, required
	// Example: "192.168.0.0/20"
	//+kubebuilder:validation:Required
	//+kubebuilder:validation:Format=cidr
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'parentPrefix' is immutable"
	ParentPrefix string `json:"parentPrefix"`

	// The NetBox Tenant to be assigned to this resource in NetBox. Use the `name` value instead of the `slug` value
	// Field is immutable, not required
	// Example: "Initech" or "Cyberdyne Systems"
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'tenant' is immutable"
	Tenant string `json:"tenant,omitempty"`

	// The NetBox Custom Fields that should be added to the resource in NetBox.
	// Note that currently only Text Type is supported (GitHub #129)
	// More info on NetBox Custom Fields:
	// https://github.com/netbox-community/netbox/blob/main/docs/customization/custom-fields.md
	// Field is mutable, not required
	// Example:
	//   customfield1: "Production"
	//   customfield2: "This is a string"
	CustomFields map[string]string `json:"customFields,omitempty"`

	// Comment that should be added to the resource in NetBox
	// Field is mutable, not required
	Comments string `json:"comments,omitempty"`

	// Description that should be added to the resource in NetBox
	// Field is mutable, not required
	Description string `json:"description,omitempty"`

	// Defines whether the Resource should be preserved in NetBox when the
	// Kubernetes Resource is deleted.
	// - When set to true, the resource will not be deleted but preserved in
	//   NetBox upon CR deletion
	// - When set to false, the resource will be cleaned up in NetBox
	//   upon CR deletion
	// Setting preserveInNetbox to true is mandatory if the user wants to restore
	// resources from NetBox (e.g. Sticky CIDRs even if resources are deleted and
	// recreated in Kubernetes)
	// Field is mutable, not required
	PreserveInNetbox bool `json:"preserveInNetbox,omitempty"`
}

IpAddressClaimSpec defines the desired state of IpAddressClaim

func (*IpAddressClaimSpec) DeepCopy

func (in *IpAddressClaimSpec) DeepCopy() *IpAddressClaimSpec

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

func (*IpAddressClaimSpec) DeepCopyInto

func (in *IpAddressClaimSpec) DeepCopyInto(out *IpAddressClaimSpec)

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

type IpAddressClaimStatus

type IpAddressClaimStatus struct {
	// The assigned IP Address in CIDR notation
	IpAddress string `json:"ipAddress,omitempty"`

	// The assigned IP Address in Dot Decimal notation
	IpAddressDotDecimal string `json:"ipAddressDotDecimal,omitempty"`

	// The name of the IpAddress CR created by the IpAddressClaim Controller
	IpAddressName string `json:"ipAddressName,omitempty"`

	// Conditions represent the latest available observations of an object's state
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}

IpAddressClaimStatus defines the observed state of IpAddressClaim

func (*IpAddressClaimStatus) DeepCopy

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

func (*IpAddressClaimStatus) DeepCopyInto

func (in *IpAddressClaimStatus) DeepCopyInto(out *IpAddressClaimStatus)

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

type IpAddressList

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

IpAddressList contains a list of IpAddress

func (*IpAddressList) DeepCopy

func (in *IpAddressList) DeepCopy() *IpAddressList

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

func (*IpAddressList) DeepCopyInto

func (in *IpAddressList) DeepCopyInto(out *IpAddressList)

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

func (*IpAddressList) DeepCopyObject

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

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

type IpAddressSpec

type IpAddressSpec struct {
	// The IP Address in CIDR notation that should be reserved in NetBox
	// Field is immutable, required
	// Example: "192.168.0.1/32"
	//+kubebuilder:validation:Format=cidr
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'ipAddress' is immutable"
	//+kubebuilder:validation:Required
	IpAddress string `json:"ipAddress"`

	// The NetBox Tenant to be assigned to this resource in NetBox. Use the `name` value instead of the `slug` value
	// Field is immutable, not required
	// Example: "Initech" or "Cyberdyne Systems"
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'tenant' is immutable"
	Tenant string `json:"tenant,omitempty"`

	// The NetBox Custom Fields that should be added to the resource in NetBox.
	// Note that currently only Text Type is supported (GitHub #129)
	// More info on NetBox Custom Fields:
	// https://github.com/netbox-community/netbox/blob/main/docs/customization/custom-fields.md
	// Field is mutable, not required
	// Example:
	//   customfield1: "Production"
	//   customfield2: "This is a string"
	CustomFields map[string]string `json:"customFields,omitempty"`

	// Comment that should be added to the resource in NetBox
	// Field is mutable, not required
	Comments string `json:"comments,omitempty"`

	// Description that should be added to the resource in NetBox
	// Field is mutable, not required
	Description string `json:"description,omitempty"`

	// Defines whether the Resource should be preserved in NetBox when the
	// Kubernetes Resource is deleted.
	// - When set to true, the resource will not be deleted but preserved in
	//   NetBox upon CR deletion
	// - When set to false, the resource will be cleaned up in NetBox
	//   upon CR deletion
	// Setting preserveInNetbox to true is mandatory if the user wants to restore
	// resources from NetBox (e.g. Sticky CIDRs even if resources are deleted and
	// recreated in Kubernetes)
	// Field is mutable, not required
	PreserveInNetbox bool `json:"preserveInNetbox,omitempty"`
}

IpAddressSpec defines the desired state of IpAddress

func (*IpAddressSpec) DeepCopy

func (in *IpAddressSpec) DeepCopy() *IpAddressSpec

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

func (*IpAddressSpec) DeepCopyInto

func (in *IpAddressSpec) DeepCopyInto(out *IpAddressSpec)

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

type IpAddressStatus

type IpAddressStatus struct {
	// The ID of the resource in NetBox
	IpAddressId int64 `json:"id,omitempty"`

	// The URL to the resource in the NetBox UI. Note that the base of this
	// URL depends on the runtime config of NetBox Operator
	IpAddressUrl string `json:"url,omitempty"`

	// Conditions represent the latest available observations of an object's state
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}

IpAddressStatus defines the observed state of IpAddress

func (*IpAddressStatus) DeepCopy

func (in *IpAddressStatus) DeepCopy() *IpAddressStatus

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

func (*IpAddressStatus) DeepCopyInto

func (in *IpAddressStatus) DeepCopyInto(out *IpAddressStatus)

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

type IpRange

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

	Spec   IpRangeSpec   `json:"spec,omitempty"`
	Status IpRangeStatus `json:"status,omitempty"`
}

IpRange allows to create a NetBox IP Range. More info about NetBox IP Ranges: https://github.com/netbox-community/netbox/blob/main/docs/models/ipam/iprange.md

func (*IpRange) Conditions

func (i *IpRange) Conditions() *[]metav1.Condition

func (*IpRange) DeepCopy

func (in *IpRange) DeepCopy() *IpRange

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

func (*IpRange) DeepCopyInto

func (in *IpRange) DeepCopyInto(out *IpRange)

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

func (*IpRange) DeepCopyObject

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

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

type IpRangeClaim

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

	Spec   IpRangeClaimSpec   `json:"spec,omitempty"`
	Status IpRangeClaimStatus `json:"status,omitempty"`
}

IpRangeClaim allows to claim a NetBox IP Range from an existing Prefix. The IpRangeClaim Controller will try to assign an available IP Range from the Prefix that is defined in the spec and if successful it will create the IpRange CR. More info about NetBox IP Ranges: https://github.com/netbox-community/netbox/blob/main/docs/models/ipam/iprange.md

func (*IpRangeClaim) Conditions

func (i *IpRangeClaim) Conditions() *[]metav1.Condition

func (*IpRangeClaim) DeepCopy

func (in *IpRangeClaim) DeepCopy() *IpRangeClaim

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

func (*IpRangeClaim) DeepCopyInto

func (in *IpRangeClaim) DeepCopyInto(out *IpRangeClaim)

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

func (*IpRangeClaim) DeepCopyObject

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

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

type IpRangeClaimList

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

IpRangeClaimList contains a list of IpRangeClaim

func (*IpRangeClaimList) DeepCopy

func (in *IpRangeClaimList) DeepCopy() *IpRangeClaimList

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

func (*IpRangeClaimList) DeepCopyInto

func (in *IpRangeClaimList) DeepCopyInto(out *IpRangeClaimList)

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

func (*IpRangeClaimList) DeepCopyObject

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

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

type IpRangeClaimSpec

type IpRangeClaimSpec struct {
	// The NetBox Prefix from which this IP Range should be claimed from
	// Field is immutable, required
	// Example: "192.168.0.0/20"
	//+kubebuilder:validation:Required
	//+kubebuilder:validation:Format=cidr
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'parentPrefix' is immutable"
	ParentPrefix string `json:"parentPrefix"`

	// The amount of consecutive IP Addresses you wish to reserve.
	// Currently only sizes up to 50 are supported due to pagination of the
	// NetBox API. In practice, this might be even lower depending on the
	// fragmentation of the parent prefix.
	// Field is immutable, required, range from 2-50
	//+kubebuilder:validation:Required
	//+kubebuilder:validation:Minimum=2
	//+kubebuilder:validation:Maximum=50
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'size' is immutable"
	Size int `json:"size,omitempty"`

	// The NetBox Tenant to be assigned to this resource in NetBox. Use the `name` value instead of the `slug` value
	// Field is immutable, not required
	// Example: "Initech" or "Cyberdyne Systems"
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'tenant' is immutable"
	Tenant string `json:"tenant,omitempty"`

	// The NetBox Custom Fields that should be added to the resource in NetBox.
	// Note that currently only Text Type is supported (GitHub #129)
	// More info on NetBox Custom Fields:
	// https://github.com/netbox-community/netbox/blob/main/docs/customization/custom-fields.md
	// Field is mutable, not required
	// Example:
	//   customfield1: "Production"
	//   customfield2: "This is a string"
	CustomFields map[string]string `json:"customFields,omitempty"`

	// Comment that should be added to the resource in NetBox
	// Field is mutable, not required
	Comments string `json:"comments,omitempty"`

	// Description that should be added to the resource in NetBox
	// Field is mutable, not required
	Description string `json:"description,omitempty"`

	// Defines whether the Resource should be preserved in NetBox when the
	// Kubernetes Resource is deleted.
	// - When set to true, the resource will not be deleted but preserved in
	//   NetBox upon CR deletion
	// - When set to false, the resource will be cleaned up in NetBox
	//   upon CR deletion
	// Setting preserveInNetbox to true is mandatory if the user wants to restore
	// resources from NetBox (e.g. Sticky CIDRs even if resources are deleted and
	// recreated in Kubernetes)
	// Field is mutable, not required
	PreserveInNetbox bool `json:"preserveInNetbox,omitempty"`
}

IpRangeClaimSpec defines the desired state of IpRangeClaim

func (*IpRangeClaimSpec) DeepCopy

func (in *IpRangeClaimSpec) DeepCopy() *IpRangeClaimSpec

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

func (*IpRangeClaimSpec) DeepCopyInto

func (in *IpRangeClaimSpec) DeepCopyInto(out *IpRangeClaimSpec)

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

type IpRangeClaimStatus

type IpRangeClaimStatus struct {
	// The assigned IP Range in CIDR notation (e.g. 192.168.0.1/32-192.168.0.123/32)
	IpRange string `json:"ipRange,omitempty"`

	// The assigned IP Range in Dot Decimal notation (e.g. 192.168.0.1-192.168.0.123)
	IpRangeDotDecimal string `json:"ipRangeDotDecimal,omitempty"`

	// The full list of IP Addresses in CIDR notation
	IpAddresses []string `json:"ipAddresses,omitempty"`

	// The full list of IP Addresses in Dot Decimal notation
	IpAddressesDotDecimal []string `json:"ipAddressesDotDecimal,omitempty"`

	// The first IP Addresses in CIDR notation
	StartAddress string `json:"startAddress,omitempty"`

	// The first IP Addresses in Dot Decimal notation
	StartAddressDotDecimal string `json:"startAddressDotDecimal,omitempty"`

	// The last IP Addresses in CIDR notation
	EndAddress string `json:"endAddress,omitempty"`

	// The last IP Addresses in Dot Decimal notation
	EndAddressDotDecimal string `json:"endAddressDotDecimal,omitempty"`

	// The name of the IpRange CR created by the IpRangeClaim Controller
	IpRangeName string `json:"ipRangeName,omitempty"`

	// Conditions represent the latest available observations of an object's state
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}

IpRangeClaimStatus defines the observed state of IpRangeClaim

func (*IpRangeClaimStatus) DeepCopy

func (in *IpRangeClaimStatus) DeepCopy() *IpRangeClaimStatus

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

func (*IpRangeClaimStatus) DeepCopyInto

func (in *IpRangeClaimStatus) DeepCopyInto(out *IpRangeClaimStatus)

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

type IpRangeList

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

IpRangeList contains a list of IpRange

func (*IpRangeList) DeepCopy

func (in *IpRangeList) DeepCopy() *IpRangeList

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

func (*IpRangeList) DeepCopyInto

func (in *IpRangeList) DeepCopyInto(out *IpRangeList)

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

func (*IpRangeList) DeepCopyObject

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

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

type IpRangeSpec

type IpRangeSpec struct {
	// The first IP in CIDR notation that should be included in the NetBox IP Range
	// Field is immutable, required
	// Example: "192.168.0.1/32"
	//+kubebuilder:validation:Format=cidr
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'startAddress' is immutable"
	//+kubebuilder:validation:Required
	StartAddress string `json:"startAddress"`

	// The last IP in CIDR notation that should be included in the NetBox IP Range
	// Field is immutable, required
	// Example: "192.168.0.20/32"
	//+kubebuilder:validation:Format=cidr
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'endAddress' is immutable"
	//+kubebuilder:validation:Required
	EndAddress string `json:"endAddress"`

	// The NetBox Tenant to be assigned to this resource in NetBox. Use the `name` value instead of the `slug` value
	// Field is immutable, not required
	// Example: "Initech" or "Cyberdyne Systems"
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'tenant' is immutable"
	Tenant string `json:"tenant,omitempty"`

	// The NetBox Custom Fields that should be added to the resource in NetBox.
	// Note that currently only Text Type is supported (GitHub #129)
	// More info on NetBox Custom Fields:
	// https://github.com/netbox-community/netbox/blob/main/docs/customization/custom-fields.md
	// Field is mutable, not required
	// Example:
	//   customfield1: "Production"
	//   customfield2: "This is a string"
	CustomFields map[string]string `json:"customFields,omitempty"`

	// Comment that should be added to the resource in NetBox
	// Field is mutable, not required
	Comments string `json:"comments,omitempty"`

	// Description that should be added to the resource in NetBox
	// Field is mutable, not required
	Description string `json:"description,omitempty"`

	// Defines whether the Resource should be preserved in NetBox when the
	// Kubernetes Resource is deleted.
	// - When set to true, the resource will not be deleted but preserved in
	//   NetBox upon CR deletion
	// - When set to false, the resource will be cleaned up in NetBox
	//   upon CR deletion
	// Setting preserveInNetbox to true is mandatory if the user wants to restore
	// resources from NetBox (e.g. Sticky CIDRs even if resources are deleted and
	// recreated in Kubernetes)
	// Field is mutable, not required
	PreserveInNetbox bool `json:"preserveInNetbox,omitempty"`
}

IpRangeSpec defines the desired state of IpRange

func (*IpRangeSpec) DeepCopy

func (in *IpRangeSpec) DeepCopy() *IpRangeSpec

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

func (*IpRangeSpec) DeepCopyInto

func (in *IpRangeSpec) DeepCopyInto(out *IpRangeSpec)

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

type IpRangeStatus

type IpRangeStatus struct {
	// The ID of the resource in NetBox
	IpRangeId int64 `json:"id,omitempty"`

	// The URL to the resource in the NetBox UI. Note that the base of this
	// URL depends on the runtime config of NetBox Operator
	IpRangeUrl string `json:"url,omitempty"`

	// Conditions represent the latest available observations of an object's state
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}

IpRangeStatus defines the observed state of IpRange

func (*IpRangeStatus) DeepCopy

func (in *IpRangeStatus) DeepCopy() *IpRangeStatus

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

func (*IpRangeStatus) DeepCopyInto

func (in *IpRangeStatus) DeepCopyInto(out *IpRangeStatus)

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

type Prefix

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

	Spec   PrefixSpec   `json:"spec,omitempty"`
	Status PrefixStatus `json:"status,omitempty"`
}

Prefix allows to create a NetBox Prefix. More info about NetBox Prefixes: https://github.com/netbox-community/netbox/blob/main/docs/models/ipam/prefix.md

func (*Prefix) Conditions

func (p *Prefix) Conditions() *[]metav1.Condition

func (*Prefix) DeepCopy

func (in *Prefix) DeepCopy() *Prefix

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

func (*Prefix) DeepCopyInto

func (in *Prefix) DeepCopyInto(out *Prefix)

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

func (*Prefix) DeepCopyObject

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

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

type PrefixClaim

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

	Spec   PrefixClaimSpec   `json:"spec,omitempty"`
	Status PrefixClaimStatus `json:"status,omitempty"`
}

PrefixClaim allows to claim a NetBox Prefix from an existing Prefix (parentPrefix) or a dynamically selected Prefix (parentPrefixSelector). The PrefixClaim Controller will try to assign an available Prefix from the Prefix that is defined in the spec and if successful it will create the Prefix CR. More info about NetBox IP Addresses: https://github.com/netbox-community/netbox/blob/main/docs/models/ipam/ipaddress.md

func (*PrefixClaim) Conditions

func (p *PrefixClaim) Conditions() *[]metav1.Condition

func (*PrefixClaim) DeepCopy

func (in *PrefixClaim) DeepCopy() *PrefixClaim

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

func (*PrefixClaim) DeepCopyInto

func (in *PrefixClaim) DeepCopyInto(out *PrefixClaim)

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

func (*PrefixClaim) DeepCopyObject

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

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

type PrefixClaimList

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

PrefixClaimList contains a list of PrefixClaim

func (*PrefixClaimList) DeepCopy

func (in *PrefixClaimList) DeepCopy() *PrefixClaimList

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

func (*PrefixClaimList) DeepCopyInto

func (in *PrefixClaimList) DeepCopyInto(out *PrefixClaimList)

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

func (*PrefixClaimList) DeepCopyObject

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

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

type PrefixClaimSpec

type PrefixClaimSpec struct {
	// The NetBox Prefix from which this Prefix should be claimed from
	// Field is immutable, required (`parentPrefix` and `parentPrefixSelector` are mutually exclusive)
	// Example: "192.168.0.0/20"
	//+kubebuilder:validation:Format=cidr
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'parentPrefix' is immutable"
	ParentPrefix string `json:"parentPrefix,omitempty"`

	// The `parentPrefixSelector` is a key-value map, where all the entries are of data type `<string-string>` The map contains a set of query conditions for selecting a set of prefixes that can be used as the parent prefix The query conditions will be chained by the AND operator, and exact match of the keys and values will be performed The built-in fields `tenant`, `site`, and `family`, along with custom fields, can be used. Note that since the key value pairs in this map are used to generate the URL for the query in NetBox, this also supports non-Text Custom Field types. For more information, please see ParentPrefixSelectorGuide.md
	// Field is immutable, required (`parentPrefix` and `parentPrefixSelector` are mutually exclusive)
	// Example:
	//   customfield1: "Production"
	//   family: "IPv4"
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'parentPrefixSelector' is immutable"
	//+kubebuilder:validation:XValidation:rule="!has(self.family) || (self.family == 'IPv4' || self.family == 'IPv6')"
	ParentPrefixSelector map[string]string `json:"parentPrefixSelector,omitempty"`

	// The desired prefix length of your Prefix using slash notation. Example: `/24` for an IPv4 Prefix or `/64` for an IPv6 Prefix
	// Field is immutable, required
	// Example: "/24"
	//+kubebuilder:validation:Required
	//+kubebuilder:validation:Pattern=`^\/[0-9]|[1-9][0-9]|1[01][0-9]|12[0-8]$`
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'prefixLength' is immutable"
	PrefixLength string `json:"prefixLength"`

	// The NetBox Site to be assigned to this resource in NetBox. Use the `name` value instead of the `slug` value
	// Field is immutable, not required
	// Example: "DM-Buffalo"
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'site' is immutable"
	Site string `json:"site,omitempty"`

	// The NetBox Tenant to be assigned to this resource in NetBox. Use the `name` value instead of the `slug` value
	// Field is immutable, not required
	// Example: "Initech" or "Cyberdyne Systems"
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'tenant' is immutable"
	Tenant string `json:"tenant,omitempty"`

	// Description that should be added to the resource in NetBox
	// Field is mutable, not required
	Description string `json:"description,omitempty"`

	// Comment that should be added to the resource in NetBox
	// Field is mutable, not required
	Comments string `json:"comments,omitempty"`

	// The NetBox Custom Fields that should be added to the resource in NetBox.
	// Note that currently only Text Type is supported (GitHub #129)
	// More info on NetBox Custom Fields:
	// https://github.com/netbox-community/netbox/blob/main/docs/customization/custom-fields.md
	// Field is mutable, not required
	// Example:
	//   customfield1: "Production"
	//   customfield2: "This is a string"
	CustomFields map[string]string `json:"customFields,omitempty"`

	// Defines whether the Resource should be preserved in NetBox when the
	// Kubernetes Resource is deleted.
	// - When set to true, the resource will not be deleted but preserved in
	//   NetBox upon CR deletion
	// - When set to false, the resource will be cleaned up in NetBox
	//   upon CR deletion
	// Setting preserveInNetbox to true is mandatory if the user wants to restore
	// resources from NetBox (e.g. Sticky CIDRs even if resources are deleted and
	// recreated in Kubernetes)
	// Field is mutable, not required
	PreserveInNetbox bool `json:"preserveInNetbox,omitempty"`
}

PrefixClaimSpec defines the desired state of PrefixClaim TODO: The reason for using a workaround please see https://github.com/netbox-community/netbox-operator/pull/90#issuecomment-2402112475 +kubebuilder:validation:XValidation:rule="!has(oldSelf.site) || has(self.site)", message="Site is required once set" +kubebuilder:validation:XValidation:rule="(!has(self.parentPrefix) && has(self.parentPrefixSelector)) || (has(self.parentPrefix) && !has(self.parentPrefixSelector))"

func (*PrefixClaimSpec) DeepCopy

func (in *PrefixClaimSpec) DeepCopy() *PrefixClaimSpec

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

func (*PrefixClaimSpec) DeepCopyInto

func (in *PrefixClaimSpec) DeepCopyInto(out *PrefixClaimSpec)

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

type PrefixClaimStatus

type PrefixClaimStatus struct {
	// Due to the fact that the parentPrefix can be specified directly in
	//`.spec.parentPrefix` or selected from `.spec.parentPrefixSelector`,
	//we use this field to store exactly which parent prefix we are using
	//for all subsequent reconcile loop calls.
	SelectedParentPrefix string `json:"parentPrefix,omitempty"`

	// The assigned Prefix in CIDR notation
	Prefix string `json:"prefix,omitempty"`

	// The name of the Prefix CR created by the PrefixClaim Controller
	PrefixName string `json:"prefixName,omitempty"`

	// Conditions represent the latest available observations of an object's state
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}

PrefixClaimStatus defines the observed state of PrefixClaim

func (*PrefixClaimStatus) DeepCopy

func (in *PrefixClaimStatus) DeepCopy() *PrefixClaimStatus

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

func (*PrefixClaimStatus) DeepCopyInto

func (in *PrefixClaimStatus) DeepCopyInto(out *PrefixClaimStatus)

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

type PrefixList

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

PrefixList contains a list of Prefix

func (*PrefixList) DeepCopy

func (in *PrefixList) DeepCopy() *PrefixList

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

func (*PrefixList) DeepCopyInto

func (in *PrefixList) DeepCopyInto(out *PrefixList)

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

func (*PrefixList) DeepCopyObject

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

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

type PrefixSpec

type PrefixSpec struct {
	// The Prefix in CIDR notation that should be reserved in NetBox
	// Field is immutable, required
	// Example: "192.168.0.0/24"
	//+kubebuilder:validation:Required
	//+kubebuilder:validation:Format=cidr
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'prefix' is immutable"
	Prefix string `json:"prefix"`

	// The NetBox Site to be assigned to this resource in NetBox. Use the `name` value instead of the `slug` value
	// Field is immutable, not required
	//+kubebuilder:validation:XValidation:rule="self == oldSelf || self != ”",message="Field 'site' is required once set"
	Site string `json:"site,omitempty"`

	// The NetBox Tenant to be assigned to this resource in NetBox. Use the `name` value instead of the `slug` value
	// Field is immutable, not required
	// Example: "Initech" or "Cyberdyne Systems"
	//+kubebuilder:validation:XValidation:rule="self == oldSelf",message="Field 'tenant' is immutable"
	Tenant string `json:"tenant,omitempty"`

	// The NetBox Custom Fields that should be added to the resource in NetBox.
	// Note that currently only Text Type is supported (GitHub #129)
	// More info on NetBox Custom Fields:
	// https://github.com/netbox-community/netbox/blob/main/docs/customization/custom-fields.md
	// Field is mutable, not required
	// Example:
	//   customfield1: "Production"
	//   customfield2: "This is a string"
	CustomFields map[string]string `json:"customFields,omitempty"`

	// Description that should be added to the resource in NetBox
	// Field is mutable, not required
	Description string `json:"description,omitempty"`

	// Comment that should be added to the resource in NetBox
	// Field is mutable, not required
	Comments string `json:"comments,omitempty"`

	// Defines whether the Resource should be preserved in NetBox when the
	// Kubernetes Resource is deleted.
	// - When set to true, the resource will not be deleted but preserved in
	//   NetBox upon CR deletion
	// - When set to false, the resource will be cleaned up in NetBox
	//   upon CR deletion
	// Setting preserveInNetbox to true is mandatory if the user wants to restore
	// resources from NetBox (e.g. Sticky CIDRs even if resources are deleted and
	// recreated in Kubernetes)
	// Field is mutable, not required
	PreserveInNetbox bool `json:"preserveInNetbox,omitempty"`
}

PrefixSpec defines the desired state of Prefix +kubebuilder:validation:XValidation:rule="!has(oldSelf.site) || has(self.site)", message="Site is required once set"

func (*PrefixSpec) DeepCopy

func (in *PrefixSpec) DeepCopy() *PrefixSpec

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

func (*PrefixSpec) DeepCopyInto

func (in *PrefixSpec) DeepCopyInto(out *PrefixSpec)

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

type PrefixStatus

type PrefixStatus struct {
	// The ID of the resource in NetBox
	PrefixId int64 `json:"id,omitempty"`

	// The URL to the resource in the NetBox UI. Note that the base of this
	// URL depends on the runtime config of NetBox Operator
	PrefixUrl string `json:"url,omitempty"`

	// Conditions represent the latest available observations of an object's state
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}

PrefixStatus defines the observed state of Prefix

func (*PrefixStatus) DeepCopy

func (in *PrefixStatus) DeepCopy() *PrefixStatus

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

func (*PrefixStatus) DeepCopyInto

func (in *PrefixStatus) DeepCopyInto(out *PrefixStatus)

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