DMS API¶
The Distributed Message Service Class¶
The dms high-level interface is available through the dms
member of a Connection
object. The
dms
member will only be added if the
otcextensions.sdk.register_otc_extensions(conn)
method is called.
Queue Operations¶
-
class
otcextensions.sdk.dms.v1._proxy.
Proxy
(session, *args, **kwargs) -
create_queue
(**kwargs) Create a queue
- Parameters
kwargs (dict) – Keyword arguments which will be used to overwrite a
Queue
-
queues
(**kwargs) List all queues
- Parameters
kwargs (dict) – List of query parameters
- Returns
A generator of Queue object of
Queue
-
get_queue
(queue) Get detail about a given queue id
-
delete_queue
(queue, ignore_missing=True) Delete queue
- Parameters
queue – The queue id or an instance of
Queue
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the queue does not exist.
- Returns
None
-
Message Group Operations¶
-
class
otcextensions.sdk.dms.v1._proxy.
Proxy
(session, *args, **kwargs) -
create_group
(queue, name) Create a list consume groups for a queue
- Parameters
queue – The queue id or an instance of
Queue
name (str) – Group name to create
- Returns
A list of object
Group
-
groups
(queue, **kwargs) List all groups for a given queue
- Parameters
queue – The queue id or an instance of
Queue
kwargs (dict) – Query parameters
- Returns
A generator of Group object
- Return type
Group
-
Instance Operations¶
-
class
otcextensions.sdk.dms.v1._proxy.
Proxy
(session, *args, **kwargs) -
instances
(**kwargs) List all DMS Instances
- Parameters
kwargs (dict) – List of query parameters
- Returns
A generator of Instance object of
Instance
-
create_instance
(**attrs) Create an DMS instance
-
delete_instance
(instance, ignore_missing=True) Delete DMS Instance
- Parameters
instance – The instance id or an object instance of
Instance
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the instance does not exist.
- Returns
None
-
find_instance
(name_or_id, ignore_missing=False) Find DMS Instance by name or id
- Parameters
name_or_id – Name or ID
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the instance does not exist.
- Returns
one object of class
Instance
-
get_instance
(instance) Get detail about a given instance id
-
update_instance
(instance, **attrs) Update an Instance
-
restart_instance
(instance) Restart instance
- Parameters
instance – Either the ID of an instance or a
Instance
instance.
-
delete_batch
(instances_list) Delete multiple instances
-
delete_failed
() Delete failed Kafka instances
-
topics
(instance) List all DMS Instance topics
-
create_topic
(instance, **attrs) Create a topic on DMS Instance
- Parameters
instance – instance id or
Instance
attrs (dict) – Attributes of the topic
otcextensions.sdk.dms.v1.topic.Topic
- Returns
An topic class object
Topic
-
delete_topic
(instance, topics, ignore_missing=True) Delete topic on DMS instance
- Parameters
instance – The instance id or an object instance of
Instance
topics (list) – List of topic IDs
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the instance does not exist.
- Returns
None
-
availability_zones
(**kwargs) List all supported DMS Instance availability zones
- Returns
A generator of Instance object of AvailabilityZone
AvailabilityZone
-
products
(**kwargs) List all supported DMS products
- Returns
A generator of Product object
Product
-
maintenance_windows
(**kwargs) List all DMS maintenance windows
- Returns
A generator of MaintenanceWindow object
MaintenanceWindow
-