Skip to main content
Version: 2023.3

CloudShell Automation API

The CloudShell Automation API package is the recommended way to automate CloudShell from Python scripts and drivers, for example, to get more information or perform more operations using CloudShell.

The CloudShell Automation API package is installed in the Python environment installation directory upon pip installation, in the following file location in your local directory: ...\python\2.7.18\Lib\site-packages\cloudshell\.

The CloudShell Automation API package includes the following API modules for use with Python scripts and drivers:

  • cloudshell_api.py: allows you to use the CloudShell API from Python.
  • common_cloudshell_api.py: is a helper file required to run methods from cloudshell_api.py.
  • cloudshell_scripts_helpers.py: provides a convenient way to initialize the CloudShell API and get blueprint variables in your script.
  • cloudshell_dev_helpers.py: allows developers to run and debug their code on their local machine as if their scripts are running in CloudShell.

The CloudShell Automation API reference documentation comes in two versions:

The Python package API guide includes additional information like class structure and return objects and is intended for experienced Python developers, while the TestShell API Python Reference Guide is intended for developers who are newer to Python, as it features an easy to understand format and code examples.

note

CloudShell Automation API uses UTC timezone by default, but you can change to a different timezone using the CloudShellAPISession.

For information about installing Python and pip, and for further information about using Python scripts and drivers, see The CloudShell DevGuide.