Kentik’s Python SDK version 1.0.0 released
The important characteristics of the Kentik Platform are rich API capabilities and the supporting SDKs. For the last two years Kentik has supported the development of the community Python SDK which is based on the Kentik’s APIs. This SDK enables our customers to use Kentik’s Platform APIs natively in the Python programming language, with Python Objects and Methods instead of dealing with the details of the API syntax.
The Community Python SDK is available on GitHub: https://github.com/kentik/community_sdk_python.
Just over a month ago, we released a new version 1.0.0. Until this version, the community Python SDK supported objects and methods that are exposed within Kentik’s REST API v5. With this new release, the support has been extended to some of the endpoints of our new gRPC-based Kentik API v6, specifically supporting Synthetics monitoring and Cloud Export configuration.
Important note on breaking changes
As it is already mentioned, Kentik’s API v6 is natively a gRPC API, but it also supports the REST access. The community Python SDK is using the Kentik API v6 directly over gRPC. To accommodate communication with the Kentik backend using both REST-based Kentik API v5 and gRPC-based Kentik API v6, the necessary change has been introduced that would require a change of your existing Python scripts and programs.
In most of the cases, you would initialize the KentikAPI
object with the constrictor that is using the api_url
argument, for example:
from kentik_api import KentikAPI
client = KentikAPI(api_url=KentikAPI.API_URL_US, auth_email=email, auth_token=token)
The api_url
argument would expect the URL to the Kentik’s API endpoint, which would be in the form: https://api.kentik.com
or https://api.kentik.eu
. However, the endpoint that is used for the Kentik’s API v6 is in the form of the host, for example: grpc.api.kentik.com
.
For this reason and to be able to configure API access information with the single parameter, it was decided that api_url
argument of the KentikAPI
constructor should be replaced with api_host
argument. The argument is expected to contain only the fully qualified hostname of the server hosting the target Kentik API instance (the default value is KentikAPI.API_HOST_US
which is equal to api.kentik.com
). Consequently, the Class variable KentikAPI.API_URL_US
has been replaced with KentikAPI.API_HOST_US
and KentikAPI.API_URL_EU
with KentikAPI.API_HOST_EU
To summarize, if you upgrade the version of your Python SDK to 1.0.0 or later, you will need for adjust the initialization of the KentikAPI
to use the changed argument, for example:
from kentik_api import KentikAPI
client = KentikAPI(api_host=KentikAPI.API_HOST_US, auth_email=email, auth_token=token)
Installation
You can easily install the latest version of the Python SDK using pip
, for example:
$ python3 -m pip install kentik-api
Let us know what you think about our Python SDK and feel free to submit any contributions or issues over GitHub. Happy coding!