Skip to content

Commit 8f0a8ea

Browse files
authored
feat(mongodb): add endpoint resource (scaleway#4274)
1 parent 6b17925 commit 8f0a8ea

File tree

6 files changed

+44
-3
lines changed

6 files changed

+44
-3
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Instance endpoints enable connection to your instance.
4+
5+
USAGE:
6+
scw mongodb endpoint
7+
8+
FLAGS:
9+
-h, --help help for endpoint
10+
11+
GLOBAL FLAGS:
12+
-c, --config string The path to the config file
13+
-D, --debug Enable debug mode
14+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
15+
-p, --profile string The config profile to use

cmd/scw/testdata/test-all-usage-mongodb-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ USAGE:
66
scw mongodb <command>
77

88
AVAILABLE COMMANDS:
9+
endpoint Endpoint management commands
910
instance Instance management commands
1011
node-type Node types management commands
1112
snapshot Snapshot management commands

docs/commands/mongodb.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Documentation for `scw mongodb`
33
This API allows you to manage your Managed Databases for MongoDB®.
44

5+
- [Endpoint management commands](#endpoint-management-commands)
56
- [Instance management commands](#instance-management-commands)
67
- [Create a MongoDB® Database Instance](#create-a-mongodb®-database-instance)
78
- [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®.
2627
- [List available MongoDB® versions](#list-available-mongodb®-versions)
2728

2829

30+
## Endpoint management commands
31+
32+
Instance endpoints enable connection to your instance.
33+
34+
Instance endpoints enable connection to your instance.
35+
36+
**Usage:**
37+
38+
```
39+
scw mongodb endpoint
40+
```
41+
42+
43+
2944
## Instance management commands
3045

3146
A Managed Database for MongoDB® Database Instance is composed of one or multiple dedicated compute nodes running a single database engine.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ require (
2626
github.com/mattn/go-isatty v0.0.20
2727
github.com/moby/buildkit v0.13.2
2828
github.com/opencontainers/go-digest v1.0.0
29-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241108081805-731b10b69dcb
29+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241113181427-c47c15a89f6f
3030
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
3131
github.com/spf13/cobra v1.8.1
3232
github.com/spf13/pflag v1.0.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
466466
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
467467
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
468468
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
469-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241108081805-731b10b69dcb h1:uHJzyIKgWLhvcsxaB0y8eHRMk+A7diA8KGEFhRvV1MI=
470-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241108081805-731b10b69dcb/go.mod h1:kAoejOVBg1E/aVAR6IwKWEmbLCEg2IXklzPAkxzAaXA=
469+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241113181427-c47c15a89f6f h1:FOwfdtT4MrTOhdnHpgkdguVsxN/8VLBi90Cd2qTrVbM=
470+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241113181427-c47c15a89f6f/go.mod h1:kAoejOVBg1E/aVAR6IwKWEmbLCEg2IXklzPAkxzAaXA=
471471
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
472472
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
473473
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=

internal/namespaces/mongodb/v1alpha1/mongodb_cli.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func GetGeneratedCommands() *core.Commands {
2525
mongodbInstance(),
2626
mongodbSnapshot(),
2727
mongodbUser(),
28+
mongodbEndpoint(),
2829
mongodbNodeTypeList(),
2930
mongodbVersionList(),
3031
mongodbInstanceList(),
@@ -100,6 +101,15 @@ func mongodbUser() *core.Command {
100101
}
101102
}
102103

104+
func mongodbEndpoint() *core.Command {
105+
return &core.Command{
106+
Short: `Endpoint management commands`,
107+
Long: `Instance endpoints enable connection to your instance.`,
108+
Namespace: "mongodb",
109+
Resource: "endpoint",
110+
}
111+
}
112+
103113
func mongodbNodeTypeList() *core.Command {
104114
return &core.Command{
105115
Short: `List available node types`,

0 commit comments

Comments
 (0)