Skip to content

Commit

Permalink
feat(instance): remove monthly prices from server types list (#1509)
Browse files Browse the repository at this point in the history
  • Loading branch information
aerialls authored Nov 2, 2020
1 parent cc46d8e commit ec278e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 64 deletions.
4 changes: 1 addition & 3 deletions internal/namespaces/instance/v1/custom_server_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ func serverTypeListBuilder(c *core.Command) *core.Command {
c.Run = func(ctx context.Context, argsI interface{}) (interface{}, error) {
type customServerType struct {
Name string `json:"name"`
MonthlyPrice *scw.Money `json:"monthly_price"`
HourlyPrice *scw.Money `json:"hourly_price"`
LocalVolumeSize scw.Size `json:"local_volume_size"`
CPU uint32 `json:"cpu"`
Expand Down Expand Up @@ -95,7 +94,6 @@ func serverTypeListBuilder(c *core.Command) *core.Command {

serverTypes = append(serverTypes, &customServerType{
Name: name,
MonthlyPrice: scw.NewMoneyFromFloat(float64(serverType.MonthlyPrice), "EUR", 2),
HourlyPrice: scw.NewMoneyFromFloat(float64(serverType.HourlyPrice), "EUR", 3),
LocalVolumeSize: serverType.VolumesConstraint.MinSize,
CPU: serverType.Ncpus,
Expand All @@ -112,7 +110,7 @@ func serverTypeListBuilder(c *core.Command) *core.Command {
if categoryA != categoryB {
return categoryA < categoryB
}
return serverTypes[i].MonthlyPrice.ToFloat() < serverTypes[j].MonthlyPrice.ToFloat()
return serverTypes[i].HourlyPrice.ToFloat() < serverTypes[j].HourlyPrice.ToFloat()
})

return serverTypes, nil
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟩🟩🟩 STDOUT️ 🟩🟩🟩️
NAME MONTHLY PRICE HOURLY PRICE LOCAL VOLUME SIZE CPU GPU RAM ARCH AVAILABILITY
DEV1-S € 2.99 € 0.006 20 GB 2 - 2.0 GiB x86_64 available
DEV1-M € 7.99 € 0.016 40 GB 3 - 4.0 GiB x86_64 available
DEV1-L € 15.99 € 0.032 80 GB 4 - 8.0 GiB x86_64 available
DEV1-XL € 23.99 € 0.048 120 GB 4 - 12 GiB x86_64 available
GP1-XS € 39.00 € 0.078 150 GB 4 - 16 GiB x86_64 available
GP1-S € 79.00 € 0.158 300 GB 8 - 32 GiB x86_64 available
GP1-M € 159.00 € 0.318 600 GB 16 - 64 GiB x86_64 available
GP1-L € 299.00 € 0.598 600 GB 32 - 128 GiB x86_64 available
GP1-XL € 569.00 € 1.138 600 GB 48 - 256 GiB x86_64 available
RENDER-S € 499.99 € 1.00 400 GB 10 1 45 GiB x86_64 available
NAME HOURLY PRICE LOCAL VOLUME SIZE CPU GPU RAM ARCH AVAILABILITY
DEV1-S € 0.006 20 GB 2 - 2.0 GiB x86_64 available
DEV1-M € 0.016 40 GB 3 - 4.0 GiB x86_64 available
DEV1-L € 0.032 80 GB 4 - 8.0 GiB x86_64 available
DEV1-XL € 0.048 120 GB 4 - 12 GiB x86_64 available
GP1-XS € 0.078 150 GB 4 - 16 GiB x86_64 available
GP1-S € 0.158 300 GB 8 - 32 GiB x86_64 available
GP1-M € 0.318 600 GB 16 - 64 GiB x86_64 available
GP1-L € 0.598 600 GB 32 - 128 GiB x86_64 available
GP1-XL € 1.138 600 GB 48 - 256 GiB x86_64 available
RENDER-S € 1.00 400 GB 10 1 45 GiB x86_64 available
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
[
{
"name": "DEV1-S",
"monthly_price": {
"currency_code": "EUR",
"units": 2,
"nanos": 990000000
},
"hourly_price": {
"currency_code": "EUR",
"units": 0,
Expand All @@ -34,11 +29,6 @@ RENDER-S € 499.99 € 1.00 400 GB 10 1 45 GiB
},
{
"name": "DEV1-M",
"monthly_price": {
"currency_code": "EUR",
"units": 7,
"nanos": 990000000
},
"hourly_price": {
"currency_code": "EUR",
"units": 0,
Expand All @@ -53,11 +43,6 @@ RENDER-S € 499.99 € 1.00 400 GB 10 1 45 GiB
},
{
"name": "DEV1-L",
"monthly_price": {
"currency_code": "EUR",
"units": 15,
"nanos": 990000000
},
"hourly_price": {
"currency_code": "EUR",
"units": 0,
Expand All @@ -72,11 +57,6 @@ RENDER-S € 499.99 € 1.00 400 GB 10 1 45 GiB
},
{
"name": "DEV1-XL",
"monthly_price": {
"currency_code": "EUR",
"units": 23,
"nanos": 990000000
},
"hourly_price": {
"currency_code": "EUR",
"units": 0,
Expand All @@ -91,11 +71,6 @@ RENDER-S € 499.99 € 1.00 400 GB 10 1 45 GiB
},
{
"name": "GP1-XS",
"monthly_price": {
"currency_code": "EUR",
"units": 39,
"nanos": 0
},
"hourly_price": {
"currency_code": "EUR",
"units": 0,
Expand All @@ -110,11 +85,6 @@ RENDER-S € 499.99 € 1.00 400 GB 10 1 45 GiB
},
{
"name": "GP1-S",
"monthly_price": {
"currency_code": "EUR",
"units": 79,
"nanos": 0
},
"hourly_price": {
"currency_code": "EUR",
"units": 0,
Expand All @@ -129,11 +99,6 @@ RENDER-S € 499.99 € 1.00 400 GB 10 1 45 GiB
},
{
"name": "GP1-M",
"monthly_price": {
"currency_code": "EUR",
"units": 159,
"nanos": 0
},
"hourly_price": {
"currency_code": "EUR",
"units": 0,
Expand All @@ -148,11 +113,6 @@ RENDER-S € 499.99 € 1.00 400 GB 10 1 45 GiB
},
{
"name": "GP1-L",
"monthly_price": {
"currency_code": "EUR",
"units": 299,
"nanos": 0
},
"hourly_price": {
"currency_code": "EUR",
"units": 0,
Expand All @@ -167,11 +127,6 @@ RENDER-S € 499.99 € 1.00 400 GB 10 1 45 GiB
},
{
"name": "GP1-XL",
"monthly_price": {
"currency_code": "EUR",
"units": 569,
"nanos": 0
},
"hourly_price": {
"currency_code": "EUR",
"units": 1,
Expand All @@ -186,11 +141,6 @@ RENDER-S € 499.99 € 1.00 400 GB 10 1 45 GiB
},
{
"name": "RENDER-S",
"monthly_price": {
"currency_code": "EUR",
"units": 499,
"nanos": 990000000
},
"hourly_price": {
"currency_code": "EUR",
"units": 1,
Expand Down

0 comments on commit ec278e4

Please sign in to comment.