diff --git a/cmd/scw/testdata/test-all-usage-instance-snapshot-usage.golden b/cmd/scw/testdata/test-all-usage-instance-snapshot-usage.golden index ea5dd9605e..ea1daee89b 100644 --- a/cmd/scw/testdata/test-all-usage-instance-snapshot-usage.golden +++ b/cmd/scw/testdata/test-all-usage-instance-snapshot-usage.golden @@ -9,7 +9,7 @@ have one Instance with a volume containing the OS and another one containing the application data, and you want to use different snapshot strategies on both volumes. -A snapshot's volume type is its original volume's type (`l_ssd` or `b_ssd`). +A snapshot's volume type is its original volume's type (`l_ssd` or `b_ssd`). Volumes can be created from snapshots of their own type. USAGE: diff --git a/cmd/scw/testdata/test-all-usage-vpc-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-usage.golden index 7bab18eea5..dbd5ab4fa5 100644 --- a/cmd/scw/testdata/test-all-usage-vpc-usage.golden +++ b/cmd/scw/testdata/test-all-usage-vpc-usage.golden @@ -7,6 +7,7 @@ USAGE: AVAILABLE COMMANDS: private-network Private network management command + route Route management command routes Routes management command subnet Subnet management command vpc VPC management command diff --git a/cmd/scw/testdata/test-all-usage-vpc-vpc-usage.golden b/cmd/scw/testdata/test-all-usage-vpc-vpc-usage.golden index 46c1ae957b..cfa905b016 100644 --- a/cmd/scw/testdata/test-all-usage-vpc-vpc-usage.golden +++ b/cmd/scw/testdata/test-all-usage-vpc-vpc-usage.golden @@ -1,7 +1,7 @@ 🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -A Virtual Private Cloud (VPC) allows you to group your regional -Private Networks together. Note that a Private Network can be a +A Virtual Private Cloud (VPC) allows you to group your regional +Private Networks together. Note that a Private Network can be a part of only one VPC. USAGE: diff --git a/docs/commands/instance.md b/docs/commands/instance.md index 95cc73317e..1b1502ece8 100644 --- a/docs/commands/instance.md +++ b/docs/commands/instance.md @@ -2409,7 +2409,7 @@ have one Instance with a volume containing the OS and another one containing the application data, and you want to use different snapshot strategies on both volumes. -A snapshot's volume type is its original volume's type (`l_ssd` or `b_ssd`). +A snapshot's volume type is its original volume's type (`l_ssd` or `b_ssd`). Volumes can be created from snapshots of their own type. diff --git a/docs/commands/vpc.md b/docs/commands/vpc.md index cadb274c54..a5e52dfb96 100644 --- a/docs/commands/vpc.md +++ b/docs/commands/vpc.md @@ -10,6 +10,7 @@ This API allows you to manage your Virtual Private Clouds (VPCs) and Private Net - [List Private Networks](#list-private-networks) - [Migrate Private Networks from zoned to regional](#migrate-private-networks-from-zoned-to-regional) - [Update Private Network](#update-private-network) +- [Route management command](#route-management-command) - [Routes management command](#routes-management-command) - [Return routes with associated next hop data](#return-routes-with-associated-next-hop-data) - [Subnet management command](#subnet-management-command) @@ -184,6 +185,20 @@ scw vpc private-network update [arg=value ...] +## Route management command + +Custom routes. + +Custom routes. + +**Usage:** + +``` +scw vpc route +``` + + + ## Routes management command Routes management command. @@ -232,8 +247,8 @@ scw vpc subnet ## VPC management command -A Virtual Private Cloud (VPC) allows you to group your regional -Private Networks together. Note that a Private Network can be a +A Virtual Private Cloud (VPC) allows you to group your regional +Private Networks together. Note that a Private Network can be a part of only one VPC. diff --git a/go.mod b/go.mod index cdfc14f508..20b55d8695 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/mattn/go-isatty v0.0.20 github.com/moby/buildkit v0.13.2 github.com/opencontainers/go-digest v1.0.0 - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240716082911-cef39a9d4ee9 + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240716150037-245ae1bc782b github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index c39efd1641..6227001887 100644 --- a/go.sum +++ b/go.sum @@ -463,8 +463,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI= github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240716082911-cef39a9d4ee9 h1:Zo++qIasET8Dt4xwpmOt4EVgjVo/NhhZgttQfDP7VSs= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240716082911-cef39a9d4ee9/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240716150037-245ae1bc782b h1:IxVLh1ZW1irNcW79Dzmffle0rJ9Vs9gqQz+FUbAZnCQ= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240716150037-245ae1bc782b/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8= github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM= github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA= diff --git a/internal/namespaces/cockpit/v1/cockpit_cli.go b/internal/namespaces/cockpit/v1/cockpit_cli.go index b779022df8..ae185c861e 100644 --- a/internal/namespaces/cockpit/v1/cockpit_cli.go +++ b/internal/namespaces/cockpit/v1/cockpit_cli.go @@ -46,6 +46,7 @@ func GetGeneratedCommands() *core.Commands { cockpitDataSourceGet(), cockpitDataSourceDelete(), cockpitDataSourceList(), + cockpitDataSourceUpdate(), cockpitUsageOverviewGet(), cockpitTokenCreate(), cockpitTokenList(), @@ -684,6 +685,43 @@ You can list data sources by Project, type and origin.`, } } +func cockpitDataSourceUpdate() *core.Command { + return &core.Command{ + Short: `Update a data source`, + Long: `Update a given data source name, specified by the data source ID.`, + Namespace: "cockpit", + Resource: "data-source", + Verb: "update", + // Deprecated: false, + ArgsType: reflect.TypeOf(cockpit.RegionalAPIUpdateDataSourceRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "data-source-id", + Short: `ID of the data source to update`, + Required: true, + Deprecated: false, + Positional: false, + }, + { + Name: "name", + Short: `Updated name of the data source`, + Required: false, + Deprecated: false, + Positional: false, + }, + core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*cockpit.RegionalAPIUpdateDataSourceRequest) + + client := core.ExtractClient(ctx) + api := cockpit.NewRegionalAPI(client) + return api.UpdateDataSource(request) + + }, + } +} + func cockpitUsageOverviewGet() *core.Command { return &core.Command{ Short: `Get data source usage overview`, diff --git a/internal/namespaces/instance/v1/instance_cli.go b/internal/namespaces/instance/v1/instance_cli.go index e632eb6bf3..7c72d6ed53 100644 --- a/internal/namespaces/instance/v1/instance_cli.go +++ b/internal/namespaces/instance/v1/instance_cli.go @@ -204,7 +204,7 @@ have one Instance with a volume containing the OS and another one containing the application data, and you want to use different snapshot strategies on both volumes. -A snapshot's volume type is its original volume's type (` + "`" + `l_ssd` + "`" + ` or ` + "`" + `b_ssd` + "`" + `). +A snapshot's volume type is its original volume's type (` + "`" + `l_ssd` + "`" + ` or ` + "`" + `b_ssd` + "`" + `). Volumes can be created from snapshots of their own type.`, Namespace: "instance", Resource: "snapshot", diff --git a/internal/namespaces/vpc/v2/vpc_cli.go b/internal/namespaces/vpc/v2/vpc_cli.go index 964f29c6c8..3f8f17d9a4 100644 --- a/internal/namespaces/vpc/v2/vpc_cli.go +++ b/internal/namespaces/vpc/v2/vpc_cli.go @@ -23,6 +23,7 @@ func GetGeneratedCommands() *core.Commands { vpcVpc(), vpcPrivateNetwork(), vpcSubnet(), + vpcRoute(), vpcRoutes(), vpcVpcList(), vpcVpcCreate(), @@ -50,8 +51,8 @@ func vpcRoot() *core.Command { func vpcVpc() *core.Command { return &core.Command{ Short: `VPC management command`, - Long: `A Virtual Private Cloud (VPC) allows you to group your regional -Private Networks together. Note that a Private Network can be a + Long: `A Virtual Private Cloud (VPC) allows you to group your regional +Private Networks together. Note that a Private Network can be a part of only one VPC.`, Namespace: "vpc", Resource: "vpc", @@ -79,6 +80,15 @@ func vpcSubnet() *core.Command { } } +func vpcRoute() *core.Command { + return &core.Command{ + Short: `Route management command`, + Long: `Custom routes.`, + Namespace: "vpc", + Resource: "route", + } +} + func vpcRoutes() *core.Command { return &core.Command{ Short: `Routes management command`,