diff --git a/api/v1alpha1/userconfig/integration-endpoints/datadog/datadog.go b/api/v1alpha1/userconfig/integration-endpoints/datadog/datadog.go new file mode 100644 index 00000000..abd513d4 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/datadog/datadog.go @@ -0,0 +1,49 @@ +// Code generated by user config generator. DO NOT EDIT. +// +kubebuilder:object:generate=true + +package datadoguserconfig + +// Datadog tag defined by user +type DatadogTags struct { + // +kubebuilder:validation:MaxLength=1024 + // Optional tag explanation + Comment *string `groups:"create,update" json:"comment,omitempty"` + + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=200 + // Tag format and usage are described here: https://docs.datadoghq.com/getting_started/tagging. Tags with prefix 'aiven-' are reserved for Aiven. + Tag string `groups:"create,update" json:"tag"` +} +type DatadogUserConfig struct { + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + // +kubebuilder:validation:Pattern=`^[A-Za-z0-9]{1,256}$` + // Datadog API key + DatadogApiKey string `groups:"create,update" json:"datadog_api_key"` + + // +kubebuilder:validation:MaxItems=32 + // Custom tags provided by user + DatadogTags []*DatadogTags `groups:"create,update" json:"datadog_tags,omitempty"` + + // Disable consumer group metrics + DisableConsumerStats *bool `groups:"create,update" json:"disable_consumer_stats,omitempty"` + + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=100 + // Number of separate instances to fetch kafka consumer statistics with + KafkaConsumerCheckInstances *int `groups:"create,update" json:"kafka_consumer_check_instances,omitempty"` + + // +kubebuilder:validation:Minimum=2 + // +kubebuilder:validation:Maximum=300 + // Number of seconds that datadog will wait to get consumer statistics from brokers + KafkaConsumerStatsTimeout *int `groups:"create,update" json:"kafka_consumer_stats_timeout,omitempty"` + + // +kubebuilder:validation:Minimum=200 + // +kubebuilder:validation:Maximum=200000 + // Maximum number of partition contexts to send + MaxPartitionContexts *int `groups:"create,update" json:"max_partition_contexts,omitempty"` + + // +kubebuilder:validation:Enum="datadoghq.com";"datadoghq.eu";"us3.datadoghq.com";"us5.datadoghq.com";"ddog-gov.com" + // Datadog intake site. Defaults to datadoghq.com + Site *string `groups:"create,update" json:"site,omitempty"` +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/datadog/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration-endpoints/datadog/zz_generated.deepcopy.go new file mode 100644 index 00000000..f1be238c --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/datadog/zz_generated.deepcopy.go @@ -0,0 +1,79 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright (c) 2024 Aiven, Helsinki, Finland. https://aiven.io/ + +// Code generated by controller-gen. DO NOT EDIT. + +package datadoguserconfig + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatadogTags) DeepCopyInto(out *DatadogTags) { + *out = *in + if in.Comment != nil { + in, out := &in.Comment, &out.Comment + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatadogTags. +func (in *DatadogTags) DeepCopy() *DatadogTags { + if in == nil { + return nil + } + out := new(DatadogTags) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatadogUserConfig) DeepCopyInto(out *DatadogUserConfig) { + *out = *in + if in.DatadogTags != nil { + in, out := &in.DatadogTags, &out.DatadogTags + *out = make([]*DatadogTags, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(DatadogTags) + (*in).DeepCopyInto(*out) + } + } + } + if in.DisableConsumerStats != nil { + in, out := &in.DisableConsumerStats, &out.DisableConsumerStats + *out = new(bool) + **out = **in + } + if in.KafkaConsumerCheckInstances != nil { + in, out := &in.KafkaConsumerCheckInstances, &out.KafkaConsumerCheckInstances + *out = new(int) + **out = **in + } + if in.KafkaConsumerStatsTimeout != nil { + in, out := &in.KafkaConsumerStatsTimeout, &out.KafkaConsumerStatsTimeout + *out = new(int) + **out = **in + } + if in.MaxPartitionContexts != nil { + in, out := &in.MaxPartitionContexts, &out.MaxPartitionContexts + *out = new(int) + **out = **in + } + if in.Site != nil { + in, out := &in.Site, &out.Site + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatadogUserConfig. +func (in *DatadogUserConfig) DeepCopy() *DatadogUserConfig { + if in == nil { + return nil + } + out := new(DatadogUserConfig) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_aws_cloudwatch_logs/external_aws_cloudwatch_logs.go b/api/v1alpha1/userconfig/integration-endpoints/external_aws_cloudwatch_logs/external_aws_cloudwatch_logs.go new file mode 100644 index 00000000..870153ba --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_aws_cloudwatch_logs/external_aws_cloudwatch_logs.go @@ -0,0 +1,24 @@ +// Code generated by user config generator. DO NOT EDIT. +// +kubebuilder:object:generate=true + +package externalawscloudwatchlogsuserconfig + +type ExternalAwsCloudwatchLogsUserConfig struct { + // +kubebuilder:validation:MaxLength=4096 + // AWS access key. Required permissions are logs:CreateLogGroup, logs:CreateLogStream, logs:PutLogEvents and logs:DescribeLogStreams + AccessKey string `groups:"create,update" json:"access_key"` + + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=512 + // +kubebuilder:validation:Pattern=`^[\.\-_/#A-Za-z0-9]+$` + // AWS CloudWatch log group name + LogGroupName *string `groups:"create,update" json:"log_group_name,omitempty"` + + // +kubebuilder:validation:MaxLength=32 + // AWS region + Region string `groups:"create,update" json:"region"` + + // +kubebuilder:validation:MaxLength=4096 + // AWS secret key + SecretKey string `groups:"create,update" json:"secret_key"` +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_aws_cloudwatch_logs/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration-endpoints/external_aws_cloudwatch_logs/zz_generated.deepcopy.go new file mode 100644 index 00000000..903a051e --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_aws_cloudwatch_logs/zz_generated.deepcopy.go @@ -0,0 +1,28 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright (c) 2024 Aiven, Helsinki, Finland. https://aiven.io/ + +// Code generated by controller-gen. DO NOT EDIT. + +package externalawscloudwatchlogsuserconfig + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalAwsCloudwatchLogsUserConfig) DeepCopyInto(out *ExternalAwsCloudwatchLogsUserConfig) { + *out = *in + if in.LogGroupName != nil { + in, out := &in.LogGroupName, &out.LogGroupName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalAwsCloudwatchLogsUserConfig. +func (in *ExternalAwsCloudwatchLogsUserConfig) DeepCopy() *ExternalAwsCloudwatchLogsUserConfig { + if in == nil { + return nil + } + out := new(ExternalAwsCloudwatchLogsUserConfig) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_aws_cloudwatch_metrics/external_aws_cloudwatch_metrics.go b/api/v1alpha1/userconfig/integration-endpoints/external_aws_cloudwatch_metrics/external_aws_cloudwatch_metrics.go new file mode 100644 index 00000000..da776cfe --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_aws_cloudwatch_metrics/external_aws_cloudwatch_metrics.go @@ -0,0 +1,23 @@ +// Code generated by user config generator. DO NOT EDIT. +// +kubebuilder:object:generate=true + +package externalawscloudwatchmetricsuserconfig + +type ExternalAwsCloudwatchMetricsUserConfig struct { + // +kubebuilder:validation:MaxLength=4096 + // AWS access key. Required permissions are cloudwatch:PutMetricData + AccessKey string `groups:"create,update" json:"access_key"` + + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=255 + // AWS CloudWatch Metrics Namespace + Namespace string `groups:"create,update" json:"namespace"` + + // +kubebuilder:validation:MaxLength=32 + // AWS region + Region string `groups:"create,update" json:"region"` + + // +kubebuilder:validation:MaxLength=4096 + // AWS secret key + SecretKey string `groups:"create,update" json:"secret_key"` +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_aws_cloudwatch_metrics/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration-endpoints/external_aws_cloudwatch_metrics/zz_generated.deepcopy.go new file mode 100644 index 00000000..c49eba9e --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_aws_cloudwatch_metrics/zz_generated.deepcopy.go @@ -0,0 +1,23 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright (c) 2024 Aiven, Helsinki, Finland. https://aiven.io/ + +// Code generated by controller-gen. DO NOT EDIT. + +package externalawscloudwatchmetricsuserconfig + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalAwsCloudwatchMetricsUserConfig) DeepCopyInto(out *ExternalAwsCloudwatchMetricsUserConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalAwsCloudwatchMetricsUserConfig. +func (in *ExternalAwsCloudwatchMetricsUserConfig) DeepCopy() *ExternalAwsCloudwatchMetricsUserConfig { + if in == nil { + return nil + } + out := new(ExternalAwsCloudwatchMetricsUserConfig) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_elasticsearch_logs/external_elasticsearch_logs.go b/api/v1alpha1/userconfig/integration-endpoints/external_elasticsearch_logs/external_elasticsearch_logs.go new file mode 100644 index 00000000..ee578236 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_elasticsearch_logs/external_elasticsearch_logs.go @@ -0,0 +1,31 @@ +// Code generated by user config generator. DO NOT EDIT. +// +kubebuilder:object:generate=true + +package externalelasticsearchlogsuserconfig + +type ExternalElasticsearchLogsUserConfig struct { + // +kubebuilder:validation:MaxLength=16384 + // PEM encoded CA certificate + Ca *string `groups:"create,update" json:"ca,omitempty"` + + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=10000 + // Maximum number of days of logs to keep + IndexDaysMax *int `groups:"create,update" json:"index_days_max,omitempty"` + + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1000 + // +kubebuilder:validation:Pattern=`^[a-z0-9][a-z0-9-_.]+$` + // Elasticsearch index prefix + IndexPrefix string `groups:"create,update" json:"index_prefix"` + + // +kubebuilder:validation:Minimum=10 + // +kubebuilder:validation:Maximum=120 + // Elasticsearch request timeout limit + Timeout *float64 `groups:"create,update" json:"timeout,omitempty"` + + // +kubebuilder:validation:MinLength=12 + // +kubebuilder:validation:MaxLength=2048 + // Elasticsearch connection URL + Url string `groups:"create,update" json:"url"` +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_elasticsearch_logs/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration-endpoints/external_elasticsearch_logs/zz_generated.deepcopy.go new file mode 100644 index 00000000..780f3a07 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_elasticsearch_logs/zz_generated.deepcopy.go @@ -0,0 +1,38 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright (c) 2024 Aiven, Helsinki, Finland. https://aiven.io/ + +// Code generated by controller-gen. DO NOT EDIT. + +package externalelasticsearchlogsuserconfig + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalElasticsearchLogsUserConfig) DeepCopyInto(out *ExternalElasticsearchLogsUserConfig) { + *out = *in + if in.Ca != nil { + in, out := &in.Ca, &out.Ca + *out = new(string) + **out = **in + } + if in.IndexDaysMax != nil { + in, out := &in.IndexDaysMax, &out.IndexDaysMax + *out = new(int) + **out = **in + } + if in.Timeout != nil { + in, out := &in.Timeout, &out.Timeout + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalElasticsearchLogsUserConfig. +func (in *ExternalElasticsearchLogsUserConfig) DeepCopy() *ExternalElasticsearchLogsUserConfig { + if in == nil { + return nil + } + out := new(ExternalElasticsearchLogsUserConfig) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_google_cloud_bigquery/external_google_cloud_bigquery.go b/api/v1alpha1/userconfig/integration-endpoints/external_google_cloud_bigquery/external_google_cloud_bigquery.go new file mode 100644 index 00000000..96492ff9 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_google_cloud_bigquery/external_google_cloud_bigquery.go @@ -0,0 +1,16 @@ +// Code generated by user config generator. DO NOT EDIT. +// +kubebuilder:object:generate=true + +package externalgooglecloudbigqueryuserconfig + +// User configuration for Google Cloud BigQuery integration +type ExternalGoogleCloudBigqueryUserConfig struct { + // +kubebuilder:validation:MinLength=6 + // +kubebuilder:validation:MaxLength=30 + // GCP project id. + ProjectId string `groups:"create,update" json:"project_id"` + + // +kubebuilder:validation:MaxLength=4096 + // This is a JSON object with the fields documented in https://cloud.google.com/iam/docs/creating-managing-service-account-keys . + ServiceAccountCredentials string `groups:"create,update" json:"service_account_credentials"` +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_google_cloud_bigquery/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration-endpoints/external_google_cloud_bigquery/zz_generated.deepcopy.go new file mode 100644 index 00000000..1c8b8ef3 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_google_cloud_bigquery/zz_generated.deepcopy.go @@ -0,0 +1,23 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright (c) 2024 Aiven, Helsinki, Finland. https://aiven.io/ + +// Code generated by controller-gen. DO NOT EDIT. + +package externalgooglecloudbigqueryuserconfig + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalGoogleCloudBigqueryUserConfig) DeepCopyInto(out *ExternalGoogleCloudBigqueryUserConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalGoogleCloudBigqueryUserConfig. +func (in *ExternalGoogleCloudBigqueryUserConfig) DeepCopy() *ExternalGoogleCloudBigqueryUserConfig { + if in == nil { + return nil + } + out := new(ExternalGoogleCloudBigqueryUserConfig) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_google_cloud_logging/external_google_cloud_logging.go b/api/v1alpha1/userconfig/integration-endpoints/external_google_cloud_logging/external_google_cloud_logging.go new file mode 100644 index 00000000..d2d50ea6 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_google_cloud_logging/external_google_cloud_logging.go @@ -0,0 +1,20 @@ +// Code generated by user config generator. DO NOT EDIT. +// +kubebuilder:object:generate=true + +package externalgooglecloudlogginguserconfig + +// User configuration for Google Cloud Logging integration +type ExternalGoogleCloudLoggingUserConfig struct { + // +kubebuilder:validation:MaxLength=512 + // Google Cloud Logging log id + LogId string `groups:"create,update" json:"log_id"` + + // +kubebuilder:validation:MinLength=6 + // +kubebuilder:validation:MaxLength=30 + // GCP project id. + ProjectId string `groups:"create,update" json:"project_id"` + + // +kubebuilder:validation:MaxLength=4096 + // This is a JSON object with the fields documented in https://cloud.google.com/iam/docs/creating-managing-service-account-keys . + ServiceAccountCredentials string `groups:"create,update" json:"service_account_credentials"` +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_google_cloud_logging/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration-endpoints/external_google_cloud_logging/zz_generated.deepcopy.go new file mode 100644 index 00000000..29e7ce72 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_google_cloud_logging/zz_generated.deepcopy.go @@ -0,0 +1,23 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright (c) 2024 Aiven, Helsinki, Finland. https://aiven.io/ + +// Code generated by controller-gen. DO NOT EDIT. + +package externalgooglecloudlogginguserconfig + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalGoogleCloudLoggingUserConfig) DeepCopyInto(out *ExternalGoogleCloudLoggingUserConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalGoogleCloudLoggingUserConfig. +func (in *ExternalGoogleCloudLoggingUserConfig) DeepCopy() *ExternalGoogleCloudLoggingUserConfig { + if in == nil { + return nil + } + out := new(ExternalGoogleCloudLoggingUserConfig) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_kafka/external_kafka.go b/api/v1alpha1/userconfig/integration-endpoints/external_kafka/external_kafka.go new file mode 100644 index 00000000..43825d8e --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_kafka/external_kafka.go @@ -0,0 +1,45 @@ +// Code generated by user config generator. DO NOT EDIT. +// +kubebuilder:object:generate=true + +package externalkafkauserconfig + +type ExternalKafkaUserConfig struct { + // +kubebuilder:validation:MinLength=3 + // +kubebuilder:validation:MaxLength=256 + // Bootstrap servers + BootstrapServers string `groups:"create,update" json:"bootstrap_servers"` + + // +kubebuilder:validation:Enum="PLAIN";"SCRAM-SHA-256";"SCRAM-SHA-512" + // SASL mechanism used for connections to the Kafka server. + SaslMechanism *string `groups:"create,update" json:"sasl_mechanism,omitempty"` + + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + // Password for SASL PLAIN mechanism in the Kafka server. + SaslPlainPassword *string `groups:"create,update" json:"sasl_plain_password,omitempty"` + + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + // Username for SASL PLAIN mechanism in the Kafka server. + SaslPlainUsername *string `groups:"create,update" json:"sasl_plain_username,omitempty"` + + // +kubebuilder:validation:Enum="PLAINTEXT";"SSL";"SASL_PLAINTEXT";"SASL_SSL" + // Security protocol + SecurityProtocol string `groups:"create,update" json:"security_protocol"` + + // +kubebuilder:validation:MaxLength=16384 + // PEM-encoded CA certificate + SslCaCert *string `groups:"create,update" json:"ssl_ca_cert,omitempty"` + + // +kubebuilder:validation:MaxLength=16384 + // PEM-encoded client certificate + SslClientCert *string `groups:"create,update" json:"ssl_client_cert,omitempty"` + + // +kubebuilder:validation:MaxLength=16384 + // PEM-encoded client key + SslClientKey *string `groups:"create,update" json:"ssl_client_key,omitempty"` + + // +kubebuilder:validation:Enum="https";"" + // The endpoint identification algorithm to validate server hostname using server certificate. + SslEndpointIdentificationAlgorithm *string `groups:"create,update" json:"ssl_endpoint_identification_algorithm,omitempty"` +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_kafka/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration-endpoints/external_kafka/zz_generated.deepcopy.go new file mode 100644 index 00000000..8aa874dd --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_kafka/zz_generated.deepcopy.go @@ -0,0 +1,58 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright (c) 2024 Aiven, Helsinki, Finland. https://aiven.io/ + +// Code generated by controller-gen. DO NOT EDIT. + +package externalkafkauserconfig + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalKafkaUserConfig) DeepCopyInto(out *ExternalKafkaUserConfig) { + *out = *in + if in.SaslMechanism != nil { + in, out := &in.SaslMechanism, &out.SaslMechanism + *out = new(string) + **out = **in + } + if in.SaslPlainPassword != nil { + in, out := &in.SaslPlainPassword, &out.SaslPlainPassword + *out = new(string) + **out = **in + } + if in.SaslPlainUsername != nil { + in, out := &in.SaslPlainUsername, &out.SaslPlainUsername + *out = new(string) + **out = **in + } + if in.SslCaCert != nil { + in, out := &in.SslCaCert, &out.SslCaCert + *out = new(string) + **out = **in + } + if in.SslClientCert != nil { + in, out := &in.SslClientCert, &out.SslClientCert + *out = new(string) + **out = **in + } + if in.SslClientKey != nil { + in, out := &in.SslClientKey, &out.SslClientKey + *out = new(string) + **out = **in + } + if in.SslEndpointIdentificationAlgorithm != nil { + in, out := &in.SslEndpointIdentificationAlgorithm, &out.SslEndpointIdentificationAlgorithm + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalKafkaUserConfig. +func (in *ExternalKafkaUserConfig) DeepCopy() *ExternalKafkaUserConfig { + if in == nil { + return nil + } + out := new(ExternalKafkaUserConfig) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_opensearch_logs/external_opensearch_logs.go b/api/v1alpha1/userconfig/integration-endpoints/external_opensearch_logs/external_opensearch_logs.go new file mode 100644 index 00000000..bd935ab3 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_opensearch_logs/external_opensearch_logs.go @@ -0,0 +1,31 @@ +// Code generated by user config generator. DO NOT EDIT. +// +kubebuilder:object:generate=true + +package externalopensearchlogsuserconfig + +type ExternalOpensearchLogsUserConfig struct { + // +kubebuilder:validation:MaxLength=16384 + // PEM encoded CA certificate + Ca *string `groups:"create,update" json:"ca,omitempty"` + + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=10000 + // Maximum number of days of logs to keep + IndexDaysMax *int `groups:"create,update" json:"index_days_max,omitempty"` + + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1000 + // +kubebuilder:validation:Pattern=`^[a-z0-9][a-z0-9-_.]+$` + // OpenSearch index prefix + IndexPrefix string `groups:"create,update" json:"index_prefix"` + + // +kubebuilder:validation:Minimum=10 + // +kubebuilder:validation:Maximum=120 + // OpenSearch request timeout limit + Timeout *float64 `groups:"create,update" json:"timeout,omitempty"` + + // +kubebuilder:validation:MinLength=12 + // +kubebuilder:validation:MaxLength=2048 + // OpenSearch connection URL + Url string `groups:"create,update" json:"url"` +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_opensearch_logs/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration-endpoints/external_opensearch_logs/zz_generated.deepcopy.go new file mode 100644 index 00000000..464709b8 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_opensearch_logs/zz_generated.deepcopy.go @@ -0,0 +1,38 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright (c) 2024 Aiven, Helsinki, Finland. https://aiven.io/ + +// Code generated by controller-gen. DO NOT EDIT. + +package externalopensearchlogsuserconfig + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalOpensearchLogsUserConfig) DeepCopyInto(out *ExternalOpensearchLogsUserConfig) { + *out = *in + if in.Ca != nil { + in, out := &in.Ca, &out.Ca + *out = new(string) + **out = **in + } + if in.IndexDaysMax != nil { + in, out := &in.IndexDaysMax, &out.IndexDaysMax + *out = new(int) + **out = **in + } + if in.Timeout != nil { + in, out := &in.Timeout, &out.Timeout + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalOpensearchLogsUserConfig. +func (in *ExternalOpensearchLogsUserConfig) DeepCopy() *ExternalOpensearchLogsUserConfig { + if in == nil { + return nil + } + out := new(ExternalOpensearchLogsUserConfig) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_postgresql/external_postgresql.go b/api/v1alpha1/userconfig/integration-endpoints/external_postgresql/external_postgresql.go new file mode 100644 index 00000000..0f8aaed0 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_postgresql/external_postgresql.go @@ -0,0 +1,44 @@ +// Code generated by user config generator. DO NOT EDIT. +// +kubebuilder:object:generate=true + +package externalpostgresqluserconfig + +type ExternalPostgresqlUserConfig struct { + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[_A-Za-z0-9][-_A-Za-z0-9]{0,62}$` + // Default database + DefaultDatabase *string `groups:"create,update" json:"default_database,omitempty"` + + // +kubebuilder:validation:MaxLength=255 + // Hostname or IP address of the server + Host string `groups:"create,update" json:"host"` + + // +kubebuilder:validation:MaxLength=256 + // Password + Password *string `groups:"create,update" json:"password,omitempty"` + + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 + // Port number of the server + Port int `groups:"create,update" json:"port"` + + // +kubebuilder:validation:MaxLength=16384 + // Client certificate + SslClientCertificate *string `groups:"create,update" json:"ssl_client_certificate,omitempty"` + + // +kubebuilder:validation:MaxLength=16384 + // Client key + SslClientKey *string `groups:"create,update" json:"ssl_client_key,omitempty"` + + // +kubebuilder:validation:Enum="disable";"allow";"prefer";"require";"verify-ca";"verify-full" + // SSL Mode + SslMode *string `groups:"create,update" json:"ssl_mode,omitempty"` + + // +kubebuilder:validation:MaxLength=16384 + // SSL Root Cert + SslRootCert *string `groups:"create,update" json:"ssl_root_cert,omitempty"` + + // +kubebuilder:validation:MaxLength=256 + // User name + Username string `groups:"create,update" json:"username"` +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_postgresql/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration-endpoints/external_postgresql/zz_generated.deepcopy.go new file mode 100644 index 00000000..529f9759 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_postgresql/zz_generated.deepcopy.go @@ -0,0 +1,53 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright (c) 2024 Aiven, Helsinki, Finland. https://aiven.io/ + +// Code generated by controller-gen. DO NOT EDIT. + +package externalpostgresqluserconfig + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPostgresqlUserConfig) DeepCopyInto(out *ExternalPostgresqlUserConfig) { + *out = *in + if in.DefaultDatabase != nil { + in, out := &in.DefaultDatabase, &out.DefaultDatabase + *out = new(string) + **out = **in + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(string) + **out = **in + } + if in.SslClientCertificate != nil { + in, out := &in.SslClientCertificate, &out.SslClientCertificate + *out = new(string) + **out = **in + } + if in.SslClientKey != nil { + in, out := &in.SslClientKey, &out.SslClientKey + *out = new(string) + **out = **in + } + if in.SslMode != nil { + in, out := &in.SslMode, &out.SslMode + *out = new(string) + **out = **in + } + if in.SslRootCert != nil { + in, out := &in.SslRootCert, &out.SslRootCert + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPostgresqlUserConfig. +func (in *ExternalPostgresqlUserConfig) DeepCopy() *ExternalPostgresqlUserConfig { + if in == nil { + return nil + } + out := new(ExternalPostgresqlUserConfig) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_schema_registry/external_schema_registry.go b/api/v1alpha1/userconfig/integration-endpoints/external_schema_registry/external_schema_registry.go new file mode 100644 index 00000000..2f835562 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_schema_registry/external_schema_registry.go @@ -0,0 +1,22 @@ +// Code generated by user config generator. DO NOT EDIT. +// +kubebuilder:object:generate=true + +package externalschemaregistryuserconfig + +type ExternalSchemaRegistryUserConfig struct { + // +kubebuilder:validation:Enum="none";"basic" + // Authentication method + Authentication string `groups:"create,update" json:"authentication"` + + // +kubebuilder:validation:MaxLength=256 + // Basic authentication password + BasicAuthPassword *string `groups:"create,update" json:"basic_auth_password,omitempty"` + + // +kubebuilder:validation:MaxLength=256 + // Basic authentication user name + BasicAuthUsername *string `groups:"create,update" json:"basic_auth_username,omitempty"` + + // +kubebuilder:validation:MaxLength=2048 + // Schema Registry URL + Url string `groups:"create,update" json:"url"` +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/external_schema_registry/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration-endpoints/external_schema_registry/zz_generated.deepcopy.go new file mode 100644 index 00000000..692e7ee3 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/external_schema_registry/zz_generated.deepcopy.go @@ -0,0 +1,33 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright (c) 2024 Aiven, Helsinki, Finland. https://aiven.io/ + +// Code generated by controller-gen. DO NOT EDIT. + +package externalschemaregistryuserconfig + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalSchemaRegistryUserConfig) DeepCopyInto(out *ExternalSchemaRegistryUserConfig) { + *out = *in + if in.BasicAuthPassword != nil { + in, out := &in.BasicAuthPassword, &out.BasicAuthPassword + *out = new(string) + **out = **in + } + if in.BasicAuthUsername != nil { + in, out := &in.BasicAuthUsername, &out.BasicAuthUsername + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalSchemaRegistryUserConfig. +func (in *ExternalSchemaRegistryUserConfig) DeepCopy() *ExternalSchemaRegistryUserConfig { + if in == nil { + return nil + } + out := new(ExternalSchemaRegistryUserConfig) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/jolokia/jolokia.go b/api/v1alpha1/userconfig/integration-endpoints/jolokia/jolokia.go new file mode 100644 index 00000000..e99d21c1 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/jolokia/jolokia.go @@ -0,0 +1,17 @@ +// Code generated by user config generator. DO NOT EDIT. +// +kubebuilder:object:generate=true + +package jolokiauserconfig + +type JolokiaUserConfig struct { + // +kubebuilder:validation:MinLength=8 + // +kubebuilder:validation:MaxLength=64 + // Jolokia basic authentication password + BasicAuthPassword *string `groups:"create,update" json:"basic_auth_password,omitempty"` + + // +kubebuilder:validation:MinLength=5 + // +kubebuilder:validation:MaxLength=32 + // +kubebuilder:validation:Pattern=`^[a-z0-9\-@_]{5,32}$` + // Jolokia basic authentication username + BasicAuthUsername *string `groups:"create,update" json:"basic_auth_username,omitempty"` +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/jolokia/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration-endpoints/jolokia/zz_generated.deepcopy.go new file mode 100644 index 00000000..a9113cbb --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/jolokia/zz_generated.deepcopy.go @@ -0,0 +1,33 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright (c) 2024 Aiven, Helsinki, Finland. https://aiven.io/ + +// Code generated by controller-gen. DO NOT EDIT. + +package jolokiauserconfig + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JolokiaUserConfig) DeepCopyInto(out *JolokiaUserConfig) { + *out = *in + if in.BasicAuthPassword != nil { + in, out := &in.BasicAuthPassword, &out.BasicAuthPassword + *out = new(string) + **out = **in + } + if in.BasicAuthUsername != nil { + in, out := &in.BasicAuthUsername, &out.BasicAuthUsername + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JolokiaUserConfig. +func (in *JolokiaUserConfig) DeepCopy() *JolokiaUserConfig { + if in == nil { + return nil + } + out := new(JolokiaUserConfig) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/prometheus/prometheus.go b/api/v1alpha1/userconfig/integration-endpoints/prometheus/prometheus.go new file mode 100644 index 00000000..9e853651 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/prometheus/prometheus.go @@ -0,0 +1,17 @@ +// Code generated by user config generator. DO NOT EDIT. +// +kubebuilder:object:generate=true + +package prometheususerconfig + +type PrometheusUserConfig struct { + // +kubebuilder:validation:MinLength=8 + // +kubebuilder:validation:MaxLength=64 + // Prometheus basic authentication password + BasicAuthPassword *string `groups:"create,update" json:"basic_auth_password,omitempty"` + + // +kubebuilder:validation:MinLength=5 + // +kubebuilder:validation:MaxLength=32 + // +kubebuilder:validation:Pattern=`^[a-z0-9\-@_]{5,32}$` + // Prometheus basic authentication username + BasicAuthUsername *string `groups:"create,update" json:"basic_auth_username,omitempty"` +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/prometheus/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration-endpoints/prometheus/zz_generated.deepcopy.go new file mode 100644 index 00000000..59cadbbf --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/prometheus/zz_generated.deepcopy.go @@ -0,0 +1,33 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright (c) 2024 Aiven, Helsinki, Finland. https://aiven.io/ + +// Code generated by controller-gen. DO NOT EDIT. + +package prometheususerconfig + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrometheusUserConfig) DeepCopyInto(out *PrometheusUserConfig) { + *out = *in + if in.BasicAuthPassword != nil { + in, out := &in.BasicAuthPassword, &out.BasicAuthPassword + *out = new(string) + **out = **in + } + if in.BasicAuthUsername != nil { + in, out := &in.BasicAuthUsername, &out.BasicAuthUsername + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusUserConfig. +func (in *PrometheusUserConfig) DeepCopy() *PrometheusUserConfig { + if in == nil { + return nil + } + out := new(PrometheusUserConfig) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/rsyslog/rsyslog.go b/api/v1alpha1/userconfig/integration-endpoints/rsyslog/rsyslog.go new file mode 100644 index 00000000..53fcfd29 --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/rsyslog/rsyslog.go @@ -0,0 +1,50 @@ +// Code generated by user config generator. DO NOT EDIT. +// +kubebuilder:object:generate=true + +package rsysloguserconfig + +type RsyslogUserConfig struct { + // +kubebuilder:validation:MaxLength=16384 + // PEM encoded CA certificate + Ca *string `groups:"create,update" json:"ca,omitempty"` + + // +kubebuilder:validation:MaxLength=16384 + // PEM encoded client certificate + Cert *string `groups:"create,update" json:"cert,omitempty"` + + // +kubebuilder:validation:Enum="rfc5424";"rfc3164";"custom" + // Message format + Format string `groups:"create,update" json:"format"` + + // +kubebuilder:validation:MaxLength=16384 + // PEM encoded client key + Key *string `groups:"create,update" json:"key,omitempty"` + + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=512 + // +kubebuilder:validation:Pattern=`^[ -~\t]+$` + // Custom syslog message format + Logline *string `groups:"create,update" json:"logline,omitempty"` + + // +kubebuilder:validation:Minimum=2048 + // +kubebuilder:validation:Maximum=2147483647 + // Rsyslog max message size + MaxMessageSize *int `groups:"create,update" json:"max_message_size,omitempty"` + + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 + // Rsyslog server port + Port int `groups:"create,update" json:"port"` + + // +kubebuilder:validation:MaxLength=1024 + // Structured data block for log message + Sd *string `groups:"create,update" json:"sd,omitempty"` + + // +kubebuilder:validation:MinLength=4 + // +kubebuilder:validation:MaxLength=255 + // Rsyslog server IP address or hostname + Server string `groups:"create,update" json:"server"` + + // Require TLS + Tls bool `groups:"create,update" json:"tls"` +} diff --git a/api/v1alpha1/userconfig/integration-endpoints/rsyslog/zz_generated.deepcopy.go b/api/v1alpha1/userconfig/integration-endpoints/rsyslog/zz_generated.deepcopy.go new file mode 100644 index 00000000..be87a22a --- /dev/null +++ b/api/v1alpha1/userconfig/integration-endpoints/rsyslog/zz_generated.deepcopy.go @@ -0,0 +1,53 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright (c) 2024 Aiven, Helsinki, Finland. https://aiven.io/ + +// Code generated by controller-gen. DO NOT EDIT. + +package rsysloguserconfig + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RsyslogUserConfig) DeepCopyInto(out *RsyslogUserConfig) { + *out = *in + if in.Ca != nil { + in, out := &in.Ca, &out.Ca + *out = new(string) + **out = **in + } + if in.Cert != nil { + in, out := &in.Cert, &out.Cert + *out = new(string) + **out = **in + } + if in.Key != nil { + in, out := &in.Key, &out.Key + *out = new(string) + **out = **in + } + if in.Logline != nil { + in, out := &in.Logline, &out.Logline + *out = new(string) + **out = **in + } + if in.MaxMessageSize != nil { + in, out := &in.MaxMessageSize, &out.MaxMessageSize + *out = new(int) + **out = **in + } + if in.Sd != nil { + in, out := &in.Sd, &out.Sd + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RsyslogUserConfig. +func (in *RsyslogUserConfig) DeepCopy() *RsyslogUserConfig { + if in == nil { + return nil + } + out := new(RsyslogUserConfig) + in.DeepCopyInto(out) + return out +} diff --git a/generators/userconfigs/main.go b/generators/userconfigs/main.go index edc38006..40e0a67e 100644 --- a/generators/userconfigs/main.go +++ b/generators/userconfigs/main.go @@ -11,13 +11,14 @@ import ( const destination = "./api/v1alpha1/userconfig" func main() { - var serviceList, integrationList string - flag.StringVar(&serviceList, "services", "", "Comma separated service list of names to generate for") - flag.StringVar(&integrationList, "integrations", "", "Comma separated integrations list of names to generate for") + var serviceList, integrationList, integrationEndpointList string + flag.StringVar(&serviceList, "services", "", "Comma separated list of service names to generate") + flag.StringVar(&integrationList, "integrations", "", "Comma separated list of integration names to generate") + flag.StringVar(&integrationEndpointList, "integration-endpoints", "", "Comma separated list of integration endpoint names to generate") flag.Parse() - if serviceList+integrationList == "" { - log.Fatal("--service or --integrations must be provided") + if serviceList+integrationList+integrationEndpointList == "" { + log.Fatal("--service, --integrations or --integration-endpoints must be provided") } if serviceList != "" { @@ -33,4 +34,11 @@ func main() { log.Fatal(err) } } + + if integrationEndpointList != "" { + err := generate(destination+"/integration-endpoints", dist.IntegrationEndpointTypes, strings.Split(integrationEndpointList, ",")) + if err != nil { + log.Fatal(err) + } + } } diff --git a/main.go b/main.go index 6e1b7bc4..784ddcab 100644 --- a/main.go +++ b/main.go @@ -23,6 +23,7 @@ import ( //go:generate go run ./generators/userconfigs/... --services mysql,cassandra,grafana,pg,kafka,redis,clickhouse,opensearch,kafka_connect //go:generate go run ./generators/userconfigs/... --integrations clickhouse_kafka,clickhouse_postgresql,datadog,kafka_connect,kafka_logs,kafka_mirrormaker,logs,metrics,external_aws_cloudwatch_metrics +//go:generate go run ./generators/userconfigs/... --integration-endpoints datadog,external_aws_cloudwatch_logs,external_aws_cloudwatch_metrics,external_elasticsearch_logs,external_google_cloud_bigquery,external_google_cloud_logging,external_kafka,external_opensearch_logs,external_postgresql,external_schema_registry,jolokia,prometheus,rsyslog var ( scheme = runtime.NewScheme()