sdb

boto.sdb

boto.sdb.connect_to_region(region_name)
boto.sdb.regions()

Get all available regions for the SDB service.

Return type:list
Returns:A list of boto.sdb.regioninfo.RegionInfo

boto.sdb.connection

class boto.sdb.connection.ItemThread(name, domain_name, item_names)
run()
class boto.sdb.connection.SDBConnection(aws_access_key_id=None, aws_secret_access_key=None, is_secure=True, port=None, proxy=None, proxy_port=None, proxy_user=None, proxy_pass=None, debug=0, https_connection_factory=None, region=None, path='/', converter=None)
ResponseError
alias of SDBResponseError
batch_put_attributes(domain_or_name, items, replace=True)

Store attributes for multiple items in a domain.

Parameters:
  • domain_or_name (string or boto.sdb.domain.Domain object.) – Either the name of a domain or a Domain object
  • items (dict or dict-like object) – A dictionary-like object. The keys of the dictionary are the item names and the values are themselves dictionaries of attribute names/values, exactly the same as the attribute_names parameter of the scalar put_attributes call.
  • replace (bool) – Whether the attribute values passed in will replace existing values or will be added as addition values. Defaults to True.
Return type:

bool

Returns:

True if successful

build_batch_list(params, items, replace=False)
build_name_list(params, attribute_names)
build_name_value_list(params, attributes, replace=False)
create_domain(domain_name)

Create a SimpleDB domain.

Parameter:domain_name (string) – The name of the new domain
Return type:boto.sdb.domain.Domain object
Returns:The newly created domain
delete_attributes(domain_or_name, item_name, attr_names=None)

Delete attributes from a given item in a domain.

Parameters:
  • domain_or_name (string or boto.sdb.domain.Domain object.) – Either the name of a domain or a Domain object
  • item_name (string) – The name of the item whose attributes are being deleted.
  • attributes (dict, list or boto.sdb.item.Item) – Either a list containing attribute names which will cause all values associated with that attribute name to be deleted or a dict or Item containing the attribute names and keys and list of values to delete as the value. If no value is supplied, all attribute name/values for the item will be deleted.
Return type:

bool

Returns:

True if successful

delete_domain(domain_or_name)

Delete a SimpleDB domain.

Parameter:domain_or_name (string or boto.sdb.domain.Domain object.) – Either the name of a domain or a Domain object
Return type:bool
Returns:True if successful

B{Note:} This will delete the domain and all items within the domain.

domain_metadata(domain_or_name)

Get the Metadata for a SimpleDB domain.

Parameter:domain_or_name (string or boto.sdb.domain.Domain object.) – Either the name of a domain or a Domain object
Return type:boto.sdb.domain.DomainMetaData object
Returns:The newly created domain metadata object
get_all_domains(max_domains=None, next_token=None)
get_attributes(domain_or_name, item_name, attribute_names=None, item=None)

Retrieve attributes for a given item in a domain.

Parameters:
  • domain_or_name (string or boto.sdb.domain.Domain object.) – Either the name of a domain or a Domain object
  • item_name (string) – The name of the item whose attributes are being retrieved.
  • attribute_names (string or list of strings) – An attribute name or list of attribute names. This parameter is optional. If not supplied, all attributes will be retrieved for the item.
Return type:

boto.sdb.item.Item

Returns:

An Item mapping type containing the requested attribute name/values

get_domain(domain_name, validate=True)
get_domain_and_name(domain_or_name)
get_usage()

Returns the BoxUsage accumulated on this SDBConnection object.

Return type:float
Returns:The accumulated BoxUsage of all requests made on the connection.
lookup(domain_name, validate=True)

Lookup an existing SimpleDB domain

Parameter:domain_name (string) – The name of the new domain
Return type:boto.sdb.domain.Domain object or None
Returns:The Domain object or None if the domain does not exist.
print_usage()
Print the BoxUsage and approximate costs of all requests made on this connection.
put_attributes(domain_or_name, item_name, attributes, replace=True)

Store attributes for a given item in a domain.

Parameters:
  • domain_or_name (string or boto.sdb.domain.Domain object.) – Either the name of a domain or a Domain object
  • item_name (string) – The name of the item whose attributes are being stored.
  • attribute_names (dict or dict-like object) – The name/value pairs to store as attributes
  • replace (bool) – Whether the attribute values passed in will replace existing values or will be added as addition values. Defaults to True.
Return type:

bool

Returns:

True if successful

query(domain_or_name, query='', max_items=None, next_token=None)

Returns a list of item names within domain_name that match the query.

Parameters:
  • domain_or_name (string or boto.sdb.domain.Domain object.) – Either the name of a domain or a Domain object
  • query (string) – The SimpleDB query to be performed.
  • max_items (int) – The maximum number of items to return. If not supplied, the default is None which returns all items matching the query.
Return type:

ResultSet

Returns:

An iterator containing the results.

query_with_attributes(domain_or_name, query='', attr_names=None, max_items=None, next_token=None)

Returns a set of Attributes for item names within domain_name that match the query.

Parameters:
  • domain_or_name (string or boto.sdb.domain.Domain object.) – Either the name of a domain or a Domain object
  • query (string) – The SimpleDB query to be performed.
  • attr_names (list) – The name of the attributes to be returned. If no attributes are specified, all attributes will be returned.
  • max_items (int) – The maximum number of items to return. If not supplied, the default is None which returns all items matching the query.
Return type:

ResultSet

Returns:

An iterator containing the results.

select(domain_or_name, query='', next_token=None)

Returns a set of Attributes for item names within domain_name that match the query. The query must be expressed in using the SELECT style syntax rather than the original SimpleDB query language. Even though the select request does not require a domain object, a domain object must be passed into this method so the Item objects returned can point to the appropriate domain.

Parameters:
  • domain_or_name (string or boto.sdb.domain.Domain object.) – Either the name of a domain or a Domain object
  • query (string) – The SimpleDB query to be performed.
Return type:

ResultSet

Returns:

An iterator containing the results.

set_item_cls(cls)
threaded_query(domain_or_name, query='', max_items=None, next_token=None, num_threads=6)

Returns a list of fully populated items that match the query provided.

The name/value pairs for all of the matching item names are retrieved in a number of separate threads (specified by num_threads) to achieve maximum throughput. The ResultSet that is returned has an attribute called next_token that can be used to retrieve additional results for the same query.

boto.sdb.db

boto.sdb.db.blob

class boto.sdb.db.blob.Blob(value=None, file=None, id=None)

Blob object

file
next()
read()
readline()
size

boto.sdb.db.key

class boto.sdb.db.key.Key(encoded=None, obj=None)
app()
classmethod from_path(*args, **kwds)
has_id_or_name()
id()
id_or_name()
kind()
name()
parent()

boto.sdb.db.manager

boto.sdb.db.manager.get_manager(cls)

Returns the appropriate Manager class for a given Model class. It does this by looking in the boto config for a section like this:

[DB]
db_type = SimpleDB
db_user = <aws access key id>
db_passwd = <aws secret access key>
db_name = my_domain
[DB_TestBasic]
db_type = SimpleDB
db_user = <another aws access key id>
db_passwd = <another aws secret access key>
db_name = basic_domain
db_port = 1111

The values in the DB section are “generic values” that will be used if nothing more specific is found. You can also create a section for a specific Model class that gives the db info for that class. In the example above, TestBasic is a Model subclass.

boto.sdb.db.manager.pgmanager

Note

This module requires psycopg2 to be installed in the Python path.

class boto.sdb.db.manager.pgmanager.PGConverter(manager)
decode(type, value)
decode_prop(prop, value)
decode_reference(value)
encode(type, value)
encode_prop(prop, value)
encode_reference(value)
class boto.sdb.db.manager.pgmanager.PGManager(cls, db_name, db_user, db_passwd, db_host, db_port, db_table, sql_dir, enable_ssl)
commit()
create_table(mapping=None)
decode_value(prop, value)
delete_object(obj)
delete_table()
encode_value(prop, value)
end_transaction()
execute_sql(query)
get_object(cls, id)
get_object_from_id(id)
get_property(prop, obj, name)
lookup(cls, name, value)
query(cls, filters, limit=None, order_by=None)
query_sql(query, vars=None)
rollback()
save_object(obj)
set_property(prop, obj, name, value)
start_transaction()

boto.sdb.db.manager.sdbmanager

class boto.sdb.db.manager.sdbmanager.SDBConverter(manager)

Responsible for converting base Python types to format compatible with underlying database. For SimpleDB, that means everything needs to be converted to a string when stored in SimpleDB and from a string when retrieved.

To convert a value, pass it to the encode or decode method. The encode method will take a Python native value and convert to DB format. The decode method will take a DB format value and convert it to Python native format. To find the appropriate method to call, the generic encode/decode methods will look for the type-specific method by searching for a method called “encode_<type name>” or “decode_<type name>”.

decode(item_type, value)
decode_blob(value)
decode_bool(value)
decode_datetime(value)
decode_float(value)
decode_int(value)
decode_list(prop, value)
decode_long(value)
decode_map(prop, value)
decode_prop(prop, value)
decode_reference(value)
encode(item_type, value)
encode_blob(value)
encode_bool(value)
encode_datetime(value)
encode_float(value)
See http://tools.ietf.org/html/draft-wood-ldapext-float-00.
encode_int(value)
encode_list(prop, value)
encode_long(value)
encode_map(prop, value)
encode_prop(prop, value)
encode_reference(value)
class boto.sdb.db.manager.sdbmanager.SDBManager(cls, db_name, db_user, db_passwd, db_host, db_port, db_table, ddl_dir, enable_ssl)
count(cls, filters)
Get the number of results that would be returned in this query
decode_value(prop, value)
delete_key_value(obj, name)
delete_object(obj)
encode_value(prop, value)
get_blob_bucket(bucket_name=None)
get_key_value(obj, name)
get_object(cls, id, a=None)
get_object_from_id(id)
get_property(prop, obj, name)
get_raw_item(obj)
get_s3_connection()
load_object(obj)
query(query)
query_gql(query_string, *args, **kwds)
save_object(obj)
set_key_value(obj, name, value)
set_property(prop, obj, name, value)

boto.sdb.db.manager.xmlmanager

class boto.sdb.db.manager.xmlmanager.XMLConverter(manager)

Responsible for converting base Python types to format compatible with underlying database. For SimpleDB, that means everything needs to be converted to a string when stored in SimpleDB and from a string when retrieved.

To convert a value, pass it to the encode or decode method. The encode method will take a Python native value and convert to DB format. The decode method will take a DB format value and convert it to Python native format. To find the appropriate method to call, the generic encode/decode methods will look for the type-specific method by searching for a method called “encode_<type name>” or “decode_<type name>”.

decode(item_type, value)
decode_bool(value)
decode_datetime(value)
decode_int(value)
decode_long(value)
decode_password(value)
decode_prop(prop, value)
decode_reference(value)
encode(item_type, value)
encode_bool(value)
encode_datetime(value)
encode_int(value)
encode_long(value)
encode_password(value)
encode_prop(prop, value)
encode_reference(value)
get_text_value(parent_node)
class boto.sdb.db.manager.xmlmanager.XMLManager(cls, db_name, db_user, db_passwd, db_host, db_port, db_table, ddl_dir, enable_ssl)
decode_value(prop, value)
delete_key_value(obj, name)
delete_object(obj)
encode_value(prop, value)
get_doc()
get_key_value(obj, name)
get_list(prop_node, item_type)
get_object(cls, id)
get_object_from_doc(cls, id, doc)
get_property(prop, obj, name)
get_props_from_doc(cls, id, doc)
Pull out the properties from this document Returns the class, the properties in a hash, and the id if provided as a tuple :return: (cls, props, id)
get_raw_item(obj)
get_s3_connection()
load_object(obj)
marshal_object(obj, doc=None)
new_doc()
query(cls, filters, limit=None, order_by=None)
query_gql(query_string, *args, **kwds)
reset()
save_list(doc, items, prop_node)
save_object(obj)
Marshal the object and do a PUT
set_key_value(obj, name, value)
set_property(prop, obj, name, value)
unmarshal_object(fp, cls=None, id=None)
unmarshal_props(fp, cls=None, id=None)
Same as unmarshalling an object, except it returns from “get_props_from_doc”

boto.sdb.db.model

class boto.sdb.db.model.Expando(id=None, **kw)
class boto.sdb.db.model.Model(id=None, **kw)
classmethod all(limit=None, next_token=None)
delete()
classmethod find(limit=None, next_token=None, **params)
classmethod find_property(prop_name)
classmethod from_xml(fp)
classmethod get_by_id(ids=None, parent=None)
classmethod get_by_ids(ids=None, parent=None)
classmethod get_by_key_name(key_names, parent=None)
classmethod get_lineage()
classmethod get_or_insert(key_name, **kw)
classmethod get_xmlmanager()
key()
classmethod kind()
load()
classmethod lookup(name, value)
classmethod properties(hidden=True)
put()
save()
set_manager(manager)
to_dict()
to_xml(doc=None)
class boto.sdb.db.model.ModelMeta(name, bases, dict)
Metaclass for all Models

boto.sdb.db.property

class boto.sdb.db.property.BlobProperty(verbose_name=None, name=None, default=None, required=False, validator=None, choices=None, unique=False)
data_type
alias of Blob
class boto.sdb.db.property.BooleanProperty(verbose_name=None, name=None, default=False, required=False, validator=None, choices=None, unique=False)
data_type
alias of bool
empty(value)
class boto.sdb.db.property.CalculatedProperty(verbose_name=None, name=None, default=None, required=False, validator=None, choices=None, calculated_type=<type 'int'>, unique=False, use_method=False)
get_value_for_datastore(model_instance)
class boto.sdb.db.property.DateTimeProperty(verbose_name=None, auto_now=False, auto_now_add=False, name=None, default=None, required=False, validator=None, choices=None, unique=False)
data_type
alias of datetime
default_value()
get_value_for_datastore(model_instance)
now()
validate(value)
class boto.sdb.db.property.FloatProperty(verbose_name=None, name=None, default=0.0, required=False, validator=None, choices=None, unique=False)
data_type
alias of float
empty(value)
validate(value)
class boto.sdb.db.property.IntegerProperty(verbose_name=None, name=None, default=0, required=False, validator=None, choices=None, unique=False, max=2147483647, min=-2147483648)
data_type
alias of int
empty(value)
validate(value)
class boto.sdb.db.property.ListProperty(item_type, verbose_name=None, name=None, default=None, **kwds)
data_type
alias of list
default_value()
empty(value)
validate(value)
class boto.sdb.db.property.LongProperty(verbose_name=None, name=None, default=0, required=False, validator=None, choices=None, unique=False)
data_type
alias of long
empty(value)
validate(value)
class boto.sdb.db.property.MapProperty(item_type=<type 'str'>, verbose_name=None, name=None, default=None, **kwds)
data_type
alias of dict
default_value()
empty(value)
validate(value)
class boto.sdb.db.property.PasswordProperty(verbose_name=None, name=None, default='', required=False, validator=None, choices=None, unique=False)

Hashed property who’s original value can not be retrieved, but still can be compaired.

data_type
alias of Password
get_value_for_datastore(model_instance)
make_value_from_datastore(value)
validate(value)
class boto.sdb.db.property.Property(verbose_name=None, name=None, default=None, required=False, validator=None, choices=None, unique=False)
data_type
alias of str
default_validator(value)
default_value()
empty(value)
get_choices()
get_value_for_datastore(model_instance)
make_value_from_datastore(value)
validate(value)
class boto.sdb.db.property.ReferenceProperty(reference_class=None, collection_name=None, verbose_name=None, name=None, default=None, required=False, validator=None, choices=None, unique=False)
check_instance(value)
check_uuid(value)
data_type
alias of Key
validate(value)
class boto.sdb.db.property.S3KeyProperty(verbose_name=None, name=None, default=None, required=False, validator=None, choices=None, unique=False)
data_type
alias of Key
get_value_for_datastore(model_instance)
validate(value)
class boto.sdb.db.property.StringProperty(verbose_name=None, name=None, default='', required=False, validator=<function validate_string at 0x2205a30>, choices=None, unique=False)
class boto.sdb.db.property.TextProperty(verbose_name=None, name=None, default='', required=False, validator=None, choices=None, unique=False, max_length=None)
validate(value)
boto.sdb.db.property.validate_string(value)

boto.sdb.db.query

class boto.sdb.db.query.Query(model_class, limit=None, next_token=None, manager=None)
count()
fetch(limit, offset=0)
filter(property_operator, value)
get_next_token()
next()
next_token
order(key)
set_next_token(token)
to_xml(doc=None)

boto.sdb.domain

Represents an SDB Domain

class boto.sdb.domain.Domain(connection=None, name=None)
batch_put_attributes(items, replace=True)

Store attributes for multiple items.

Parameters:
  • items (dict or dict-like object) – A dictionary-like object. The keys of the dictionary are the item names and the values are themselves dictionaries of attribute names/values, exactly the same as the attribute_names parameter of the scalar put_attributes call.
  • replace (bool) – Whether the attribute values passed in will replace existing values or will be added as addition values. Defaults to True.
Return type:

bool

Returns:

True if successful

delete_attributes(item_name, attributes=None)

Delete attributes from a given item.

Parameters:
  • item_name (string) – The name of the item whose attributes are being deleted.
  • attributes (dict, list or boto.sdb.item.Item) – Either a list containing attribute names which will cause all values associated with that attribute name to be deleted or a dict or Item containing the attribute names and keys and list of values to delete as the value. If no value is supplied, all attribute name/values for the item will be deleted.
Return type:

bool

Returns:

True if successful

delete_item(item)
endElement(name, value, connection)
from_xml(doc)
Load this domain based on an XML document
get_attributes(item_name, attribute_name=None, item=None)

Retrieve attributes for a given item.

Parameters:
  • item_name (string) – The name of the item whose attributes are being retrieved.
  • attribute_names (string or list of strings) – An attribute name or list of attribute names. This parameter is optional. If not supplied, all attributes will be retrieved for the item.
Return type:

boto.sdb.item.Item

Returns:

An Item mapping type containing the requested attribute name/values

get_item(item_name)
get_metadata()
new_item(item_name)
put_attributes(item_name, attributes, replace=True)

Store attributes for a given item.

Parameters:
  • item_name (string) – The name of the item whose attributes are being stored.
  • attribute_names (dict or dict-like object) – The name/value pairs to store as attributes
  • replace (bool) – Whether the attribute values passed in will replace existing values or will be added as addition values. Defaults to True.
Return type:

bool

Returns:

True if successful

query(query='', max_items=None, attr_names=None)

Returns a list of items within domain that match the query.

Parameters:
  • query (string) – The SimpleDB query to be performed.
  • max_items (int) – The maximum number of items to return. If not supplied, the default is None which returns all items matching the query.
  • attr_names (list) – Either None, meaning return all attributes or a list of attribute names which means to return only those attributes.
Return type:

iter

Returns:

An iterator containing the results. This is actually a generator function that will iterate across all search results, not just the first page.

select(query='', next_token=None, max_items=None)

Returns a set of Attributes for item names within domain_name that match the query. The query must be expressed in using the SELECT style syntax rather than the original SimpleDB query language.

Parameters:
  • query (string) – The SimpleDB query to be performed.
  • max_items (int) – The maximum number of items to return.
Return type:

iter

Returns:

An iterator containing the results. This is actually a generator function that will iterate across all search results, not just the first page.

startElement(name, attrs, connection)
to_xml(f=None)

Get this domain as an XML DOM Document :param f: Optional File to dump directly to :type f: File or Stream

Returns:File object where the XML has been dumped to
Return type:file
class boto.sdb.domain.DomainDumpParser(domain)

SAX parser for a domain that has been dumped

characters(ch)
endElement(name)
startElement(name, attrs)
class boto.sdb.domain.DomainMetaData(domain=None)
endElement(name, value, connection)
startElement(name, attrs, connection)
class boto.sdb.domain.UploaderThread(domain)

Uploader Thread

run()

boto.sdb.item

Represents an SDB Item

class boto.sdb.item.Item(domain, name='', active=False)
add_value(key, value)
decode_value(value)
delete()
endElement(name, value, connection)
load()
save(replace=True)
startElement(name, attrs, connection)

boto.sdb.persist

class boto.sdb.persist.Manager(domain_name=None, aws_access_key_id=None, aws_secret_access_key=None, debug=0)
get_s3_connection()
boto.sdb.persist.get_domain()
boto.sdb.persist.get_manager(domain_name=None, aws_access_key_id=None, aws_secret_access_key=None, debug=0)
boto.sdb.persist.object_lister(cls, query_lister, manager)
boto.sdb.persist.revive_object_from_id(id, manager)
boto.sdb.persist.set_domain(domain_name)

boto.sdb.persist.checker

class boto.sdb.persist.checker.BooleanChecker(**params)
check(value)
from_string(str_value, obj)
to_string(value)
class boto.sdb.persist.checker.DateTimeChecker(**params)
check(value)
from_string(str_value, obj)
to_string(value)
class boto.sdb.persist.checker.IntegerChecker(**params)
check(value)
from_string(str_value, obj)
to_string(value)
class boto.sdb.persist.checker.ObjectChecker(**params)
check(value)
from_string(str_value, obj)
to_string(value)
class boto.sdb.persist.checker.PasswordChecker(**params)
check(value)
class boto.sdb.persist.checker.S3BucketChecker(**params)
check(value)
from_string(str_value, obj)
to_string(value)
class boto.sdb.persist.checker.S3KeyChecker(**params)
check(value)
from_string(str_value, obj)
to_string(value)
class boto.sdb.persist.checker.StringChecker(**params)
check(value)
from_string(str_value, obj)
to_string(value)
class boto.sdb.persist.checker.ValueChecker
check(value)

Checks a value to see if it is of the right type.

Should raise a TypeError exception if an in appropriate value is passed in.

from_string(str_value, obj)

Takes a string as input and returns the type-specific value represented by that string.

Should raise a ValueError if the value cannot be converted to the appropriate type.

to_string(value)

Convert a value to it’s string representation.

Should raise a ValueError if the value cannot be converted to a string representation.

boto.sdb.persist.object

class boto.sdb.persist.object.SDBBase(name, bases, dict)
Metaclass for all SDBObjects
class boto.sdb.persist.object.SDBObject(id=None, manager=None)
delete()
classmethod find(**params)
classmethod find_properties()
classmethod get(id=None, **params)
classmethod get_lineage()
classmethod list(max_items=None, manager=None)
classmethod properties()
save()

boto.sdb.persist.property

class boto.sdb.persist.property.BooleanListProperty(**params)
class boto.sdb.persist.property.BooleanProperty(**params)
class boto.sdb.persist.property.DateTimeProperty(**params)
class boto.sdb.persist.property.HasManyProperty(checker_class, **params)
set_name(name)
class boto.sdb.persist.property.IntegerListProperty(**params)
class boto.sdb.persist.property.IntegerProperty(**params)
class boto.sdb.persist.property.LargeIntegerListProperty(**params)
class boto.sdb.persist.property.LargeIntegerProperty(**params)
class boto.sdb.persist.property.LargePositiveIntegerListProperty(**params)
class boto.sdb.persist.property.LargePositiveIntegerProperty(**params)
class boto.sdb.persist.property.MultiValue(property, obj, _list)

Special Multi Value for boto persistence layer to allow us to do obj.list.append(foo)

append(value)
index(value)
remove(value)
class boto.sdb.persist.property.MultiValueProperty(checker_class, **params)
load(obj)
to_string(obj)
class boto.sdb.persist.property.ObjectListProperty(**params)
class boto.sdb.persist.property.ObjectProperty(**params)
class boto.sdb.persist.property.PasswordProperty(**params)
Hashed password
class boto.sdb.persist.property.PositiveIntegerListProperty(**params)
class boto.sdb.persist.property.PositiveIntegerProperty(**params)
class boto.sdb.persist.property.Property(checker_class, **params)
set_name(name)
class boto.sdb.persist.property.S3BucketProperty(**params)
class boto.sdb.persist.property.S3KeyProperty(**params)
class boto.sdb.persist.property.ScalarProperty(checker_class, **params)
load(obj)
save(obj)
to_string(obj)
class boto.sdb.persist.property.SmallIntegerListProperty(**params)
class boto.sdb.persist.property.SmallIntegerProperty(**params)
class boto.sdb.persist.property.SmallPositiveIntegerListProperty(**params)
class boto.sdb.persist.property.SmallPositiveIntegerProperty(**params)
class boto.sdb.persist.property.StringListProperty(**params)
class boto.sdb.persist.property.StringProperty(**params)

boto.sdb.queryresultset

class boto.sdb.queryresultset.QueryResultSet(domain=None, query='', max_items=None, attr_names=None)
class boto.sdb.queryresultset.SelectResultSet(domain=None, query='', max_items=None, next_token=None)
next()
boto.sdb.queryresultset.query_lister(domain, query='', max_items=None, attr_names=None)
boto.sdb.queryresultset.select_lister(domain, query='', max_items=None)