Skip to content

Renaming SdMonClient -> SdMonitorClient #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ Usage

_Note:_ in order to use this API you must obtain a Sysdig Monitor/Secure API token. You can get your user's token in the _Sysdig Monitor API_ section of the settings page for [monitor](https://app.sysdigcloud.com/#/settings/user) or [secure](https://secure.sysdig.com/#/settings/user).

The library exports two classes, `SdMonClient` and `SdSecureClient` that are used to connect to Sysdig Monitor/Secure and execute actions. They can be instantiated like this:
The library exports two classes, `SdMonitorClient` and `SdSecureClient` that are used to connect to Sysdig Monitor/Secure and execute actions. They can be instantiated like this:

``` python
from sdcclient import SdMonClient
from sdcclient import SdMonitorClient

api_token = "MY_API_TOKEN"

#
# Instantiate the Sysdig Monitor client
#
client = SdMonClient(api_token)
client = SdMonitorClient(api_token)
```

For backwards compatibility purposes, a third class `SdcClient` is exported which is an alias of `SdMonClient`.
For backwards compatibility purposes, a third class `SdcClient` is exported which is an alias of `SdMonitorClient`.

Once instantiated, all the methods documented below can be called on the object.

#### Return Values
Every method in the SdMonClient/SdSecureClient classes 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:
Every method in the SdMonitorClient/SdSecureClient classes 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

Expand All @@ -70,7 +70,7 @@ export SDC_SSL_VERIFY='false'
Alternatively, you can specify the additional arguments in your Python scripts as you instantiate the SDC client:

```
client = SdMonClient(api_token, sdc_url='https://<YOUR-API-SERVER-HOSTNAME-OR-IP>', ssl_verify=False)
client = SdMonitorClient(api_token, sdc_url='https://<YOUR-API-SERVER-HOSTNAME-OR-IP>', ssl_verify=False)
```


Expand Down
2 changes: 1 addition & 1 deletion sdcclient/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from sdcclient._client import SdcClient
from sdcclient._client import SdMonClient
from sdcclient._client import SdMonitorClient
from sdcclient._client import SdSecureClient
6 changes: 3 additions & 3 deletions sdcclient/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,10 +867,10 @@ def get_user_api_token(self, username, teamname):
data = res.json()
return [True, data['token']['key']]

class SdMonClient(_SdcCommon):
class SdMonitorClient(_SdcCommon):

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

def get_alerts(self):
'''**Description**
Expand Down Expand Up @@ -1721,7 +1721,7 @@ def clear_falco_rules(self):


# For backwards compatibility
SdcClient = SdMonClient
SdcClient = SdMonitorClient

class SdSecureClient(_SdcCommon):

Expand Down