v1

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package v1 is the v1 version of the API.

Index

Constants

This section is empty.

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: indicatordocument.GroupName, Version: "v1"}

SchemeGroupVersion is group version used to register these objects

Functions

func ChartTypeToString added in v0.9.1

func ChartTypeToString(ct ChartType) string

func GetComparatorAbbrev

func GetComparatorAbbrev(op ThresholdOperator) string

func GetComparatorSymbol

func GetComparatorSymbol(op ThresholdOperator) string

func IndicatorTypeToString

func IndicatorTypeToString(it IndicatorType) string

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func PopulateDefaults

func PopulateDefaults(doc *IndicatorDocument)

If the given document is missing data, fills it in with sane defaults. Populates the layout as the standard SLI/KLI/Metrics three-row setup. Defaults the title of the layout to "<name> - <version>". Defaults the alert to `[1m]` steps. Ensures that some values, for example chart's labels, are [] instead of nil.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

func ValidateBytesBySchema added in v0.8.6

func ValidateBytesBySchema(docBytes []byte, schemaName string) ([]error, bool)

Validates provided YAML is in correct v1 format by OpenAPI Schema

Types

type Alert

type Alert struct {
	For  string `json:"for,omitempty"`
	Step string `json:"step,omitempty"`
}

func (*Alert) DeepCopy

func (in *Alert) DeepCopy() *Alert

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

func (*Alert) DeepCopyInto

func (in *Alert) DeepCopyInto(out *Alert)

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

type ChartType

type ChartType int
const (
	UndefinedChart ChartType = iota
	InvalidChart
	StepChart
	BarChart
	StatusChart
	QuotaChart
)

func ChartTypeFromString added in v0.9.1

func ChartTypeFromString(s string) ChartType

func (ChartType) MarshalJSON added in v0.9.1

func (ct ChartType) MarshalJSON() ([]byte, error)

func (*ChartType) UnmarshalJSON added in v0.9.1

func (ct *ChartType) UnmarshalJSON(data []byte) error

type Indicator

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

	Spec   IndicatorSpec   `json:"spec"`
	Status IndicatorStatus `json:"status,omitempty"`
}

+genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*Indicator) DeepCopy

func (in *Indicator) DeepCopy() *Indicator

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

func (*Indicator) DeepCopyInto

func (in *Indicator) DeepCopyInto(out *Indicator)

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

func (*Indicator) DeepCopyObject

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

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

type IndicatorDocument

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

	Spec   IndicatorDocumentSpec   `json:"spec"`
	Status IndicatorDocumentStatus `json:"status,omitempty"`
}

IndicatorDocument is a specification for a IndicatorDocument resource

func (IndicatorDocument) BoshUID

func (id IndicatorDocument) BoshUID() string

func (*IndicatorDocument) DeepCopy

func (in *IndicatorDocument) DeepCopy() *IndicatorDocument

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

func (*IndicatorDocument) DeepCopyInto

func (in *IndicatorDocument) DeepCopyInto(out *IndicatorDocument)

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

func (*IndicatorDocument) DeepCopyObject

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

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

func (IndicatorDocument) Indicator

func (id IndicatorDocument) Indicator(name string) *IndicatorSpec

func (*IndicatorDocument) Validate

func (doc *IndicatorDocument) Validate() []error

type IndicatorDocumentList

type IndicatorDocumentList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []IndicatorDocument `json:"items"`
}

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object IndicatorDocumentList is a list of IndicatorDocument resources

func (*IndicatorDocumentList) DeepCopy

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

func (*IndicatorDocumentList) DeepCopyInto

func (in *IndicatorDocumentList) DeepCopyInto(out *IndicatorDocumentList)

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

func (*IndicatorDocumentList) DeepCopyObject

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

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

type IndicatorDocumentSpec

type IndicatorDocumentSpec struct {
	Product    Product         `json:"product"`
	Indicators []IndicatorSpec `json:"indicators,omitempty"`
	Layout     Layout          `json:"layout,omitempty"`
}

IndicatorDocumentSpec is the spec for a IndicatorDocument resource

func (*IndicatorDocumentSpec) DeepCopy

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

func (*IndicatorDocumentSpec) DeepCopyInto

func (in *IndicatorDocumentSpec) DeepCopyInto(out *IndicatorDocumentSpec)

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

type IndicatorDocumentStatus

type IndicatorDocumentStatus map[string]IndicatorStatus

IndicatorDocumentStatus is the status for a IndicatorDocument resource, it maps names of indicators to their statuses.

func (IndicatorDocumentStatus) DeepCopy

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

func (IndicatorDocumentStatus) DeepCopyInto

func (in IndicatorDocumentStatus) DeepCopyInto(out *IndicatorDocumentStatus)

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

type IndicatorList

type IndicatorList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []Indicator `json:"items"`
}

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object IndicatorList is a list of Indicator resources

func (*IndicatorList) DeepCopy

func (in *IndicatorList) DeepCopy() *IndicatorList

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

func (*IndicatorList) DeepCopyInto

func (in *IndicatorList) DeepCopyInto(out *IndicatorList)

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

func (*IndicatorList) DeepCopyObject

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

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

type IndicatorSpec

type IndicatorSpec struct {
	// Product duplicated between here and indicator documents for the `kubectl get indicators` display
	Product       string            `json:"product,omitempty"`
	Name          string            `json:"name"`
	Type          IndicatorType     `json:"type"`
	PromQL        string            `json:"promql"`
	Thresholds    []Threshold       `json:"thresholds,omitempty"`
	Documentation map[string]string `json:"documentation,omitempty"`
	Presentation  Presentation      `json:"presentation,omitempty"`
}

func (*IndicatorSpec) DeepCopy

func (in *IndicatorSpec) DeepCopy() *IndicatorSpec

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

func (*IndicatorSpec) DeepCopyInto

func (in *IndicatorSpec) DeepCopyInto(out *IndicatorSpec)

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

func (*IndicatorSpec) Validate

func (is *IndicatorSpec) Validate(indicatorIndex int, apiVersion string) []error

type IndicatorStatus

type IndicatorStatus struct {
	Phase     string      `json:"phase"`
	UpdatedAt metav1.Time `json:"updatedAt"`
}

func (*IndicatorStatus) DeepCopy

func (in *IndicatorStatus) DeepCopy() *IndicatorStatus

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

func (*IndicatorStatus) DeepCopyInto

func (in *IndicatorStatus) DeepCopyInto(out *IndicatorStatus)

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

type IndicatorType

type IndicatorType int
const (
	DefaultIndicator IndicatorType = iota
	ServiceLevelIndicator
	KeyPerformanceIndicator
	UndefinedType
)

func IndicatorTypeFromString

func IndicatorTypeFromString(s string) IndicatorType

func (IndicatorType) MarshalJSON

func (it IndicatorType) MarshalJSON() ([]byte, error)

func (*IndicatorType) UnmarshalJSON

func (it *IndicatorType) UnmarshalJSON(data []byte) error

type Layout

type Layout struct {
	Owner       string    `json:"owner,omitempty"`
	Title       string    `json:"title,omitempty"`
	Description string    `json:"description,omitempty"`
	Sections    []Section `json:"sections,omitempty"`
}

func (*Layout) DeepCopy

func (in *Layout) DeepCopy() *Layout

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

func (*Layout) DeepCopyInto

func (in *Layout) DeepCopyInto(out *Layout)

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

type Presentation

type Presentation struct {
	ChartType    ChartType `json:"chartType,omitempty"`
	CurrentValue bool      `json:"currentValue,omitempty"`
	Frequency    int64     `json:"frequency,omitempty"`
	Labels       []string  `json:"labels,omitempty"`
	Units        string    `json:"units,omitempty"`
}

func (*Presentation) DeepCopy

func (in *Presentation) DeepCopy() *Presentation

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

func (*Presentation) DeepCopyInto

func (in *Presentation) DeepCopyInto(out *Presentation)

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

type Product

type Product struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

func (*Product) DeepCopy

func (in *Product) DeepCopy() *Product

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

func (*Product) DeepCopyInto

func (in *Product) DeepCopyInto(out *Product)

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

type Section

type Section struct {
	Title       string   `json:"title,omitempty"`
	Description string   `json:"description,omitempty"`
	Indicators  []string `json:"indicators,omitempty"`
}

func (*Section) DeepCopy

func (in *Section) DeepCopy() *Section

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

func (*Section) DeepCopyInto

func (in *Section) DeepCopyInto(out *Section)

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

type Threshold

type Threshold struct {
	Level    string            `json:"level"`
	Operator ThresholdOperator `json:"operator"`
	Value    float64           `json:"value"`
	Alert    Alert             `json:"alert,omitempty"`
}

func (*Threshold) DeepCopy

func (in *Threshold) DeepCopy() *Threshold

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

func (*Threshold) DeepCopyInto

func (in *Threshold) DeepCopyInto(out *Threshold)

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

type ThresholdOperator

type ThresholdOperator int
const (
	UndefinedOperator ThresholdOperator = iota
	LessThan
	LessThanOrEqualTo
	EqualTo
	NotEqualTo
	GreaterThanOrEqualTo
	GreaterThan
)

func GetComparatorFromString

func GetComparatorFromString(operator string) ThresholdOperator

func (ThresholdOperator) MarshalJSON

func (ot ThresholdOperator) MarshalJSON() ([]byte, error)

func (*ThresholdOperator) UnmarshalJSON

func (ot *ThresholdOperator) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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