generated from vshn/go-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from vshn/add-dbaas-exoscale
Support Kafka, Redis, OpenSearch and MySQL DBaaS
- Loading branch information
Showing
13 changed files
with
418 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package database | ||
|
||
import ( | ||
"database/sql" | ||
"github.com/appuio/appuio-cloud-reporting/pkg/db" | ||
) | ||
|
||
// KafkaDBaaSType represents kafka DBaaS type | ||
const KafkaDBaaSType ObjectType = "kafka" | ||
|
||
// Available plans for Kafka | ||
var kafkaProductDBaaS = []ProductDBaaS{ | ||
{Plan: "startup-2", Target: "1416", Amount: 0.34305}, | ||
{Plan: "business-4", Target: "1416", Amount: 0.85131}, | ||
{Plan: "business-8", Target: "1416", Amount: 1.64491}, | ||
{Plan: "business-16", Target: "1416", Amount: 3.31770}, | ||
{Plan: "business-32", Target: "1416", Amount: 6.33919}, | ||
{Plan: "premium-6x-8", Target: "1416", Amount: 3.33140}, | ||
{Plan: "premium-6x-16", Target: "1416", Amount: 6.35223}, | ||
{Plan: "premium-6x-32", Target: "1416", Amount: 11.71154}, | ||
{Plan: "premium-9x-8", Target: "1416", Amount: 4.78083}, | ||
{Plan: "premium-9x-16", Target: "1416", Amount: 8.80127}, | ||
{Plan: "premium-9x-32", Target: "1416", Amount: 17.56341}, | ||
{Plan: "premium-15x-8", Target: "1416", Amount: 7.37187}, | ||
{Plan: "premium-15x-16", Target: "1416", Amount: 14.67527}, | ||
{Plan: "premium-15x-32", Target: "1416", Amount: 25.54634}, | ||
{Plan: "premium-30x-8", Target: "1416", Amount: 14.74374}, | ||
{Plan: "premium-30x-16", Target: "1416", Amount: 25.61155}, | ||
{Plan: "premium-30x-32", Target: "1416", Amount: 51.09267}, | ||
} | ||
|
||
func generateKafkaProducts() []db.Product { | ||
products := make([]db.Product, 0, len(kafkaProductDBaaS)) | ||
for _, p := range kafkaProductDBaaS { | ||
s := dbaasSourceString{ | ||
Query: queryDBaaSKafka, | ||
Organization: "*", | ||
Namespace: "*", | ||
Plan: p.Plan, | ||
} | ||
product := db.Product{ | ||
Source: s.getSourceString(), | ||
Target: sql.NullString{String: p.Target, Valid: true}, | ||
Amount: p.Amount, | ||
Unit: defaultUnitDBaaS, | ||
During: db.InfiniteRange(), | ||
} | ||
products = append(products, product) | ||
} | ||
return products | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package database | ||
|
||
import ( | ||
"database/sql" | ||
"github.com/appuio/appuio-cloud-reporting/pkg/db" | ||
) | ||
|
||
// MysqlDBaaSType represents mysql DBaaS type | ||
const MysqlDBaaSType ObjectType = "mysql" | ||
|
||
// Available plans for MySQL | ||
var mysqlProductDBaaS = []ProductDBaaS{ | ||
{Plan: "hobbyist-2", Target: "1412", Amount: 0.06683}, | ||
{Plan: "startup-4", Target: "1412", Amount: 0.15731}, | ||
{Plan: "startup-8", Target: "1412", Amount: 0.30889}, | ||
{Plan: "startup-16", Target: "1412", Amount: 0.60507}, | ||
{Plan: "startup-32", Target: "1412", Amount: 1.10238}, | ||
{Plan: "startup-64", Target: "1412", Amount: 2.02408}, | ||
{Plan: "startup-128", Target: "1412", Amount: 3.58055}, | ||
{Plan: "startup-225", Target: "1412", Amount: 5.65519}, | ||
{Plan: "business-4", Target: "1412", Amount: 0.30787}, | ||
{Plan: "business-8", Target: "1412", Amount: 0.60525}, | ||
{Plan: "business-16", Target: "1412", Amount: 1.17123}, | ||
{Plan: "business-32", Target: "1412", Amount: 2.1285}, | ||
{Plan: "business-64", Target: "1412", Amount: 3.80662}, | ||
{Plan: "business-128", Target: "1412", Amount: 7.30291}, | ||
{Plan: "business-225", Target: "1412", Amount: 9.97887}, | ||
{Plan: "premium-4", Target: "1412", Amount: 0.44811}, | ||
{Plan: "premium-8", Target: "1412", Amount: 0.86957}, | ||
{Plan: "premium-16", Target: "1412", Amount: 1.72469}, | ||
{Plan: "premium-32", Target: "1412", Amount: 3.14683}, | ||
{Plan: "premium-64", Target: "1412", Amount: 5.64105}, | ||
{Plan: "premium-128", Target: "1412", Amount: 9.49136}, | ||
{Plan: "premium-225", Target: "1412", Amount: 14.84892}, | ||
} | ||
|
||
func generateMysqlProducts() []db.Product { | ||
products := make([]db.Product, 0, len(mysqlProductDBaaS)) | ||
for _, p := range mysqlProductDBaaS { | ||
s := dbaasSourceString{ | ||
Query: queryDBaaSMysql, | ||
Organization: "*", | ||
Namespace: "*", | ||
Plan: p.Plan, | ||
} | ||
product := db.Product{ | ||
Source: s.getSourceString(), | ||
Target: sql.NullString{String: p.Target, Valid: true}, | ||
Amount: p.Amount, | ||
Unit: defaultUnitDBaaS, | ||
During: db.InfiniteRange(), | ||
} | ||
products = append(products, product) | ||
} | ||
return products | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package database | ||
|
||
import ( | ||
"database/sql" | ||
"github.com/appuio/appuio-cloud-reporting/pkg/db" | ||
) | ||
|
||
// OpensearchDBaaSType represents opensearch DBaaS type | ||
const OpensearchDBaaSType ObjectType = "opensearch" | ||
|
||
// Available plans for OpenSearch | ||
var opensearchProductDBaaS = []ProductDBaaS{ | ||
{Plan: "hobbyist-2", Target: "1414", Amount: 0.07875}, | ||
{Plan: "startup-4", Target: "1414", Amount: 0.18937}, | ||
{Plan: "startup-8", Target: "1414", Amount: 0.37583}, | ||
{Plan: "startup-16", Target: "1414", Amount: 0.73911}, | ||
{Plan: "startup-32", Target: "1414", Amount: 1.43845}, | ||
{Plan: "business-4", Target: "1414", Amount: 0.54946}, | ||
{Plan: "business-8", Target: "1414", Amount: 1.08649}, | ||
{Plan: "business-16", Target: "1414", Amount: 2.16514}, | ||
{Plan: "business-32", Target: "1414", Amount: 4.1663}, | ||
{Plan: "premium-6x-8", Target: "1414", Amount: 2.17296}, | ||
{Plan: "premium-6x-16", Target: "1414", Amount: 4.18124}, | ||
{Plan: "premium-6x-32", Target: "1414", Amount: 7.82587}, | ||
{Plan: "premium-9x-8", Target: "1414", Amount: 3.14767}, | ||
{Plan: "premium-9x-16", Target: "1414", Amount: 5.8918}, | ||
{Plan: "premium-9x-32", Target: "1414", Amount: 11.7388}, | ||
{Plan: "premium-15x-16", Target: "1414", Amount: 9.81967}, | ||
{Plan: "premium-15x-32", Target: "1414", Amount: 17.55262}, | ||
{Plan: "premium-30x-16", Target: "1414", Amount: 17.62729}, | ||
{Plan: "premium-30x-32", Target: "1414", Amount: 35.10523}, | ||
} | ||
|
||
func generateOpensearchProducts() []db.Product { | ||
products := make([]db.Product, 0, len(opensearchProductDBaaS)) | ||
for _, p := range opensearchProductDBaaS { | ||
s := dbaasSourceString{ | ||
Query: queryDBaaSOpensearch, | ||
Organization: "*", | ||
Namespace: "*", | ||
Plan: p.Plan, | ||
} | ||
product := db.Product{ | ||
Source: s.getSourceString(), | ||
Target: sql.NullString{String: p.Target, Valid: true}, | ||
Amount: p.Amount, | ||
Unit: defaultUnitDBaaS, | ||
During: db.InfiniteRange(), | ||
} | ||
products = append(products, product) | ||
} | ||
return products | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.