LTS API

The Log Tank Service Class

The nat high-level interface is available through the lts member of a Connection object. The lts member will only be added if the otcextensions.sdk.register_otc_extensions(conn) method is called.

LTS Group Operations

class otcextensions.sdk.lts.v2._proxy.Proxy(session, *args, **kwargs)
groups()

Query all log groups of an account.

Returns:

A generator of log group Group instances

create_group(**attrs)

Creating a log group for log retention and query

Parameters:

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

Returns:

The results of config creation

Return type:

Group

update_group(group, **attrs)

Update log group attributes

Parameters:
  • group – The id or an instance of Group

  • attrs (dict) – attributes for update on Group

Return type:

Group

delete_group(group, ignore_missing=True)

Delete a single log group.

Parameters:
  • group – The value can be the ID of a log group or a Group instance.

  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the group does not exist. When set to True, no exception will be set when attempting to delete a nonexistent log group.

Returns:

None

LTS Stream Operations

class otcextensions.sdk.lts.v2._proxy.Proxy(session, *args, **kwargs)
streams(log_group)

List log stream in log group

Parameters:

log_group – The value can be the ID of a log group or a Group instance.

Returns:

A generator of log stream Stream instances

Return type:

Stream

create_stream(log_group, **query)

Create a log stream in log group

Parameters:
  • log_group – The value can be the ID of a log group or a Group instance.

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

Returns:

The result of stream creation.

delete_stream(log_group, log_stream, ignore_missing=True)

Delete log stream from log group

Parameters:
  • log_group – The value can be the ID of a log group or a Group instance.

  • log_stream – The value can be the ID of a log stream or a Stream instance.

Returns:

None