bigeye-cli 0.3.55__tar.gz → 0.3.61__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bigeye_cli-0.3.55/bigeye_cli/CLI_DOCS.md → bigeye_cli-0.3.61/PKG-INFO +81 -12
- bigeye_cli-0.3.55/PKG-INFO → bigeye_cli-0.3.61/bigeye_cli/CLI_DOCS.md +59 -34
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/__main__.py +34 -1
- bigeye_cli-0.3.61/bigeye_cli/bigconfig/bigconfig_commands.py +198 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/catalog/catalog_commands.py +229 -10
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/deltas/deltas_commands.py +56 -32
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/exceptions/exceptions.py +10 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/metric/metric_commands.py +3 -3
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/model/github_report.py +27 -15
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/model/vendor_report.py +4 -0
- bigeye_cli-0.3.61/bigeye_cli/workspace/workspace_commands.py +575 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/pyproject.toml +2 -2
- bigeye_cli-0.3.55/bigeye_cli/bigconfig/bigconfig_commands.py +0 -161
- bigeye_cli-0.3.55/bigeye_cli/workspace/workspace_commands.py +0 -490
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/LICENSE +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/__init__.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/__version__.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/bigconfig/__init__.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/bigconfig/bigconfig_options.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/catalog/__init__.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/collections/__init__.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/collections/collection_commands.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/configure/__init__.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/configure/configure_commands.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/deltas/__init__.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/enums.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/exceptions/__init__.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/functions.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/global_options.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/issues/__init__.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/issues/issue_commands.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/lineage/__init__.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/lineage/lineage_commands.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/metric/__init__.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/model/__init__.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/model/cicd_conf.py +0 -0
- {bigeye_cli-0.3.55 → bigeye_cli-0.3.61}/bigeye_cli/workspace/__init__.py +0 -0
|
@@ -1,5 +1,26 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: bigeye-cli
|
|
3
|
+
Version: 0.3.61
|
|
4
|
+
Summary: Bigeye CLI offers developer tools for maintaining your developer workspace.
|
|
5
|
+
Home-page: https://docs.bigeye.com/docs
|
|
6
|
+
License: Proprietary
|
|
7
|
+
Author: Bigeye
|
|
8
|
+
Author-email: support@bigeye.com
|
|
9
|
+
Requires-Python: >=3.9.0,<4.0.0
|
|
10
|
+
Classifier: License :: Other/Proprietary License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Requires-Dist: PyGithub (>=1.57,<2.0)
|
|
17
|
+
Requires-Dist: bigeye-sdk (>=0.4.81,<0.5.0)
|
|
18
|
+
Requires-Dist: click (>=8.0.4,<9.0.0)
|
|
19
|
+
Requires-Dist: rich (>=12.4.4,<13.0.0)
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
1
22
|
# **Bigeye CLI**
|
|
2
|
-
Version: 0.3.
|
|
23
|
+
Version: 0.3.61
|
|
3
24
|
## Installation
|
|
4
25
|
|
|
5
26
|
**Setting up your local/build environment**
|
|
@@ -171,9 +192,7 @@ password = fakepassword1234
|
|
|
171
192
|
|
|
172
193
|
**Note:** Most use cases will only require you to have a single `DEFAULT` credential that all workspaces can utilize. Running the `bigeye configure -w <workspace-name>` command for a non-default workspace will prompt you to inherit the credentials from default or create a new set of credentials. A workspace credential is only required if the `use_default_credential` setting is set to False in the configuration of the corresponding workspace.
|
|
173
194
|
|
|
174
|
-
# CLI Documentation
|
|
175
|
-
|
|
176
|
-
# `bigeye configure`
|
|
195
|
+
# CLI Documentation# `bigeye configure`
|
|
177
196
|
|
|
178
197
|
Configuration Commands for Bigeye CLI
|
|
179
198
|
|
|
@@ -287,6 +306,7 @@ $ bigeye workspace [OPTIONS] COMMAND [ARGS]...
|
|
|
287
306
|
* `schedule-all-metrics`: Schedule all metrics in a workspace.
|
|
288
307
|
* `unschedule-all-metrics`: Unschedule all metrics in a workspace.
|
|
289
308
|
* `upsert-group`: Create or update a group.
|
|
309
|
+
* `upsert-named-schedule`: Create a named, cron based schedule
|
|
290
310
|
* `upsert-workspace`: Create or update a workspace.
|
|
291
311
|
|
|
292
312
|
## `bigeye workspace create-named-schedule`
|
|
@@ -513,6 +533,25 @@ $ bigeye workspace upsert-group [OPTIONS]
|
|
|
513
533
|
* `-id, --group_id INTEGER`: Group ID.
|
|
514
534
|
* `--help`: Show this message and exit.
|
|
515
535
|
|
|
536
|
+
## `bigeye workspace upsert-named-schedule`
|
|
537
|
+
|
|
538
|
+
Create a named, cron based schedule
|
|
539
|
+
|
|
540
|
+
**Usage**:
|
|
541
|
+
|
|
542
|
+
```console
|
|
543
|
+
$ bigeye workspace upsert-named-schedule [OPTIONS]
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
**Options**:
|
|
547
|
+
|
|
548
|
+
* `-b, --bigeye_conf TEXT`: Bigeye Credential File Path [env var: BIGEYE_API_CRED_FILE]
|
|
549
|
+
* `-c, --config_file TEXT`: Bigeye CLI Configuration File Path [env var: BIGEYE_API_CONFIG_FILE]
|
|
550
|
+
* `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
|
|
551
|
+
* `-sn, --name TEXT`: The user defined name of the schedule [required]
|
|
552
|
+
* `-c, --cron TEXT`: The cron string to define the schedule [required]
|
|
553
|
+
* `--help`: Show this message and exit.
|
|
554
|
+
|
|
516
555
|
## `bigeye workspace upsert-workspace`
|
|
517
556
|
|
|
518
557
|
Create or update a workspace.
|
|
@@ -624,6 +663,7 @@ $ bigeye bigconfig plan [OPTIONS]
|
|
|
624
663
|
* `-nq, --no_queue`: Don't submit to queue: True or False.
|
|
625
664
|
* `-r, --recursive`: Search all input directories recursively.
|
|
626
665
|
* `-strict, --strict_mode`: API errors cause an exception if True. (Validation errors still cause an exception)
|
|
666
|
+
* `-cicd, --cicd_report`: Add the report to a pull request. (Github only)
|
|
627
667
|
* `--help`: Show this message and exit.
|
|
628
668
|
|
|
629
669
|
# `bigeye catalog`
|
|
@@ -663,6 +703,7 @@ $ bigeye catalog [OPTIONS] COMMAND [ARGS]...
|
|
|
663
703
|
* `run-metrics`: Runs metrics by warehouse id, schema...
|
|
664
704
|
* `schedule-all-metrics`: Updates schedule for all metrics in a...
|
|
665
705
|
* `set-metric-time`: Sets metric times from a list of possible...
|
|
706
|
+
* `track-schema-changes`: Track schema changes for sources on demand...
|
|
666
707
|
* `unschedule-all-metrics`: Unschedule all metrics by warehouse,...
|
|
667
708
|
* `unset-metric-time`: Unsets metric times for whole warehouse or...
|
|
668
709
|
* `upsert-template`: Create or update a template for a source.
|
|
@@ -750,7 +791,7 @@ $ bigeye catalog delete-metrics [OPTIONS]
|
|
|
750
791
|
* `-wid, --warehouse_id INTEGER`: Warehouse ID
|
|
751
792
|
* `-sn, --schema_name TEXT`: List of Schema Names. E.g. -sn schema_1 -sn schema_2.
|
|
752
793
|
* `-tid, --table_id INTEGER`: Table IDs. E.g. -tid 123 -tid 124
|
|
753
|
-
* `-m, --metric_type TEXT`: Delete by name of the metric type.UNDEFINED_PREDEFINED_METRIC_NAME, PERCENT_NULL, COUNT_NULL, PERCENT_EMPTY_STRING, COUNT_EMPTY_STRING, PERCENT_UNIQUE, PERCENT_VALUE_IN_LIST, AVERAGE, MIN, MAX, SUM, COUNT_ROWS, COUNT_DISTINCT, HOURS_SINCE_MAX_DATE, HOURS_SINCE_MAX_TIMESTAMP, COUNT_TRUE, PERCENT_TRUE, COUNT_FALSE, PERCENT_FALSE, COUNT_USA_PHONE, PERCENT_USA_PHONE, COUNT_USA_ZIP_CODE, PERCENT_USA_ZIP_CODE, PERCENT_UUID, COUNT_TIMESTAMP_STRING, PERCENT_TIMESTAMP_STRING, COUNT_DUPLICATES, COUNT_USA_STATE_CODE, PERCENT_USA_STATE_CODE, VARIANCE, SKEW, KURTOSIS, GEOMETRIC_MEAN, HARMONIC_MEAN, COUNT_UUID, COUNT_CUSIP, PERCENT_CUSIP, COUNT_SEDOL, PERCENT_SEDOL, COUNT_ISIN, PERCENT_ISIN, COUNT_LEI, PERCENT_LEI, COUNT_FIGI, PERCENT_FIGI, COUNT_PERM_ID, PERCENT_PERM_ID, COUNT_NAN, PERCENT_NAN, COUNT_LONGITUDE, PERCENT_LONGITUDE, COUNT_LATITUDE, PERCENT_LATITUDE, COUNT_NOT_IN_FUTURE, PERCENT_NOT_IN_FUTURE, COUNT_DATE_NOT_IN_FUTURE, PERCENT_DATE_NOT_IN_FUTURE, MEDIAN, PERCENTILE, COUNT_NOT_NULL, STRING_LENGTH_AVERAGE, STRING_LENGTH_MIN, STRING_LENGTH_MAX, COUNT_SSN, PERCENT_SSN, COUNT_EMAIL, PERCENT_EMAIL, ROWS_INSERTED, HOURS_SINCE_LAST_LOAD, COUNT_READ_QUERIES, PERCENT_NOT_NULL, FRESHNESS, VOLUME,
|
|
794
|
+
* `-m, --metric_type TEXT`: Delete by name of the metric type.UNDEFINED_PREDEFINED_METRIC_NAME, PERCENT_NULL, COUNT_NULL, PERCENT_EMPTY_STRING, COUNT_EMPTY_STRING, PERCENT_UNIQUE, PERCENT_VALUE_IN_LIST, AVERAGE, MIN, MAX, SUM, COUNT_ROWS, COUNT_DISTINCT, HOURS_SINCE_MAX_DATE, HOURS_SINCE_MAX_TIMESTAMP, COUNT_TRUE, PERCENT_TRUE, COUNT_FALSE, PERCENT_FALSE, COUNT_USA_PHONE, PERCENT_USA_PHONE, COUNT_USA_ZIP_CODE, PERCENT_USA_ZIP_CODE, PERCENT_UUID, COUNT_TIMESTAMP_STRING, PERCENT_TIMESTAMP_STRING, COUNT_DUPLICATES, COUNT_USA_STATE_CODE, PERCENT_USA_STATE_CODE, VARIANCE, SKEW, KURTOSIS, GEOMETRIC_MEAN, HARMONIC_MEAN, COUNT_UUID, COUNT_CUSIP, PERCENT_CUSIP, COUNT_SEDOL, PERCENT_SEDOL, COUNT_ISIN, PERCENT_ISIN, COUNT_LEI, PERCENT_LEI, COUNT_FIGI, PERCENT_FIGI, COUNT_PERM_ID, PERCENT_PERM_ID, COUNT_NAN, PERCENT_NAN, COUNT_LONGITUDE, PERCENT_LONGITUDE, COUNT_LATITUDE, PERCENT_LATITUDE, COUNT_NOT_IN_FUTURE, PERCENT_NOT_IN_FUTURE, COUNT_DATE_NOT_IN_FUTURE, PERCENT_DATE_NOT_IN_FUTURE, MEDIAN, PERCENTILE, COUNT_NOT_NULL, STRING_LENGTH_AVERAGE, STRING_LENGTH_MIN, STRING_LENGTH_MAX, COUNT_SSN, PERCENT_SSN, COUNT_EMAIL, PERCENT_EMAIL, ROWS_INSERTED, HOURS_SINCE_LAST_LOAD, COUNT_READ_QUERIES, PERCENT_NOT_NULL, FRESHNESS, VOLUME, FRESHNESS_DATA, VOLUME_DATA, COUNT_VALUE_IN_LIST
|
|
754
795
|
* `--help`: Show this message and exit.
|
|
755
796
|
|
|
756
797
|
## `bigeye catalog delete-source`
|
|
@@ -1073,6 +1114,32 @@ $ bigeye catalog set-metric-time [OPTIONS]
|
|
|
1073
1114
|
* `-r, --replace`: replace metric times if already present on tables? Default is false.
|
|
1074
1115
|
* `--help`: Show this message and exit.
|
|
1075
1116
|
|
|
1117
|
+
## `bigeye catalog track-schema-changes`
|
|
1118
|
+
|
|
1119
|
+
Track schema changes for sources on demand or every n hour(s) and notify specified channels.
|
|
1120
|
+
Environment variables SMTP_USER and SMTP_PASSWORD MUST be set if using email notification.
|
|
1121
|
+
|
|
1122
|
+
**Usage**:
|
|
1123
|
+
|
|
1124
|
+
```console
|
|
1125
|
+
$ bigeye catalog track-schema-changes [OPTIONS]
|
|
1126
|
+
```
|
|
1127
|
+
|
|
1128
|
+
**Options**:
|
|
1129
|
+
|
|
1130
|
+
* `-b, --bigeye_conf TEXT`: Bigeye Credential File Path [env var: BIGEYE_API_CRED_FILE]
|
|
1131
|
+
* `-c, --config_file TEXT`: Bigeye CLI Configuration File Path [env var: BIGEYE_API_CONFIG_FILE]
|
|
1132
|
+
* `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
|
|
1133
|
+
* `-src, --source TEXT`: A list of source names to track. (None will track changes from all sources)
|
|
1134
|
+
* `-s, --since TEXT`: Track schema changes from this date. (Formatted as yyyy-MM-dd) [default: 1970-01-01]
|
|
1135
|
+
* `-f, --frequency INTEGER`: Every n hours to check for schema changes. (None will only run the check once) [default: 0]
|
|
1136
|
+
* `-ct, --change_type [CREATED|DELETED|TYPE_CHANGED]`: The types of changes to track; i.e additions, changes, deletions. (None will track all types) [default: DELETED, CREATED, TYPE_CHANGED]
|
|
1137
|
+
* `-nc, --channel TEXT`: A list of notification channels; e.g. -nc email@mydomain.com -nc #slack_channel -nc https://www.webhook.com
|
|
1138
|
+
* `-smtp, --server TEXT`: The server to send emails.
|
|
1139
|
+
* `-p, --port INTEGER`: The server port to send emails. [default: 587]
|
|
1140
|
+
* `-t, --token TEXT`: The token to utilize the Slack web client. (Will attempt to use environment variable SLACK_BOT_TOKEN, if not set)
|
|
1141
|
+
* `--help`: Show this message and exit.
|
|
1142
|
+
|
|
1076
1143
|
## `bigeye catalog unschedule-all-metrics`
|
|
1077
1144
|
|
|
1078
1145
|
Unschedule all metrics by warehouse, schema or tables.
|
|
@@ -1127,12 +1194,13 @@ $ bigeye catalog upsert-template [OPTIONS]
|
|
|
1127
1194
|
* `-b, --bigeye_conf TEXT`: Bigeye Credential File Path [env var: BIGEYE_API_CRED_FILE]
|
|
1128
1195
|
* `-c, --config_file TEXT`: Bigeye CLI Configuration File Path [env var: BIGEYE_API_CONFIG_FILE]
|
|
1129
1196
|
* `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
|
|
1130
|
-
* `-sn, --source_name TEXT`: The name of the source where the template will be defined
|
|
1131
|
-
* `-tn, --name TEXT`: The user defined name of the template
|
|
1132
|
-
* `-tb, --body TEXT`: The string to define the template
|
|
1133
|
-
* `-rt, --returns [BOOLEAN|NUMERIC]`: The data type returned by the template; i.e. NUMERIC, BOOLEAN
|
|
1134
|
-
* `-p, --params TEXT`: A list of key/value pairs for parameters; ex. -p column=COLUMN_REFERENCE -p table=STRING
|
|
1197
|
+
* `-sn, --source_name TEXT`: The name of the source where the template will be defined
|
|
1198
|
+
* `-tn, --name TEXT`: The user defined name of the template
|
|
1199
|
+
* `-tb, --body TEXT`: The string to define the template
|
|
1200
|
+
* `-rt, --returns [BOOLEAN|NUMERIC]`: The data type returned by the template; i.e. NUMERIC, BOOLEAN
|
|
1201
|
+
* `-p, --params TEXT`: A list of key/value pairs for parameters; ex. -p column=COLUMN_REFERENCE -p table=STRING
|
|
1135
1202
|
* `-id, --template_id INTEGER`: The template ID (Only required when updating a template). [default: 0]
|
|
1203
|
+
* `-tf, --template_file TEXT`: A file containing a template definition.
|
|
1136
1204
|
* `--help`: Show this message and exit.
|
|
1137
1205
|
|
|
1138
1206
|
## `bigeye catalog upsert-virtual-table`
|
|
@@ -1490,7 +1558,7 @@ $ bigeye deltas suggest-deltas [OPTIONS]
|
|
|
1490
1558
|
* `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
|
|
1491
1559
|
* `-source, --source_selector TEXT`: The pattern of tables in the source to select. Wildcard (*) indicates all tables or all schemas, e.g. source_1.*.* would be all schemas in source_1. [required]
|
|
1492
1560
|
* `-target, --target_selector TEXT`: The pattern of tables in the target to select. Wildcard (*) indicates all tables or all schemas, e.g. source_2.*.* would be all schemas in source_2. [required]
|
|
1493
|
-
* `-mt, --match_type [strict|fuzzy]`: How to match tables between the source and target destinations. Strict will only create relations if table names match exactly, Fuzzy will attempt to create relations using a fuzzy match. [default:
|
|
1561
|
+
* `-mt, --match_type [strict|fuzzy]`: How to match tables between the source and target destinations. Strict will only create relations if table names match exactly, Fuzzy will attempt to create relations using a fuzzy match. [default: strict]
|
|
1494
1562
|
* `-op, --output_path TEXT`: File to write the delta configuration. [required]
|
|
1495
1563
|
* `--help`: Show this message and exit.
|
|
1496
1564
|
|
|
@@ -1757,6 +1825,7 @@ $ bigeye lineage infer-relations [OPTIONS]
|
|
|
1757
1825
|
* `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
|
|
1758
1826
|
* `-upstream, --upstream_selector TEXT`: The pattern of tables in the upstream source to select. Wildcard (*) indicates all tables or all schemas, e.g. source_1.*.* would be all schemas in source_1.
|
|
1759
1827
|
* `-downstream, --downstream_selector TEXT`: The pattern of tables in the downstream source to select. Wildcard (*) indicates all tables or all schemas, e.g. source_2.*.* would be all schemas in source_2.
|
|
1760
|
-
* `-mt, --match_type [strict|fuzzy]`: How to match tables between the source and target destinations. Strict will only create relations if table names match exactly, Fuzzy will attempt to create relations using a fuzzy match. [default:
|
|
1828
|
+
* `-mt, --match_type [strict|fuzzy]`: How to match tables between the source and target destinations. Strict will only create relations if table names match exactly, Fuzzy will attempt to create relations using a fuzzy match. [default: strict]
|
|
1761
1829
|
* `--help`: Show this message and exit.
|
|
1762
1830
|
|
|
1831
|
+
|
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: bigeye-cli
|
|
3
|
-
Version: 0.3.55
|
|
4
|
-
Summary: Bigeye CLI offers developer tools for maintaining your developer workspace.
|
|
5
|
-
Home-page: https://docs.bigeye.com/docs
|
|
6
|
-
License: Proprietary
|
|
7
|
-
Author: Bigeye
|
|
8
|
-
Author-email: support@bigeye.com
|
|
9
|
-
Requires-Python: >=3.9.0,<4.0.0
|
|
10
|
-
Classifier: License :: Other/Proprietary License
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
-
Requires-Dist: PyGithub (>=1.57,<2.0)
|
|
17
|
-
Requires-Dist: bigeye-sdk (>=0.4.75,<0.5.0)
|
|
18
|
-
Requires-Dist: click (>=8.0.4,<9.0.0)
|
|
19
|
-
Requires-Dist: rich (>=12.4.4,<13.0.0)
|
|
20
|
-
Description-Content-Type: text/markdown
|
|
21
|
-
|
|
22
1
|
# **Bigeye CLI**
|
|
23
|
-
Version: 0.3.
|
|
2
|
+
Version: 0.3.61
|
|
24
3
|
## Installation
|
|
25
4
|
|
|
26
5
|
**Setting up your local/build environment**
|
|
@@ -192,9 +171,7 @@ password = fakepassword1234
|
|
|
192
171
|
|
|
193
172
|
**Note:** Most use cases will only require you to have a single `DEFAULT` credential that all workspaces can utilize. Running the `bigeye configure -w <workspace-name>` command for a non-default workspace will prompt you to inherit the credentials from default or create a new set of credentials. A workspace credential is only required if the `use_default_credential` setting is set to False in the configuration of the corresponding workspace.
|
|
194
173
|
|
|
195
|
-
# CLI Documentation
|
|
196
|
-
|
|
197
|
-
# `bigeye configure`
|
|
174
|
+
# CLI Documentation# `bigeye configure`
|
|
198
175
|
|
|
199
176
|
Configuration Commands for Bigeye CLI
|
|
200
177
|
|
|
@@ -308,6 +285,7 @@ $ bigeye workspace [OPTIONS] COMMAND [ARGS]...
|
|
|
308
285
|
* `schedule-all-metrics`: Schedule all metrics in a workspace.
|
|
309
286
|
* `unschedule-all-metrics`: Unschedule all metrics in a workspace.
|
|
310
287
|
* `upsert-group`: Create or update a group.
|
|
288
|
+
* `upsert-named-schedule`: Create a named, cron based schedule
|
|
311
289
|
* `upsert-workspace`: Create or update a workspace.
|
|
312
290
|
|
|
313
291
|
## `bigeye workspace create-named-schedule`
|
|
@@ -534,6 +512,25 @@ $ bigeye workspace upsert-group [OPTIONS]
|
|
|
534
512
|
* `-id, --group_id INTEGER`: Group ID.
|
|
535
513
|
* `--help`: Show this message and exit.
|
|
536
514
|
|
|
515
|
+
## `bigeye workspace upsert-named-schedule`
|
|
516
|
+
|
|
517
|
+
Create a named, cron based schedule
|
|
518
|
+
|
|
519
|
+
**Usage**:
|
|
520
|
+
|
|
521
|
+
```console
|
|
522
|
+
$ bigeye workspace upsert-named-schedule [OPTIONS]
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
**Options**:
|
|
526
|
+
|
|
527
|
+
* `-b, --bigeye_conf TEXT`: Bigeye Credential File Path [env var: BIGEYE_API_CRED_FILE]
|
|
528
|
+
* `-c, --config_file TEXT`: Bigeye CLI Configuration File Path [env var: BIGEYE_API_CONFIG_FILE]
|
|
529
|
+
* `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
|
|
530
|
+
* `-sn, --name TEXT`: The user defined name of the schedule [required]
|
|
531
|
+
* `-c, --cron TEXT`: The cron string to define the schedule [required]
|
|
532
|
+
* `--help`: Show this message and exit.
|
|
533
|
+
|
|
537
534
|
## `bigeye workspace upsert-workspace`
|
|
538
535
|
|
|
539
536
|
Create or update a workspace.
|
|
@@ -645,6 +642,7 @@ $ bigeye bigconfig plan [OPTIONS]
|
|
|
645
642
|
* `-nq, --no_queue`: Don't submit to queue: True or False.
|
|
646
643
|
* `-r, --recursive`: Search all input directories recursively.
|
|
647
644
|
* `-strict, --strict_mode`: API errors cause an exception if True. (Validation errors still cause an exception)
|
|
645
|
+
* `-cicd, --cicd_report`: Add the report to a pull request. (Github only)
|
|
648
646
|
* `--help`: Show this message and exit.
|
|
649
647
|
|
|
650
648
|
# `bigeye catalog`
|
|
@@ -684,6 +682,7 @@ $ bigeye catalog [OPTIONS] COMMAND [ARGS]...
|
|
|
684
682
|
* `run-metrics`: Runs metrics by warehouse id, schema...
|
|
685
683
|
* `schedule-all-metrics`: Updates schedule for all metrics in a...
|
|
686
684
|
* `set-metric-time`: Sets metric times from a list of possible...
|
|
685
|
+
* `track-schema-changes`: Track schema changes for sources on demand...
|
|
687
686
|
* `unschedule-all-metrics`: Unschedule all metrics by warehouse,...
|
|
688
687
|
* `unset-metric-time`: Unsets metric times for whole warehouse or...
|
|
689
688
|
* `upsert-template`: Create or update a template for a source.
|
|
@@ -771,7 +770,7 @@ $ bigeye catalog delete-metrics [OPTIONS]
|
|
|
771
770
|
* `-wid, --warehouse_id INTEGER`: Warehouse ID
|
|
772
771
|
* `-sn, --schema_name TEXT`: List of Schema Names. E.g. -sn schema_1 -sn schema_2.
|
|
773
772
|
* `-tid, --table_id INTEGER`: Table IDs. E.g. -tid 123 -tid 124
|
|
774
|
-
* `-m, --metric_type TEXT`: Delete by name of the metric type.UNDEFINED_PREDEFINED_METRIC_NAME, PERCENT_NULL, COUNT_NULL, PERCENT_EMPTY_STRING, COUNT_EMPTY_STRING, PERCENT_UNIQUE, PERCENT_VALUE_IN_LIST, AVERAGE, MIN, MAX, SUM, COUNT_ROWS, COUNT_DISTINCT, HOURS_SINCE_MAX_DATE, HOURS_SINCE_MAX_TIMESTAMP, COUNT_TRUE, PERCENT_TRUE, COUNT_FALSE, PERCENT_FALSE, COUNT_USA_PHONE, PERCENT_USA_PHONE, COUNT_USA_ZIP_CODE, PERCENT_USA_ZIP_CODE, PERCENT_UUID, COUNT_TIMESTAMP_STRING, PERCENT_TIMESTAMP_STRING, COUNT_DUPLICATES, COUNT_USA_STATE_CODE, PERCENT_USA_STATE_CODE, VARIANCE, SKEW, KURTOSIS, GEOMETRIC_MEAN, HARMONIC_MEAN, COUNT_UUID, COUNT_CUSIP, PERCENT_CUSIP, COUNT_SEDOL, PERCENT_SEDOL, COUNT_ISIN, PERCENT_ISIN, COUNT_LEI, PERCENT_LEI, COUNT_FIGI, PERCENT_FIGI, COUNT_PERM_ID, PERCENT_PERM_ID, COUNT_NAN, PERCENT_NAN, COUNT_LONGITUDE, PERCENT_LONGITUDE, COUNT_LATITUDE, PERCENT_LATITUDE, COUNT_NOT_IN_FUTURE, PERCENT_NOT_IN_FUTURE, COUNT_DATE_NOT_IN_FUTURE, PERCENT_DATE_NOT_IN_FUTURE, MEDIAN, PERCENTILE, COUNT_NOT_NULL, STRING_LENGTH_AVERAGE, STRING_LENGTH_MIN, STRING_LENGTH_MAX, COUNT_SSN, PERCENT_SSN, COUNT_EMAIL, PERCENT_EMAIL, ROWS_INSERTED, HOURS_SINCE_LAST_LOAD, COUNT_READ_QUERIES, PERCENT_NOT_NULL, FRESHNESS, VOLUME,
|
|
773
|
+
* `-m, --metric_type TEXT`: Delete by name of the metric type.UNDEFINED_PREDEFINED_METRIC_NAME, PERCENT_NULL, COUNT_NULL, PERCENT_EMPTY_STRING, COUNT_EMPTY_STRING, PERCENT_UNIQUE, PERCENT_VALUE_IN_LIST, AVERAGE, MIN, MAX, SUM, COUNT_ROWS, COUNT_DISTINCT, HOURS_SINCE_MAX_DATE, HOURS_SINCE_MAX_TIMESTAMP, COUNT_TRUE, PERCENT_TRUE, COUNT_FALSE, PERCENT_FALSE, COUNT_USA_PHONE, PERCENT_USA_PHONE, COUNT_USA_ZIP_CODE, PERCENT_USA_ZIP_CODE, PERCENT_UUID, COUNT_TIMESTAMP_STRING, PERCENT_TIMESTAMP_STRING, COUNT_DUPLICATES, COUNT_USA_STATE_CODE, PERCENT_USA_STATE_CODE, VARIANCE, SKEW, KURTOSIS, GEOMETRIC_MEAN, HARMONIC_MEAN, COUNT_UUID, COUNT_CUSIP, PERCENT_CUSIP, COUNT_SEDOL, PERCENT_SEDOL, COUNT_ISIN, PERCENT_ISIN, COUNT_LEI, PERCENT_LEI, COUNT_FIGI, PERCENT_FIGI, COUNT_PERM_ID, PERCENT_PERM_ID, COUNT_NAN, PERCENT_NAN, COUNT_LONGITUDE, PERCENT_LONGITUDE, COUNT_LATITUDE, PERCENT_LATITUDE, COUNT_NOT_IN_FUTURE, PERCENT_NOT_IN_FUTURE, COUNT_DATE_NOT_IN_FUTURE, PERCENT_DATE_NOT_IN_FUTURE, MEDIAN, PERCENTILE, COUNT_NOT_NULL, STRING_LENGTH_AVERAGE, STRING_LENGTH_MIN, STRING_LENGTH_MAX, COUNT_SSN, PERCENT_SSN, COUNT_EMAIL, PERCENT_EMAIL, ROWS_INSERTED, HOURS_SINCE_LAST_LOAD, COUNT_READ_QUERIES, PERCENT_NOT_NULL, FRESHNESS, VOLUME, FRESHNESS_DATA, VOLUME_DATA, COUNT_VALUE_IN_LIST
|
|
775
774
|
* `--help`: Show this message and exit.
|
|
776
775
|
|
|
777
776
|
## `bigeye catalog delete-source`
|
|
@@ -1094,6 +1093,32 @@ $ bigeye catalog set-metric-time [OPTIONS]
|
|
|
1094
1093
|
* `-r, --replace`: replace metric times if already present on tables? Default is false.
|
|
1095
1094
|
* `--help`: Show this message and exit.
|
|
1096
1095
|
|
|
1096
|
+
## `bigeye catalog track-schema-changes`
|
|
1097
|
+
|
|
1098
|
+
Track schema changes for sources on demand or every n hour(s) and notify specified channels.
|
|
1099
|
+
Environment variables SMTP_USER and SMTP_PASSWORD MUST be set if using email notification.
|
|
1100
|
+
|
|
1101
|
+
**Usage**:
|
|
1102
|
+
|
|
1103
|
+
```console
|
|
1104
|
+
$ bigeye catalog track-schema-changes [OPTIONS]
|
|
1105
|
+
```
|
|
1106
|
+
|
|
1107
|
+
**Options**:
|
|
1108
|
+
|
|
1109
|
+
* `-b, --bigeye_conf TEXT`: Bigeye Credential File Path [env var: BIGEYE_API_CRED_FILE]
|
|
1110
|
+
* `-c, --config_file TEXT`: Bigeye CLI Configuration File Path [env var: BIGEYE_API_CONFIG_FILE]
|
|
1111
|
+
* `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
|
|
1112
|
+
* `-src, --source TEXT`: A list of source names to track. (None will track changes from all sources)
|
|
1113
|
+
* `-s, --since TEXT`: Track schema changes from this date. (Formatted as yyyy-MM-dd) [default: 1970-01-01]
|
|
1114
|
+
* `-f, --frequency INTEGER`: Every n hours to check for schema changes. (None will only run the check once) [default: 0]
|
|
1115
|
+
* `-ct, --change_type [CREATED|DELETED|TYPE_CHANGED]`: The types of changes to track; i.e additions, changes, deletions. (None will track all types) [default: DELETED, CREATED, TYPE_CHANGED]
|
|
1116
|
+
* `-nc, --channel TEXT`: A list of notification channels; e.g. -nc email@mydomain.com -nc #slack_channel -nc https://www.webhook.com
|
|
1117
|
+
* `-smtp, --server TEXT`: The server to send emails.
|
|
1118
|
+
* `-p, --port INTEGER`: The server port to send emails. [default: 587]
|
|
1119
|
+
* `-t, --token TEXT`: The token to utilize the Slack web client. (Will attempt to use environment variable SLACK_BOT_TOKEN, if not set)
|
|
1120
|
+
* `--help`: Show this message and exit.
|
|
1121
|
+
|
|
1097
1122
|
## `bigeye catalog unschedule-all-metrics`
|
|
1098
1123
|
|
|
1099
1124
|
Unschedule all metrics by warehouse, schema or tables.
|
|
@@ -1148,12 +1173,13 @@ $ bigeye catalog upsert-template [OPTIONS]
|
|
|
1148
1173
|
* `-b, --bigeye_conf TEXT`: Bigeye Credential File Path [env var: BIGEYE_API_CRED_FILE]
|
|
1149
1174
|
* `-c, --config_file TEXT`: Bigeye CLI Configuration File Path [env var: BIGEYE_API_CONFIG_FILE]
|
|
1150
1175
|
* `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
|
|
1151
|
-
* `-sn, --source_name TEXT`: The name of the source where the template will be defined
|
|
1152
|
-
* `-tn, --name TEXT`: The user defined name of the template
|
|
1153
|
-
* `-tb, --body TEXT`: The string to define the template
|
|
1154
|
-
* `-rt, --returns [BOOLEAN|NUMERIC]`: The data type returned by the template; i.e. NUMERIC, BOOLEAN
|
|
1155
|
-
* `-p, --params TEXT`: A list of key/value pairs for parameters; ex. -p column=COLUMN_REFERENCE -p table=STRING
|
|
1176
|
+
* `-sn, --source_name TEXT`: The name of the source where the template will be defined
|
|
1177
|
+
* `-tn, --name TEXT`: The user defined name of the template
|
|
1178
|
+
* `-tb, --body TEXT`: The string to define the template
|
|
1179
|
+
* `-rt, --returns [BOOLEAN|NUMERIC]`: The data type returned by the template; i.e. NUMERIC, BOOLEAN
|
|
1180
|
+
* `-p, --params TEXT`: A list of key/value pairs for parameters; ex. -p column=COLUMN_REFERENCE -p table=STRING
|
|
1156
1181
|
* `-id, --template_id INTEGER`: The template ID (Only required when updating a template). [default: 0]
|
|
1182
|
+
* `-tf, --template_file TEXT`: A file containing a template definition.
|
|
1157
1183
|
* `--help`: Show this message and exit.
|
|
1158
1184
|
|
|
1159
1185
|
## `bigeye catalog upsert-virtual-table`
|
|
@@ -1511,7 +1537,7 @@ $ bigeye deltas suggest-deltas [OPTIONS]
|
|
|
1511
1537
|
* `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
|
|
1512
1538
|
* `-source, --source_selector TEXT`: The pattern of tables in the source to select. Wildcard (*) indicates all tables or all schemas, e.g. source_1.*.* would be all schemas in source_1. [required]
|
|
1513
1539
|
* `-target, --target_selector TEXT`: The pattern of tables in the target to select. Wildcard (*) indicates all tables or all schemas, e.g. source_2.*.* would be all schemas in source_2. [required]
|
|
1514
|
-
* `-mt, --match_type [strict|fuzzy]`: How to match tables between the source and target destinations. Strict will only create relations if table names match exactly, Fuzzy will attempt to create relations using a fuzzy match. [default:
|
|
1540
|
+
* `-mt, --match_type [strict|fuzzy]`: How to match tables between the source and target destinations. Strict will only create relations if table names match exactly, Fuzzy will attempt to create relations using a fuzzy match. [default: strict]
|
|
1515
1541
|
* `-op, --output_path TEXT`: File to write the delta configuration. [required]
|
|
1516
1542
|
* `--help`: Show this message and exit.
|
|
1517
1543
|
|
|
@@ -1778,7 +1804,6 @@ $ bigeye lineage infer-relations [OPTIONS]
|
|
|
1778
1804
|
* `-w, --workspace TEXT`: Name of the workspace configuration. [env var: BIGEYE_WORKSPACE; default: DEFAULT]
|
|
1779
1805
|
* `-upstream, --upstream_selector TEXT`: The pattern of tables in the upstream source to select. Wildcard (*) indicates all tables or all schemas, e.g. source_1.*.* would be all schemas in source_1.
|
|
1780
1806
|
* `-downstream, --downstream_selector TEXT`: The pattern of tables in the downstream source to select. Wildcard (*) indicates all tables or all schemas, e.g. source_2.*.* would be all schemas in source_2.
|
|
1781
|
-
* `-mt, --match_type [strict|fuzzy]`: How to match tables between the source and target destinations. Strict will only create relations if table names match exactly, Fuzzy will attempt to create relations using a fuzzy match. [default:
|
|
1807
|
+
* `-mt, --match_type [strict|fuzzy]`: How to match tables between the source and target destinations. Strict will only create relations if table names match exactly, Fuzzy will attempt to create relations using a fuzzy match. [default: strict]
|
|
1782
1808
|
* `--help`: Show this message and exit.
|
|
1783
1809
|
|
|
1784
|
-
|
|
@@ -6,6 +6,8 @@ import bigeye_cli.__version__ as bigeye_cli_version
|
|
|
6
6
|
import bigeye_sdk.__version__ as bigeye_sdk_version
|
|
7
7
|
|
|
8
8
|
from bigeye_cli.functions import print_markdown
|
|
9
|
+
from bigeye_sdk.authentication.config import Config, WorkspaceConfig
|
|
10
|
+
from bigeye_sdk.functions.version import check_package_for_updates
|
|
9
11
|
from bigeye_sdk.log import get_logger
|
|
10
12
|
|
|
11
13
|
from bigeye_cli import CLI_DOCS_MD
|
|
@@ -37,6 +39,29 @@ app.add_typer(lineage_commands.app, name='lineage')
|
|
|
37
39
|
app.add_typer(configure_commands.app, name='configure')
|
|
38
40
|
|
|
39
41
|
|
|
42
|
+
def _check_cli_and_sdk_versions(config_file: str, workspace: str):
|
|
43
|
+
try:
|
|
44
|
+
config = Config.load_config(config_file)
|
|
45
|
+
workspace_config = WorkspaceConfig(**config[workspace])
|
|
46
|
+
check_package_for_updates(
|
|
47
|
+
pypi_package_name='bigeye-cli',
|
|
48
|
+
internal_package_name='Bigeye CLI',
|
|
49
|
+
installed_version=bigeye_cli_version.version,
|
|
50
|
+
auto_update_enabled=workspace_config.auto_update_enabled,
|
|
51
|
+
warning_message_disabled=workspace_config.disable_auto_update_message
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
check_package_for_updates(
|
|
55
|
+
pypi_package_name='bigeye-sdk',
|
|
56
|
+
internal_package_name='Bigeye SDK',
|
|
57
|
+
installed_version=bigeye_sdk_version.version,
|
|
58
|
+
auto_update_enabled=workspace_config.auto_update_enabled,
|
|
59
|
+
warning_message_disabled=workspace_config.disable_auto_update_message
|
|
60
|
+
)
|
|
61
|
+
except:
|
|
62
|
+
pass
|
|
63
|
+
|
|
64
|
+
|
|
40
65
|
@app.callback(invoke_without_command=True)
|
|
41
66
|
def options_callback(
|
|
42
67
|
version: Optional[bool] = typer.Option(
|
|
@@ -44,8 +69,16 @@ def options_callback(
|
|
|
44
69
|
readme: Optional[bool] = typer.Option(
|
|
45
70
|
None, "--readme", help="Prints Readme."),
|
|
46
71
|
verbose: Optional[bool] = typer.Option(
|
|
47
|
-
None, "--verbose", help="Enables full output.")
|
|
72
|
+
None, "--verbose", help="Enables full output."),
|
|
73
|
+
config_file: str = typer.Option(
|
|
74
|
+
None, "--config_file", "-c",
|
|
75
|
+
help="Bigeye CLI Configuration File Path", envvar='BIGEYE_API_CONFIG_FILE'),
|
|
76
|
+
workspace: str = typer.Option(
|
|
77
|
+
'DEFAULT', "--workspace", "-w",
|
|
78
|
+
help="Name of the workspace configuration.", envvar='BIGEYE_WORKSPACE')
|
|
48
79
|
):
|
|
80
|
+
_check_cli_and_sdk_versions(config_file, workspace)
|
|
81
|
+
|
|
49
82
|
if version:
|
|
50
83
|
typer.echo(f'Bigeye CLI Version: {bigeye_cli_version.version}\n'
|
|
51
84
|
f'Bigeye SDK Version: {bigeye_sdk_version.version}')
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import Optional, List
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
|
|
7
|
+
from bigeye_cli.functions import cli_client_factory
|
|
8
|
+
from bigeye_cli import global_options
|
|
9
|
+
from bigeye_cli.bigconfig import bigconfig_options
|
|
10
|
+
from bigeye_cli.model.github_report import GitHubReport
|
|
11
|
+
from bigeye_sdk.controller.metric_controller import MetricController
|
|
12
|
+
from bigeye_sdk.controller.metric_suite_controller import MetricSuiteController
|
|
13
|
+
from bigeye_sdk.generated.com.bigeye.models.generated import MetricInfoList
|
|
14
|
+
from bigeye_sdk.model.protobuf_message_facade import SimpleCollection
|
|
15
|
+
from bigeye_sdk.log import get_logger
|
|
16
|
+
|
|
17
|
+
log = get_logger(__file__)
|
|
18
|
+
|
|
19
|
+
app = typer.Typer(no_args_is_help=True, help="Bigconfig Commands for Bigeye CLI")
|
|
20
|
+
|
|
21
|
+
"""
|
|
22
|
+
File should contain commands relating to deploying Bigconfig files.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@app.command()
|
|
27
|
+
def plan(
|
|
28
|
+
bigeye_conf: str = global_options.bigeye_conf,
|
|
29
|
+
config_file: str = global_options.config_file,
|
|
30
|
+
workspace: str = global_options.workspace,
|
|
31
|
+
input_path: Optional[List[str]] = bigconfig_options.input_path,
|
|
32
|
+
output_path: str = bigconfig_options.output_path,
|
|
33
|
+
purge_source_names: Optional[List[str]] = bigconfig_options.purge_source_names,
|
|
34
|
+
purge_all_sources: bool = bigconfig_options.purge_all_sources,
|
|
35
|
+
no_queue: bool = bigconfig_options.no_queue,
|
|
36
|
+
recursive: bool = bigconfig_options.recursive,
|
|
37
|
+
strict_mode: bool = bigconfig_options.strict_mode,
|
|
38
|
+
cicd: bool = typer.Option(
|
|
39
|
+
False,
|
|
40
|
+
"--cicd_report",
|
|
41
|
+
"-cicd",
|
|
42
|
+
help="Add the report to a pull request. (Github only)",
|
|
43
|
+
),
|
|
44
|
+
):
|
|
45
|
+
"""Executes a plan for purging sources or processing bigconfig files in the input path/current
|
|
46
|
+
working directory."""
|
|
47
|
+
|
|
48
|
+
client = cli_client_factory(bigeye_conf, config_file, workspace)
|
|
49
|
+
mc = MetricSuiteController(client=client)
|
|
50
|
+
|
|
51
|
+
# Resolve args to first true or first non None values
|
|
52
|
+
if not input_path:
|
|
53
|
+
input_path = client.config.bigconfig_input_path or [Path.cwd()]
|
|
54
|
+
if not output_path:
|
|
55
|
+
output_path = client.config.bigconfig_output_path or Path.cwd()
|
|
56
|
+
strict_mode = strict_mode or client.config.bigconfig_strict_mode
|
|
57
|
+
|
|
58
|
+
if purge_source_names or purge_all_sources:
|
|
59
|
+
report = mc.execute_purge(
|
|
60
|
+
purge_source_names=purge_source_names,
|
|
61
|
+
purge_all_sources=purge_all_sources,
|
|
62
|
+
output_path=output_path,
|
|
63
|
+
apply=False,
|
|
64
|
+
)
|
|
65
|
+
else:
|
|
66
|
+
report = mc.execute_bigconfig(
|
|
67
|
+
input_path=input_path,
|
|
68
|
+
output_path=output_path,
|
|
69
|
+
apply=False,
|
|
70
|
+
recursive=recursive,
|
|
71
|
+
no_queue=no_queue,
|
|
72
|
+
strict_mode=strict_mode,
|
|
73
|
+
)
|
|
74
|
+
if cicd:
|
|
75
|
+
gh_report = GitHubReport(github_token=os.environ["GITHUB_TOKEN"])
|
|
76
|
+
gh_report.publish_bigconfig_plan(plan=report)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
@app.command()
|
|
80
|
+
def apply(
|
|
81
|
+
bigeye_conf: str = global_options.bigeye_conf,
|
|
82
|
+
config_file: str = global_options.config_file,
|
|
83
|
+
workspace: str = global_options.workspace,
|
|
84
|
+
input_path: Optional[List[str]] = bigconfig_options.input_path,
|
|
85
|
+
output_path: str = bigconfig_options.output_path,
|
|
86
|
+
purge_source_names: Optional[List[str]] = bigconfig_options.purge_source_names,
|
|
87
|
+
purge_all_sources: bool = bigconfig_options.purge_all_sources,
|
|
88
|
+
no_queue: bool = bigconfig_options.no_queue,
|
|
89
|
+
recursive: bool = bigconfig_options.recursive,
|
|
90
|
+
strict_mode: bool = bigconfig_options.strict_mode,
|
|
91
|
+
auto_approve: bool = bigconfig_options.auto_approve,
|
|
92
|
+
):
|
|
93
|
+
"""Applies a purge of deployed metrics or applies Bigconfig files from the input path/current working directory to
|
|
94
|
+
the Bigeye workspace."""
|
|
95
|
+
|
|
96
|
+
client = cli_client_factory(bigeye_conf, config_file, workspace)
|
|
97
|
+
mc = MetricSuiteController(client=client)
|
|
98
|
+
|
|
99
|
+
# Resolve args to first true or first non None values
|
|
100
|
+
if not input_path:
|
|
101
|
+
input_path = client.config.bigconfig_input_path or [Path.cwd()]
|
|
102
|
+
if not output_path:
|
|
103
|
+
output_path = client.config.bigconfig_output_path or Path.cwd()
|
|
104
|
+
strict_mode = strict_mode or client.config.bigconfig_strict_mode
|
|
105
|
+
auto_approve = auto_approve or client.config.bigconfig_auto_approve
|
|
106
|
+
|
|
107
|
+
if purge_source_names or purge_all_sources:
|
|
108
|
+
mc.execute_purge(
|
|
109
|
+
purge_source_names=purge_source_names,
|
|
110
|
+
purge_all_sources=purge_all_sources,
|
|
111
|
+
output_path=output_path,
|
|
112
|
+
apply=True,
|
|
113
|
+
)
|
|
114
|
+
else:
|
|
115
|
+
mc.execute_bigconfig(
|
|
116
|
+
input_path=input_path,
|
|
117
|
+
output_path=output_path,
|
|
118
|
+
apply=True,
|
|
119
|
+
no_queue=no_queue,
|
|
120
|
+
recursive=recursive,
|
|
121
|
+
strict_mode=strict_mode,
|
|
122
|
+
auto_approve=auto_approve,
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
@app.command()
|
|
127
|
+
def export(
|
|
128
|
+
bigeye_conf: str = global_options.bigeye_conf,
|
|
129
|
+
config_file: str = global_options.config_file,
|
|
130
|
+
workspace: str = global_options.workspace,
|
|
131
|
+
output_path: str = bigconfig_options.output_path,
|
|
132
|
+
collection_id: int = typer.Option(
|
|
133
|
+
None, "--collection_id", "-cid", help="Collection ID of metrics to be exported."
|
|
134
|
+
),
|
|
135
|
+
table_id: int = typer.Option(
|
|
136
|
+
None, "--table_id", "-tid", help="Table ID of metrics to be exported."
|
|
137
|
+
),
|
|
138
|
+
metric_ids: List[int] = typer.Option(
|
|
139
|
+
None, "--metric_id", "-mid", help="Metric ID of metrics to be exported."
|
|
140
|
+
),
|
|
141
|
+
):
|
|
142
|
+
"""Exports existing metrics into a valid Bigconfig file."""
|
|
143
|
+
|
|
144
|
+
client = cli_client_factory(bigeye_conf, config_file, workspace)
|
|
145
|
+
mc = MetricController(client=client)
|
|
146
|
+
collection: SimpleCollection = SimpleCollection(
|
|
147
|
+
name="Sample", description="SDK Generated"
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
# Require at least 1 option to be specified
|
|
151
|
+
if not collection_id and not table_id and not metric_ids:
|
|
152
|
+
raise typer.BadParameter(
|
|
153
|
+
"At least 1 option must be provided for bigconfig export. Please provide the "
|
|
154
|
+
"collection id (-cid), table id (-tid), or list of metric ids (-mid). "
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
# Get existing collection if passed
|
|
158
|
+
if collection_id:
|
|
159
|
+
collection: SimpleCollection = SimpleCollection.from_datawatch_object(
|
|
160
|
+
client.get_collection(collection_id=collection_id).collection
|
|
161
|
+
)
|
|
162
|
+
metric_ids.extend(collection.metric_ids)
|
|
163
|
+
|
|
164
|
+
# Get metrics from table if passed
|
|
165
|
+
if table_id:
|
|
166
|
+
metrics_from_table = client.get_metric_info_batch_post(
|
|
167
|
+
table_ids=[table_id]
|
|
168
|
+
).metrics
|
|
169
|
+
metric_ids.extend([m.metric_configuration.id for m in metrics_from_table])
|
|
170
|
+
if not metrics_from_table:
|
|
171
|
+
raise typer.BadParameter(
|
|
172
|
+
f"No metrics found for given table id. Please check arguments and try again."
|
|
173
|
+
)
|
|
174
|
+
if not collection_id:
|
|
175
|
+
collection.name = metrics_from_table[0].metric_metadata.dataset_name
|
|
176
|
+
|
|
177
|
+
# Pull metric information
|
|
178
|
+
metrics: MetricInfoList = client.get_metric_info_batch_post(metric_ids=metric_ids)
|
|
179
|
+
|
|
180
|
+
if not output_path:
|
|
181
|
+
output_path = client.config.bigconfig_output_path or Path.cwd()
|
|
182
|
+
|
|
183
|
+
if not metrics.metrics:
|
|
184
|
+
raise typer.BadParameter(
|
|
185
|
+
"No metrics found for given arguments. Please check again."
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
bigconfig = mc.metric_info_to_bigconfig(metric_info=metrics, collection=collection)
|
|
189
|
+
|
|
190
|
+
file_name = collection.name.lower().replace(" ", "_")
|
|
191
|
+
output = bigconfig.save(
|
|
192
|
+
output_path=output_path,
|
|
193
|
+
default_file_name=f"{file_name}.bigconfig",
|
|
194
|
+
custom_formatter=bigconfig.format_bigconfig_export,
|
|
195
|
+
)
|
|
196
|
+
typer.secho(
|
|
197
|
+
f"\nSample bigconfig file generated at: {output}\n", fg="green", bold=True
|
|
198
|
+
)
|