01-19-2024 04:58 PM
I am trying to export a notebook or directory using /api/2.0/workspace/export.
When I run /api/2.0/workspace/list with a particular url and path, I get the results that I expect, a list of objects (notebooks and folders) at that location.
But when I run /api/2.0/workspace/export with the same url and path, I get an error 404: resource does not exist.
Why would this be?
requests.request(
method = 'GET',
url = 'https://{host}/api/2.0/workspace/list',
params = {'path' : '/Users/{user}/{folder}/'},
headers = {'Authorization' : f'Bearer {host_token}'}
)
requests.request(
method = 'GET',
url = 'https://{host}/api/2.0/workspace/export/',
params = {'path' : '/Users/{user}/{folder}/', 'format' : 'AUTO', 'direct_download' : True},
headers = {'Authorization' : f'Bearer {host_token}'}
)
01-21-2024 10:19 PM
Hi @hbs59 , Could you please try changing the export URL from :
https://{host}/api/2.0/workspace/export/
To :
https://{host}/api/2.0/workspace/export
Removing Extra '/' from the end.
01-19-2024 07:48 PM
Hi, Could you please remove the parameters , (format and direct_download) and confirm?
01-19-2024 07:56 PM
Sure, I ran the following:
requests.request(
method = 'GET',
url = 'https://{host}/api/2.0/workspace/export/',
params = {'path' : '/Users/{user}/{folder}/'},
headers = {'Authorization' : f'Bearer {host_token}'}
)
As far as I can tell, the error is the same:
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 Bad Target: GET /2.0/workspace/export/</title>
</head>
<body><h2>HTTP ERROR 404 Bad Target: GET /2.0/workspace/export/</h2>
<table>
<tr><th>URI:</th><td>/api/2.0/workspace/export/</td></tr>
<tr><th>STATUS:</th><td>404</td></tr>
<tr><th>MESSAGE:</th><td>Bad Target: GET /2.0/workspace/export/</td></tr>
<tr><th>SERVLET:</th><td>com.databricks.webapp.WebappDispatcherServletWithProxy-45f675a4</td></tr>
</table>
01-19-2024 08:31 PM
Hi, Could you please raise a support ticket with us to investigate this further? We want to run this and check in your workspace.
01-21-2024 09:31 PM
Hi, thank you for following up. I just opened a ticket for this.
01-21-2024 10:19 PM
Hi @hbs59 , Could you please try changing the export URL from :
https://{host}/api/2.0/workspace/export/
To :
https://{host}/api/2.0/workspace/export
Removing Extra '/' from the end.
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.
If there isn’t a group near you, start one and help create a community that brings people together.
Request a New Group