diff --git a/cmd/scw/testdata/test-all-usage-mongodb-endpoint-usage.golden b/cmd/scw/testdata/test-all-usage-mongodb-endpoint-usage.golden new file mode 100644 index 0000000000..ed392f1bb7 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-mongodb-endpoint-usage.golden @@ -0,0 +1,15 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +🟥🟥🟥 STDERR️️ 🟥🟥🟥️ +Instance endpoints enable connection to your instance. + +USAGE: + scw mongodb endpoint + +FLAGS: + -h, --help help for endpoint + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-mongodb-usage.golden b/cmd/scw/testdata/test-all-usage-mongodb-usage.golden index a612c08d57..b74975d8b4 100644 --- a/cmd/scw/testdata/test-all-usage-mongodb-usage.golden +++ b/cmd/scw/testdata/test-all-usage-mongodb-usage.golden @@ -6,6 +6,7 @@ USAGE: scw mongodb AVAILABLE COMMANDS: + endpoint Endpoint management commands instance Instance management commands node-type Node types management commands snapshot Snapshot management commands diff --git a/docs/commands/mongodb.md b/docs/commands/mongodb.md index 9b18e89cd7..847ac4fbb8 100644 --- a/docs/commands/mongodb.md +++ b/docs/commands/mongodb.md @@ -2,6 +2,7 @@ # Documentation for `scw mongodb` This API allows you to manage your Managed Databases for MongoDB®. +- [Endpoint management commands](#endpoint-management-commands) - [Instance management commands](#instance-management-commands) - [Create a MongoDB® Database Instance](#create-a-mongodb®-database-instance) - [Delete a MongoDB® Database Instance](#delete-a-mongodb®-database-instance) @@ -26,6 +27,20 @@ This API allows you to manage your Managed Databases for MongoDB®. - [List available MongoDB® versions](#list-available-mongodb®-versions) +## Endpoint management commands + +Instance endpoints enable connection to your instance. + +Instance endpoints enable connection to your instance. + +**Usage:** + +``` +scw mongodb endpoint +``` + + + ## Instance management commands A Managed Database for MongoDB® Database Instance is composed of one or multiple dedicated compute nodes running a single database engine. diff --git a/go.mod b/go.mod index 10b5f08f26..b6c6fbfd24 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,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.30.0.20241108081805-731b10b69dcb + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241113181427-c47c15a89f6f 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 98591c956e..9175bd47fb 100644 --- a/go.sum +++ b/go.sum @@ -466,8 +466,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.30.0.20241108081805-731b10b69dcb h1:uHJzyIKgWLhvcsxaB0y8eHRMk+A7diA8KGEFhRvV1MI= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241108081805-731b10b69dcb/go.mod h1:kAoejOVBg1E/aVAR6IwKWEmbLCEg2IXklzPAkxzAaXA= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241113181427-c47c15a89f6f h1:FOwfdtT4MrTOhdnHpgkdguVsxN/8VLBi90Cd2qTrVbM= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241113181427-c47c15a89f6f/go.mod h1:kAoejOVBg1E/aVAR6IwKWEmbLCEg2IXklzPAkxzAaXA= 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/mongodb/v1alpha1/mongodb_cli.go b/internal/namespaces/mongodb/v1alpha1/mongodb_cli.go index 6c1306698a..39cc53f72b 100644 --- a/internal/namespaces/mongodb/v1alpha1/mongodb_cli.go +++ b/internal/namespaces/mongodb/v1alpha1/mongodb_cli.go @@ -25,6 +25,7 @@ func GetGeneratedCommands() *core.Commands { mongodbInstance(), mongodbSnapshot(), mongodbUser(), + mongodbEndpoint(), mongodbNodeTypeList(), mongodbVersionList(), mongodbInstanceList(), @@ -100,6 +101,15 @@ func mongodbUser() *core.Command { } } +func mongodbEndpoint() *core.Command { + return &core.Command{ + Short: `Endpoint management commands`, + Long: `Instance endpoints enable connection to your instance.`, + Namespace: "mongodb", + Resource: "endpoint", + } +} + func mongodbNodeTypeList() *core.Command { return &core.Command{ Short: `List available node types`,