v1alpha1

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: Apache-2.0 Imports: 11 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.eventing.knative.dev

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/pkg/apis/sources +k8s:defaulter-gen=TypeMeta +groupName=sources.eventing.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"

	// PrometheusConditionEventTypeProvided has status True when the PrometheusSource has been configured with its event types.
	PrometheusConditionEventTypeProvided apis.ConditionType = "EventTypesProvided"
)
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.eventing.knative.dev", Version: "v1alpha1"}

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

Functions

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) GetGroupVersionKind

func (s *PrometheusSource) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind returns the GroupVersionKind.

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 *duckv1beta1.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.

type PrometheusSourceStatus

type PrometheusSourceStatus struct {
	// inherits duck/v1 Status, 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.
	duckv1.Status `json:",inline"`

	// SinkURI is the current active sink URI that has been configured
	// for the PrometheusSource.
	// +optional
	SinkURI string `json:"sinkUri,omitempty"`
}

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) MarkEventTypes

func (s *PrometheusSourceStatus) MarkEventTypes()

MarkEventTypes sets the condition that the source has set its event type.

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) MarkNoEventTypes

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

MarkNoEventTypes sets the condition that the source does not its event type 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 string)

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

func (*PrometheusSourceStatus) MarkSinkWarnRefDeprecated added in v0.11.0

func (s *PrometheusSourceStatus) MarkSinkWarnRefDeprecated(uri string)

MarkSinkWarnDeprecated sets the condition that the source has a sink configured and warns ref is deprecated.

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