Document Database (DDS) API¶
For details on how to use dds, see /sdk/guides/dds (NEEDS TO BE DONE)
The DDS Class¶
The dds high-level interface is available through the dds
member of a
Connection
object. The dds
member will only
be added if the otcextensions.sdk.register_otc_extensions(conn)
method is
called.
Datastore Operations¶
- class otcextensions.sdk.dds.v3._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- datastore_types()
List supported datastore types
- Returns:
A generator of supported datastore types
- datastores(datastore_name)
List datastores
- Parameters:
database_name – database store name (currently only DDS-Community and is case-sensitive.)
- Returns:
A generator of supported datastore versions.
- Return type:
Flavor Operations¶
- class otcextensions.sdk.dds.v3._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- flavors(region, engine_name)
List flavors of all DB instances specifications in specified region
- Parameters:
engine_name – database engine name
region – region
- Returns:
A generator of flavor
- Return type:
Instance Operations¶
- class otcextensions.sdk.dds.v3._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- create_instance(**attrs)
Create a new instance from attributes
- delete_instance(instance, ignore_missing=True)
Delete an instance
- Parameters:
instance – The value can be either the ID of an instance or a
Instance
instance.ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the instance does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent instance.
- Returns:
None
- get_instance(instance)
Get a single instance
- find_instance(name_or_id, ignore_missing=True)
Find a single instance
- Parameters:
name_or_id – The name or ID of a instance.
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the resource does not exist. When set toTrue
, None will be returned when attempting to find a nonexistent resource.
- Returns:
One
Instance
or None.
- instances(**params)
Return a generator of instances
- Parameters:
params (dict) – Optional query parameters to be sent to limit the instances being returned.
- Returns:
A generator of instance objects.
- Return type: