Class WorkspaceAPI
- java.lang.Object
-
- com.databricks.sdk.service.workspace.WorkspaceAPI
-
@Generated public class WorkspaceAPI extends Object
The Workspace API allows you to list, import, export, and delete notebooks and folders.A notebook is a web-based interface to a document that contains runnable code, visualizations, and explanatory text.
-
-
Constructor Summary
Constructors Constructor Description WorkspaceAPI(ApiClient apiClient)
Regular-use constructorWorkspaceAPI(WorkspaceService mock)
Constructor for mocks
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(Delete request)
Delete a workspace object.void
delete(String path)
ExportResponse
export(ExportRequest request)
Export a workspace object.ExportResponse
export(String path)
ObjectInfo
getStatus(GetStatusRequest request)
Get status.ObjectInfo
getStatus(String path)
WorkspaceService
impl()
void
importContent(Import request)
Import a workspace object.void
importContent(String path)
Iterable<ObjectInfo>
list(ListWorkspaceRequest request)
List contents.Iterable<ObjectInfo>
list(String path)
void
mkdirs(Mkdirs request)
Create a directory.void
mkdirs(String path)
-
-
-
Constructor Detail
-
WorkspaceAPI
public WorkspaceAPI(ApiClient apiClient)
Regular-use constructor
-
WorkspaceAPI
public WorkspaceAPI(WorkspaceService mock)
Constructor for mocks
-
-
Method Detail
-
delete
public void delete(String path)
-
delete
public void delete(Delete request)
Delete a workspace object.Deletes an object or a directory (and optionally recursively deletes all objects in the directory). * If `path` does not exist, this call returns an error `RESOURCE_DOES_NOT_EXIST`. * If `path` is a non-empty directory and `recursive` is set to `false`, this call returns an error `DIRECTORY_NOT_EMPTY`.
Object deletion cannot be undone and deleting a directory recursively is not atomic.
-
export
public ExportResponse export(String path)
-
export
public ExportResponse export(ExportRequest request)
Export a workspace object.Exports an object or the contents of an entire directory.
If `path` does not exist, this call returns an error `RESOURCE_DOES_NOT_EXIST`.
One can only export a directory in `DBC` format. If the exported data would exceed size limit, this call returns `MAX_NOTEBOOK_SIZE_EXCEEDED`. Currently, this API does not support exporting a library.
-
getStatus
public ObjectInfo getStatus(String path)
-
getStatus
public ObjectInfo getStatus(GetStatusRequest request)
Get status.Gets the status of an object or a directory. If `path` does not exist, this call returns an error `RESOURCE_DOES_NOT_EXIST`.
-
importContent
public void importContent(String path)
-
importContent
public void importContent(Import request)
Import a workspace object.Imports a workspace object (for example, a notebook or file) or the contents of an entire directory. If `path` already exists and `overwrite` is set to `false`, this call returns an error `RESOURCE_ALREADY_EXISTS`. One can only use `DBC` format to import a directory.
-
list
public Iterable<ObjectInfo> list(String path)
-
list
public Iterable<ObjectInfo> list(ListWorkspaceRequest request)
List contents.Lists the contents of a directory, or the object if it is not a directory.If the input path does not exist, this call returns an error `RESOURCE_DOES_NOT_EXIST`.
-
mkdirs
public void mkdirs(String path)
-
mkdirs
public void mkdirs(Mkdirs request)
Create a directory.Creates the specified directory (and necessary parent directories if they do not exist). If there is an object (not a directory) at any prefix of the input path, this call returns an error `RESOURCE_ALREADY_EXISTS`.
Note that if this operation fails it may have succeeded in creating some of the necessary parrent directories.
-
impl
public WorkspaceService impl()
-
-