Software Development Kit
This section contains detailed information about the BMC Cloud Lifecycle Management Software Development Kit (SDK), which provides a simple way to perform task-based API operations in BMC Cloud Lifecycle Management. You do not need to interact directly with the BMC Cloud Lifecycle Management RESTful API. Instead, the SDK provides Python bindings to the full RESTful API, enabling you to use a Python command-line, code, or scripts to complete BMC Cloud Lifecycle Management operations with a simplified syntax.
This topic contains the following sections:
Installing the SDK
The SDK is installed as part of your BMC Cloud Lifecycle Management installation, and is located in the
sdk folder of the Platform Manager.Alternatively, you can download the SDK from BMC Communities.
To use the SDK, you must first complete the following activities:
Install Python 2.7.x on the computer you will use to run SDK commands. Visit www.python.org for software and documentation.
Python 2.7.x is only required on the computer from which you will run the SDK. The BMC Cloud Lifecycle Management server does not require Python.
If you will install Python on a Red Hat Enterprise Linux (RHEL) system, do not upgrade the existing Python version already installed on your RHEL system. Instead, install Python 2.7.x as a separate program:
- Ensure that you have the GNU Compiler Collection (GCC) installed. For more information about GCC, see http://gcc.gnu.org.
- Download Python 2.7.x
Run the following commands, where x is a number of the Python version you downloaded:
# tar -xzf Python-2.7.x.tgz # cd Python-2.7.x # ./configure # make altinstall
make altinstallcommand installs Python 2.7.x in parallel with the existing Python version, and enables you to run the newer version using a
- Install Python Setuptools in your Python environment. Visit https://pypi.python.org/pypi/setuptools for installation files and documentation.
- Install pip (a package manager for Python) in your Python environment. Add Python and its scripts folder to your PATH environment. Visit http://www.pip-installer.org/en/latest/installing.html for more information about pip.
After you have prepared your Python environment, complete the following installation steps:
- Copy the
Platform_Manager/sdk/python-sdk-1.0-src.zipfile from the Platform Manager server to the computer from which you will run SDK commands. Consider using
C:\sdk(for Windows) or
/home/admin/(for Linux) as a destination folder.
- Extract the .zip file.
- Enter the following command:
python setup.py installThe SDK is installed in the
csmsdkfolder of your home directory.
- Verify that the SDK was installed by entering the following command:
The SDK is installed if
bmc-csm-sdkis listed in the output.
Configuring the SDK to use SSL
If you are running BMC Cloud Lifecycle Management Platform Manager using Secure Sockets Layer (SSL), you must configure the SDK to use SSL.
- Locate the SSL key and certification files on your Platform Manager installation.
- Copy the files to the
csmsdk/key_filedirectory of your SDK installation.
- Log in to BMC Cloud Lifecycle Management using the SDK
logincommand, ensuring that you use
--urlargument of the command. For example:
python com/bmc/cloud/sdk/commandline/clmcmd.py login --url "" --user "cloudadmin" --password "password"
Configuring the SDK
Once you have run at least one command from the command line, an SDK configuration file called
csmconfig.ini is created in the
csmsdk and folder of your SDK installation. You can configure the following settings in the configuration file:
|The locale of your SDK environment.|
Time in seconds to wait for response from the server, otherwise the SDK returns the running task details. The default value is 300 seconds.
|Whether SDK activity will be logged. The value can be true or false.|
The level of logging. The values can be any of the following:
|The maximum size (in MB) of the log file. The default size is 20 MB.|
|The maximum number of old log files to retain. The default value is 5.|
The absolute path and name of the log file to use if SDK logging is enabled. The default value is:
The location of the SSL key file, if BMC Cloud Lifecycle Management Platform Manager is using SSL. The default value is:
The location of the SSL certification file, if BMC Cloud Lifecycle Management Platform Manager is using SSL. The default value is:
Uninstalling the SDK
If you want to uninstall the SDK from your BMC Cloud Lifecycle Management environment, complete the following steps:
- In a Python client, enter the following command:
The command returns
- Enter the following command:
pip uninstall bmc-csm-sdk
The SDK is uninstalled.