Skip to content

Commit f31f6f0

Browse files
authored
Merge pull request #19 from draios/doc_onprem
Document steps for connecting in On-Premises installs
2 parents 34c5e65 + 6ce3970 commit f31f6f0

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
Sysdig Cloud python client library
1+
Sysdig Cloud Python client library
22
===
33

44
[![Build Status](https://travis-ci.org/draios/python-sdc-client.png?branch=master)](https://travis-ci.org/draios/python-sdc-client)
55
[![Current version on PyPI](http://img.shields.io/pypi/v/sdcclient.svg)](https://pypi.python.org/pypi/sdcclient)
66

7-
A python client API for Sysdig Cloud.
7+
A Python client API for Sysdig Cloud.
88

9-
This module is a wrapper around the Sysdig Cloud API, which is documented [here](http://support.sysdigcloud.com/hc/en-us/articles/205233166-The-Sysdig-Cloud-API-Specification). 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](examples/) subdir) that quickly address several use cases.
9+
This module is a wrapper around the Sysdig Cloud API, which is documented [here](http://support.sysdigcloud.com/hc/en-us/articles/205233166-The-Sysdig-Cloud-API-Specification). 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](examples/) subdir) that quickly address several use cases.
1010

1111
Installation
1212
------------
@@ -56,12 +56,28 @@ Function List
5656

5757
Please Refer to the [Python Script Library documentation page](http://python-sdc-client.readthedocs.io/en/latest/) for the list of functions available.
5858

59-
Transitioning from python to REST
59+
On-Premises Installs
60+
--------------------
61+
For [On-Premises Sysdig Cloud installs](https://support.sysdigcloud.com/hc/en-us/articles/206519903-On-Premises-Installation-Guide), additional configuration is necessary to point to your API server rather than the default SaaS-based one, and also to easily connect when using a self-signed certificate for SSL. One way to handle this is by setting environment variables before running your Python scripts:
62+
63+
```
64+
export SDC_URL='https://<YOUR-API-SERVER-HOSTNAME-OR-IP>'
65+
export SDC_SSL_VERIFY='false'
66+
```
67+
68+
Alternatively, you can specify the additional arguments in your Python scripts as you instantiate the SDC client:
69+
70+
```
71+
sdclient = SdcClient(sdc_token, sdc_url='https://<YOUR-API-SERVER-HOSTNAME-OR-IP>', ssl_verify=False)
72+
```
73+
74+
75+
Transitioning from Python to REST
6076
---------------------------------
6177

62-
If your goal is to interact with the REST API directly, you can use this python client library to understand the REST interactions by logging the actions it takes. This is useful because full documentation of the REST API has not yet been created; and also provides a complete example of known working operations.
78+
If your goal is to interact with the REST API directly, you can use this Python client library to understand the REST interactions by logging the actions it takes. This is useful because full documentation of the REST API has not yet been created; and also provides a complete example of known working operations.
6379

64-
- Use or modify an example, or write a new script against the python sdcclient module.
80+
- Use or modify an example, or write a new script against the Python sdcclient module.
6581
- Log the HTTP requests made by the script.
6682

6783
To log all the requests made by your script in significant detail, add to your script:

sdcclient/_client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
import copy
55

66
class SdcClient:
7+
'''Interact with the Sysdig Cloud API.
8+
9+
**Arguments**
10+
- **token**: A Sysdig Cloud API token from the *Sysdig Cloud API* section of the `Settings <https://app.sysdigcloud.com/#/settings/user>`_ page.
11+
- **sdc_url**: URL for contacting Sysdig Cloud API server. Set this in `On-Premises installs <https://support.sysdigcloud.com/hc/en-us/articles/206519903-On-Premises-Installation-Guide>`__.
12+
- **ssl_verify**: Whether to verify certificate. Set to False if using a self-signed certificate in an `On-Premises install <https://support.sysdigcloud.com/hc/en-us/articles/206519903-On-Premises-Installation-Guide>`__.
13+
14+
**Returns**
15+
An object for further interactions with the Sysdig Cloud API. See methods below.
16+
'''
717
lasterr = None
818

919
def __init__(self, token="", sdc_url='https://app.sysdigcloud.com', ssl_verify=True):

0 commit comments

Comments
 (0)