MuranoPL Core Library¶
Some objects and actions can be used in several application deployments. All common parts are grouped into MuranoPL libraries. Murano core library is a set of classes needed in each deployment. Class names from core library can be used in the application definitions. This library is located under the meta directory.
Classes included in the Murano core library are as follows:
io.murano
io.murano.resources
io.murano.system
Class: Object¶
A parent class for all MuranoPL classes. It implements the initialize
,
setAttr
, and getAttr
methods defined in the pythonic part of the Object class.
All MuranoPL classes are implicitly inherited from this class.
See also
Source Object.yaml file.
Class: Application¶
Defines an application itself. All custom applications must be derived from this class.
See also
Source Application.yaml file.
Class: SecurityGroupManager¶
Manages security groups during an application deployment.
See also
Source SecurityGroupManager.yaml file.
Class: CloudRegion¶
Defines a CloudRegion and groups region-local properties
Property |
Description |
Default usage |
---|---|---|
|
A region name. |
|
|
A property containing the |
|
|
A property containing a HeatStack object that can be used to interact with Heat. |
|
|
A property containing user-defined Networks
( |
|
|
A property containing the |
|
See also
Source CloudRegion.yaml file.
Class: Environment¶
Defines an environment in terms of the deployment process and groups all Applications and their related infrastructures. It also able to deploy them at once.
Environments is intent to group applications to manage them easily.
Property |
Description |
Default usage |
---|---|---|
|
An environment name. |
|
|
A list of applications belonging to an environment. |
|
|
A property containing the |
|
|
A property containing a HeatStack object in default region that can be used to interact with Heat. |
|
|
A property containing the |
|
|
A property containing templates for user-defined Networks in regions
( |
|
|
A property containing the |
|
|
A property containing the name of home region from murano config |
|
|
A property containing the map regionName -> CloudRegion instance. |
|
|
A property containing the map regionName -> CloudRegion config |
|
See also
Source Environment.yaml file.
Class: Instance¶
Defines virtual machine parameters and manages an instance lifecycle: spawning, deploying, joining to the network, applying security group, and deleting.
Property |
Description |
Default usage |
---|---|---|
|
Inherited from |
|
|
An instance name. |
|
|
An instance flavor defining virtual machine hardware parameters. |
|
|
An instance image defining operation system. |
|
|
Optional. A key pair name used to connect easily to the instance. |
|
|
Configures interaction with the Murano agent using
|
|
|
A list of all IP addresses assigned to an instance. Floating ip address is placed in the list tail if present. |
|
|
Specifies the networks that an instance will be joined to.
Custom networks that extend Network class can be
specified. An instance will be connected to them and for the default
environment network or flat network if corresponding values are set
to |
|
|
Specifies the mapping of a mounting path to volume implementations
that must be attached to the instance. Custom volumes that extend
|
|
|
Specifies the list of block device mappings that an instance will use
to boot from. Each mapping defines a volume that must be an instance of
|
|
|
Determines if floating IP is required. Default is |
|
|
IP addresses assigned to an instance after an application deployment. |
|
|
Optional. A security group that an instance will be joined to. |
|
See also
Source Instance.yaml file.
Resources¶
Instance class uses the following resources:
- Agent-v2.template
Python Murano Agent template.
Note
This agent is supposed to be unified. Currently, only Linux-based machines are supported. Windows support will be added later.
- linux-init.sh
Python Murano Agent initialization script that sets up an agent with valid information containing an updated agent template.
- Agent-v1.template
Windows Murano Agent template.
- windows-init.sh
Windows Murano Agent initialization script.
Class: Network¶
The basic abstract class for all MuranoPL classes representing networks.
See also
Source Network.yaml file.
Class: Logger¶
Logging API is the part of core library since Liberty release. It was introduced to improve debuggability of MuranoPL programs.
You can get a logger instance by calling a logger
function which
is located in io.murano.system
namespace. The logger
function takes
a logger name as the only parameter. It is a common recommendation to use full
class name as a logger name within that class. This convention avoids names
conflicts in logs and ensures a better logging subsystem configurability.
Logger class instantiation:
$log: logger('io.murano.apps.activeDirectory.ActiveDirectory')
Level |
Description |
---|---|
CRITICAL |
Very severe error events that will presumably lead the application to abort. |
ERROR |
Error events that might not prevent the application from running. |
WARNING |
Events that are potentially harmful but will allow the application to continue running. |
INFO |
Informational messages highlighting the progress of the application at the coarse-grained level. |
DEBUG |
Detailed informational events that are useful when debugging an application. |
TRACE |
Even more detailed informational events comparing to the DEBUG level. |
There are several methods that fully correspond to the log levels you can use
for logging events. They are debug
, trace
, info
, warning
,
error
, and critical
.
Logging example:
$log.info('print my info message {message}', message=>message)
Logging methods use the same format rules as the YAQL format function. Thus the line above is equal to the:
$log.info('print my info message {message}'.format(message=>message))
To print an exception stacktrace, use the exception method. This method uses the ERROR level:
Try:
- Throw: exceptionName
Message: exception message
Catch:
With: exceptionName
As: e
Do:
- $log.exception($e, 'something bad happen "{message}"', message=>message)
Note
You can configure the logging subsystem through the logging.conf
file
of the Murano Engine.
See also
Source Logger.yaml file.
Class: StatusReporter¶
Provides feedback feature. To follow the deployment process in the UI, all status changes should be included in the application configuration.
See also
Source StatusReporter.yaml file.