DCS API¶
The Distributed Cache Service Class¶
The dcs high-level interface is available through the dcs
member of a Connection
object. The
dcs
member will only be added if the
otcextensions.sdk.register_otc_extensions(conn)
method is called.
Instance Operations¶
- class otcextensions.sdk.dcs.v1._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(**kwargs)
Create an instance
- Parameters:
kwargs (dict) – Keyword arguments which will be used to overwrite a
Instance
- instances(**query)
List all cache instances
- Returns:
A generator of Instance object of
Instance
- get_instance(instance)
Get detail about a given instance
- find_instance(name_or_id, ignore_missing=False)
Find instance by name or id
- update_instance(instance, **attrs)
Update instance with attributes
- delete_instance(instance, ignore_missing=True)
Delete an instance
- Parameters:
instance – The instance id, name or an instance of
Instance
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the queue does not exist.
- Returns:
None
- extend_instance(instance, capacity)
Extend capacity of existing instance
- stop_instance(instance)
Stop existing instance
- start_instance(instance)
Start existing instance
Statistics Operations¶
- class otcextensions.sdk.dcs.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- statistics()
Query statisctics for all instances
- Returns:
A generator of Instance object of
Statistics
Backup Operations¶
- class otcextensions.sdk.dcs.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- backup_instance(instance, **kwargs)
Create an instance backup
- backups(instance, **query)
List all instance backups
- Returns:
A generator of Instance object of
Backup
- delete_instance_backup(instance, backup, ignore_missing=True, **attrs)
Delete an instance backup
- Parameters:
backup – The instance id, an instance of
Backup
ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the queue does not exist.
- Returns:
None
- restore_instance(instance, backup=None, **kwargs)
Restore instance from backup
- Parameters:
instance – The instance id or an instance of
Instance
kwargs (dict) – Keyword arguments which will be used to overwrite a
RestoreRecord
backup_id and description are expected
- restore_records(instance, **query)
List all instance restore records
- Parameters:
instance – The instance id or an instance of
Instance
- Returns:
A generator of Instance object of
RestoreRecord
Instance Configuration Operations¶
- class otcextensions.sdk.dcs.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- instance_params(instance)
List all instance configuration records
Quota Operations¶
- class otcextensions.sdk.dcs.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- quotas()
Return a generator of quotas
- Returns:
A generator of quota objects
- Return type:
Maintenance Time Window Operations¶
- class otcextensions.sdk.dcs.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- maintenance_time_windows()
Return a generator of maintenance time windows
- Returns:
A generator of maintenance time window objects
- Return type:
MaintenanceTimeWindow
.
Service Specification Operations¶
- class otcextensions.sdk.dcs.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- service_specifications()
Return a generator of service specifications
- Returns:
A generator of service specifications
- Return type:
ServiceSpecification
Availability Zone Operations¶
- class otcextensions.sdk.dcs.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
- availability_zones()
Return a generator of Availability Zones where a DCS instance resides.
- Returns:
A generator of Availability Zone objects
- Return type:
- class:
~otcextensions.sdk.dcs.v1.availability_zone.AvailabilityZone