Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reverted from v. 1
Panel
Table of Contents

Universal Extension

...

Package

UniversalExtension class

Base class for Stonebranch Universal Extension module implementations

...

Input

Parameters:

  • fields: dict
    The fields parameter expects a dictionary of output fields to be sent back to the controller for the associated Extension instance. Field names are implementation dependent and correlate with the Universal Template field names in the Controller’s Template definition for the associated task.
OutputNone

ExtensionResult class

class ExtensionResult(**kwargs)

...

ParameterTypeDefaultDescription
rc

int, optional

0

This parameter represents the return code of the Dynamic Command operation and determines whether the command is perceived as completing with success or failure by the Controller.

A value of 0 indicates success. All other values indicate an error condition and the command result will not be added to the Controller's Output tab. However, the Controller will log the command response. The non-zero value used to represent the error condition is implementation defined and therefore left up to the extension developer.

messagestr, optionalEmpty string

The message parameter specifies a short status string (error message or success message) that will be logged by the Controller. 

output

bool, optional

False

This parameter is a Boolean value that specifies if the command produced output that should be persisted and displayed under the task instance Output tab in the Controller task instance associated with the dynamic command invocation.

The default value is False.

This flag allows distinguishing between a command that does not produce output and a command that produces output but the output returned was empty.

output_data

str, optional

None

This parameter specifies the data that will be returned to the Controller for the command execution.  It is interpreted as a UTF-8 encoded text object.

If the output attribute is True, the output_data will be persisted in the Controller as a record under table ops_exec_output, and appearing as Universal Command output type from the task instance Output tab.

The default value is None.

output_name

str, optional

None

This parameter is used to provide a custom name for the associated output data.  The output_name (if provided) will be used in the presentation of the output_data by the Controller.

ExtensionLogger class

class ExtensionLogger(name)

...

Input

Parameters:

  • command_name: str
    The name of the dynamic command.
OutputExtensionResult

Universal Extension 1.1.0 API 

UniversalExtension class

Base class for Stonebranch Universal Extension module implementations

Methods

extension_cancel(self)

Implement in derived class.

extension_start(self, fields)

Implement in derived class.

update_extension_status(self, fields)

Propagate state changes back to the associated extension instance in the Controller.

...

Parameters

  • fields : dict. The fields parameter expects a dictionary of output fields to be sent back to the controller for the associated Extension instance. Field names are implementation dependent and correlate with the Universal Template field names in the Controller's Template definition for the associated task.

...

Returns: None

Examples: 

...