peek_plugin_base

(M) LoopingCallUtil

peek_plugin_base.LoopingCallUtil.peekCatchErrbackWithLogger(logger)[source]

Peek Catch Errback With Logger

A LoopingCall will stop if any errors are thrown from the method it calls.

This decorator should ensure that no exceptions or failures are thrown into the LoopingCall, and all should continue on.

(M) PeekPlatformCommonHookABC

class peek_plugin_base.PeekPlatformCommonHookABC.PeekPlatformCommonHookABC[source]

Bases: object

getOtherPluginApi(pluginName: str) → Optional[object][source]

Get Other Plugin Api

Asks the plugin for it’s api object and return it to this plugin. The API returned matches the platform service.

Parameters:pluginName – The name of the plugin to retrieve the API for
Returns:An instance of the other plugins API for this Peek Platform Service.
serviceId

Service ID

Return a unique identifier for this service.

(M) PeekPlatformFileStorageHookABC

class peek_plugin_base.PeekPlatformFileStorageHookABC.PeekPlatformFileStorageHookABC[source]

Bases: object

Peek Platform File Storage Hook

This ABC provides methods allowing plugins to use the file system.

Though there is nothing in place to prevent the plugins doing what ever they like, they should play nice and get their allocated path from here.

fileStorageDirectory

File Storage Directory

This method returns a Path object providing access to the managed file storage location where the plugin can persistently store any files it wants to.

See https://docs.python.org/3/library/pathlib.html#basic-use

Returns:The plugins managed storage Path object.

(M) PeekPlatformServerInfoHookABC

class peek_plugin_base.PeekPlatformServerInfoHookABC.PeekPlatformServerInfoHookABC[source]

Bases: object

Peek Platform Server Info Hook

This ABC provides information for plugins that want to connect to their own code running on the server service, via the inter peek service HTTP.

peekServerHost

Peek Server Host

Returns:The IP address of the server where the peek server service is running.
peekServerHttpPort

Peek Server HTTP Port

Returns:The TCP Port of the Peek Servers HTTP Service (not the admin webapp site)
peekServerSSL

Peek server https

Returns:true or false
peekServerSSLClientBundleFilePath

PEM filepath that contains the key and the certificate of the tls client for mTLS

Returns:the PEM file path
peekServerSSLClientMutualTLSCertificateAuthorityBundleFilePath
PEM filepath that contains certificate authorities used for mTLS to
verify the identity of the peek server
Returns:the PEM file path
peekServerSSLEnableMutualTLS

Peek server https with mTLS

Returns:true or false
peekServerSSLMutualTLSTrustedPeerCertificateBundleFilePath

PEM filepath that contains trusted peer certificates

Returns:the PEM file path

(M) PeekVortexUtil

peek_plugin_base.PeekVortexUtil.peekAdminName = 'peek-admin-app'

The vortex name for the Admin browser client

peek_plugin_base.PeekVortexUtil.peekAgentName = 'peek-agent-service'

The vortex name for the Agent service

peek_plugin_base.PeekVortexUtil.peekDesktopName = 'peek-office-app'

The vortex name for the Desktop browser clients

peek_plugin_base.PeekVortexUtil.peekFieldName = 'peek-field-service'

The vortex name for the Field service

peek_plugin_base.PeekVortexUtil.peekMobileName = 'peek-field-app'

The vortex name for the Mobile device/browser clients

peek_plugin_base.PeekVortexUtil.peekServerName = 'peek-logic-service'

The vortex name for the Server service

peek_plugin_base.PeekVortexUtil.peekStorageName = 'peek-storage-service'

The vortex name for the Storage service

peek_plugin_base.PeekVortexUtil.peekWorkerName = 'peek-worker-service'

The vortex name for the Worker service

(M) PluginCommonEntryHookABC

class peek_plugin_base.PluginCommonEntryHookABC.PluginCommonEntryHookABC(pluginName: str, pluginRootDir: str)[source]

Bases: object

load() → None[source]

Load

This will be called when the plugin is loaded, just after the db is migrated. Place any custom initialiastion steps here.

name

Plugin Name

Returns:The name of this plugin
packageCfg

Package Config

Returns:A reference to the plugin_package.json loader object (see json-cfg)
rootDir

Plugin Root Dir

Returns:The absolute directory where the Plugin package is located.
classmethod setupStaticWebResources(platformApi: Any)[source]

Setup Static Web Resources

This method is called during the load/start stage of a plugin. This must server

start() → None[source]

Start

This method is called by the platform when the plugin should start

stop() → None[source]

Stop

This method is called by the platform to tell the peek app to shutdown and stop everything it’s doing

title

Peek App Title :return the title of this plugin

unload() → None[source]

Unload

This method is called after stop is called, to unload any last resources before the PLUGIN is unlinked from the platform

(M) PluginPackageFileConfig

class peek_plugin_base.PluginPackageFileConfig.PluginPackageFileConfig(pluginRootDir: str)[source]

Bases: object

This class helps with accessing the config for the plugin_package.json

Constructor

Parameters:pluginRootDir – The root directory of this package, where plugin_package.json lives.
config

Config

Returns:The jsoncfg config object, for accessing and saving the config.
configForService(serviceName)[source]