cterasdk.asynchronous.core.notifications module#

class cterasdk.asynchronous.core.notifications.LastResponse(cursor)#

Bases: object

property cursor#
property more#
property objects#
class cterasdk.asynchronous.core.notifications.Notifications(core)#

Bases: BaseCommand

CTERA Portal Notification Service APIs

async ancestors(descendant)#

Get Ancestors.

Parameters:

descendant (cterasdk.asynchronous.core.types.Event) – Event

Returns:

Sorted List of Ancestors

Return type:

list[cterasdk.common.object.Object]

async changes(cursor, timeout=None)#

Check for Changes.

Parameters:
  • cursor (str) – Cursor

  • timeout (int,optional) – Timeout

Returns:

True if changes are available for this cursor, False otherwise

Return type:

bool

async get(cloudfolders=None, cursor=None)#

List Changes.

Parameters:
  • cloudfolders (list[CloudFSFolderFindingHelper],optional) – List of Cloud Drive folders, defaults to all cloud drive folders.

  • cursor (str,optional) – Cursor

Returns:

An asynchronous iterator

Return type:

cterasdk.asynchronous.core.iterator.CursorAsyncIterator

class cterasdk.asynchronous.core.notifications.Service(core)#

Bases: BaseCommand

Change Notification Service

run(client_queue, save_cursor, *, cloudfolders=None, cursor=None)#

Start Service.

Parameters:
  • client_queue (asyncio.Queue) – Queue.

  • save_cursor (callback) – Asynchronous callback function to persist the cursor.

  • cloudfolders (list[CloudFSFolderFindingHelper]) – List of Cloud Drive folders.

  • cursor (str,optional) – Cursor.

async stop()#

Stop Service

async cterasdk.asynchronous.core.notifications.enqueue_events(events, queue)#

Enqueue Events.

Parameters:
async cterasdk.asynchronous.core.notifications.forward_events(server_queue, client_queue, save_cursor)#

Change Notification Service.

Parameters:
  • server_queue (asyncio.Queue) – Server queue.

  • client_queue (asyncio.Queue) – Client queue.

  • save_cursor (callback) – Callback function to persist the cursor.

async cterasdk.asynchronous.core.notifications.on_connection_error(error)#
async cterasdk.asynchronous.core.notifications.persist_cursor(save_cursor, cursor)#

Persist Cursor.

Parameters:
  • save_cursor (callback) – Asynchronous callback function to persist the cursor.

  • cursor (str) – Cursor

async cterasdk.asynchronous.core.notifications.process_events(queue)#

Process Events.

Parameters:

queue (asyncio.Queue) – Queue.

async cterasdk.asynchronous.core.notifications.retrieve_events(server_queue, core, cloudfolders, cursor)#

Retrieval Service.

Parameters:
  • server_queue (asyncio.Queue) – Queue.

  • core (cterasdk.objects.data.DataServices) – Data Services object.

  • cloudfolders (list[CloudFSFolderFindingHelper]) – List of Cloud Drive folders.

  • cursor (str) – Cursor