File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
internal/namespaces/baremetal/v1 Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ func GetCommands() *core.Commands {
1414 ))
1515
1616 human .RegisterMarshalerFunc (baremetal .ServerPingStatus ("" ), human .EnumMarshalFunc (serverPingStatusMarshalSpecs ))
17+ human .RegisterMarshalerFunc (baremetal .OfferStock ("" ), human .EnumMarshalFunc (offerAvailabilityMarshalSpecs ))
1718
1819 cmds .MustFind ("baremetal" , "server" , "create" ).Override (serverCreateBuilder )
1920 cmds .MustFind ("baremetal" , "server" , "install" ).Override (serverInstallBuilder )
Original file line number Diff line number Diff line change 1+ package baremetal
2+
3+ import (
4+ "github.com/fatih/color"
5+ "github.com/scaleway/scaleway-cli/v2/internal/human"
6+ "github.com/scaleway/scaleway-sdk-go/api/baremetal/v1"
7+ )
8+
9+ var (
10+ offerAvailabilityMarshalSpecs = human.EnumMarshalSpecs {
11+ baremetal .OfferStockEmpty : & human.EnumMarshalSpec {Attribute : color .FgRed , Value : "empty" },
12+ baremetal .OfferStockLow : & human.EnumMarshalSpec {Attribute : color .FgYellow , Value : "low" },
13+ baremetal .OfferStockAvailable : & human.EnumMarshalSpec {Attribute : color .FgGreen , Value : "available" },
14+ }
15+ )
You can’t perform that action at this time.
0 commit comments