eb3386398e71794418d224aa2880dba2509d8836
[demo.git] / vnfs / DAaaS / microservices / collectd-operator / pkg / apis / onap / v1alpha1 / collectdplugin_types.go
1 package v1alpha1
2
3 import (
4         metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5 )
6
7 const (
8         //Initial indicates the initial status of CollectdPlugin
9         Initial = ""
10         //Created indicates the status of CollectdPlugin after first reconcile
11         Created = "Created"
12         //Enabled indicates the status of CollectdPlugin after all the pods are reloaded
13         Enabled = "Enabled"
14         //Deleting state
15         Deleting = "Deleting"
16         //Deprecated state when a plugin with same name is created. Old plugin gets deprecated and deleted eventually.
17         Deprecated = "Deprecated"
18 )
19
20 // EDIT THIS FILE!  THIS IS SCAFFOLDING FOR YOU TO OWN!
21 // NOTE: json tags are required.  Any new fields you add must have json tags for the fields to be serialized.
22
23 // CollectdPluginSpec defines the desired state of CollectdPlugin
24 // +k8s:openapi-gen=true
25 type CollectdPluginSpec struct {
26         // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
27         // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
28         // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html
29         PluginName string `json:"pluginName"`
30         PluginConf string `json:"pluginConf"`
31 }
32
33 // CollectdPluginStatus defines the observed state of CollectdPlugin
34 // +k8s:openapi-gen=true
35 type CollectdPluginStatus struct {
36         // CollectdAgents are the collectd pods in the Daemonset
37         // Status can be one of "", Created, Deleting, Applied, Deprecated
38         CollectdAgents []string `json:"collectdAgents,omitempty"`
39         Status         string   `json:"status"`
40 }
41
42 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
43
44 // CollectdPlugin is the Schema for the collectdplugins API
45 // +k8s:openapi-gen=true
46 // +kubebuilder:subresource:status
47 type CollectdPlugin struct {
48         metav1.TypeMeta   `json:",inline"`
49         metav1.ObjectMeta `json:"metadata,omitempty"`
50
51         Spec   CollectdPluginSpec   `json:"spec,omitempty"`
52         Status CollectdPluginStatus `json:"status,omitempty"`
53 }
54
55 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
56
57 // CollectdPluginList contains a list of CollectdPlugin
58 type CollectdPluginList struct {
59         metav1.TypeMeta `json:",inline"`
60         metav1.ListMeta `json:"metadata,omitempty"`
61         Items           []CollectdPlugin `json:"items"`
62 }
63
64 func init() {
65         SchemeBuilder.Register(&CollectdPlugin{}, &CollectdPluginList{})
66 }