From 2026cb5283fbc44a4f68641f6e85628381ebda04 Mon Sep 17 00:00:00 2001 From: Srivahni Date: Thu, 24 Oct 2019 14:08:58 -0700 Subject: Add/update/delete PrometheusRemoteEndpoint CR PrometheusRemoteEndpoint CR when applied, a remote write endpoint is added/updated/deleted in prometheus. Issue-ID: ONAPARC-393 Signed-off-by: Srivahni Change-Id: I8cdc0b673b35be3457a2b12c6769cd3cf62ac6c5 --- .../v1alpha1/prometheusremoteendpoint_types.go | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 vnfs/DAaaS/microservices/remote-config-operator/pkg/apis/onap/v1alpha1/prometheusremoteendpoint_types.go (limited to 'vnfs/DAaaS/microservices/remote-config-operator/pkg/apis/onap/v1alpha1/prometheusremoteendpoint_types.go') diff --git a/vnfs/DAaaS/microservices/remote-config-operator/pkg/apis/onap/v1alpha1/prometheusremoteendpoint_types.go b/vnfs/DAaaS/microservices/remote-config-operator/pkg/apis/onap/v1alpha1/prometheusremoteendpoint_types.go new file mode 100644 index 00000000..71b38dc2 --- /dev/null +++ b/vnfs/DAaaS/microservices/remote-config-operator/pkg/apis/onap/v1alpha1/prometheusremoteendpoint_types.go @@ -0,0 +1,73 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type Metadata struct { + Name string `json:"Name"` + Labels []string `json:"Labels"` +} + +// PrometheusRemoteEndpointSpec defines the desired state of PrometheusRemoteEndpoint +// +k8s:openapi-gen=true +type PrometheusRemoteEndpointSpec struct { + AdapterUrl string `json:"adapterUrl"` + FilterSelector *metav1.LabelSelector `json:"filterSelector,omitempty"` + Type string `json:"type"` + KafkaConfig string `json:"kafkaConfig,omitempty"` + QueueConfig QueueConfig `json:"queueConfig,omitempty"` + RemoteTimeout string `json:"remoteTimeout,omitempty"` +} + +type KafkaConfig struct { + BrokerUrl string `json:"brokerUrl"` + Group string `json:"group,omitempty"` + Topic string `json:"topic"` +} + +type QueueConfig struct { + BatchSendDeadline string `json:"batchSendDeadline,omitempty"` + Capacity string `json:"capacity,omitempty"` + MaxBackoff string `json:"maxBackoff,omitempty"` + MaxRetries string `json:"maxRetries,omitempty"` + MaxSamplesPerSend string `json:"maxSamplesPerSend,omitempty"` + MaxShards string `json:"maxShards,omitempty"` + MinBackoff string `json:"minBackoff,omitempty"` + MinShards string `json:"minShards,omitempty"` +} + +// PrometheusRemoteEndpointStatus defines the observed state of PrometheusRemoteEndpoint +// +k8s:openapi-gen=true +type PrometheusRemoteEndpointStatus struct { + // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + // Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// PrometheusRemoteEndpoint is the Schema for the prometheusremoteendpoints API +// +k8s:openapi-gen=true +// +kubebuilder:subresource:status +// +kubebuilder:resource:path=prometheusremoteendpoints,scope=Namespaced +type PrometheusRemoteEndpoint struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec PrometheusRemoteEndpointSpec `json:"spec,omitempty"` + Status PrometheusRemoteEndpointStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// PrometheusRemoteEndpointList contains a list of PrometheusRemoteEndpoint +type PrometheusRemoteEndpointList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []PrometheusRemoteEndpoint `json:"items"` +} + +func init() { + SchemeBuilder.Register(&PrometheusRemoteEndpoint{}, &PrometheusRemoteEndpointList{}) +} -- cgit 1.2.3-korg