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
50 changes: 25 additions & 25 deletions cmd/scw-sweeper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,43 +68,43 @@ func mainNoExit() int {

var errors []string

err = accountSweeper.SweepAll(client)
err = accountSweeper.SweepAll(client, true)
if err != nil {
log.Printf("Error sweeping account: %s", err)
errors = append(errors, fmt.Sprintf("account: %s", err))
}

err = applesiliconSweeper.SweepAllLocalities(client)
err = applesiliconSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping applesilicon: %s", err)
errors = append(errors, fmt.Sprintf("applesilicon: %s", err))
}

err = baremetalSweeper.SweepAllLocalities(client)
err = baremetalSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping baremetal: %s", err)
errors = append(errors, fmt.Sprintf("baremetal: %s", err))
}

err = cockpitSweeper.SweepAllLocalities(client)
err = cockpitSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping cockpit: %s", err)
errors = append(errors, fmt.Sprintf("cockpit: %s", err))
}

err = containerSweeper.SweepAllLocalities(client)
err = containerSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping container: %s", err)
errors = append(errors, fmt.Sprintf("container: %s", err))
}

err = flexibleipSweeper.SweepAllLocalities(client)
err = flexibleipSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping flexibleip: %s", err)
errors = append(errors, fmt.Sprintf("flexibleip: %s", err))
}

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

err = inferenceSweeper.SweepAllLocalities(client)
err = inferenceSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping inference: %s", err)
errors = append(errors, fmt.Sprintf("inference: %s", err))
}

err = instanceSweeper.SweepAllLocalities(client)
err = instanceSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping instance: %s", err)
errors = append(errors, fmt.Sprintf("instance: %s", err))
}

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

err = iotSweeper.SweepAllLocalities(client)
err = iotSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping iot: %s", err)
errors = append(errors, fmt.Sprintf("iot: %s", err))
}

err = jobsSweeper.SweepAllLocalities(client)
err = jobsSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping jobs: %s", err)
errors = append(errors, fmt.Sprintf("jobs: %s", err))
}

err = k8sSweeper.SweepAllLocalities(client)
err = k8sSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping k8s: %s", err)
errors = append(errors, fmt.Sprintf("k8s: %s", err))
}

err = lbSweeper.SweepAllLocalities(client)
err = lbSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping lb: %s", err)
errors = append(errors, fmt.Sprintf("lb: %s", err))
}

err = mongodbSweeper.SweepAllLocalities(client)
err = mongodbSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping mongodb: %s", err)
errors = append(errors, fmt.Sprintf("mongodb: %s", err))
}

err = mnqSweeper.SweepAllLocalities(client)
err = mnqSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping mnq: %s", err)
errors = append(errors, fmt.Sprintf("mnq: %s", err))
}

err = rdbSweeper.SweepAllLocalities(client)
err = rdbSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping rdb: %s", err)
errors = append(errors, fmt.Sprintf("rdb: %s", err))
}

err = redisSweeper.SweepAllLocalities(client)
err = redisSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping redis: %s", err)
errors = append(errors, fmt.Sprintf("redis: %s", err))
}

err = registrySweeper.SweepAllLocalities(client)
err = registrySweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping registry: %s", err)
errors = append(errors, fmt.Sprintf("registry: %s", err))
}

err = secretSweeper.SweepAllLocalities(client)
err = secretSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping secret: %s", err)
errors = append(errors, fmt.Sprintf("secret: %s", err))
}

err = sdbSweeper.SweepAllLocalities(client)
err = sdbSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping sdb: %s", err)
errors = append(errors, fmt.Sprintf("sdb: %s", err))
}

err = vpcSweeper.SweepAllLocalities(client)
err = vpcSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping vpc: %s", err)
errors = append(errors, fmt.Sprintf("vpc: %s", err))
}

err = vpcgwSweeper.SweepAllLocalities(client)
err = vpcgwSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping vpcgw: %s", err)
errors = append(errors, fmt.Sprintf("vpcgw: %s", err))
}

err = webhostingSweeper.SweepAllLocalities(client)
err = webhostingSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping webhosting: %s", err)
errors = append(errors, fmt.Sprintf("webhosting: %s", err))
}

// IPAM IPs need to be swept in the end because we need to be sure
// that every resource with an attached ip is destroyed before executing it.
err = ipamSweeper.SweepAllLocalities(client)
err = ipamSweeper.SweepAllLocalities(client, true)
if err != nil {
log.Printf("Error sweeping ipam: %s", err)
errors = append(errors, fmt.Sprintf("ipam: %s", err))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Create searchdb resources.

USAGE:
scw searchdb deployment create [arg=value ...]

ARGS:
[project-id] Project ID to use. If none is passed the default project ID will be used
[name] Name of the deployment
[tags.{index}] Tags
[node-amount] Number of nodes
[node-type] Node type
[user-name] Username for the deployment user
[password] Password for the deployment user
[volume.type] Define the type of the Volume (unknown_type | sbs_5k | sbs_15k)
[volume.size-bytes] Define the size of the Volume
[endpoints.{index}.private-network.private-network-id]
[version] The Opensearch version to use
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for create

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
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Delete searchdb resources.

USAGE:
scw searchdb deployment delete [arg=value ...]

ARGS:
deployment-id ID of the deployment
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for delete

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
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Get searchdb resources.

USAGE:
scw searchdb deployment get [arg=value ...]

ARGS:
deployment-id ID of the deployment
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for get

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
@@ -0,0 +1,24 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
List searchdb resources.

USAGE:
scw searchdb deployment list [arg=value ...]

ARGS:
[project-id] ID of the Project containing the deployments
[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)
[tags.{index}] Filter by tag, only deployments with one or more matching tags will be returned
[name] Deployment name to filter for
[version] Engine version to filter for
[organization-id] ID of the Organization containing the deployments
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all)

FLAGS:
-h, --help help for list

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
@@ -0,0 +1,21 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Update searchdb resources.

USAGE:
scw searchdb deployment update [arg=value ...]

ARGS:
deployment-id UUID of the deployment to update
[name] Name of the deployment
[tags.{index}] Tags of a deployment
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

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
@@ -0,0 +1,21 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Upgrade searchdb resources.

USAGE:
scw searchdb deployment upgrade [arg=value ...]

ARGS:
deployment-id UUID of the Deployment to upgrade
[node-amount] Amount of node upgrade target
[volume-size-bytes] Volume size upgrade target
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for upgrade

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
@@ -0,0 +1,25 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Manage your SearchDB deployment.

USAGE:
scw searchdb deployment <command>

AVAILABLE COMMANDS:
create Create searchdb resources
delete Delete searchdb resources
get Get searchdb resources
list List searchdb resources
update Update searchdb resources
upgrade Upgrade searchdb resources

FLAGS:
-h, --help help for deployment

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

Use "scw searchdb deployment [command] --help" for more information about a command.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Create searchdb resources.

USAGE:
scw searchdb endpoint create [arg=value ...]

ARGS:
[deployment-id] ID of the deployment for which to create an endpoint
[endpoint-spec.private-network.private-network-id]
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for create

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
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Delete searchdb resources.

USAGE:
scw searchdb endpoint delete [arg=value ...]

ARGS:
endpoint-id ID of the endpoint to delete
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for delete

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
Loading
Loading