These forums are a place for learning, helping and sharing experiences with others about any of our products. Feel free to ask a question and get answers from our community and our most advanced users.
Note that these are public forums - anyone can view the discussions here.
VISIT OUR DIFFERENT FORUMS:
Announcements > | |
CloudShell > | TestShell > |
Developers > | BI (Business Inteligence) > |
This is where you can suggest your ideas to help and improve the product for everyone.
Please make sure to read the following article before posting a new idea, to get more information about the required information and ideas lifecycle.
Feel free to vote and comment on other ideas to promote them.
Thanks for everyone who suggested the ideas and voted for them.
Find, download and share integrations that can extend and enhance the CloudShell experience.
Integrations have several levels:
Certified - Officially tested and supported by Quali.
Preview - Provides a sneak peek to what the Quali team is developing. Officially supported by Quali. Feel free to experiment and comment, but please take into consideration that it is not yet tested and released.
Community - Integrations shared by community users. Feel free to look into what other users have contributed, please take into consideration that these integrations are not tested by Quali.
To learn more about creating Shells and integrating with CloudShell, use the following links:
CloudShell's Dev Guide > | Configuration Management > |
Getting started with Shells > | Extending CloudShell with Cloud Providers > |
Getting started with Orchestration > | API Guide > |
To share your integration, follow the instructions in this guide >.
As part of the Shell Standardization initiative the way the Shell logs are structured has been standardize and a logger that can be used by any Shell was created.
The Networking Shell Standard can be found here.
The logs folder is structured as follows:
There is a folder per each reservation and its name is equal to the reservation ID. For Autoload commands that are being executed outside of the reservation context there is a separate folder called Autoload.
In those folders there is a file per each resource. The file name is resourceName--D-MMM-YYYY--HH-MM-SS(the time in the file indicates the creation time of the file). In case of environment commands that run as part of an environment orchestration a separate file will be created, this file is namedenvironmentName--D-MMM-YYYY--HH-MM-SS.logand it will include logs both for environment commands (which are part of a driver) and environments scripts.
Each log entry contains the following – date, time, verbosity level, module name (max 50 characters), method name (max 50 characters) and message.
Description of the log record attributes: https://docs.python.org/2/library/logging.html#logrecord-attributes
The logger is located in cloudshell-core Python package (link to repository) and comes with a configuration in which it is possible to customize the logs.
To customize the logs verbosity change the LOG_LEVEL from DEBUG to INFO, WARN or ERROR.
It is also possible to customize the structure of a log entry in the LOG_FORMAT section, and the time format used in each log entry in the TIME_FORMAT section.
The location in which the logs will be located is defined in the LOG_PATH.
The default location “../../Logs” translates to the following path in 6.4 Shells:
C:\ProgramData\QualiSystems\QsPython27\Lib\site-pacakges\cloudshell\Logs
Starting from 7.0, the Shells use the python driver infrastructure and the default location “../../Logs” translates to the following path:
C:\ProgramData\QualiSystems\venv\{driverName_version}\Lib\site-packages\cloudshell\Logs
This location refers to a location on each execution server. It is possible to change the path to ashared location that is accessible (including write permissions) to the execution server. To change that just update the LOG_PATH in the qs_config.ini file to‘{sharedLocation}:/Logs/’and restart the execution server.
Setup the cloudshell-core package:
To use qs_logger install attached cloudshell-core-1.0.11.zip package:
Logger example script:
The networking shell that follows the standard has the following python packages structure:
cloudshell-core
--> cloudshell-shell-core
--> cloudshell-networking
--> cloudshell-networking-[vendor]
--> cloudshell-networking-[vendor]-[os]
The logger described in the previous section is located in the “cloudshell-core” and all the definitions required for using it are located in the networking generic resource driver ( cloudshell-networking/cloudshell/networking/resource_driver/networking_generic_resource_dirver.py). Any resource driver that will be based on the networking generic resource driver will get all the logger definitions.
For a resource driver to be based on the networking generic resource driver it should inherit the networking_generic_resource_driver class and use this class’ Init function in the new driver’s Init:
Once the above is defined it is possible to write to the logger in the following format:
Replace “info” with the desired verbosity level (debug, info, warn, error).
from qs_logger import * def log_something(m_logger, message): m_logger.info(message) if __name__ == '__main__': # test_logger = get_qs_logger('logger_name', 'resource_name', 'reservation_id') test_logger = get_qs_logger() log_something(test_logger,'>>>My Message<<<') test_logger.debug('Sending Command to device') test_logger.info('This is Info message') test_logger.warning('This is Warning message') test_logger.error('This is Critical error message!') print 'OK'
These forums are a place for learning, helping and sharing experiences with others about any of our products. Feel free to ask a question and get answers from our community and our most advanced users.
Note that these are public forums - anyone can view the discussions here.
Announcements | |
CloudShell | TestShell |
Developers | BI (Business Inteligence) |
This is where you can suggest your ideas to help and improve the product for everyone.
Please make sure to read the following article before posting a new idea, to get more information about the required information and ideas lifecycle.
Feel free to vote and comment on other ideas to promote them.
Thanks for everyone who suggested the ideas and voted for them.
Find, download and share integrations that can extend and enhance the CloudShell experience.
Integrations have several levels:
Certified - Officially tested and supported by Quali.
Preview - Provides a sneak peek to what the Quali team is developing. Officially supported by Quali. Feel free to experiment and comment, but please take into consideration that it is not yet tested and released.
Community - Integrations shared by community users. Feel free to look into what other users have contributed, please take into consideration that these integrations are not tested by Quali.
To learn more about creating Shells and integrating with CloudShell, use the following links:
CloudShell's Dev Guide | Configuration Management |
Getting started with Shells | Extending CloudShell with Cloud Providers |
Getting started with Orchestration | API Guide |
To share your integration, follow the instructions in this guide.
Networking Shell Standard - Customizing a Shell in CloudShell 6.4
Do not duplicate Shells when creating a new one
[Application] Developer center and GitHub
[Application] Working with PyCharm IDE and Python API Calls
Creating a Save/Restore Snapshot orchestration script (VMs only)
CloudShell User management using Python cloudshell-automation-api
[Application] How to add the CloudShell Python API to PyCharm IDE