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:
datastore_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
- restart_instance(instance)
Restart an existing instance
- enlarge_instance(instance, size, group_id=None)
Enlarge storage space of a DB instance
- add_instance_nodes(instance, **attrs)
Add nodes for a specific instance
- resize_instance(instance, **attrs)
Change specifications of a DB instance
- switchover_instance(instance)
Perform a primary/secondary switchover in a replica set instance.
- enable_instance_ssl(instance, enable=True)
Enable SSL in a replica set instance.
- change_instance_name(instance, name)
Change name of a DB instance
- change_instance_port(instance, port)
Change port of a DB instance
- change_instance_security_group(instance, security_group_id)
Change security group of a DB instance
- change_instance_private_ip(instance, **attrs)
Change private IP of a DB instance
- create_instance_ip(instance, **attrs)
Add IP for a DB instance
- configure_client_network(instance, network_ranges)
Configure client network of a DB instance :param instance: The value can be either the ID of an instance or a
Instance
instance. :param list network_ranges: List of network ranges- Returns:
workflow ID.
- Return type:
- 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:
- wait_normal_instance(instance, status='normal', failures=None, interval=60, wait=None)
Wait for normal status of an instance
Job 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)
- get_job(job)
Get information about a job
- wait_job(job, status='Completed', failures=None, interval=20, wait=None)
Wait for the job to complete
- Parameters:
job – The value can be either the ID of a job or a :param status: Desired status of the job.
failures – List of failure statuses.
interval – Seconds to wait between retries.
wait – Seconds to wait for response.
- Returns:
One
Job
Eip 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)
- bind_eip(node, public_ip, public_ip_id)
Bind an IP to a node
- Parameters:
node – The value is the ID of a node
public_ip – The public IP address of the node.
public_ip_id – The public IP address of the node.
- Returns:
The IP address of the node.
- unbind_eip(node)
Unbind an IP to a node
- Parameters:
node – The value is the ID of a node
- Returns:
The ID of the node.
Recycle Bin Policy 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)
- get_policy()
Get the current policy
- Returns:
The current policy.
- create_policy(**attrs)
Create a new policy from attributes
- Parameters:
attrs (dict) – Keyword arguments which will be used to create a
RecyclePolicy
, comprised of the properties on the RecyclePolicy class.- Returns:
The result of creation.
- Return type:
Recycle Instances 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)
- recycle_instances(**params)
Get list of instances in recycle bin
- Parameters:
params (dict) – Keyword arguments which will be used to get list :returns: A generator of recycle instance objects.