Beispiel #1
0
 def history(self, **kwargs):
     key = urlsafe_base64_encode(self.key)
     keyword = ['start', 'end']
     url = "http://{0}/{1}/hubs/{2}/streams/{3}/historyactivity?".format(
         API_HOST, API_VERSION, self.hub, key)
     url = normalize_path(kwargs, keyword, url)
     return api._get(url=url, auth=self.__auth__)
Beispiel #2
0
 def refresh(self):
     key = urlsafe_base64_encode(self.key)
     url = "http://%s/%s/hubs/%s/streams/%s" % (API_HOST, API_VERSION,
                                                self.hub, key)
     data = api._get(url=url, auth=self.__auth__)
     self.__data__ = {}
     for p in [
             "disabledTill", "converts", "createdAt", "updatedAt",
             "expireAt", "watermark", "converts"
     ]:
         self.__data__[p] = json.loads(
             data.text).get(p) if p in data.text else None
     self.__data__["key"] = self.key
     self.__data__["hub"] = self.hub
     return self.__data__
Beispiel #3
0
 def wm_list(self, **kwargs):
     keyword = ['limit']
     url = "http://{0}/{1}/hubs/{2}/watermarktemplate".format(
         API_HOST, API_VERSION, self.__hub__)
     url = normalize_path(kwargs, keyword, url)
     return api._get(url=url, auth=self.__auth__)
Beispiel #4
0
 def bandwidth_count_detail(self, time):
     url = "http://{0}/{1}/hubs/{2}/stat/play/history/detail?time={3}".format(
         API_HOST, API_VERSION, self.__hub__, time)
     return api._get(url, self.__auth__)
Beispiel #5
0
 def bandwidth_count_history(self, **kwargs):
     url = "http://{0}/{1}/hubs/{2}/stat/play/history".format(
         API_HOST, API_VERSION, self.__hub__)
     keyword = ['start', 'end', 'limit', 'marker']
     url = normalize_path(kwargs, keyword, url)
     return api._get(url=url, auth=self.__auth__)
Beispiel #6
0
 def bandwidth_count_now(self):
     url = "http://{0}/{1}/hubs/{2}/stat/play".format(
         API_HOST, API_VERSION, self.__hub__)
     return api._get(url, self.__auth__)
Beispiel #7
0
 def list(self, **kwargs):
     url = "http://{0}/{1}/hubs/{2}/streams?".format(
         API_HOST, API_VERSION, self.__hub__)
     keyword = ['liveonly', 'prefix', 'limit', 'marker']
     url = normalize_path(kwargs, keyword, url)
     return api._get(url=url, auth=self.__auth__)
Beispiel #8
0
 def wm_query(self, name):
     url = "http://{0}/{1}/hubs/{2}/watermarktemplate/{3}".format(
         API_HOST, API_VERSION, self.__hub__, name)
     return api._get(url=url, auth=self.__auth__)
Beispiel #9
0
 def status(self):
     key = urlsafe_base64_encode(self.key)
     url = "http://%s/%s/hubs/%s/streams/%s/live" % (API_HOST, API_VERSION,
                                                     self.hub, key)
     return api._get(url=url, auth=self.__auth__)
Beispiel #10
0
 def getUser(self, roomName, version=RTC_API_VERSION):
     url = "http://%s/%s/rooms/%s/users" % (RTC_API_HOST, version, roomName)
     return api._get(url=url, auth=self.__auth__)