Fetches a fragment of a blob up to MAX_BLOB_FETCH_SIZE in length. Attempting
to fetch a fragment that extends beyond the boundaries of the blob will return
the amount of data from start_index until the end of the blob, which will be
a smaller size than requested. Requesting a fragment that is entirely outside
the boundaries of the blob will return an empty string. Attempting to fetch a
negative index will raise an exception.
Args
blob
A BlobInfo, BlobKey, string, or Unicode representation of
the BlobKey of the blob from which you want to fetch data.
start_index
The start index of blob data to fetch. This value must not be
negative.
end_index
The end index (inclusive) of the blob data to fetch. This value
must be greater than or equal to start_index.
rpc
Optional UserRPC object.
Returns
A UserRPC whose result will be a string as returned by fetch_data().
Raises
TypeError
If start_index or end_index are not indexes, or if blob is
not a string, BlobKey or BlobInfo.
DataIndexOutOfRangeError
If start_index is set to a value that is less
than 0 or end_index is less than start_index when calling
rpc.get_result().
BlobFetchSizeTooLargeError
If the requested blob fragment is larger than
MAX_BLOB_FETCH_SIZE when calling rpc.get_result().
BlobNotFoundError
If the blob does not exist when calling
rpc.get_result().
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-09-30 UTC."],[[["`fetch_data_async` retrieves a specified segment of data from a blob, with the segment size capped at `MAX_BLOB_FETCH_SIZE`."],["The function accepts a blob identifier (either `BlobInfo`, `BlobKey`, string, or Unicode) and `start_index` and `end_index` to define the data range to be extracted."],["The function returns a `UserRPC` object that ultimately contains the data segment, which will be a string when the result is obtained."],["Exceptions like `TypeError`, `DataIndexOutOfRangeError`, `BlobFetchSizeTooLargeError`, and `BlobNotFoundError` can be raised if arguments are incorrect or the requested operation fails."],["The end index is inclusive, meaning that the data up to the end index is fetched, so if the end index is beyond the length of the blob, the function will return the portion from the `start_index` to the end of the blob."]]],[]]