class ManagementSupport: (source)
Management support class. Provides functions for accessing and managing CSE internal functions. Also provides functions for retrieving and formatting CSE status, statistics, and runtime information.
| Method | add |
Add new HTTP or WebSocket Basic credentials to the CSE. |
| Method | add |
Add new HTTP or WebSocket Token credentials to the CSE. |
| Method | delete |
Delete HTTP or WebSocket Basic credentials from the CSE. |
| Method | delete |
Delete HTTP or WebSocket Token credentials from the CSE. |
| Method | do |
Export instances of a container resource to a CSV file in the tmp directory, or return as a string. |
| Method | do |
Export a resource and its children to the tmp directory as a shell script with curl commands. |
| Method | get |
Get the current attribute type policies of the CSE. |
| Method | get |
Get the current HTTP or WS credentials of the CSE. |
| Method | get |
Get the current configuration of the CSE as a JSON string. |
| Method | get |
Get the current status of the CSE. |
| Method | get |
Get the status, statistics, and runtime information of the CSE. |
| Method | get |
Get the current flexcontainer type policies of the CSE. |
| Method | get |
Get the current registered interceptors of the CSE. |
| Method | get |
Get a generator that yields log entries as strings. |
| Method | get |
Get the current log level of the CSE. |
| Method | get |
Get the current loaded plugins of the CSE. |
| Method | get |
Get the current registration status of the CSE as a JSON string. |
| Method | get |
Create and return an overview about the registrar, registrees, and descendant CSE's. |
| Method | get |
Return the registration status of the CSE, and registrations of CSEs and AEs. |
| Method | get |
Get the current requests of the CSE as a generator of JSON strings. |
| Method | get |
Generate a Rich table with all requests and a PlantUML sequence diagram. |
| Method | get |
This function will generate a Rich tree structure of a CSE's resource structure. |
| Method | get |
This function will generate a Text tree of a CSE's resource structure. |
| Method | get |
Get the current resource type policies of the CSE. |
| Method | get |
Get the current registered services and their endpoints of the CSE. |
| Method | get |
Generate an overview about various resources, event counts, and more. |
| Method | get |
The CSE, Type, http, port |
| Method | get |
Get the current HTTP or WebSocket Bearer credentials of the CSE. |
| Method | refresh |
Force the CSE to immediately check the registrations with the remote registrar(s). |
| Method | reload |
Reload the credentials from the credential storage. |
| Method | reset |
Reset the CSE to its initial state. |
| Method | restart |
Restart the CSE. |
| Method | set |
Set the log level of the CSE. |
| Method | set |
Enable or disable request recording. |
| Method | shutdown |
Shutdown the CSE. |
| Method | update |
Update existing HTTP or WebSocket Basic credentials in the CSE. |
| Method | update |
Update existing HTTP or WebSocket Token credentials in the CSE. |
| Class Variable | credentials |
Injected CredentialsManager instance. |
| Class Variable | cse |
Injected function to shutdown the CSE. |
| Class Variable | cse |
Injected function to reset the CSE. |
| Class Variable | dispatcher |
Injected Dispatcher instance. |
| Class Variable | request |
Injected RequestManager instance. |
| Class Variable | security |
Injected SecurityManager instance. |
| Class Variable | storage |
Injected Storage instance. |
| Class Variable | validator |
Injected Validator instance. |
| Method | _check |
Check if the required binding plugins are enabled. |
| Method | _handle |
Handle an attribute policy and return a JSON representation of it. |
Add new HTTP or WebSocket Basic credentials to the CSE.
| Parameters | |
jsn:JSON | A JSON object containing the new credentials in the format { "username": "password" }. |
ty:BindingType | The type of credentials to add. |
| Returns | |
str | A JSON object with a message indicating success or failure. |
Add new HTTP or WebSocket Token credentials to the CSE.
| Parameters | |
jsn:JSON | A JSON object containing the new credentials in the format { "username": "password" }. |
ty:BindingType | The type of credentials to add. |
| Returns | |
str | A JSON object with a message indicating success or failure. |
Delete HTTP or WebSocket Basic credentials from the CSE.
| Parameters | |
username:str | The username of the credentials to delete. |
ty:BindingType | The type of credentials to delete. |
| Returns | |
str | A JSON object with a message indicating success or failure. |
Delete HTTP or WebSocket Token credentials from the CSE.
| Parameters | |
token:str | The token of the credentials to delete. |
ty:BindingType | The type of credentials to delete. |
| Returns | |
str | A JSON object with a message indicating success or failure. |
Export instances of a container resource to a CSV file in the tmp directory, or return as a string.
| Parameters | |
ri:str | Resource ID of the container resource. |
asbool | None | Return the CSV string instead of writing to a file. |
| Returns | |
tuple[ | Tuple with the number of instances exported, and the filename of the exported file or the CSV string. |
str, withChildResources: bool | None = False) -> tuple[ int, str]:
(source)
¶
Export a resource and its children to the tmp directory as a shell script with curl commands.
| Parameters | |
ri:str | Resource ID of the resource to export. |
withbool | None | If True, also export child resources. |
| Returns | |
tuple[ | Tuple with the number of resources exported, and the filename of the exported file. |
Get the current attribute type policies of the CSE.
| Parameters | |
filter:str | None | An optional filter for the management command. |
| Returns | |
str | The attribute type policies of the CSE in JSON format. |
Get the current HTTP or WS credentials of the CSE.
| Parameters | |
ty:BindingType | The type of credentials to retrieve. |
| Returns | |
str | The HTTP or WScredentials of the CSE in JSON format, or an error message if the HTTP server plugin is not enabled. |
Get the current configuration of the CSE as a JSON string.
| Returns | |
str | The configuration of the CSE in JSON format. |
Get the current flexcontainer type policies of the CSE.
| Parameters | |
filter:str | None | An optional filter for the management command. |
| Returns | |
str | The flexcontainer type policies of the CSE in JSON format. |
Get the current registered interceptors of the CSE.
| Returns | |
str | The registered interceptors of the CSE in JSON format. |
Get a generator that yields log entries as strings.
| Returns | |
Generator[ | A generator that yields log entries as strings. |
Get the current registration status of the CSE as a JSON string.
| Returns | |
str | The registration status of the CSE in JSON format. |
Style | None = Style(), textStyle: Style | None = None) -> Table:
(source)
¶
Create and return an overview about the registrar, registrees, and descendant CSE's.
| Parameters | |
style:Style | None | Style for the general output. |
textStyle | None | Style for the text. |
| Returns | |
Table | Rich formatted string. |
Return the registration status of the CSE, and registrations of CSEs and AEs.
| Returns | |
JSON | A JSON object with the registration status of the CSE, and registrations of CSEs and AEs. |
Get the current requests of the CSE as a generator of JSON strings.
| Returns | |
Generator[ | A generator that yields JSON strings of the request. |
Generate a Rich table with all requests and a PlantUML sequence diagram.
| Parameters | |
id:str | None | If set, then only the requests for this resource ID are returned. |
| Returns | |
tuple[ | A tuple with a Rich Table object and a PlantUML sequence diagram string. |
int = 0, parent: str | None = None, style: Style | None = Style(), withProgress: bool | None = True, treeMode: TreeMode | None = TreeMode.NORMAL) -> Tree:
(source)
¶
This function will generate a Rich tree structure of a CSE's resource structure.
| Parameters | |
maxint | The maximum level for the result tree. |
parent:str | None | The resource ID from where to start the tree. The default is the CSEBase. |
style:Style | None | The Rich Style to use. |
withbool | None | Display a progress indicator while gathering the tree. |
treeTreeMode | None | Undocumented |
| Returns | |
Tree | Return a Rich Tree object. |
This function will generate a Text tree of a CSE's resource structure.
Todo
Support the maxLevel parameter.
| Parameters | |
maxint | Maximum tree level to render. Currently not supported. |
| Returns | |
str | Pure text rendering of the resource tree. |
Get the current resource type policies of the CSE.
| Parameters | |
filter:str | None | An optional filter for the management command. |
| Returns | |
str | The resource type policies of the CSE in JSON format. |
Get the current registered services and their endpoints of the CSE.
| Returns | |
str | The registered services and their endpoints of the CSE in JSON format. |
Style | None = Style(), withProgress: bool | None = True, textStyle: Style | None = None) -> Table:
(source)
¶
Generate an overview about various resources, event counts, and more.
| Parameters | |
style:Style | None | Rich style. |
withbool | None | Display with progress indicator. |
textStyle | None | Rich text style. If this is not set then the style is used for the text as well. |
| Returns | |
Table | Rich Table object. |
- This function will generate a PlanUML graph of a CSE's structure, including:
- The CSE, Type, http, port
- The CSE's resource tree
- The Registrar CSE (if any)
- A list of descendant CSE's (if any)
This function calls itself recursively to generate the tree structure.
| Parameters | |
maxint | None | The maximum level of the tree to print. 0 means all levels. |
| Returns | |
str | The PlanUML graph as a string. |
Get the current HTTP or WebSocket Bearer credentials of the CSE.
| Parameters | |
ty:BindingType | The type of credentials to retrieve. |
| Returns | |
str | The HTTP or WebSocket Bearer credentials of the CSE in JSON format, or an error message if the corresponding server plugin is not enabled. |
Force the CSE to immediately check the registrations with the remote registrar(s).
This is useful for testing purposes, e.g. when the CSE is started and the registration is not done automatically.
| Returns | |
str | A message indicating the result of the registration. |
Restart the CSE.
This is done by setting the CSE status to SHUTTINGDOWNRESTART and calling the forceShutdown method.
Set the log level of the CSE.
| Parameters | |
level:str | The log level to set. Should be one of the Logging levels. |
| Returns | |
str | A response indicating the result |
Enable or disable request recording.
| Parameters | |
param:str | The parameter to set. Should be 'enable' or 'disable'. |
| Returns | |
str | The new status of the request recording. |
Update existing HTTP or WebSocket Basic credentials in the CSE.
| Parameters | |
jsn:JSON | A JSON object containing the updated credentials in the format { "username": "password" }. |
ty:BindingType | The type of credentials to update. |
| Returns | |
str | A JSON object with a message indicating success or failure. |
Update existing HTTP or WebSocket Token credentials in the CSE.
| Parameters | |
jsn:JSON | A JSON object containing the updated credentials in the format { "token": "<token>" }. |
ty:BindingType | The type of credentials to update. |
| Returns | |
str | A JSON object with a message indicating success or failure. |
Check if the required binding plugins are enabled.
| Parameters | |
ty:BindingType | The type of binding to check. |
| Returns | |
str | None | None if the required binding plugins are enabled, or an error message if not. |
ResourceTypes | str | None, policy: AttributePolicy) -> JSON:
(source)
¶
Handle an attribute policy and return a JSON representation of it.
| Parameters | |
rt:ResourceTypes | str | None | Undocumented |
policy:AttributePolicy | The attribute policy to handle. |
| Returns | |
JSON | A JSON representation of the attribute policy. |