Skip to content

Commit

Permalink
feat(apis): adding databases apis
Browse files Browse the repository at this point in the history
  • Loading branch information
smileisak committed Jan 3, 2024
1 parent 314022b commit c06c92c
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apis/zz_register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions config/databases/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package databases

import "github.com/crossplane/upjet/pkg/config"

const (
shortGroup = "databases"
)

// Configure configures individual resources by adding custom ResourceConfigurators.
func Configure(p *config.Provider) {
p.AddResourceConfigurator("ovh_cloud_project_database", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_cloud_project_database_database", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_cloud_project_database_integration", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_cloud_project_database_ip_restriction", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_cloud_project_database_kafka_acl", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_cloud_project_database_kafka_schemaregistryacl", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_cloud_project_database_kafka_topic", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_cloud_project_database_m3db_namespace", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_cloud_project_database_m3db_user", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_cloud_project_database_mongodb_user", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_cloud_project_database_opensearch_pattern", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_cloud_project_database_opensearch_user", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_cloud_project_database_postgresql_user", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_cloud_project_database_redis_user", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
p.AddResourceConfigurator("ovh_cloud_project_database_user", func(r *config.Resource) {
r.ShortGroup = shortGroup
})
}
15 changes: 15 additions & 0 deletions config/external_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ var ExternalNameConfigs = map[string]config.ExternalName{
"ovh_dbaas_logs_cluster": config.NameAsIdentifier,
"ovh_dbaas_logs_graylog_output_stream": config.NameAsIdentifier,
"ovh_dbaas_logs_input": config.NameAsIdentifier,
"ovh_cloud_project_database": config.NameAsIdentifier,
"ovh_cloud_project_database_database": config.NameAsIdentifier,
"ovh_cloud_project_database_integration": config.NameAsIdentifier,
"ovh_cloud_project_database_ip_restriction": config.NameAsIdentifier,
"ovh_cloud_project_database_kafka_acl": config.NameAsIdentifier,
"ovh_cloud_project_database_kafka_schemaregistryacl": config.NameAsIdentifier,
"ovh_cloud_project_database_kafka_topic": config.NameAsIdentifier,
"ovh_cloud_project_database_m3db_namespace": config.NameAsIdentifier,
"ovh_cloud_project_database_m3db_user": config.NameAsIdentifier,
"ovh_cloud_project_database_mongodb_user": config.NameAsIdentifier,
"ovh_cloud_project_database_opensearch_pattern": config.NameAsIdentifier,
"ovh_cloud_project_database_opensearch_user": config.NameAsIdentifier,
"ovh_cloud_project_database_postgresql_user": config.NameAsIdentifier,
"ovh_cloud_project_database_redis_user": config.NameAsIdentifier,
"ovh_cloud_project_database_user": config.NameAsIdentifier,
}

// ExternalNameConfigurations applies all external name configs listed in the
Expand Down
3 changes: 3 additions & 0 deletions config/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
// Note(turkenh): we are importing this to embed provider schema document
_ "embed"

"github.com/edixos/provider-ovh/config/databases"

"github.com/edixos/provider-ovh/config/logs"

"github.com/edixos/provider-ovh/config/lb"
Expand Down Expand Up @@ -59,6 +61,7 @@ func GetProvider() *ujconfig.Provider {
dns.Configure,
lb.Configure,
logs.Configure,
databases.Configure,
} {
configure(pc)
}
Expand Down
30 changes: 30 additions & 0 deletions internal/controller/zz_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ import (
reverse "github.com/edixos/provider-ovh/internal/controller/additionalip/reverse"
service "github.com/edixos/provider-ovh/internal/controller/additionalip/service"
cephacl "github.com/edixos/provider-ovh/internal/controller/clouddiskarray/cephacl"
projectdatabase "github.com/edixos/provider-ovh/internal/controller/databases/projectdatabase"
projectdatabasedatabase "github.com/edixos/provider-ovh/internal/controller/databases/projectdatabasedatabase"
projectdatabaseintegration "github.com/edixos/provider-ovh/internal/controller/databases/projectdatabaseintegration"
projectdatabaseiprestriction "github.com/edixos/provider-ovh/internal/controller/databases/projectdatabaseiprestriction"
projectdatabasekafkaacl "github.com/edixos/provider-ovh/internal/controller/databases/projectdatabasekafkaacl"
projectdatabasekafkaschemaregistryacl "github.com/edixos/provider-ovh/internal/controller/databases/projectdatabasekafkaschemaregistryacl"
projectdatabasekafkatopic "github.com/edixos/provider-ovh/internal/controller/databases/projectdatabasekafkatopic"
projectdatabasem3dbnamespace "github.com/edixos/provider-ovh/internal/controller/databases/projectdatabasem3dbnamespace"
projectdatabasem3dbuser "github.com/edixos/provider-ovh/internal/controller/databases/projectdatabasem3dbuser"
projectdatabasemongodbuser "github.com/edixos/provider-ovh/internal/controller/databases/projectdatabasemongodbuser"
projectdatabaseopensearchpattern "github.com/edixos/provider-ovh/internal/controller/databases/projectdatabaseopensearchpattern"
projectdatabaseopensearchuser "github.com/edixos/provider-ovh/internal/controller/databases/projectdatabaseopensearchuser"
projectdatabasepostgresqluser "github.com/edixos/provider-ovh/internal/controller/databases/projectdatabasepostgresqluser"
projectdatabaseredisuser "github.com/edixos/provider-ovh/internal/controller/databases/projectdatabaseredisuser"
projectdatabaseuser "github.com/edixos/provider-ovh/internal/controller/databases/projectdatabaseuser"
installationtemplate "github.com/edixos/provider-ovh/internal/controller/dedicatedserver/installationtemplate"
installationtemplatepartitionscheme "github.com/edixos/provider-ovh/internal/controller/dedicatedserver/installationtemplatepartitionscheme"
installationtemplatepartitionschemehardwareraid "github.com/edixos/provider-ovh/internal/controller/dedicatedserver/installationtemplatepartitionschemehardwareraid"
Expand Down Expand Up @@ -70,6 +85,21 @@ func Setup(mgr ctrl.Manager, o controller.Options) error {
reverse.Setup,
service.Setup,
cephacl.Setup,
projectdatabase.Setup,
projectdatabasedatabase.Setup,
projectdatabaseintegration.Setup,
projectdatabaseiprestriction.Setup,
projectdatabasekafkaacl.Setup,
projectdatabasekafkaschemaregistryacl.Setup,
projectdatabasekafkatopic.Setup,
projectdatabasem3dbnamespace.Setup,
projectdatabasem3dbuser.Setup,
projectdatabasemongodbuser.Setup,
projectdatabaseopensearchpattern.Setup,
projectdatabaseopensearchuser.Setup,
projectdatabasepostgresqluser.Setup,
projectdatabaseredisuser.Setup,
projectdatabaseuser.Setup,
installationtemplate.Setup,
installationtemplatepartitionscheme.Setup,
installationtemplatepartitionschemehardwareraid.Setup,
Expand Down

0 comments on commit c06c92c

Please sign in to comment.