v1alpha1

package
v0.17.5 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=knative.dev/eventing-contrib/prometheus/pkg/apis/sources +k8s:defaulter-gen=TypeMeta +groupName=sources.knative.dev

Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:defaulter-gen=TypeMeta +groupName=sources.knative.dev

Index

Constants

View Source
const (
	// PrometheusConditionReady has status True when the PrometheusSource is ready to send events.
	PrometheusConditionReady = apis.ConditionReady

	// PrometheusConditionValidSchedule has status True when the PrometheusSource has been configured with a valid schedule.
	PrometheusConditionValidSchedule apis.ConditionType = "ValidSchedule"

	// PrometheusConditionSinkProvided has status True when the PrometheusSource has been configured with a sink target.
	PrometheusConditionSinkProvided apis.ConditionType = "SinkProvided"

	// PrometheusConditionDeployed has status True when the PrometheusSource has had it's deployment created.
	PrometheusConditionDeployed apis.ConditionType = "Deployed"
)
View Source
const (
	// PromQLPrometheusSourceEventType is the PrometheusSource PromQL CloudEvent type.
	PromQLPrometheusSourceEventType = "dev.knative.prometheus.promql"
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: sources.GroupName, Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)

Functions

func Kind added in v0.14.0

func Kind(kind string) schema.GroupKind

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

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type PrometheusSource

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

	Spec   PrometheusSourceSpec   `json:"spec,omitempty"`
	Status PrometheusSourceStatus `json:"status,omitempty"`
}

PrometheusSource is the Schema for the prometheussources API +k8s:openapi-gen=true

func (*PrometheusSource) DeepCopy

func (in *PrometheusSource) DeepCopy() *PrometheusSource

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

func (*PrometheusSource) DeepCopyInto

func (in *PrometheusSource) DeepCopyInto(out *PrometheusSource)

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

func (*PrometheusSource) DeepCopyObject

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

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

func (*PrometheusSource) GetConditionSet added in v0.16.0

func (*PrometheusSource) GetConditionSet() apis.ConditionSet

GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.

func (*PrometheusSource) GetGroupVersionKind

func (*PrometheusSource) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind returns the GroupVersionKind.

func (*PrometheusSource) GetStatus added in v0.16.0

func (p *PrometheusSource) GetStatus() *duckv1.Status

GetStatus retrieves the duck status for this resource. Implements the KRShaped interface.

func (*PrometheusSource) SetDefaults added in v0.16.0

func (s *PrometheusSource) SetDefaults(ctx context.Context)

func (*PrometheusSource) Validate added in v0.16.0

func (s *PrometheusSource) Validate(ctx context.Context) *apis.FieldError

Validate Prometheus source object fields

type PrometheusSourceList

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

PrometheusSourceList contains a list of PrometheusSource

func (*PrometheusSourceList) DeepCopy

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

func (*PrometheusSourceList) DeepCopyInto

func (in *PrometheusSourceList) DeepCopyInto(out *PrometheusSourceList)

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

func (*PrometheusSourceList) DeepCopyObject

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

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

type PrometheusSourceSpec

type PrometheusSourceSpec struct {
	// ServiceAccountName holds the name of the Kubernetes service account
	// as which the underlying K8s resources should be run. If unspecified
	// this will default to the "default" service account for the namespace
	// in which the PrometheusSource exists.
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	// ServerURL is the URL of the Prometheus server
	ServerURL string `json:"serverURL"`

	// PromQL is the Prometheus query for this source
	PromQL string `json:"promQL"`

	// The name of the file containing the authenication token
	// +optional
	AuthTokenFile string `json:"authTokenFile,omitempty"`

	// The name of the config map containing the CA certificate of the
	// Prometheus service's signer.
	// +optional
	CACertConfigMap string `json:"caCertConfigMap,omitempty"`

	// A crontab-formatted schedule for running the PromQL query
	Schedule string `json:"schedule"`

	// Query resolution step width in duration format or float number of seconds.
	// Prometheus duration strings are of the form [0-9]+[smhdwy].
	// +optional
	Step string `json:"step,omitempty"`

	// Sink is a reference to an object that will resolve to a host
	// name to use as the sink.
	// +optional
	Sink *duckv1.Destination `json:"sink,omitempty"`
}

PrometheusSourceSpec defines the desired state of PrometheusSource

func (*PrometheusSourceSpec) DeepCopy

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

func (*PrometheusSourceSpec) DeepCopyInto

func (in *PrometheusSourceSpec) DeepCopyInto(out *PrometheusSourceSpec)

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

func (*PrometheusSourceSpec) SetDefaults added in v0.16.0

func (s *PrometheusSourceSpec) SetDefaults(ctx context.Context)

func (*PrometheusSourceSpec) Validate added in v0.16.0

Validate Prometheus source Spec object fields

type PrometheusSourceStatus

type PrometheusSourceStatus struct {
	// inherits duck/v1 SourceStatus, which currently provides:
	// * ObservedGeneration - the 'Generation' of the Service that was last
	//   processed by the controller.
	// * Conditions - the latest available observations of a resource's current
	//   state.
	// * SinkURI - the current active sink URI that has been configured for the
	//   Source.
	duckv1.SourceStatus `json:",inline"`
}

PrometheusSourceStatus defines the observed state of PrometheusSource

func (*PrometheusSourceStatus) DeepCopy

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

func (*PrometheusSourceStatus) DeepCopyInto

func (in *PrometheusSourceStatus) DeepCopyInto(out *PrometheusSourceStatus)

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

func (*PrometheusSourceStatus) GetCondition

GetCondition returns the condition currently associated with the given type, or nil.

func (*PrometheusSourceStatus) InitializeConditions

func (s *PrometheusSourceStatus) InitializeConditions()

InitializeConditions sets relevant unset conditions to Unknown state.

func (*PrometheusSourceStatus) IsReady

func (s *PrometheusSourceStatus) IsReady() bool

IsReady returns true if the resource is ready overall.

func (*PrometheusSourceStatus) MarkInvalidSchedule added in v0.11.0

func (s *PrometheusSourceStatus) MarkInvalidSchedule(reason, messageFormat string, messageA ...interface{})

MarkInvalidSchedule sets the condition that the source does not have a valid schedule configured.

func (*PrometheusSourceStatus) MarkNoSink

func (s *PrometheusSourceStatus) MarkNoSink(reason, messageFormat string, messageA ...interface{})

MarkNoSink sets the condition that the source does not have a sink configured.

func (*PrometheusSourceStatus) MarkSink

func (s *PrometheusSourceStatus) MarkSink(uri *apis.URL)

MarkSink sets the condition that the source has a sink configured.

func (*PrometheusSourceStatus) MarkValidSchedule added in v0.11.0

func (s *PrometheusSourceStatus) MarkValidSchedule()

MarkValidSchedule sets the condition that the source has a valid schedule configured.

func (*PrometheusSourceStatus) PropagateDeploymentAvailability

func (s *PrometheusSourceStatus) PropagateDeploymentAvailability(d *appsv1.Deployment)

PropagateDeploymentAvailability uses the availability of the provided Deployment to determine if PrometheusConditionDeployed should be marked as true or false.

Jump to

Keyboard shortcuts

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