otcextensions.sdk.dis.v2.stream

The DIS Stream Class

The Stream class inherits from Resource.

class otcextensions.sdk.dis.v2.stream.Stream(_synchronized=False, connection=None, **attrs)

The base resource

Parameters:
  • _synchronized (bool) – This is not intended to be used directly. See new() and existing().

  • connection (openstack.connection.Connection) – Reference to the Connection being used. Defaults to None to allow Resource objects to be used without an active Connection, such as in unit tests. Use of self._connection in Resource code should protect itself with a check for None.

base_path: str = '/streams'

The base part of the URI for this resource.

resources_key: ty.Optional[str] = 'stream_info_list'

Plural form of key for resource.

allow_create = True

Allow create operation for this resource.

allow_list = True

Allow list operation for this resource.

allow_commit = True

Allow update operation for this resource.

allow_delete = True

Allow delete operation for this resource.

allow_fetch = True

Allow get operation for this resource.

allow_patch = True

Allow patch operation for this resource.

auto_scale_min_partition_count

Minimum number of partitions for automatic scale-down when auto scaling is enabled.

auto_scale_max_partition_count

Maximum number of partitions for automatic scale-up when auto scaling is enabled.

compression_format

Data compression type. The following types are available: nsnappy ngzip nzip nData is not compressed by default.

created_at

Timestamp at which the DIS stream was created.

current_partition_count

Partition Count of a stream before updating.

data_duration

Data retention period. nValue range: 24–72 nUnit: hour nDefault value: 24

data_type

Source data type.

has_more_partitions

Specifies whether there are more matching partitions of the DIS stream to list.

is_auto_scale_enabled

Specifies whether to enable auto scaling. n`true`: auto scaling is enabled. n`false`: auto scaling is disabled.

name: ty.Union[Body, URI]

Stream name.

partition_count

Number of partitions. Partitions are the base throughput unit of the DIS stream.

partitions

A list of partitions that comprise the DIS stream.

readable_partition_count

Total number of readable partitions (including partitions in ACTIVE and DELETED state).

retention_period

Period for storing data in units of hours.

status

Current status of the stream. Possible values: n`CREATING`: The stream is being created. n`RUNNING`: The stream is running. n`TERMINATING`: The stream is being deleted. n`TERMINATED`: The stream has been deleted.

stream_id

Stream Id.

stream_type

Stream type. n`COMMON`: a common stream. The bandwidth is 1 MB/s. n`ADVANCED`: an advanced stream. The bandwidth is 5 MB/s.

sys_tags

Enterprise project of a stream.

tags

List of stream tags.

target_partition_count

Number of the target partitions. The value is an integer greater than 0.

updated_at

Timestamp at which the DIS stream was most recently modified.

writable_partition_count

Total number of writable partitions (including partitions in ACTIVE state only).

classmethod list(session, paginated=True, base_path=None, allow_unknown_params=False, **params)

This method is a generator which yields resource objects.

This resource object list generator handles pagination and takes query params for response filtering.

Parameters:
  • session (Adapter) – The session to use for making this request.

  • paginated (bool) – True if a GET to this resource returns a paginated series of responses, or False if a GET returns only one page of data. When paginated is False only one page of data will be returned regardless of the API’s support of pagination.

  • base_path (str) – Base part of the URI for listing resources, if different from base_path.

  • allow_unknown_params (bool) – True to accept, but discard unknown query parameters. This allows getting list of ‘filters’ and passing everything known to the server. False will result in validation exception when unknown query parameters are passed.

  • microversion (str) – API version to override the negotiated one.

  • headers (dict) – Additional headers to inject into the HTTP request.

  • params (dict) – These keyword arguments are passed through the _transpose() method to find if any of them match expected query parameters to be sent in the params argument to get(). They are additionally checked against the base_path format string to see if any path fragments need to be filled in by the contents of this argument. Parameters supported as filters by the server side are passed in the API call, remaining parameters are applied as filters to the retrieved results.

Returns:

A generator of Resource objects.

Raises:

MethodNotSupported if Resource.allow_list is not set to True.

Raises:

InvalidResourceQuery if query contains invalid params.