File Management¶
These dataclasses are used in the SDK to represent API requests and responses for services in the databricks.sdk.service.files module.
- class databricks.sdk.service.files.AddBlockResponse¶
- as_dict() dict¶
Serializes the AddBlockResponse into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the AddBlockResponse into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) AddBlockResponse¶
Deserializes the AddBlockResponse from a dictionary.
- class databricks.sdk.service.files.CloseResponse¶
- as_dict() dict¶
Serializes the CloseResponse into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the CloseResponse into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) CloseResponse¶
Deserializes the CloseResponse from a dictionary.
- class databricks.sdk.service.files.CreateResponse(handle: 'Optional[int]' = None)¶
- handle: int | None = None¶
Handle which should subsequently be passed into the AddBlock and Close calls when writing to a file through a stream.
- as_dict() dict¶
Serializes the CreateResponse into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the CreateResponse into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) CreateResponse¶
Deserializes the CreateResponse from a dictionary.
- class databricks.sdk.service.files.DeleteResponse¶
- as_dict() dict¶
Serializes the DeleteResponse into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the DeleteResponse into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) DeleteResponse¶
Deserializes the DeleteResponse from a dictionary.
- class databricks.sdk.service.files.DirectoryEntry(file_size: 'Optional[int]' = None, is_directory: 'Optional[bool]' = None, last_modified: 'Optional[int]' = None, name: 'Optional[str]' = None, path: 'Optional[str]' = None)¶
- file_size: int | None = None¶
The length of the file in bytes. This field is omitted for directories.
- is_directory: bool | None = None¶
True if the path is a directory.
- last_modified: int | None = None¶
Last modification time of given file in milliseconds since unix epoch.
- name: str | None = None¶
The name of the file or directory. This is the last component of the path.
- path: str | None = None¶
The absolute path of the file or directory.
- as_dict() dict¶
Serializes the DirectoryEntry into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the DirectoryEntry into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) DirectoryEntry¶
Deserializes the DirectoryEntry from a dictionary.
- class databricks.sdk.service.files.DownloadResponse(content_length: 'Optional[int]' = None, content_type: 'Optional[str]' = None, contents: 'Optional[BinaryIO]' = None, last_modified: 'Optional[str]' = None)¶
- content_length: int | None = None¶
The length of the HTTP response body in bytes.
- content_type: str | None = None¶
- contents: BinaryIO | None = None¶
- last_modified: str | None = None¶
The last modified time of the file in HTTP-date (RFC 7231) format.
- as_dict() dict¶
Serializes the DownloadResponse into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the DownloadResponse into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) DownloadResponse¶
Deserializes the DownloadResponse from a dictionary.
- class databricks.sdk.service.files.FileInfo(file_size: 'Optional[int]' = None, is_dir: 'Optional[bool]' = None, modification_time: 'Optional[int]' = None, path: 'Optional[str]' = None)¶
- file_size: int | None = None¶
The length of the file in bytes. This field is omitted for directories.
- is_dir: bool | None = None¶
True if the path is a directory.
- modification_time: int | None = None¶
Last modification time of given file in milliseconds since epoch.
- path: str | None = None¶
The absolute path of the file or directory.
- as_dict() dict¶
Serializes the FileInfo into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the FileInfo into a shallow dictionary of its immediate attributes.
- class databricks.sdk.service.files.GetMetadataResponse(content_length: 'Optional[int]' = None, content_type: 'Optional[str]' = None, last_modified: 'Optional[str]' = None)¶
- content_length: int | None = None¶
The length of the HTTP response body in bytes.
- content_type: str | None = None¶
- last_modified: str | None = None¶
The last modified time of the file in HTTP-date (RFC 7231) format.
- as_dict() dict¶
Serializes the GetMetadataResponse into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the GetMetadataResponse into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) GetMetadataResponse¶
Deserializes the GetMetadataResponse from a dictionary.
- class databricks.sdk.service.files.ListDirectoryResponse(contents: 'Optional[List[DirectoryEntry]]' = None, next_page_token: 'Optional[str]' = None)¶
- contents: List[DirectoryEntry] | None = None¶
Array of DirectoryEntry.
- next_page_token: str | None = None¶
A token, which can be sent as page_token to retrieve the next page.
- as_dict() dict¶
Serializes the ListDirectoryResponse into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the ListDirectoryResponse into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) ListDirectoryResponse¶
Deserializes the ListDirectoryResponse from a dictionary.
- class databricks.sdk.service.files.ListStatusResponse(files: 'Optional[List[FileInfo]]' = None)¶
- files: List[FileInfo] | None = None¶
A list of FileInfo’s that describe contents of directory or file. See example above.
- as_dict() dict¶
Serializes the ListStatusResponse into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the ListStatusResponse into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) ListStatusResponse¶
Deserializes the ListStatusResponse from a dictionary.
- class databricks.sdk.service.files.MkDirsResponse¶
- as_dict() dict¶
Serializes the MkDirsResponse into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the MkDirsResponse into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) MkDirsResponse¶
Deserializes the MkDirsResponse from a dictionary.
- class databricks.sdk.service.files.MoveResponse¶
- as_dict() dict¶
Serializes the MoveResponse into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the MoveResponse into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) MoveResponse¶
Deserializes the MoveResponse from a dictionary.
- class databricks.sdk.service.files.PutResponse¶
- as_dict() dict¶
Serializes the PutResponse into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the PutResponse into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) PutResponse¶
Deserializes the PutResponse from a dictionary.
- class databricks.sdk.service.files.ReadResponse(bytes_read: 'Optional[int]' = None, data: 'Optional[str]' = None)¶
- bytes_read: int | None = None¶
The number of bytes read (could be less than
lengthif we hit end of file). This refers to number of bytes read in unencoded version (response data is base64-encoded).
- data: str | None = None¶
The base64-encoded contents of the file read.
- as_dict() dict¶
Serializes the ReadResponse into a dictionary suitable for use as a JSON request body.
- as_shallow_dict() dict¶
Serializes the ReadResponse into a shallow dictionary of its immediate attributes.
- classmethod from_dict(d: Dict[str, Any]) ReadResponse¶
Deserializes the ReadResponse from a dictionary.