Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c67ab37
feat(dedicated-cloud): Add datacenter management commands and enhance…
Nov 13, 2025
726006e
test(dedicated-cloud): Add comprehensive tests for dedicated-cloud co…
Nov 14, 2025
3383a91
fix(dedicated-cloud): Move datacenters condition to wrap section title
Nov 14, 2025
6aa35fe
refactor(dedicated-cloud): Simplify datacenterId type conversion
Nov 14, 2025
21137a4
fix(dedicated-cloud): Add json.Number support to toFloat64 and toInt …
Nov 14, 2025
49ee14b
refactor(dedicated-cloud): Remove IAM from datacenter get and fix tab…
Nov 14, 2025
3d42673
refactor(dedicated-cloud): Simplify version formatting code
Nov 14, 2025
ff53489
refactor(dedicated-cloud): Further simplify version formatting code
Nov 14, 2025
e547f28
refactor(dedicated-cloud): Replace flags with subcommands for datacen…
Nov 14, 2025
336d0cb
refactor: simplify loop in dedicatedcloud hosts processing
Nov 17, 2025
b04b48e
refactor: simplify loops in dedicatedcloud using range with value
Nov 17, 2025
dcce83b
refactor: use switch statement for vmTotal type assertion
Nov 17, 2025
40a3b5f
refactor: simplify cpuNum conversion using toInt directly
Nov 17, 2025
0c41767
refactor: use switch statement in toInt function
Nov 17, 2025
1594d49
refactor: use switch statement in toFloat64 function
Nov 17, 2025
24bb107
refactor: simplify RAM total calculation using toFloat64 directly
Nov 17, 2025
4a8aab1
test: verify all dedicated cloud tests pass after refactoring
Nov 17, 2025
837045a
fix: update TestCloudInstanceNullImageCmd to match new table formatting
Nov 17, 2025
988b824
Merge branch 'main' into private-cloud
fluatovh Dec 15, 2025
f6ec6f1
Update display.go
fluatovh Dec 15, 2025
8c825f5
Update display.go
fluatovh Dec 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/ovhcloud-cli.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions internal/cmd/cloud_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ func (ms *MockSuite) TestCloudInstanceNullImageCmd(assert, require *td.T) {

IP addresses:

IP | Type | Gateway IP
------------------------|------------------------|------------------------
1.2.3.4 | public | 1.2.3.4
2001:db8::1 | public | 2001:db8::ff
IP | Type | Gateway IP
-------------|--------|--------------
1.2.3.4 | public | 1.2.3.4
2001:db8::1 | public | 2001:db8::ff

## Flavor details

Expand Down
44 changes: 44 additions & 0 deletions internal/cmd/dedicatedcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,49 @@ func init() {
Run: dedicatedcloud.GetDedicatedCloud,
})

// Datacenter commands
dedicatedcloudDatacenterCmd := &cobra.Command{
Use: "datacenter",
Short: "Manage datacenters of a DedicatedCloud",
}
dedicatedcloudCmd.AddCommand(dedicatedcloudDatacenterCmd)

dedicatedcloudDatacenterCmd.AddCommand(withFilterFlag(&cobra.Command{
Use: "list <service_name>",
Aliases: []string{"ls"},
Short: "List datacenters of a DedicatedCloud",
Args: cobra.ExactArgs(1),
Run: dedicatedcloud.ListDatacenter,
}))

datacenterGetCmd := &cobra.Command{
Use: "get <service_name> <datacenter_id>",
Short: "Get information about a specific datacenter of a DedicatedCloud",
Args: cobra.ExactArgs(2),
Run: dedicatedcloud.GetDatacenter,
}
dedicatedcloudDatacenterCmd.AddCommand(datacenterGetCmd)

dedicatedcloudDatacenterCmd.AddCommand(&cobra.Command{
Use: "hosts <service_name> <datacenter_id>",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be datacenter host list <service_name> <datacenter_id> to be consistent with the other CLI commands (same for filers and clusters)

Short: "Get hosts information for a specific datacenter",
Args: cobra.ExactArgs(2),
Run: dedicatedcloud.GetDatacenterHosts,
})

dedicatedcloudDatacenterCmd.AddCommand(&cobra.Command{
Use: "filers <service_name> <datacenter_id>",
Short: "Get filers information for a specific datacenter",
Args: cobra.ExactArgs(2),
Run: dedicatedcloud.GetDatacenterFilers,
})

dedicatedcloudDatacenterCmd.AddCommand(&cobra.Command{
Use: "clusters <service_name> <datacenter_id>",
Short: "Get clusters information for a specific datacenter",
Args: cobra.ExactArgs(2),
Run: dedicatedcloud.GetDatacenterClusters,
})

rootCmd.AddCommand(dedicatedcloudCmd)
}
Loading