Skip to content

Commit

Permalink
Add Datahub how-to section on docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Sassi committed Aug 9, 2024
1 parent acbbba7 commit 89cd7c7
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
- [Superset](/how-tos/superset/)
- [Add a Database](/how-tos/superset/how_to_database.md)
- [Add a Data Set](/how-tos/superset/how_to_data_set.md)
- [Datahub](/how-tos/datahub/)
- [Manage datahub using CLI](/how-tos/datahub/how_to_datahub_cli.md)
- [DataOps](/how-tos/dataops/)
- [Releasing a new feature](/how-tos/dataops/releasing-new-feature)
- [Git](/how-tos/git/)
Expand Down
5 changes: 5 additions & 0 deletions docs/how-tos/datahub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# DataHub in Datacoves

These how to guides are dedicated to DataHub in Datacoves. See how to:

- Manage your DataHub instance from the VSCode terminal
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/how-tos/datahub/assets/datahub-check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/how-tos/datahub/assets/datahub-env-slug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/how-tos/datahub/assets/datahub-init.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/how-tos/datahub/assets/datahub-token.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions docs/how-tos/datahub/how_to_datahub_cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

# How to use DataHub's CLI from your VSCode terminal

Connecting to your DataHub instance via your VSCode terminal might be really helpful to perform some maintenance in your metadata, run ingestions, delete data, etc.

## Configure DataHub CLI

### DataHub host url

First of all, you need to establish a secure connection to your DataHub server.

Open a terminal on VSCode and run `DataHub init`:

![DataHub init](./assets/DataHub-init.png)

Type the DataHub host url, following this pattern: `http://{environment slug}-DataHub-DataHub-gms:8080`, the environment slug can be found next to your environment name in the header.

![Environment slug](./assets/DataHub-env-slug.png)

In this example it's `DEV123`, so the url becomes: http://dev123-DataHub-DataHub-gms:8080.

### DataHub API token

The next element you need to provide is a DataHub access token:

![DataHub token](./assets/DataHub-token.png)

1. On a new tab, navigate to Datacoves and then DataHub
2. Go to `Settings` (gear icon on the top right corner)
3. Click on the `Access Tokens` nav bar menu item

![DataHub access tokens](./assets/DataHub-access-tokens.png)

4. Click on `+ Generate new token` link, a popup window will show where you give the token a name, description and expiration date.

![DataHub new token](./assets/DataHub-new-token.png)

5. Click on create and right after you'll see the new JWT token generated.
6. Copy the token clicking on this button and don't close the window as you won’t be able to see it again.

![DataHub copy token](./assets/DataHub-copy-token.png)

7. Go back to the tab were you have VSCode terminal waiting for your input and paste the copied token. Press Enter.
8. You can validate that the connection was correctly configured by running `DataHub check server-config`:

![DataHub check](./assets/DataHub-check.png)

## Useful commands

Once you successfully configured DataHub CLI, you can run `DataHub` on the terminal and explore the different options the tool has to offer.

### Delete ingested data

Sometimes you loaded some data for testing purposes and the DataHub UI does not provide a way to delete it, you can easily achieve that by running `DataHub delete`.

The command accepts different filters, a straight-forward one is `--platform`, i.e. `DataHub delete --platform dbt`.

0 comments on commit 89cd7c7

Please sign in to comment.