QualiSystems / devguide_source

This repository hosts the source code of the CloudShell developer guide.
https://devguide.quali.com
2 stars 8 forks source link

New suggestion for /devops/9.3.0/available-apis.html #236

Closed katzy687 closed 4 years ago

katzy687 commented 5 years ago

The code sample on this page shows how to start an api session from the sandbox object for orchestration scripts.

I think we should add a simple example for starting a session outside of orchestration scripts for performing admin tasks.

New customers are always asking for this simple example script, and it would be nicer to be able to link them to the dev guide.

something such as:

from cloudshell.api.cloudshell_api import CloudShellAPISession

# add credentials
user = "admin"
password = "admin"
server = "localhost"
domain = "Global"

# start session
api = CloudShellAPISession(host=server, username=user, password=password, domain=domain)

# find resources of target model
res_details = api.FindResources(resourceModel="Putshell")
Shnitselon commented 4 years ago

fixed on 12/12/2019