A python client API for Sysdig Cloud.
This module is a wrapper around the Sysdig Cloud API, which is documented here. It exposes most of the sysdig REST API functionality as an easy to use and easy to install python interface. The repository includes a rich set of examples (in the examples subdir) that quickly address several use cases.
Automatic w/ PyPI (virtualenv is recommended.)
pip install sdcclient
git clone https://github.com/draios/python-sdc-client.git
pip install
- If you are interested in exporting metrics data from Sysdig Cloud, take a look at examples/get_data_simple.py and examples/get_data_advanced.py.
- If you want to programmatically create an alert, refer to examples/create_alert.py
- If you want to programmatically create a dashboard, refer to examples/create_dashboard.py
Note: in order to use this API you must obtain a Sysdig Cloud token. You can get your user's token in the Sysdig Cloud API section of the settings page.
The library exports a single class, SdcClient
, that is used to connect to Sysdig Cloud and execute actions. It can be instantiated like this:
from sdcclient import SdcClient
sdc_token = "MY_API_TOKEN"
#
# Instantiate the SDC client
#
sdclient = SdcClient(sdc_token)
Once instantiated, all the methods documented below can be called on the object.
####Return Values Every method in the SdcClient class returns a list with two entries. The first one is a boolean value indicating if the call was successful. The second entry depends on the result:
- If the call was successful, it's a dictionary reflecting the json returned by the underlying REST call
- If the call failed, it's a string describing the error
For an example on how to parse this output, take a look at a simple example like get_data_simple.py
Please Refer to the Python Script Library documentation page for the list of functions available.