otcextensions.sdk.lts.v2.group

The LTS Group Class

The Group class inherits from Resource.

class otcextensions.sdk.lts.v2.group.Group

The base resource

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

  • 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.

resource_key: str | None = 'log_groups'

Singular form of key for resource.

resources_key: str | None = 'log_groups'

Plural form of key for resource.

base_path: str = '/groups'

The base part of the URI for this resource.

allow_create = True

Allow create operation for this resource.

allow_fetch = False

Allow get operation for this resource.

allow_commit = True

Allow update operation for this resource.

allow_delete = True

Allow delete operation for this resource.

allow_list = True

Allow list operation for this resource.

creation_time

Time when a log group was created

id: str

ID of the log group.

name: str

Name of the log group.

ttl_in_days

Log retention duration, in days (fixed to 7 days).

tag

Log group tag.

commit(session, prepend_key=True, has_body=True, retry_on_conflict=None, base_path=None, *, microversion=None, **kwargs)

Commit the state of the instance to the remote resource.

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

  • prepend_key – Whether the resource_key should be prepended in a resource creation request. Default to True.

  • retry_on_conflict – Whether to enable retries on HTTP CONFLICT (409). Value of None leaves the Adapter defaults.

  • base_path – Base part of the URI for modifying resources, if different from base_path.

  • microversion – API version to override the negotiated one.

  • attrs – Attributes to pass when updating the resource. These should correspond to either Body or Header values on the resource.

Returns:

This Resource instance.

Raises:

MethodNotSupported if Resource.allow_commit is not set to True.

create_stream(session, query)

Method to create a stream in log group

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

  • query (dict) – Additional parameters to create stream

delete_stream(session, log_stream_id, ignore_missing)

Method to delete stream from log group

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

  • log_stream_id (str) – Id of the stream to be deleted

  • ignore_missing (bool) – Should it be deleted if doesn’t exist or not