Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
Manage endpoints associated with a deployment.

USAGE:
scw datawarehouse endpoint
scw datawarehouse endpoint <command>

AVAILABLE COMMANDS:
create Create a new endpoint for a deployment
delete Delete an endpoint from a deployment

FLAGS:
-h, --help help for endpoint
Expand All @@ -14,3 +18,5 @@ GLOBAL FLAGS:
-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

Use "scw datawarehouse endpoint [command] --help" for more information about a command.
38 changes: 36 additions & 2 deletions docs/commands/datawarehouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Data Warehouse API.
- [List deployments](#list-deployments)
- [Update a deployment](#update-a-deployment)
- [Endpoint management commands](#endpoint-management-commands)
- [Create a new endpoint for a deployment](#create-a-new-endpoint-for-a-deployment)
- [Delete an endpoint from a deployment](#delete-an-endpoint-from-a-deployment)
- [List available presets](#list-available-presets)
- [List available presets](#list-available-presets)
- [User management commands](#user-management-commands)
Expand Down Expand Up @@ -241,15 +243,47 @@ scw datawarehouse deployment update <deployment-id ...> [arg=value ...]

Manage endpoints associated with a deployment.

Manage endpoints associated with a deployment.

### Create a new endpoint for a deployment

Create a new endpoint for a deployment.

**Usage:**

```
scw datawarehouse endpoint create [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| deployment-id | | UUID of the deployment |
| endpoint.private-network.private-network-id | | UUID of the Private Network |
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |



### Delete an endpoint from a deployment

Delete an endpoint from a deployment.

**Usage:**

```
scw datawarehouse endpoint
scw datawarehouse endpoint delete [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| endpoint-id | Required | UUID of the Endpoint to delete |
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |



## List available presets

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/moby/buildkit v0.26.3
github.com/opencontainers/go-digest v1.0.0
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260122164551-ccce19cd242c
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260130135251-d983e7b5616c
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra v1.10.2
github.com/spf13/pflag v1.0.10
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7
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.36.0.20260122164551-ccce19cd242c h1:nCrW3tGV0n6zSbk4RPzfLYngOPCSnF3EvH+3ft8DAz0=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260122164551-ccce19cd242c/go.mod h1:VbEqG0nAXcEFyHLKWwbhgbDNimnLf24Qat73/12DU9o=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260130135251-d983e7b5616c h1:d+fekBfNNjEoRLITir9SgaYq/GyLDVLo1jE9RrsSwoc=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260130135251-d983e7b5616c/go.mod h1:VbEqG0nAXcEFyHLKWwbhgbDNimnLf24Qat73/12DU9o=
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.9.1 h1:nZZaNz4DiERIQguNy0cL5qTdn9lR8XKHf4RUyG1Sx3g=
Expand Down
76 changes: 76 additions & 0 deletions internal/namespaces/datawarehouse/v1beta1/datawarehouse_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ func GetGeneratedCommands() *core.Commands {
datawarehouseUserCreate(),
datawarehouseUserUpdate(),
datawarehouseUserDelete(),
datawarehouseEndpointDelete(),
datawarehouseEndpointCreate(),
datawarehouseDatabaseList(),
datawarehouseDatabaseCreate(),
datawarehouseDatabaseDelete(),
Expand Down Expand Up @@ -706,6 +708,80 @@ func datawarehouseUserDelete() *core.Command {
}
}

func datawarehouseEndpointDelete() *core.Command {
return &core.Command{
Short: `Delete an endpoint from a deployment`,
Long: `Delete an endpoint from a deployment.`,
Namespace: "datawarehouse",
Resource: "endpoint",
Verb: "delete",
// Deprecated: false,
ArgsType: reflect.TypeOf(datawarehouse.DeleteEndpointRequest{}),
ArgSpecs: core.ArgSpecs{
{
Name: "endpoint-id",
Short: `UUID of the Endpoint to delete`,
Required: true,
Deprecated: false,
Positional: false,
},
core.RegionArgSpec(scw.RegionFrPar),
},
Run: func(ctx context.Context, args any) (i any, e error) {
request := args.(*datawarehouse.DeleteEndpointRequest)

client := core.ExtractClient(ctx)
api := datawarehouse.NewAPI(client)
e = api.DeleteEndpoint(request)
if e != nil {
return nil, e
}

return &core.SuccessResult{
Resource: "endpoint",
Verb: "delete",
}, nil
},
}
}

func datawarehouseEndpointCreate() *core.Command {
return &core.Command{
Short: `Create a new endpoint for a deployment`,
Long: `Create a new endpoint for a deployment.`,
Namespace: "datawarehouse",
Resource: "endpoint",
Verb: "create",
// Deprecated: false,
ArgsType: reflect.TypeOf(datawarehouse.CreateEndpointRequest{}),
ArgSpecs: core.ArgSpecs{
{
Name: "deployment-id",
Short: `UUID of the deployment`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "endpoint.private-network.private-network-id",
Short: `UUID of the Private Network`,
Required: false,
Deprecated: false,
Positional: false,
},
core.RegionArgSpec(scw.RegionFrPar),
},
Run: func(ctx context.Context, args any) (i any, e error) {
request := args.(*datawarehouse.CreateEndpointRequest)

client := core.ExtractClient(ctx)
api := datawarehouse.NewAPI(client)

return api.CreateEndpoint(request)
},
}
}

func datawarehouseDatabaseList() *core.Command {
return &core.Command{
Short: `List databases within a deployment`,
Expand Down
Loading