docs(cli/dataset): add dataset CLI get and upsert examples (#10688)

This commit is contained in:
Aseem Bansal 2024-06-12 18:26:41 +05:30 committed by GitHub
parent 9307ec0580
commit 3ac9b72d2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 34 additions and 2 deletions

View File

@ -341,6 +341,24 @@ datahub timeline --urn "urn:li:dataset:(urn:li:dataPlatform:mysql,User.UserAccou
## Entity Specific Commands
### dataset (Dataset Entity)
The `dataset` command allows you to interact with the dataset entity.
The `get` operation can be used to read in a dataset into a yaml file.
```shell
datahub dataset get --urn "$URN" --to-file "$FILE_NAME"
```
The `upsert` operation can be used to create a new user or update an existing one.
```shell
datahub dataset upsert -f dataset.yaml
```
An example of `dataset.yaml` would look like as in [dataset.yaml](https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/examples/cli_usage/dataset/dataset.yaml).
### user (User Entity)
The `user` command allows you to interact with the User entity.
@ -351,7 +369,7 @@ For detailed information, please refer to [Creating Users and Groups with Datahu
datahub user upsert -f users.yaml
```
An example of `users.yaml` would look like the following. You can refer to the [bar.user.dhub.yaml](https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/examples/cli_usage/user/bar.user.dhub.yaml) file for the complete code.
An example of `users.yaml` would look like as in [bar.user.dhub.yaml](https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/examples/cli_usage/user/bar.user.dhub.yaml) file for the complete code.
```yaml
- id: bar@acryl.io
@ -379,7 +397,7 @@ For more information, please refer to [Creating Users and Groups with Datahub CL
datahub group upsert -f group.yaml
```
An example of `group.yaml` would look like the following. You can refer to the [foo.group.dhub.yaml](https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/examples/cli_usage/group/foo.group.dhub.yaml) file for the complete code.
An example of `group.yaml` would look like as in [foo.group.dhub.yaml](https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/examples/cli_usage/group/foo.group.dhub.yaml) file for the complete code.
```yaml
id: foogroup@acryl.io

View File

@ -0,0 +1,14 @@
urn: urn:li:dataset:(urn:li:dataPlatform:snowflake,long_tail_companions.adoption.actuating,PROD)
name: ACTUATING
schema_metadata:
fields:
- id: pk
urn: urn:li:schemaField:(urn:li:dataset:(urn:li:dataPlatform:snowflake,long_tail_companions.adoption.actuating,PROD),pk)
type: "SchemaFieldDataTypeClass({'type': NumberTypeClass({})})"
nativeDataType: NUMBER(1,0)
nullable: true
recursive: false
properties: {}
subtypes:
- Table