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
@@ -0,0 +1,21 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Update information about a Redis™ Database Instance (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`, `port`, `private_network` and `public_network` specifications are returned in the response.

USAGE:
scw redis endpoint update [arg=value ...]

ARGS:
endpoint-id
[private-network.id] UUID of the Private Network to connect to the Database Instance
[private-network.service-ips.{index}] Endpoint IPv4 address with a CIDR notation. You must provide at least one IPv4 per node.
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | pl-waw-1 | pl-waw-2)

FLAGS:
-h, --help help for update

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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ AVAILABLE COMMANDS:
delete Delete an endpoint for a cluster
get Get an endpoint
set Set endpoints for a cluster
update Update an endpoint

FLAGS:
-h, --help help for endpoint
Expand Down
23 changes: 23 additions & 0 deletions docs/commands/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Managed Database for Redis™ API.
- [Delete an endpoint for a cluster](#delete-an-endpoint-for-a-cluster)
- [Get an endpoint](#get-an-endpoint)
- [Set endpoints for a cluster](#set-endpoints-for-a-cluster)
- [Update an endpoint](#update-an-endpoint)
- [Node Types management commands](#node-types-management-commands)
- [List available node types](#list-available-node-types)
- [Settings management commands](#settings-management-commands)
Expand Down Expand Up @@ -427,6 +428,28 @@ scw redis endpoint set [arg=value ...]



### Update an endpoint

Update information about a Redis™ Database Instance (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`, `port`, `private_network` and `public_network` specifications are returned in the response.

**Usage:**

```
scw redis endpoint update [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| endpoint-id | Required | |
| private-network.id | | UUID of the Private Network to connect to the Database Instance |
| private-network.service-ips.{index} | | Endpoint IPv4 address with a CIDR notation. You must provide at least one IPv4 per node. |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config |



## Node Types management commands

Nodes are the compute units that make up your Redis™ Database Instance. Different node types are available with varying amounts of RAM and vCPU.
Expand Down
44 changes: 44 additions & 0 deletions internal/namespaces/redis/v1/redis_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func GetGeneratedCommands() *core.Commands {
redisEndpointAdd(),
redisEndpointDelete(),
redisEndpointGet(),
redisEndpointUpdate(),
)
}
func redisRoot() *core.Command {
Expand Down Expand Up @@ -1116,3 +1117,46 @@ func redisEndpointGet() *core.Command {
},
}
}

func redisEndpointUpdate() *core.Command {
return &core.Command{
Short: `Update an endpoint`,
Long: `Update information about a Redis™ Database Instance (Redis™ cluster) endpoint. Full details about the endpoint, like ` + "`" + `ips` + "`" + `, ` + "`" + `port` + "`" + `, ` + "`" + `private_network` + "`" + ` and ` + "`" + `public_network` + "`" + ` specifications are returned in the response.`,
Namespace: "redis",
Resource: "endpoint",
Verb: "update",
// Deprecated: false,
ArgsType: reflect.TypeOf(redis.UpdateEndpointRequest{}),
ArgSpecs: core.ArgSpecs{
{
Name: "endpoint-id",
Required: true,
Deprecated: false,
Positional: false,
},
{
Name: "private-network.id",
Short: `UUID of the Private Network to connect to the Database Instance`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "private-network.service-ips.{index}",
Short: `Endpoint IPv4 address with a CIDR notation. You must provide at least one IPv4 per node.`,
Required: false,
Deprecated: false,
Positional: false,
},
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw1, scw.ZonePlWaw2),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*redis.UpdateEndpointRequest)

client := core.ExtractClient(ctx)
api := redis.NewAPI(client)
return api.UpdateEndpoint(request)

},
}
}