fix(cli): don't use env for container, add example (#5012)

This commit is contained in:
Aseem Bansal 2022-05-29 20:56:45 +05:30 committed by GitHub
parent 3c82f77a6c
commit 1fd5549ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -61,6 +61,11 @@ _Note: All these commands below support the soft-delete option (`-s/--soft`) as
datahub delete --env DEV --entity_type dataset
```
### Delete all containers for a particular platform
```
datahub delete --entity_type container --platform s3
```
### Delete all Pipelines and Tasks in the DEV environment
```
datahub delete --env DEV --entity_type "datajob"

View File

@ -352,9 +352,9 @@ def get_urns_by_filter(
endpoint: str = "/entities?action=search"
url = gms_host + endpoint
filter_criteria = []
if env:
filter_criteria.append({"field": "origin", "value": env, "condition": "EQUAL"})
entity_type_lower = entity_type.lower()
if env and entity_type_lower != "container":
filter_criteria.append({"field": "origin", "value": env, "condition": "EQUAL"})
if (
platform is not None
and entity_type_lower == "dataset"