GUI-Driven Python Script Generator #1495
Quali-Community
started this conversation in
Integrations
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
GUI-Driven Python Script Generator
Originally by Chris Grabosky
The project has a GitHub page located here:
https://github.com/graboskyc/QS-by-Blockly
About this project
The purpose of this repo is to quickly build out QualiSystems CloudShell environment python scripts via a drag-and-drop interfacce. While building a Setup driver or script is relatively simple, much of the process is boilerplate code. Also the process of identifying the exact resource and service names is error prone. Worse, finding the exact name of a command can be problematic since the command pane shows the alias, not the real command name. This causes the author to go back and forth between many locations. This holds true for any inputs as well. This tool aims at solving that by pulling in all resource and service commands by their exact names, as well as their inputs. The resulting generated python code may be 100% complete for simple situations or a great starting point for more complex orchestration scripts. In this latest build, it is still a proof of concept. However we have added the functionality to load a reservation's details out of a CloudShell instance and make building blocks out of it to make an orchestration script quickly.
New in this version
• Can upload the script to CloudShell without having to do it manually (downloading .py file, logging in, uploading)
• Can download the generated XML and PY files rather than having to copy/paste into text docs
• Updated the canvas to be more readable and with more controls (like zoom)
• Version beta0.9.0.0 of the code generator introduces commands with and without inputs
• The canvas now supports lists (required for the above) as well as variables
Deployment
Dump the entire contents of this folder into an IIS or Apache website. Visit index.php and you are good to go! Requires PHP and CloudShell 6.4 with python. Changes may be needed in the config.php file depending on your deployment. Content Main content of custom Blockly Blocks is created in the index.php and blocks/Quali.js Additionally, there is a python scriptgetDetails.py which uses the CloudShell API to find all resources and services with commands in a given reservation and prepopulate the startblock on the canvas with those commands.
Assumptions/Limitations
• PHP is intalled
• CloudShell is installed with API version compatibility with 6.4
• Python for CloudShell is installed in the default location (see config.php) and edit that if it changed.
• Deployed on IIS in default directory. If not, update JavaScript/CSS includes and configuration settings in config.php
• Running on Windows and if you try and upload something, the script needs write access to c:\temp
Repository
Latest Release
README.md
Name
QS-by-Blockly
Owner
graboskyc
Type
Other
Category
Application
Min. Compatible CloudShell Version
6.4
Link
beta0.9.0.0
(Version / Tag)
TAR / ZIP
beta0.9.0.0 (TAR)
beta0.9.0.0 (ZIP)
Author
graboskyc
Published On
03/23/2016 06:34 PM
About this Repo
The purpose of this repo is to quickly build out QualiSystems CloudShell environment python scripts via a drag-and-drop interfacce.
While building a Setup driver or script is relatively simple, much of the process is boilerplate code. Also the process of identifying the exact resource and service names is error prone. Worse, finding the exact name of a command can be problematic since the command pane shows the alias, not the real command name. This causes the author to go back and forth between many locations. This holds true for any inputs as well. This tool aims at solving that by pulling in all resource and service commands by their exact names, as well as their inputs. The resulting generated python code may be 100% complete for simple situations or a great starting point for more complex orchestration scripts.
There are two projects here, the web interface (every file and directory not in the CS folder) and a self contained service that will act as a mini webserver. If modifying the service code, note that when you compile the project in CloudShell Authoring, you must manually copy all other assets from this project into a folder called www inside the authoring directory. Then compile and deploy and it will start the site.
Latest updates
Features of note in this version
Features of note in previous versions
Deployment
Option 1 - Hosted:
Requires PHP webserver and CloudShell 6.4 with python. Webserver must be able to talk to Quali server to upload scripts or pull data about reservations.
Option 2 - CloudShell Service
Assumes your execution server is on Windows, Running CloudShell 6.4 in the default locations
Content
Main content of custom Blockly Blocks is created in the index.php and blocks/Quali.js
Additionally, there is a python script getDetails.py which uses the CloudShell API to find all resources and services with commands in a given reservation and prepopulate the startblock on the canvas with those commands.
Assumptions/Limitations for Deployment 1
* Please allow 30-60 seconds for manual update changes to take effect.
Quali 06/20/2016 11:46 AM
· 193 ·
Beta Was this translation helpful? Give feedback.
All reactions