Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli/api): add commands to cli #45

Merged
merged 9 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,22 @@ pip install msfabricutils



### Fabric API
- Create, update, delete workspaces, lakehouses, notebooks using the Fabric REST API.
### Thin Fabric API wrapper
Intregate functions to manage workspaces, lakehouses, notebooks, environments, libraries, etc.
For more details, see the [Fabric API Reference](https://mrjsj.github.io/msfabricutils/core/fabric-api/)

### Command Line Interface
- Create, update, delete workspaces, lakehouses, notebooks using the built-in CLI.
### Fabric API as CLI
CLI for managing workspaces, lakehouses, notebooks, environments, libraries, etc.

To get started, run:
```bash
msfu --help
```

![msfu CLI help](assets/images/cli-help.png)



### Fabric DuckDB Connection
Seamless integration between DuckDB and Microsoft Fabric Lakehouses for data exploration and analysis.

Expand Down
Binary file added assets/images/cli-help.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 assets/images/cli-lakehouse-create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/core/fabric-api/capacity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Capacity

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.capacity

9 changes: 9 additions & 0 deletions docs/core/fabric-api/dashboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Dashboard

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.dashboard

9 changes: 9 additions & 0 deletions docs/core/fabric-api/data_pipeline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Data Pipeline

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.data_pipeline

9 changes: 9 additions & 0 deletions docs/core/fabric-api/datamart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Datamart

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.datamart

9 changes: 9 additions & 0 deletions docs/core/fabric-api/environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Environment

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.environment

9 changes: 9 additions & 0 deletions docs/core/fabric-api/eventhouse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Eventhouse

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.eventhouse

9 changes: 9 additions & 0 deletions docs/core/fabric-api/eventstream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Eventstream

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.eventstream

14 changes: 12 additions & 2 deletions docs/core/fabric-api/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Fabric API

A collection of functions to interact with the Fabric API. Automatically handles pagination and authentication.
The functions can either be called with an `id` or `name` parameter, however it is recommended to use the `id` as using the name requires more API requests, and is thus slower.
A collection of functions to interact with the Fabric API. I tried to mimic the API as closely as possible, however there are some differences, especially in relation to item defintions.

While the APIs with item definitions takes multiple item parts as base64 encoded strings, these wrapper functions take a path to the folder containing the item parts, e.g.

- `path/to/myReport.Report`
- `path/to/mySemanticModel.SemanticModel`
- `path/to/myNotebook.Notebook`.

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).
9 changes: 9 additions & 0 deletions docs/core/fabric-api/kql_dashboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Kql Dashboard

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.kql_dashboard

9 changes: 9 additions & 0 deletions docs/core/fabric-api/kql_database.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Kql Database

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.kql_database

9 changes: 9 additions & 0 deletions docs/core/fabric-api/kql_queryset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Kql Queryset

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.kql_queryset

8 changes: 7 additions & 1 deletion docs/core/fabric-api/lakehouse.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Lakehouse

::: msfabricutils.core.lakehouse
!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.lakehouse

9 changes: 9 additions & 0 deletions docs/core/fabric-api/long_running_operation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Long Running Operation

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.long_running_operation

9 changes: 9 additions & 0 deletions docs/core/fabric-api/mirrored_database.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Mirrored Database

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.mirrored_database

9 changes: 9 additions & 0 deletions docs/core/fabric-api/mirrored_warehouse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Mirrored Warehouse

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.mirrored_warehouse

9 changes: 9 additions & 0 deletions docs/core/fabric-api/ml_experiment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Ml Experiment

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.ml_experiment

9 changes: 9 additions & 0 deletions docs/core/fabric-api/ml_model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Ml Model

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.ml_model

8 changes: 7 additions & 1 deletion docs/core/fabric-api/notebook.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Notebook

::: msfabricutils.core.notebook
!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.notebook

9 changes: 9 additions & 0 deletions docs/core/fabric-api/paginated_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Paginated Report

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.paginated_report

9 changes: 9 additions & 0 deletions docs/core/fabric-api/reflex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Reflex

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.reflex

9 changes: 9 additions & 0 deletions docs/core/fabric-api/report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Report

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.report

9 changes: 9 additions & 0 deletions docs/core/fabric-api/semantic_model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Semantic Model

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.semantic_model

9 changes: 9 additions & 0 deletions docs/core/fabric-api/spark_job_definition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Spark Job Definition

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.spark_job_definition

10 changes: 8 additions & 2 deletions docs/core/fabric-api/sql_endpoint.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SQL Endpoint
# Sql Endpoint

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.sql_endpoint

::: msfabricutils.core.sql_endpoint
9 changes: 9 additions & 0 deletions docs/core/fabric-api/warehouse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Warehouse

!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.warehouse

8 changes: 7 additions & 1 deletion docs/core/fabric-api/workspace.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Workspace

::: msfabricutils.core.workspace
!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

::: msfabricutils.rest_api.workspace

22 changes: 7 additions & 15 deletions docs/usage/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,15 @@ The CLI is a way to interact with the Microsoft Fabric REST API. It includes com

For complete documentation, run `msfu --help`.

## Examples

### Workspace
!!! warning
The functions are not fully tested yet.
Use with caution.
Please report any issues to the [GitHub repository](https://github.com/mrjsj/msfabricutils/issues).

```bash
msfu workspace create --name "My Workspace" --description "My workspace description"
```

### Lakehouse

```bash
msfu lakehouse create --name "My Lakehouse" --workspace-id "beefbeef-beef-beef-beef-beefbeefbeef" --enable-schemas
```
## Examples

### Notebook
![msfu CLI help](/assets/images/cli-help.png)

```bash
msfu notebook create --path "path/to/notebook.Notebook" --workspace-id "beefbeef-beef-beef-beef-beefbeefbeef"
```
![msfu CLI lakehouse create](/assets/images/cli-lakehouse-create.png)

8 changes: 2 additions & 6 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ theme:
plugins:
- search:
lang: en
- include_dir_to_nav
- gen-files:
scripts:
- docs/gen_ref_pages.py
Expand Down Expand Up @@ -67,12 +68,7 @@ nav:
- API Reference:
- Core:
- core/authentication.md
- Fabric API:
- core/fabric-api/index.md
- core/fabric-api/workspace.md
- core/fabric-api/lakehouse.md
- core/fabric-api/notebook.md
- core/fabric-api/sql_endpoint.md
- Fabric API: core/fabric-api
- ETL:
- etl/index.md
- etl/read.md
Expand Down
13 changes: 13 additions & 0 deletions scripts/cli/commands/capacity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
command: capacity
subcommands:
list:
endpoint: capacities
method: get
description: List capacities for a workspace.
panel: Capacity
args:
- name: continuation-token
type: str
required: false
arg_type: query
description: A token for retrieving the next page of results.
18 changes: 18 additions & 0 deletions scripts/cli/commands/dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
command: dashboard
subcommands:
list:
endpoint: workspaces/{workspace_id}/dashboards
method: get
description: List dashboards for a workspace.
panel: Dashboard
args:
- name: workspace-id
type: str
required: true
arg_type: path
description: The id of the workspace to list dashboards for.
- name: continuation-token
type: str
required: false
arg_type: query
description: A token for retrieving the next page of results.
Loading
Loading