Skip to content

Commit 125751d

Browse files
authored
Merge pull request #52 from serverscom/ds-to-ebm
Rename ds ( dedicated server ) entity to ebm ( enterprise bare metal )
2 parents 94c12a8 + e1d5a93 commit 125751d

106 files changed

Lines changed: 254 additions & 254 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/base/list_options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ type AttachedSubnetworksOption[T any] struct {
437437
}
438438

439439
func (o *AttachedSubnetworksOption[T]) AddFlags(cmd *cobra.Command) {
440-
cmd.Flags().BoolVar(&o.attached, "attached", false, "Filter only subnetworks that are attached to a dedicated server")
440+
cmd.Flags().BoolVar(&o.attached, "attached", false, "Filter only subnetworks that are attached to server")
441441
}
442442

443443
func (o *AttachedSubnetworksOption[T]) ApplyToCollection(collection serverscom.Collection[T]) {

cmd/entities/hosts/add.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/spf13/pflag"
1212
)
1313

14-
type AddDSFlags struct {
14+
type AddEBMFlags struct {
1515
Skeleton bool
1616
InputPath string
1717
LocationID int
@@ -38,7 +38,7 @@ type AddSBMFlags struct {
3838

3939
func applyFlagsToInput(
4040
input *serverscom.DedicatedServerCreateInput,
41-
flags *AddDSFlags,
41+
flags *AddEBMFlags,
4242
pflags *pflag.FlagSet,
4343
) error {
4444
if pflags.Changed("location-id") {
@@ -128,18 +128,18 @@ func applyFlagsToInput(
128128
return nil
129129
}
130130

131-
func newAddDSCmd(cmdContext *base.CmdContext) *cobra.Command {
132-
flags := &AddDSFlags{}
131+
func newAddEBMCmd(cmdContext *base.CmdContext) *cobra.Command {
132+
flags := &AddEBMFlags{}
133133

134134
cmd := &cobra.Command{
135135
Use: "add",
136-
Short: "Create a dedicated server",
136+
Short: "Create an enterprise bare metal server",
137137
Args: cobra.ArbitraryArgs,
138138
RunE: func(cmd *cobra.Command, args []string) error {
139139
formatter := cmdContext.GetOrCreateFormatter(cmd)
140140

141141
if flags.Skeleton {
142-
return formatter.FormatSkeleton("hosts/add_ds.json")
142+
return formatter.FormatSkeleton("hosts/add_ebm.json")
143143
}
144144

145145
manager := cmdContext.GetManager()

cmd/entities/hosts/connections.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import (
66
"github.com/spf13/cobra"
77
)
88

9-
func newListDSConnectionsCmd(cmdContext *base.CmdContext) *cobra.Command {
9+
func newListEBMConnectionsCmd(cmdContext *base.CmdContext) *cobra.Command {
1010
factory := func(verbose bool, args ...string) serverscom.Collection[serverscom.HostConnection] {
1111
scClient := cmdContext.GetClient().SetVerbose(verbose).GetScClient()
1212
return scClient.Hosts.DedicatedServerConnections(args[0])
1313
}
1414

1515
opts := &base.BaseListOptions[serverscom.HostConnection]{}
1616

17-
cmd := base.NewListCmd("list-connections", "Dedicated server connections", factory, cmdContext, opts)
17+
cmd := base.NewListCmd("list-connections", "Enterprise bare metal server connections", factory, cmdContext, opts)
1818
cmd.Use = "list-connections <id>"
1919
cmd.Args = cobra.ExactArgs(1)
2020

cmd/entities/hosts/drive-slots.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import (
66
"github.com/spf13/cobra"
77
)
88

9-
func newListDSDriveSlotsCmd(cmdContext *base.CmdContext) *cobra.Command {
9+
func newListEBMDriveSlotsCmd(cmdContext *base.CmdContext) *cobra.Command {
1010
factory := func(verbose bool, args ...string) serverscom.Collection[serverscom.HostDriveSlot] {
1111
scClient := cmdContext.GetClient().SetVerbose(verbose).GetScClient()
1212
return scClient.Hosts.DedicatedServerDriveSlots(args[0])
1313
}
1414

1515
opts := &base.BaseListOptions[serverscom.HostDriveSlot]{}
1616

17-
cmd := base.NewListCmd("list-drive-slots", "Dedicated server drive slots", factory, cmdContext, opts)
17+
cmd := base.NewListCmd("list-drive-slots", "Enterprise bare metal server drive slots", factory, cmdContext, opts)
1818
cmd.Use = "list-drive-slots <id>"
1919
cmd.Args = cobra.ExactArgs(1)
2020

cmd/entities/hosts/features.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import (
66
"github.com/spf13/cobra"
77
)
88

9-
func newListDSFeaturesCmd(cmdContext *base.CmdContext) *cobra.Command {
9+
func newListEBMFeaturesCmd(cmdContext *base.CmdContext) *cobra.Command {
1010
factory := func(verbose bool, args ...string) serverscom.Collection[serverscom.DedicatedServerFeature] {
1111
scClient := cmdContext.GetClient().SetVerbose(verbose).GetScClient()
1212
return scClient.Hosts.DedicatedServerFeatures(args[0])
1313
}
1414

1515
opts := &base.BaseListOptions[serverscom.DedicatedServerFeature]{}
1616

17-
cmd := base.NewListCmd("list-features", "Dedicated server features", factory, cmdContext, opts)
17+
cmd := base.NewListCmd("list-features", "Enterprise bare metal server features", factory, cmdContext, opts)
1818
cmd.Use = "list-features <id>"
1919
cmd.Args = cobra.ExactArgs(1)
2020

cmd/entities/hosts/features_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var (
1616
featuresFixtureBasePath = filepath.Join("..", "..", "..", "testdata", "entities", "hosts", "features")
1717
)
1818

19-
func TestListDSFeaturesCmd(t *testing.T) {
19+
func TestListEBMFeaturesCmd(t *testing.T) {
2020
testFeature1 := serverscom.DedicatedServerFeature{
2121
Name: "disaggregated_public_ports",
2222
Status: "deactivated",
@@ -119,7 +119,7 @@ func TestListDSFeaturesCmd(t *testing.T) {
119119
testCmdContext := testutils.NewTestCmdContext(scClient)
120120
cmd := NewCmd(testCmdContext)
121121

122-
args := append([]string{"hosts", "ds", "list-features"}, tc.args...)
122+
args := append([]string{"hosts", "ebm", "list-features"}, tc.args...)
123123
if tc.output != "" {
124124
args = append(args, "--output", tc.output)
125125
}

cmd/entities/hosts/get.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ type HostGetter interface {
1313
Get(ctx context.Context, client *serverscom.Client, id string) (any, error)
1414
}
1515

16-
type DSGetMgr struct{}
16+
type EBMGetMgr struct{}
1717

18-
func (g *DSGetMgr) Get(ctx context.Context, client *serverscom.Client, id string) (any, error) {
18+
func (g *EBMGetMgr) Get(ctx context.Context, client *serverscom.Client, id string) (any, error) {
1919
return client.Hosts.GetDedicatedServer(ctx, id)
2020
}
2121

cmd/entities/hosts/hosts.go

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,33 @@ func NewCmd(cmdContext *base.CmdContext) *cobra.Command {
3333

3434
hostTypeCmds := []HostTypeCmd{
3535
{
36-
use: "ds",
37-
shortDesc: "Manage dedicated servers",
38-
entityName: "Dedicated servers",
36+
use: "ebm",
37+
shortDesc: "Manage enterprise bare metal servers",
38+
entityName: "Enterprise Bare Metal",
3939
typeFlag: "dedicated_server",
4040
managers: HostManagers{
41-
getMgr: &DSGetMgr{},
42-
powerMgr: &DSPowerMgr{},
43-
reinstallMgr: &DSReinstallMgr{},
41+
getMgr: &EBMGetMgr{},
42+
powerMgr: &EBMPowerMgr{},
43+
reinstallMgr: &EBMReinstallMgr{},
4444
},
4545
extraCmds: []func(*base.CmdContext) *cobra.Command{
46-
newAddDSCmd,
47-
newUpdateDSCmd,
48-
newListDSDriveSlotsCmd,
49-
newListDSConnectionsCmd,
50-
newListDSPTRCmd,
51-
newCreateDSPTRCmd,
52-
newDeleteDSPTRCmd,
53-
newDSAbortReleaseCmd,
54-
newDSScheduleReleaseCmd,
55-
newListDSNetworksCmd,
56-
newGetDSNetworkCmd,
57-
newAddDSNetworkCmd,
58-
newDeleteDSNetworkCmd,
59-
newListDSCmd,
60-
newListDSServicesCmd,
61-
newListDSFeaturesCmd,
62-
newGetDSOOBCredsCmd,
46+
newAddEBMCmd,
47+
newUpdateEBMCmd,
48+
newListEBMDriveSlotsCmd,
49+
newListEBMConnectionsCmd,
50+
newListEBMPTRCmd,
51+
newCreateEBMPTRCmd,
52+
newDeleteEBMPTRCmd,
53+
newEBMAbortReleaseCmd,
54+
newEBMScheduleReleaseCmd,
55+
newListEBMNetworksCmd,
56+
newGetEBMNetworkCmd,
57+
newAddEBMNetworkCmd,
58+
newDeleteEBMNetworkCmd,
59+
newListEBMCmd,
60+
newListEBMServicesCmd,
61+
newListEBMFeaturesCmd,
62+
newGetEBMOOBCredsCmd,
6363
},
6464
},
6565
{
@@ -103,7 +103,7 @@ func NewCmd(cmdContext *base.CmdContext) *cobra.Command {
103103
cmd := &cobra.Command{
104104
Use: "hosts",
105105
Short: "Manage hosts",
106-
Long: "Manage hosts of different types ( dedicated server, kubernetes baremetal node, scalable baremetal server)",
106+
Long: "Manage hosts of different types ( enterprise bare metal, kubernetes baremetal node, scalable baremetal server)",
107107
PersistentPreRunE: base.CombinePreRunE(
108108
base.CheckFormatterFlags(cmdContext, entitiesMap),
109109
base.CheckEmptyContexts(cmdContext),
@@ -157,11 +157,11 @@ func getHostsEntities() (map[string]entities.EntityInterface, error) {
157157
}
158158
result["hosts"] = hostsEntity
159159

160-
dsEntity, err := entities.Registry.GetEntityFromValue(serverscom.DedicatedServer{})
160+
ebmEntity, err := entities.Registry.GetEntityFromValue(serverscom.DedicatedServer{})
161161
if err != nil {
162162
return nil, err
163163
}
164-
result["ds"] = dsEntity
164+
result["ebm"] = ebmEntity
165165

166166
kbmEntity, err := entities.Registry.GetEntityFromValue(serverscom.KubernetesBaremetalNode{})
167167
if err != nil {

0 commit comments

Comments
 (0)