Files
deb-python-dcos/dcos/sse.py
Maksym Naboka 33c44b4a9f switch to dcos-log logging backend (#817)
with DC/OS 1.9 release all system and container logs will go to sd journal on each
host. This PR adds dcos-log support to CLI.

Before using newest API , the CLI will try to get the cosmos capability "LOGGING".
If the cluster supports dcos-log, it will use it. If the requests fails or
dcos-log is missing the LOGGING capability, we will default to mesos files API.
2017-01-03 15:00:15 -08:00

20 lines
561 B
Python

from sseclient import SSEClient
from . import http
def get(url, **kwargs):
""" Make a get request to streaming endpoint which
implements SSE (Server sent events). The parameter session=http
will ensure we are using `dcos.http` module with all required auth
headers.
:param url: server sent events streaming URL
:type url: str
:param kwargs: arbitrary params for requests
:type kwargs: dict
:return: instance of sseclient.SSEClient
:rtype: sseclient.SSEClient
"""
return SSEClient(url, session=http, **kwargs)