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

Parameters:

instance – The instance id or an instance of Instance

Returns:

one object of class Instance

find_instance(name_or_id, ignore_missing=False)

Find instance by name or id

Parameters:

name_or_id – The instance id or name of Instance

Returns:

one object of class Instance

update_instance(instance, **attrs)

Update instance with attributes

Parameters:
  • instance – The value can be the ID of an instance or a Instance instance.

  • attrs (dict) – Keyword arguments which will be used to create a Instance, comprised of the properties on the Instance class.

Returns:

The updated instance

Return type:

Instance

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

Parameters:
  • instance – The instance id, name or an instance of Instance

  • capacity (int) – New instance capacity

Returns:

Updated instance

Return type:

Instance

stop_instance(instance)

Stop existing instance

Parameters:

instance – The instance id, name or an instance of Instance

Returns:

Updated instance

Return type:

Instance

start_instance(instance)

Start existing instance

Parameters:

instance – The instance id, name or an instance of Instance

Returns:

Updated instance

Return type:

Instance

restart_instance(instance)

Retart existing instance

Parameters:

instance – The instance id, name or an instance of Instance

Returns:

Updated instance

Return type:

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

Parameters:
  • instance – The instance id or an instance of Instance

  • kwargs (dict) – Keyword arguments which will be used to overwrite a 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

Parameters:

instance – The instance id or an instance of Instance

Returns:

A generator of Instance object of Config

update_instance_params(instance, params)

Update instance configuration parameter with attributes

Parameters:
  • instance – The value can be the ID of an instance or a Instance instance.

  • params – List of parameters of a Config.

Returns:

None

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:

Quota.

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