Allocates a range of IDs in the datastore such that those IDs will not
be automatically assigned to new entities. You can only allocate IDs
for model keys from your app. If there is an error, raises a subclass of
datastore_errors.Error.
Either size or max must be provided but not both. If size is provided then a
range of the given size is returned. If max is provided then the largest
range of ids that are safe to use with an upper bound of max is returned (can
be an empty range).
Max should only be provided if you have an existing numeric id range that you
want to reserve, e.g. bulk loading entities that already have IDs. If you
don't care about which IDs you receive, use size instead.
Args
model_key
Key or string to serve as a model specifying the ID sequence in
which to allocate IDs
size
integer, number of IDs to allocate.
max
integer, upper bound of the range of IDs to allocate.
[[["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."],[[["The `AllocateIds` function reserves a range of numeric IDs in the datastore to prevent them from being auto-assigned to new entities, specifically for model keys within your application."],["You must provide either `size` to specify the number of IDs to allocate, or `max` to define the upper limit of the desired ID range, but not both."],["Using the `size` parameter is recommended for general ID allocation, while `max` should only be used when needing to reserve a specific existing numeric ID range."],["The function accepts a `model_key` to define the ID sequence and an optional `config` for request configuration."],["Upon successful execution, `AllocateIds` returns a tuple containing the start and end of the allocated ID range, inclusively."]]],[]]