Skip to content

Commit

Permalink
feat(mongodb): add endpoint resource (#4274)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Nov 18, 2024
1 parent 6b17925 commit 8f0a8ea
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 3 deletions.
15 changes: 15 additions & 0 deletions cmd/scw/testdata/test-all-usage-mongodb-endpoint-usage.golden
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions cmd/scw/testdata/test-all-usage-mongodb-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ USAGE:
scw mongodb <command>

AVAILABLE COMMANDS:
endpoint Endpoint management commands
instance Instance management commands
node-type Node types management commands
snapshot Snapshot management commands
Expand Down
15 changes: 15 additions & 0 deletions docs/commands/mongodb.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
10 changes: 10 additions & 0 deletions internal/namespaces/mongodb/v1alpha1/mongodb_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func GetGeneratedCommands() *core.Commands {
mongodbInstance(),
mongodbSnapshot(),
mongodbUser(),
mongodbEndpoint(),
mongodbNodeTypeList(),
mongodbVersionList(),
mongodbInstanceList(),
Expand Down Expand Up @@ -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`,
Expand Down

0 comments on commit 8f0a8ea

Please sign in to comment.