Skip to content

Commit e0a918f

Browse files
feat(searchdb): add support for v1alpha1 (#5285)
Co-authored-by: Rémy Léone <rleone@scaleway.com>
1 parent b0ecd53 commit e0a918f

28 files changed

+1469
-47
lines changed

cmd/scw-sweeper/main.go

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -68,43 +68,43 @@ func mainNoExit() int {
6868

6969
var errors []string
7070

71-
err = accountSweeper.SweepAll(client)
71+
err = accountSweeper.SweepAll(client, true)
7272
if err != nil {
7373
log.Printf("Error sweeping account: %s", err)
7474
errors = append(errors, fmt.Sprintf("account: %s", err))
7575
}
7676

77-
err = applesiliconSweeper.SweepAllLocalities(client)
77+
err = applesiliconSweeper.SweepAllLocalities(client, true)
7878
if err != nil {
7979
log.Printf("Error sweeping applesilicon: %s", err)
8080
errors = append(errors, fmt.Sprintf("applesilicon: %s", err))
8181
}
8282

83-
err = baremetalSweeper.SweepAllLocalities(client)
83+
err = baremetalSweeper.SweepAllLocalities(client, true)
8484
if err != nil {
8585
log.Printf("Error sweeping baremetal: %s", err)
8686
errors = append(errors, fmt.Sprintf("baremetal: %s", err))
8787
}
8888

89-
err = cockpitSweeper.SweepAllLocalities(client)
89+
err = cockpitSweeper.SweepAllLocalities(client, true)
9090
if err != nil {
9191
log.Printf("Error sweeping cockpit: %s", err)
9292
errors = append(errors, fmt.Sprintf("cockpit: %s", err))
9393
}
9494

95-
err = containerSweeper.SweepAllLocalities(client)
95+
err = containerSweeper.SweepAllLocalities(client, true)
9696
if err != nil {
9797
log.Printf("Error sweeping container: %s", err)
9898
errors = append(errors, fmt.Sprintf("container: %s", err))
9999
}
100100

101-
err = flexibleipSweeper.SweepAllLocalities(client)
101+
err = flexibleipSweeper.SweepAllLocalities(client, true)
102102
if err != nil {
103103
log.Printf("Error sweeping flexibleip: %s", err)
104104
errors = append(errors, fmt.Sprintf("flexibleip: %s", err))
105105
}
106106

107-
err = functionSweeper.SweepAllLocalities(client)
107+
err = functionSweeper.SweepAllLocalities(client, true)
108108
if err != nil {
109109
log.Printf("Error sweeping function: %s", err)
110110
errors = append(errors, fmt.Sprintf("function: %s", err))
@@ -116,113 +116,113 @@ func mainNoExit() int {
116116
errors = append(errors, fmt.Sprintf("iam: %s", err))
117117
}
118118

119-
err = inferenceSweeper.SweepAllLocalities(client)
119+
err = inferenceSweeper.SweepAllLocalities(client, true)
120120
if err != nil {
121121
log.Printf("Error sweeping inference: %s", err)
122122
errors = append(errors, fmt.Sprintf("inference: %s", err))
123123
}
124124

125-
err = instanceSweeper.SweepAllLocalities(client)
125+
err = instanceSweeper.SweepAllLocalities(client, true)
126126
if err != nil {
127127
log.Printf("Error sweeping instance: %s", err)
128128
errors = append(errors, fmt.Sprintf("instance: %s", err))
129129
}
130130

131131
// Instance servers need to be swept before volumes and snapshots can be swept
132132
// because volumes and snapshots are attached to servers.
133-
err = blockSweeper.SweepAllLocalities(client)
133+
err = blockSweeper.SweepAllLocalities(client, true)
134134
if err != nil {
135135
log.Printf("Error sweeping block: %s", err)
136136
errors = append(errors, fmt.Sprintf("block: %s", err))
137137
}
138138

139-
err = iotSweeper.SweepAllLocalities(client)
139+
err = iotSweeper.SweepAllLocalities(client, true)
140140
if err != nil {
141141
log.Printf("Error sweeping iot: %s", err)
142142
errors = append(errors, fmt.Sprintf("iot: %s", err))
143143
}
144144

145-
err = jobsSweeper.SweepAllLocalities(client)
145+
err = jobsSweeper.SweepAllLocalities(client, true)
146146
if err != nil {
147147
log.Printf("Error sweeping jobs: %s", err)
148148
errors = append(errors, fmt.Sprintf("jobs: %s", err))
149149
}
150150

151-
err = k8sSweeper.SweepAllLocalities(client)
151+
err = k8sSweeper.SweepAllLocalities(client, true)
152152
if err != nil {
153153
log.Printf("Error sweeping k8s: %s", err)
154154
errors = append(errors, fmt.Sprintf("k8s: %s", err))
155155
}
156156

157-
err = lbSweeper.SweepAllLocalities(client)
157+
err = lbSweeper.SweepAllLocalities(client, true)
158158
if err != nil {
159159
log.Printf("Error sweeping lb: %s", err)
160160
errors = append(errors, fmt.Sprintf("lb: %s", err))
161161
}
162162

163-
err = mongodbSweeper.SweepAllLocalities(client)
163+
err = mongodbSweeper.SweepAllLocalities(client, true)
164164
if err != nil {
165165
log.Printf("Error sweeping mongodb: %s", err)
166166
errors = append(errors, fmt.Sprintf("mongodb: %s", err))
167167
}
168168

169-
err = mnqSweeper.SweepAllLocalities(client)
169+
err = mnqSweeper.SweepAllLocalities(client, true)
170170
if err != nil {
171171
log.Printf("Error sweeping mnq: %s", err)
172172
errors = append(errors, fmt.Sprintf("mnq: %s", err))
173173
}
174174

175-
err = rdbSweeper.SweepAllLocalities(client)
175+
err = rdbSweeper.SweepAllLocalities(client, true)
176176
if err != nil {
177177
log.Printf("Error sweeping rdb: %s", err)
178178
errors = append(errors, fmt.Sprintf("rdb: %s", err))
179179
}
180180

181-
err = redisSweeper.SweepAllLocalities(client)
181+
err = redisSweeper.SweepAllLocalities(client, true)
182182
if err != nil {
183183
log.Printf("Error sweeping redis: %s", err)
184184
errors = append(errors, fmt.Sprintf("redis: %s", err))
185185
}
186186

187-
err = registrySweeper.SweepAllLocalities(client)
187+
err = registrySweeper.SweepAllLocalities(client, true)
188188
if err != nil {
189189
log.Printf("Error sweeping registry: %s", err)
190190
errors = append(errors, fmt.Sprintf("registry: %s", err))
191191
}
192192

193-
err = secretSweeper.SweepAllLocalities(client)
193+
err = secretSweeper.SweepAllLocalities(client, true)
194194
if err != nil {
195195
log.Printf("Error sweeping secret: %s", err)
196196
errors = append(errors, fmt.Sprintf("secret: %s", err))
197197
}
198198

199-
err = sdbSweeper.SweepAllLocalities(client)
199+
err = sdbSweeper.SweepAllLocalities(client, true)
200200
if err != nil {
201201
log.Printf("Error sweeping sdb: %s", err)
202202
errors = append(errors, fmt.Sprintf("sdb: %s", err))
203203
}
204204

205-
err = vpcSweeper.SweepAllLocalities(client)
205+
err = vpcSweeper.SweepAllLocalities(client, true)
206206
if err != nil {
207207
log.Printf("Error sweeping vpc: %s", err)
208208
errors = append(errors, fmt.Sprintf("vpc: %s", err))
209209
}
210210

211-
err = vpcgwSweeper.SweepAllLocalities(client)
211+
err = vpcgwSweeper.SweepAllLocalities(client, true)
212212
if err != nil {
213213
log.Printf("Error sweeping vpcgw: %s", err)
214214
errors = append(errors, fmt.Sprintf("vpcgw: %s", err))
215215
}
216216

217-
err = webhostingSweeper.SweepAllLocalities(client)
217+
err = webhostingSweeper.SweepAllLocalities(client, true)
218218
if err != nil {
219219
log.Printf("Error sweeping webhosting: %s", err)
220220
errors = append(errors, fmt.Sprintf("webhosting: %s", err))
221221
}
222222

223223
// IPAM IPs need to be swept in the end because we need to be sure
224224
// that every resource with an attached ip is destroyed before executing it.
225-
err = ipamSweeper.SweepAllLocalities(client)
225+
err = ipamSweeper.SweepAllLocalities(client, true)
226226
if err != nil {
227227
log.Printf("Error sweeping ipam: %s", err)
228228
errors = append(errors, fmt.Sprintf("ipam: %s", err))
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Create searchdb resources.
4+
5+
USAGE:
6+
scw searchdb deployment create [arg=value ...]
7+
8+
ARGS:
9+
[project-id] Project ID to use. If none is passed the default project ID will be used
10+
[name] Name of the deployment
11+
[tags.{index}] Tags
12+
[node-amount] Number of nodes
13+
[node-type] Node type
14+
[user-name] Username for the deployment user
15+
[password] Password for the deployment user
16+
[volume.type] Define the type of the Volume (unknown_type | sbs_5k | sbs_15k)
17+
[volume.size-bytes] Define the size of the Volume
18+
[endpoints.{index}.private-network.private-network-id]
19+
[version] The Opensearch version to use
20+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
21+
22+
FLAGS:
23+
-h, --help help for create
24+
25+
GLOBAL FLAGS:
26+
-c, --config string The path to the config file
27+
-D, --debug Enable debug mode
28+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
29+
-p, --profile string The config profile to use
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Delete searchdb resources.
4+
5+
USAGE:
6+
scw searchdb deployment delete [arg=value ...]
7+
8+
ARGS:
9+
deployment-id ID of the deployment
10+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
11+
12+
FLAGS:
13+
-h, --help help for delete
14+
15+
GLOBAL FLAGS:
16+
-c, --config string The path to the config file
17+
-D, --debug Enable debug mode
18+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
19+
-p, --profile string The config profile to use
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Get searchdb resources.
4+
5+
USAGE:
6+
scw searchdb deployment get [arg=value ...]
7+
8+
ARGS:
9+
deployment-id ID of the deployment
10+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
11+
12+
FLAGS:
13+
-h, --help help for get
14+
15+
GLOBAL FLAGS:
16+
-c, --config string The path to the config file
17+
-D, --debug Enable debug mode
18+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
19+
-p, --profile string The config profile to use
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
List searchdb resources.
4+
5+
USAGE:
6+
scw searchdb deployment list [arg=value ...]
7+
8+
ARGS:
9+
[project-id] ID of the Project containing the deployments
10+
[order-by] Define the order of the returned deployments (created_at_asc | created_at_desc | name_asc | name_desc | updated_at_asc | updated_at_desc)
11+
[tags.{index}] Filter by tag, only deployments with one or more matching tags will be returned
12+
[name] Deployment name to filter for
13+
[version] Engine version to filter for
14+
[organization-id] ID of the Organization containing the deployments
15+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all)
16+
17+
FLAGS:
18+
-h, --help help for list
19+
20+
GLOBAL FLAGS:
21+
-c, --config string The path to the config file
22+
-D, --debug Enable debug mode
23+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
24+
-p, --profile string The config profile to use
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Update searchdb resources.
4+
5+
USAGE:
6+
scw searchdb deployment update [arg=value ...]
7+
8+
ARGS:
9+
deployment-id UUID of the deployment to update
10+
[name] Name of the deployment
11+
[tags.{index}] Tags of a deployment
12+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
13+
14+
FLAGS:
15+
-h, --help help for update
16+
17+
GLOBAL FLAGS:
18+
-c, --config string The path to the config file
19+
-D, --debug Enable debug mode
20+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
21+
-p, --profile string The config profile to use
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Upgrade searchdb resources.
4+
5+
USAGE:
6+
scw searchdb deployment upgrade [arg=value ...]
7+
8+
ARGS:
9+
deployment-id UUID of the Deployment to upgrade
10+
[node-amount] Amount of node upgrade target
11+
[volume-size-bytes] Volume size upgrade target
12+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
13+
14+
FLAGS:
15+
-h, --help help for upgrade
16+
17+
GLOBAL FLAGS:
18+
-c, --config string The path to the config file
19+
-D, --debug Enable debug mode
20+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
21+
-p, --profile string The config profile to use
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Manage your SearchDB deployment.
4+
5+
USAGE:
6+
scw searchdb deployment <command>
7+
8+
AVAILABLE COMMANDS:
9+
create Create searchdb resources
10+
delete Delete searchdb resources
11+
get Get searchdb resources
12+
list List searchdb resources
13+
update Update searchdb resources
14+
upgrade Upgrade searchdb resources
15+
16+
FLAGS:
17+
-h, --help help for deployment
18+
19+
GLOBAL FLAGS:
20+
-c, --config string The path to the config file
21+
-D, --debug Enable debug mode
22+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
23+
-p, --profile string The config profile to use
24+
25+
Use "scw searchdb deployment [command] --help" for more information about a command.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Create searchdb resources.
4+
5+
USAGE:
6+
scw searchdb endpoint create [arg=value ...]
7+
8+
ARGS:
9+
[deployment-id] ID of the deployment for which to create an endpoint
10+
[endpoint-spec.private-network.private-network-id]
11+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
12+
13+
FLAGS:
14+
-h, --help help for create
15+
16+
GLOBAL FLAGS:
17+
-c, --config string The path to the config file
18+
-D, --debug Enable debug mode
19+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
20+
-p, --profile string The config profile to use
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Delete searchdb resources.
4+
5+
USAGE:
6+
scw searchdb endpoint delete [arg=value ...]
7+
8+
ARGS:
9+
endpoint-id ID of the endpoint to delete
10+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
11+
12+
FLAGS:
13+
-h, --help help for delete
14+
15+
GLOBAL FLAGS:
16+
-c, --config string The path to the config file
17+
-D, --debug Enable debug mode
18+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
19+
-p, --profile string The config profile to use

0 commit comments

Comments
 (0)