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
- Variables
- func Resource(resource string) schema.GroupResource
- type PrometheusSource
- type PrometheusSourceList
- type PrometheusSourceSpec
- type PrometheusSourceStatus
- func (in *PrometheusSourceStatus) DeepCopy() *PrometheusSourceStatus
- func (in *PrometheusSourceStatus) DeepCopyInto(out *PrometheusSourceStatus)
- func (s *PrometheusSourceStatus) GetCondition(t apis.ConditionType) *apis.Condition
- func (s *PrometheusSourceStatus) InitializeConditions()
- func (s *PrometheusSourceStatus) IsReady() bool
- func (s *PrometheusSourceStatus) MarkEventTypes()
- func (s *PrometheusSourceStatus) MarkNoEventTypes(reason, messageFormat string, messageA ...interface{})
- func (s *PrometheusSourceStatus) MarkNoSink(reason, messageFormat string, messageA ...interface{})
- func (s *PrometheusSourceStatus) MarkSink(uri string)
- func (s *PrometheusSourceStatus) PropagateDeploymentAvailability(d *appsv1.Deployment)
Constants ¶
const ( // PrometheusConditionReady has status True when the PrometheusSource is ready to send events. PrometheusConditionReady = apis.ConditionReady // 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" )
const (
// PromQLPrometheusSourceEventType is the PrometheusSource PromQL CloudEvent type.
PromQLPrometheusSourceEventType = "dev.knative.prometheus.promql"
)
Variables ¶
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 )
var PrometheusCondSet = apis.NewLivingConditionSet( PrometheusConditionSinkProvided, PrometheusConditionDeployed, PrometheusConditionEventTypeProvided, )
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 ¶
func (in *PrometheusSourceList) DeepCopy() *PrometheusSourceList
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"` // Sink is a reference to an object that will resolve to a domain // name to use as the sink. // +optional Sink *corev1.ObjectReference `json:"sink,omitempty"` }
PrometheusSourceSpec defines the desired state of PrometheusSource
func (*PrometheusSourceSpec) DeepCopy ¶
func (in *PrometheusSourceSpec) DeepCopy() *PrometheusSourceSpec
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 ¶
func (in *PrometheusSourceStatus) DeepCopy() *PrometheusSourceStatus
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 ¶
func (s *PrometheusSourceStatus) GetCondition(t apis.ConditionType) *apis.Condition
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) 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) 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.