v1

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package v1 contains core API types used by most ndd resources. +kubebuilder:object:generate=true

Index

Constants

View Source
const (
	LabelKeyLifecyclePolicy  string = "app.yndd.io/lifecyclepolicy" // planned or active
	LabelKeyOwner            string = "app.yndd.io/owner"           // represented as org.depl.az.nddokind.crname
	LabelKeyOwnerGeneration  string = "app.yndd.io/owner-generation"
	LabelKeyTarget           string = "app.yndd.io/target"
	LabelKeyInterface        string = "app.yndd.io/interface"
	LabelKeySubInterface     string = "app.yndd.io/subinterface"
	LabelKeyNetworkInstance  string = "app.yndd.io/network-instance"
	LabelKeyEndpointGroup    string = "app.yndd.io/endpoint-group"
	LabelKeyOrganization     string = "app.yndd.io/organization"
	LabelKeyDeployment       string = "app.yndd.io/deployment"
	LabelKeyAvailabilityZone string = "app.yndd.io/availability-zone"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthCondition

type HealthCondition struct {
	// Kind of this condition. At most one of each condition kind may apply to
	// a resource at any point in time.
	ResourceName string `json:"resourceName"`

	HealthKind string `json:"healthKind"`

	// Status of this condition; is it currently True, False, or Unknown?
	Status corev1.ConditionStatus `json:"status"`

	// LastTransitionTime is the last time this condition transitioned from one
	// status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime"`

	// A Reason for this condition's last transition from one status to another.
	Reason string `json:"reason,omitempty"`

	// A Message containing details about this condition's last transition from
	// one status to another, if any.
	// +optional
	Message string `json:"message,omitempty"`
}

func (*HealthCondition) DeepCopy

func (in *HealthCondition) DeepCopy() *HealthCondition

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

func (*HealthCondition) DeepCopyInto

func (in *HealthCondition) DeepCopyInto(out *HealthCondition)

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

func (HealthCondition) Equal

func (c HealthCondition) Equal(other HealthCondition) bool

Equal returns true if the condition is identical to the supplied condition, ignoring the LastTransitionTime.

func (HealthCondition) WithMessage

func (c HealthCondition) WithMessage(msg string) HealthCondition

WithMessage returns a condition by adding the provided message to existing condition.

type HealthConditionedStatus

type HealthConditionedStatus struct {
	// Status of the health in percentage
	Percentage uint32 `json:"percentage,omitempty"`

	// LastTransitionTime is the last time this condition transitioned from one
	// status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`

	// HealthConditions that determine the health status.
	// +optional
	HealthConditions []HealthCondition `json:"healthConditions,omitempty"`
}

func NewHealthConditionedStatus

func NewHealthConditionedStatus(p uint32, c ...HealthCondition) *HealthConditionedStatus

NewConditionedStatus returns a stat with the supplied conditions set.

func (*HealthConditionedStatus) DeepCopy

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

func (*HealthConditionedStatus) DeepCopyInto

func (in *HealthConditionedStatus) DeepCopyInto(out *HealthConditionedStatus)

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

func (*HealthConditionedStatus) Equal

Equal returns true if the status is identical to the supplied status, ignoring the LastTransitionTimes and order of statuses.

func (*HealthConditionedStatus) GetHealthCondition

func (s *HealthConditionedStatus) GetHealthCondition(resourceName, hck string) HealthCondition

GetCondition returns the condition for the given ConditionKind if exists, otherwise returns nil

func (*HealthConditionedStatus) SetHealthConditions

func (s *HealthConditionedStatus) SetHealthConditions(c ...HealthCondition)

SetConditions sets the supplied conditions, replacing any existing conditions of the same kind. This is a no-op if all supplied conditions are identical, ignoring the last transition time, to those already set.

type LifecyclePolicy

type LifecyclePolicy string
const (
	// LifecyclePlanned means the app will allocate resources but will not
	// be deployed on the network element
	LifecyclePlanned LifecyclePolicy = "planned"

	// LifecycleActive means the app will be deployed on the network elements
	LifecycleActive LifecyclePolicy = "active"
)

type OdaInfo

type OdaInfo struct {
	Oda []Tag `json:"oda,omitempty"`
}

func NewOdaInfo

func NewOdaInfo(c ...Tag) *OdaInfo

func (*OdaInfo) DeepCopy

func (in *OdaInfo) DeepCopy() *OdaInfo

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

func (*OdaInfo) DeepCopyInto

func (in *OdaInfo) DeepCopyInto(out *OdaInfo)

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

func (*OdaInfo) GetAvailabilityZone

func (x *OdaInfo) GetAvailabilityZone() string

func (*OdaInfo) GetDeployment

func (x *OdaInfo) GetDeployment() string

func (*OdaInfo) GetOda

func (x *OdaInfo) GetOda(k string) Tag

GetCondition returns the condition for the given ConditionKind if exists, otherwise returns nil

func (*OdaInfo) GetOrganization

func (x *OdaInfo) GetOrganization() string

func (*OdaInfo) SetAvailabilityZone

func (x *OdaInfo) SetAvailabilityZone(s string)

func (*OdaInfo) SetDeployment

func (x *OdaInfo) SetDeployment(s string)

func (*OdaInfo) SetOrganization

func (x *OdaInfo) SetOrganization(s string)

func (*OdaInfo) SetTags

func (s *OdaInfo) SetTags(c ...Tag)

SetTags sets the supplied tags, replacing any existing tag of the same kind. This is a no-op if all supplied tags are identical, ignoring the last transition time, to those already set.

type OdaKind

type OdaKind string
const (
	OdaKindOrganization    OdaKind = "organization"
	OdaKindDeployment      OdaKind = "deployment"
	OdaKindAvailabiityZone OdaKind = "availability-zone"
	OdaKindUnknown         OdaKind = "unknown"
)

func (OdaKind) String

func (s OdaKind) String() string

type ResourceSpec

type ResourceSpec struct {
	// LifecyclePolicy specifies what will happen to the lifecycle of the resource
	// +kubebuilder:validation:Enum=`planned`;`active`
	// +kubebuilder:default=planned
	LifecyclePolicy LifecyclePolicy `json:"deployment-policy,omitempty"`
}

func (*ResourceSpec) DeepCopy

func (in *ResourceSpec) DeepCopy() *ResourceSpec

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

func (*ResourceSpec) DeepCopyInto

func (in *ResourceSpec) DeepCopyInto(out *ResourceSpec)

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

type ResourceStatus

type ResourceStatus struct {
	// the condition status
	nddv1.ConditionedStatus `json:",inline"`
	// the health condition status
	Health HealthConditionedStatus `json:"health,omitempty"`
	// the oda info
	OdaInfo `json:",inline"`
}

ResourceStatus represents the observed state of a managed resource.

func (*ResourceStatus) DeepCopy

func (in *ResourceStatus) DeepCopy() *ResourceStatus

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

func (*ResourceStatus) DeepCopyInto

func (in *ResourceStatus) DeepCopyInto(out *ResourceStatus)

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

type Tag

type Tag struct {
	Key   *string `json:"key,omitempty"`
	Value *string `json:"value,omitempty"`
}

func (*Tag) DeepCopy

func (in *Tag) DeepCopy() *Tag

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

func (*Tag) DeepCopyInto

func (in *Tag) DeepCopyInto(out *Tag)

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

func (Tag) Equal

func (t Tag) Equal(other Tag) bool

Equal returns true if the tag is identical to the supplied tag, ignoring the LastTransitionTime.

func (*Tag) GetTag

func (t *Tag) GetTag() map[string]string

Jump to

Keyboard shortcuts

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