diff --git a/docs/cli.md b/docs/cli.md index 32036a11df..ca660f209e 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -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 diff --git a/metadata-ingestion/examples/cli_usage/dataset/dataset.yaml b/metadata-ingestion/examples/cli_usage/dataset/dataset.yaml new file mode 100644 index 0000000000..e4643b3188 --- /dev/null +++ b/metadata-ingestion/examples/cli_usage/dataset/dataset.yaml @@ -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 +