Skip to content

Commit

Permalink
Merge branch 'master' into pool_in_get_cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone authored Jul 30, 2020
2 parents 54ef762 + 3fa46f4 commit d0aecf1
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/namespaces/rdb/v1/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ func GetCommands() *core.Commands {
human.RegisterMarshalerFunc(rdb.InstanceStatus(0), human.EnumMarshalFunc(instanceStatusMarshalSpecs))
human.RegisterMarshalerFunc(rdb.DatabaseBackupStatus(0), human.EnumMarshalFunc(backupStatusMarshalSpecs))
human.RegisterMarshalerFunc(rdb.InstanceLogStatus(0), human.EnumMarshalFunc(logStatusMarshalSpecs))
human.RegisterMarshalerFunc(rdb.NodeTypeStock(0), human.EnumMarshalFunc(nodeTypeStockMarshalSpecs))
human.RegisterMarshalerFunc(rdb.ACLRuleAction(0), human.EnumMarshalFunc(aclRuleActionMarshalSpecs))

cmds.Merge(core.NewCommands(
instanceWaitCommand(),
Expand Down
14 changes: 14 additions & 0 deletions internal/namespaces/rdb/v1/custom_acl.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package rdb

import (
"github.com/fatih/color"
"github.com/scaleway/scaleway-cli/internal/human"
"github.com/scaleway/scaleway-sdk-go/api/rdb/v1"
)

var (
aclRuleActionMarshalSpecs = human.EnumMarshalSpecs{
rdb.ACLRuleActionAllow: &human.EnumMarshalSpec{Attribute: color.FgGreen, Value: "allow"},
rdb.ACLRuleActionDeny: &human.EnumMarshalSpec{Attribute: color.FgRed, Value: "deny"},
}
)
16 changes: 16 additions & 0 deletions internal/namespaces/rdb/v1/custom_node_type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package rdb

import (
"github.com/fatih/color"
"github.com/scaleway/scaleway-cli/internal/human"
"github.com/scaleway/scaleway-sdk-go/api/rdb/v1"
)

var (
nodeTypeStockMarshalSpecs = human.EnumMarshalSpecs{
rdb.NodeTypeStockAvailable: &human.EnumMarshalSpec{Attribute: color.FgGreen, Value: "available"},
rdb.NodeTypeStockUnknown: &human.EnumMarshalSpec{Attribute: color.Faint, Value: "unknown"},
rdb.NodeTypeStockLowStock: &human.EnumMarshalSpec{Attribute: color.FgYellow, Value: "low stock"},
rdb.NodeTypeStockOutOfStock: &human.EnumMarshalSpec{Attribute: color.FgRed, Value: "out of stock"},
}
)

0 comments on commit d0aecf1

Please sign in to comment.