<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to import a Lakeview Dashboard programmatically (API or CLI)? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-import-a-lakeview-dashboard-programmatically-api-or-cli/m-p/71101#M34244</link>
    <description>&lt;P&gt;Glad you've got everything up and running!&lt;/P&gt;</description>
    <pubDate>Thu, 30 May 2024 13:23:12 GMT</pubDate>
    <dc:creator>miranda_luna_db</dc:creator>
    <dc:date>2024-05-30T13:23:12Z</dc:date>
    <item>
      <title>How to import a Lakeview Dashboard programmatically (API or CLI)?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-import-a-lakeview-dashboard-programmatically-api-or-cli/m-p/60446#M31669</link>
      <description>&lt;P&gt;I'm trying to import a Lakeview Dashboard that I've originally exported through the CLI (version 0.213.0). The exported file has extension &lt;STRONG&gt;.lvdash.json &lt;/STRONG&gt;and is a single line json file.&lt;/P&gt;&lt;P&gt;I can't get it to work, I tried this command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;databricks workspace import /Users/my@user.com/my_first_lakeview_dashboard.lvdash.json --profile prd --file dashboard.json&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I get: &lt;EM&gt;"Error: The zip file may not be valid or may be an unsupported version. Hint: Objects imported using format=SOURCE are expected to be zip encoded databricks source notebook(s) by default. Please specify a language using the --language flag if you are trying to import a single uncompressed notebook"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;There is a &lt;STRONG&gt;language&lt;/STRONG&gt; flag but the only options available are: [PYTHON, R, SCALA, SQL].&lt;/P&gt;&lt;P&gt;There is &lt;STRONG&gt;json&lt;/STRONG&gt; flag but it's only for providing the request in JSON format.&lt;/P&gt;&lt;P&gt;There is no mention of Lakeview dashboards in &lt;A href="https://docs.databricks.com/api/azure/workspace/workspace/import" target="_self"&gt;this API&lt;/A&gt;. &lt;STRONG&gt;Is this even supported?&lt;/STRONG&gt; Or do I have the syntax wrong? The &lt;A href="https://docs.databricks.com/api/workspace/lakeview/publish" target="_self"&gt;Lakeview API&lt;/A&gt; only supports &lt;STRONG&gt;publishing&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 20:50:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-import-a-lakeview-dashboard-programmatically-api-or-cli/m-p/60446#M31669</guid>
      <dc:creator>Gutek</dc:creator>
      <dc:date>2024-02-16T20:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a Lakeview Dashboard programmatically (API or CLI)?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-import-a-lakeview-dashboard-programmatically-api-or-cli/m-p/60970#M31701</link>
      <description>&lt;P&gt;Thanks for flagging. There should be enhanced API documentation specific to Lakeview in the next week or two (PR is in review). Keep an eye out for a page called "&lt;SPAN&gt;Use the Lakeview API and Workspace API to create and manage Lakeview dashboards."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Currently, there is API support for Lakeview dashboard:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Export/Import (via workspace APIs)&lt;/LI&gt;
&lt;LI&gt;List (via workspace APIs)&lt;/LI&gt;
&lt;LI&gt;Get Status (via workspace APIs)&lt;/LI&gt;
&lt;LI&gt;Publish&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Additional areas are under development.&lt;/P&gt;
&lt;P&gt;For a bit more information on Lakeview dashboard export/import via API specifically....&lt;/P&gt;
&lt;H2&gt;&lt;SPAN&gt;Exporting a dashboard&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;If we want to export the contents of mydashboard.lvdash.json, we can use the &lt;/SPAN&gt;&lt;A href="https://docs.databricks.com/api/workspace/workspace/export" target="_blank"&gt;&lt;SPAN&gt;Workspace Export API&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; to do so.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;GET /api/2.0/workspace/export

Query parameters: 
{
	"path": "/Users/my@user.com/examples/mydashboard.lvdash.json",
	"direct_download": true
}

Response:
{
	"pages": [
		{
			"name": "7db2d3cf",
			"displayName": "New Page"
		}
	]
}
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;This response shows the contents of a minimal dashboard definition which is blank.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Note that the file name without extension is what appears as the name of the dashboard in the Workspace (&lt;/SPAN&gt;&lt;STRONG&gt;mydashboard&lt;/STRONG&gt;&lt;SPAN&gt;.lvdash.json).&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;If the direct_download property is left out of the request or is set to false, the response will include the base64 encoded version of the json string. We will use this later for the import request.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;GET /api/2.0/workspace/export

Query parameters: 
{
	"path": "/Users/my@user.com/examples/mydashboard.lvdash.json",
	"direct_download": false
}

Response:
{
	"content": "eyJwYWdlcyI6W3sibmFtZSI6IjdkYjJkM2NmIiwiZGlzcGxheU5hbWUiOiJOZXcgUGFnZSJ9XX0=",
	"file_type": "lvdash.json"
}
&lt;/LI-CODE&gt;
&lt;H2&gt;&lt;SPAN&gt;Importing a dashboard&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;If we want to import another dashboard into the workspace using the same contents as mydashboard.lvdash.json, we can do so by using the Workspace Import API. For the import to be properly recognized as a Lakeview dashboard, a few important parameters must be set:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;"format": "AUTO" - this setting will allow the system to automatically detect the asset type.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;"path": needs the file path to end in ".lvdash.json". This in conjunction with the format will mean the content will attempt to import as a Lakeview dashboard.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;If these settings are not configured properly, the import might succeed but the dashboard would be treated like a normal file.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;POST /api/2.0/workspace/import

Request body parameters:
{
	"path": "/Users/my@user.com/examples/myseconddashboard.lvdash.json",
	"content": "eyJwYWdlcyI6W3sibmFtZSI6IjdkYjJkM2NmIiwiZGlzcGxheU5hbWUiOiJOZXcgUGFnZSJ9XX0=",
	"format": "AUTO"
}

Response:
{}
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;If we were to immediately issue the same API request, we would get an error:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
	"error_code": "RESOURCE_ALREADY_EXISTS",
	"message": "Path (/Users/my@user.com/examples/myseconddashboard.lvdash.json) already exists."
}
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;In order to overwrite the contents of an existing dashboard in place, the "overwrite" property can be set:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;POST /api/2.0/workspace/import

Request body parameters:
{
	"path": "/Users/my@user.com/examples/myseconddashboard.lvdash.json",
	"content": "eyJwYWdlcyI6W3sibmFtZSI6IjdkYjJkM2NmIiwiZGlzcGxheU5hbWUiOiJOZXcgUGFnZSJ9XX0=",
	"format": "AUTO",
	"overwrite": true
}

Response:
{}
&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 17 Feb 2024 23:22:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-import-a-lakeview-dashboard-programmatically-api-or-cli/m-p/60970#M31701</guid>
      <dc:creator>miranda_luna_db</dc:creator>
      <dc:date>2024-02-17T23:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a Lakeview Dashboard programmatically (API or CLI)?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-import-a-lakeview-dashboard-programmatically-api-or-cli/m-p/71057#M34232</link>
      <description>&lt;P&gt;Thanks for the very detailed response. This is a fantastic example of a detailed support response.&lt;/P&gt;&lt;P&gt;We have a problem with the import API. No matter the combination of content parameter (base64, pure JSON, json dump, str, etc.) the API always returns&lt;/P&gt;&lt;P&gt;b'{"error_code":"MALFORMED_REQUEST","message":"Invalid JSON given in the body of the request - failed to parse given JSON"}\n'&lt;/P&gt;&lt;P&gt;Here's the code we're using: iterate over all our warehouses and create a dashboard for each. The JSON dashboard file is taken straight from&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/CodyAustinDavis/dbsql_sme/blob/main/Observability%20Dashboards%20and%20DBA%20Resources/Observability%20Lakeview%20Dashboard%20Templates/DBSQL%20Warehouse%20Advisor%20Observability%20Dashboard.lvdash.json" target="_blank"&gt;https://github.com/CodyAustinDavis/dbsql_sme/blob/main/Observability%20Dashboards%20and%20DBA%20Resources/Observability%20Lakeview%20Dashboard%20Templates/DBSQL%20Warehouse%20Advisor%20Observability%20Dashboard.lvdash.json&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Has there been an update to the API to make Lakeview Dashboards work more smoothly?&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 21:04:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-import-a-lakeview-dashboard-programmatically-api-or-cli/m-p/71057#M34232</guid>
      <dc:creator>yegorski</dc:creator>
      <dc:date>2024-05-29T21:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a Lakeview Dashboard programmatically (API or CLI)?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-import-a-lakeview-dashboard-programmatically-api-or-cli/m-p/71065#M34239</link>
      <description>&lt;P&gt;Turns out the problem was between keyboard and chair! The issues was with using requests data vs json. Here's the full working code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;import base64&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;import json&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;import os&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;import requests&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;WORKSPACE_DASHBOARDS_FOLDER = "/Workspace/Engineering Metrics/SQL Warehouse Monitoring"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;with open("./dashboard_template.json", "r") as file:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;DASHBOARD_TEMPLATE = json.load(file)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;class Databricks:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;def __init__(self, API_KEY):&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;self.url = "&lt;A href="https://enigma-e2-premium.cloud.databricks.com/api/2.0" target="_blank"&gt;https://enigma-e2-premium.cloud.databricks.com/api/2.0&lt;/A&gt;"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;self.api_key = API_KEY&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;self.headers = (&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-120px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;"Accept": "application/json",&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-120px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;"Content-Type": "application/json",&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-120px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;"Authorization": f"Authorization: Bearer {self.api_key}",&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;},&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;def make_request(self, method, query, **kwargs):&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;response = requests.request(&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;method, f"{self.url}{query}", headers=self.headers[0], **kwargs&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;response.raise_for_status()&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;return response&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;def list_serverless_warehouses(self):&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;response = self.make_request("get", f"/sql/warehouses").json()["warehouses"]&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;warehouses = []&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;for warehouse in response:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;if warehouse["enable_serverless_compute"] == True:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-120px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;warehouses.append(&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-150px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-180px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;"id": warehouse["id"],&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-180px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;"name": warehouse["name"],&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-150px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-120px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;return warehouses&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;def create_dashboard(self, warehouse_id: str, warehouse_name: str):&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;dashboard_config = DASHBOARD_TEMPLATE&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;for i, v in enumerate(dashboard_config["datasets"]):&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;dashboard_config["datasets"][i]["parameters"][0]["defaultSelection"][&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;"values"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;]["values"][0]["value"] = warehouse_id&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;request_data = {&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;"path": f"{WORKSPACE_DASHBOARDS_FOLDER}/{warehouse_name}.lvdash.json",&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;"content": base64.b64encode(&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-120px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;json.dumps(dashboard_config).encode("utf-8")&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;).decode("utf-8"),&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;"format": "AUTO",&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;"overwrite": "true",&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;return self.make_request("post", f"/workspace/import", json=request_data)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;databricks = Databricks(os.getenv("DATABRICKS_TOKEN_PREMIUM"))&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;warehouses = databricks.list_serverless_warehouses()&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;for warehouse in warehouses:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;databricks.create_dashboard(warehouse["id"], warehouse["name"])&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 03:17:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-import-a-lakeview-dashboard-programmatically-api-or-cli/m-p/71065#M34239</guid>
      <dc:creator>yegorski</dc:creator>
      <dc:date>2024-05-30T03:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a Lakeview Dashboard programmatically (API or CLI)?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-import-a-lakeview-dashboard-programmatically-api-or-cli/m-p/71101#M34244</link>
      <description>&lt;P&gt;Glad you've got everything up and running!&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 13:23:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-import-a-lakeview-dashboard-programmatically-api-or-cli/m-p/71101#M34244</guid>
      <dc:creator>miranda_luna_db</dc:creator>
      <dc:date>2024-05-30T13:23:12Z</dc:date>
    </item>
  </channel>
</rss>

