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
7 changes: 4 additions & 3 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
GOODDATA_URL=
GOODDATA_LOGIN=
GOODDATA_PASSWORD=
# for manage:mass-project-remove-expiration
KBC_MANAGE_TOKEN_US=
KBC_MANAGE_TOKEN_EU=
KBC_MANAGE_TOKEN_NE=
87 changes: 2 additions & 85 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,7 @@ Assorted CLI utils

`docker run --rm -it keboola/cli-utils php ./cli.php`

## Mass Dedup

Loads project ids and tables from a CSV file and runs a dedup job on each table.

**Command**

```
php cli.php storage:mass-dedup MANAGETOKEN /usr/ondra/data.csv
```

**Dry run**

Does not create the job or the snapshot.

```
php cli.php storage:mass-dedup MANAGETOKEN /usr/ondra/data.csv --dry-run
```

**CSV data sample**

```
data.csv
"project","table"
"232","out.c-rs-main.data"
"232","in.c-main.data"
```

## Redshift Deep Copy

Performs a deep copy of a table in Redshift backend. Fails if there are any aliases based on this table.

```
php cli.php storage:redshift-deep-copy PROJECTTOKEN in.c-main.buggy-table
```

## Bulk Project Add Feature

Adds a project feature to multiple projects

```
Expand Down Expand Up @@ -87,7 +51,7 @@ cat data.csv | php cli.php storage:notify-projects MANAGETOKEN

## Mass project extend expiration:

Prepare input file "extend.txt" from looker https://keboola.looker.com/explore/keboola_internal_reporting/usage_metric_values:
Prepare input file "extend.txt" in following format:
```
123-EU
579-US
Expand All @@ -107,27 +71,6 @@ Run command:

Use number of days or 0 as show to remove expiration completely. By default, it's dry-run. Override with `-f` parameter.

## Mass GD project drop:

Prepare input file "projects.csv" with project IDs:

```
123abc123abc123abc123abc123abc123abc
```

Prepare `.env` file from `.env.dist`:
```
GOODDATA_URL=
GOODDATA_LOGIN=
GOODDATA_PASSWORD=
```

Run command:

`php cli.php gooddata:delete-projects`

To actually drop the projects add `-f` flag. Default is dry-run.

## Add a feature to project templates

You can add a project feature to all the project templates available on the stack
Expand Down Expand Up @@ -160,32 +103,6 @@ Loads last N _(default 100)_ jobs into Marquez tool. Export has two modes:
- default - jobs are identified by job IDs
- with `--job-names-configurations` option - job are identified by component and configuration IDs

## Mass Project Queue Migration

- Create a manage token.
- Prepare input file (e.g. "projects") with ids of the projects to migrate to new Queue.
```
1234
5678
9012
3456
```

- Run the mass migration command
```
php cli.php manage:mass-project-queue-migration <manage_token> <kbc_url> <file_with_projects>
```

The command will do the following for every projectId in the source file:
- add project feature `queuev2`
- create and run configuration of `keboola.queue-migration-tool` component
- if a job was successful, it will disable legacy orchestrations in the project
- if a job ended with error, it will remove the `queuev2` feature from the project


- After migration delete your manage token you have created and used for migrations.


## Mass project enable dynamic backends
Prerequisities: https://keboola.atlassian.net/wiki/spaces/KB/pages/2135982081/Enable+Dynamic+Backends#Enable-for-project

Expand Down Expand Up @@ -227,7 +144,7 @@ It will perform a dry run unleass the `--force/-f` option is applied.

- Run the command
```
php ./cli.php storage:delete-orphaned=workspaces [--force/-f] <storage-token> <component-list> <untile-date> <hostname-suffix>
php ./cli.php storage:delete-orphaned-workspaces [--force/-f] <storage-token> <component-list> <untile-date> <hostname-suffix>
```

## Delete Orphaned Workspaces in Organization command
Expand Down
10 changes: 0 additions & 10 deletions cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,16 @@
use Keboola\Console\Command\DeleteOwnerlessWorkspaces;
use Keboola\Console\Command\DescribeOrganizationWorkspaces;
use Keboola\Console\Command\LineageEventsExport;
use Keboola\Console\Command\MassDedup;
use Keboola\Console\Command\MassDeleteProjectWorkspaces;
use Keboola\Console\Command\MassProjectEnableDynamicBackends;
use Keboola\Console\Command\MassProjectExtendExpiration;
use Keboola\Console\Command\MassProjectQueueMigration;
use Keboola\Console\Command\MigrateFiles;
use Keboola\Console\Command\OrganizationIntoMaintenanceMode;
use Keboola\Console\Command\OrganizationStorageBackend;
use Keboola\Console\Command\QueueMassTerminateJobs;
use Keboola\Console\Command\ReactivateSchedules;
use Keboola\Console\Command\RedshiftDeepCopy;
use Keboola\Console\Command\ProjectsAddFeature;
use Keboola\Console\Command\ProjectsRemoveFeature;
use Keboola\Console\Command\RedshiftSchemasCount;
use Keboola\Console\Command\RedshiftOrphanedWorkspaces;
use Keboola\Console\Command\DeletedProjectsPurge;
use Keboola\Console\Command\DeleteProjectSandboxes;
use Keboola\Console\Command\NotifyProjects;
Expand All @@ -35,12 +30,8 @@
use Keboola\Console\Command\UpdateDataRetention;

$application = new Application();
$application->add(new MassDedup());
$application->add(new RedshiftDeepCopy());
$application->add(new ProjectsAddFeature());
$application->add(new ProjectsRemoveFeature());
$application->add(new RedshiftSchemasCount());
$application->add(new RedshiftOrphanedWorkspaces());
$application->add(new DeletedProjectsPurge());
$application->add(new NotifyProjects());
$application->add(new SetDataRetention());
Expand All @@ -49,7 +40,6 @@
$application->add(new MassProjectEnableDynamicBackends());
$application->add(new AddFeature());
$application->add(new AllStacksIterator());
$application->add(new MassProjectQueueMigration());
$application->add(new LineageEventsExport());
$application->add(new QueueMassTerminateJobs());
$application->add(new DeleteOrphanedWorkspaces());
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:
app:
build: .
Expand Down
131 changes: 0 additions & 131 deletions src/Keboola/Console/Command/MassDedup.php

This file was deleted.

Loading