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 >.
Description:
In this post: https://support.qualisystems.com/entries/99050407--General-Sample-Resource-Driver-Python- there is un "unofficial" snippet of code for getting the resource driver context for debugging purpose. I tried to use it but I get an error on this Resource Driver
*************************************************************************************
import drivercontext import cloudshell.api.cloudshell_api as api import cloudshell.helpers.scripts.cloudshell_scripts_helpers as qs_helper import cloudshell.helpers.scripts.cloudshell_dev_helpers as dev_help from cloudshell.shell.core.driver_context import * from cloudshell.shell.core.resource_driver_interface import * import socket import Remotest_rest as rmt class Remotest(ResourceDriverInterface): session = None resID = None def __init__(self): ResourceDriverInterface.__init__(self) # Initialize the driver session, this function is called every time a new instance of the driver is created # This is a good place to load and cache the driver configuration, initiate sessions etc. def initialize(self, context): """ :type context: drivercontext.InitCommandContext """ pass # Destroy the driver session, this function is called every time a driver instance is destroyed # This is a good place to close any open sessions, finish writing to log files def cleanup(self): pass if __name__ == '__main__': cloudshell_user = 'yyy' cloudshell_pass = 'xxx' cloudshell_domain = 'Global' cloudshell_IP = '163.162.xxx.yyy' cloudshell_port = '8029' res_id = 'c9129958-e09a-40a3-a796-9663c8a76610' resource_name = 'Remotest' dev_help.attach_to_cloudshell_as(user=cloudshell_user, password=cloudshell_pass, domain=cloudshell_domain, reservation_id=res_id, server_address=cloudshell_IP, cloudshell_api_port=cloudshell_port, resource_name=resource_name) details = qs_helper.get_reservation_context_details() resource = qs_helper.get_resource_context_details() reservation = qs_helper.get_reservation_context_details() connectivity = qs_helper.get_connectivity_context_details() my_context = ResourceCommandContext(connectivity=connectivity, resource=resource, reservation=reservation, connectors=[]) my_driver_instance = Remotest() my_driver_instance.initialize(my_context) session = api.CloudShellAPISession(my_context.connectivity.server_address, token_id=my_context.connectivity.admin_auth_token, domain=my_context.reservation.domain)
Traceback (most recent call last): token_id=my_context.connectivity.admin_auth_token, AttributeError: ConnectivityContextDetails instance has no attribute 'admin_auth_token' Process finished with exit code 1
.
Answer by Chris Grabosky · Aug 02, 2016 at 01:53 PM
Hi,
So the updated official documentation is located here to do this specific task: https://qualisystems.github.io/devguide//orch/scripts-deep-dive.html
and the generic tutorial is here: https://qualisystems.github.io/devguide/tut/getting-information-from-cloudshell.html
Here is what I did:
* Made a reservation on the system
* used [shellfoundry](https://github.com/QualiSystems/shellfoundry) to create the driver skeleton: `shellfoundry new --template resource fakeshell`
* Opened pycharm, pointed it at the project, and put in the code from the [first link](https://qualisystems.github.io/devguide//orch/scripts-deep-dive.html) to connect to the reservation
You can also use the [debugging capabilities to debug a python driver in real time](https://qualisystems.github.io/devguide/tut/debugging-driver-commands.html).
If that doesn't work, post back your results and the version you are trying to run. Also ensure that [shellfoundry](https://github.com/QualiSystems/shellfoundry) and the [pycharm plugin](https://github.com/QualiSystemsLab/CloudShell-PyCharm-Plugin) are up to date.
Answer by Riccardo Russo · Aug 02, 2016 at 03:06 PM
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.
Is there a way for a driver to obtain a blueprint's "Estimated setup duration" value? 4 Answers
How do I add new Python startup/teardown functionality to a blueprint? 4 Answers
Upload resource driver - error message: 'Object reference not set to an instance of an object' 1 Answer
Has someone experience with Python vs cx_Oracle library integration? 3 Answers
Failed to install shell? 1 Answer