In addition to what is seen below, boto includes an abstraction layer for SimpleDB that may be used:
Given a valid region name, return a boto.sdb.connection.SDBConnection.
Type: | str |
---|---|
Parameters: | region_name – The name of the region to connect to. |
Return type: | boto.sdb.connection.SDBConnection or None |
Returns: | A connection to the given region, or None if an invalid region name is given |
Get all available regions for the SDB service.
Return type: | list |
---|---|
Returns: | A list of boto.sdb.regioninfo.RegionInfo instances |
A threaded Item retriever utility class. Retrieved Item objects are stored in the items instance variable after run() is called.
Tip
The item retrieval will not start until the run() method is called.
Parameters: | |
---|---|
Variables: | items (list) – A list of items retrieved. Starts as empty list. |
This class serves as a gateway to your SimpleDB region (defaults to us-east-1). Methods within allow access to SimpleDB Domain objects and their associated Item objects.
Tip
While you may instantiate this class directly, it may be easier to go through boto.connect_sdb().
For any keywords that aren’t documented, refer to the parent class, boto.connection.AWSAuthConnection. You can avoid having to worry about these keyword arguments by instantiating these objects via boto.connect_sdb().
Parameters: | region (boto.sdb.regioninfo.SDBRegionInfo) – Explicitly specify a region. Defaults to us-east-1 if not specified. You may also specify the region in your boto.cfg: [SDB]
region = eu-west-1
|
---|
alias of SDBResponseError
Delete multiple items in a domain.
Parameters: |
|
---|---|
Returns: | True if successful |
Store attributes for multiple items in a domain.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | True if successful |
Create a SimpleDB domain.
Parameters: | domain_name (string) – The name of the new domain |
---|---|
Return type: | boto.sdb.domain.Domain object |
Returns: | The newly created domain |
Delete attributes from a given item in a domain.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | True if successful |
Delete a SimpleDB domain.
Caution
This will delete the domain and all items within the domain.
Parameters: | 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 |
Get the Metadata for a SimpleDB domain.
Parameters: | 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 |
Returns a boto.resultset.ResultSet containing all boto.sdb.domain.Domain objects associated with this connection’s Access Key ID.
Parameters: |
|
---|
Retrieve attributes for a given item in a domain.
Parameters: |
|
---|---|
Return type: | |
Returns: | An Item with the requested attribute name/values set on it |
Retrieves a boto.sdb.domain.Domain object whose name matches domain_name.
Parameters: | |
---|---|
Raises: | boto.exception.SDBResponseError if validate is True and no match could be found. |
Return type: | |
Returns: | The requested domain |
Given a str or boto.sdb.domain.Domain, return a tuple with the following members (in order):
- In instance of boto.sdb.domain.Domain for the requested domain
- The domain’s name as a str
Parameters: | domain_or_name (str or boto.sdb.domain.Domain) – The domain or domain name to get the domain and name for. |
---|---|
Raises: | boto.exception.SDBResponseError when an invalid domain name is specified. |
Return type: | tuple |
Returns: | A tuple with contents outlined as per above. |
Returns the BoxUsage (in USD) accumulated on this specific SDBConnection instance.
Tip
This can be out of date, and should only be treated as a rough estimate. Also note that this estimate only applies to the requests made on this specific connection instance. It is by no means an account-wide estimate.
Return type: | float |
---|---|
Returns: | The accumulated BoxUsage of all requests made on the connection. |
Lookup an existing SimpleDB domain. This differs from get_domain() in that None is returned if validate is True and no match was found (instead of raising an exception).
Parameters: | |
---|---|
Return type: | boto.sdb.domain.Domain object or None |
Returns: | The Domain object or None if the domain does not exist. |
Print the BoxUsage and approximate costs of all requests made on this specific SDBConnection instance.
Tip
This can be out of date, and should only be treated as a rough estimate. Also note that this estimate only applies to the requests made on this specific connection instance. It is by no means an account-wide estimate.
Store attributes for a given item in a domain.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | True if successful |
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: |
|
---|---|
Return type: | ResultSet |
Returns: | An iterator containing the results. |
While the default item class is boto.sdb.item.Item, this default may be overridden. Use this method to change a connection’s item class.
Parameters: | cls (object) – The new class to set as this connection’s item class. See the default item class for inspiration as to what your replacement should/could look like. |
---|
Delete multiple items in this domain.
Parameters: | items (dict or dict-like object) – A dictionary-like object. The keys of the dictionary are the item names and the values are either:
|
---|---|
Return type: | bool |
Returns: | True if successful |
Store attributes for multiple items.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | True if successful |
Delete this domain, and all items under it
Delete attributes from a given item.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | True if successful |
Load this domain based on an XML document
Retrieve attributes for a given item.
Parameters: |
|
---|---|
Return type: | |
Returns: | An Item mapping type containing the requested attribute name/values |
Retrieves an item from the domain, along with all of its attributes.
Parameters: | |
---|---|
Return type: | boto.sdb.item.Item or None |
Returns: | The requested item, or None if there was no match found |
Store attributes for a given item.
Parameters: |
|
---|---|
Return type: | bool |
Returns: | True if successful |
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. |
---|---|
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. |
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 |
SAX parser for a domain that has been dumped
A dict sub-class that serves as an object representation of a SimpleDB item. An item in SDB is similar to a row in a relational database. Items belong to a Domain, which is similar to a table in a relational database.
The keys on instances of this object correspond to attributes that are stored on the SDB item.
Tip
While it is possible to instantiate this class directly, you may want to use the convenience methods on boto.sdb.domain.Domain for that purpose. For example, boto.sdb.domain.Domain.get_item().
Parameters: |
|
---|
Helps set or add to attributes on this item. If you are adding a new attribute that has yet to be set, it will simply create an attribute named key with your given value as its value. If you are adding a value to an existing attribute, this method will convert the attribute to a list (if it isn’t already) and append your new value to said list.
For clarification, consider the following interactive session:
>>> item = some_domain.get_item('some_item')
>>> item.has_key('some_attr')
False
>>> item.add_value('some_attr', 1)
>>> item['some_attr']
1
>>> item.add_value('some_attr', 2)
>>> item['some_attr']
[1, 2]
Parameters: |
---|
Deletes this item in SDB.
Note
This local Python object remains in its current state after deletion, this only deletes the remote item in SDB.
Loads or re-loads this item’s attributes from SDB.
Warning
If you have changed attribute values on an Item instance, this method will over-write the values if they are different in SDB. For any local attributes that don’t yet exist in SDB, they will be safe.
Saves this item to SDB.
Parameters: | replace (bool) – If True, delete any attributes on the remote SDB item that have a None value on this object. |
---|