Add traffic endpoint for System API
This commit is contained in:
parent
be52fae1c3
commit
608d4bfe10
1 changed files with 39 additions and 0 deletions
|
@ -41,3 +41,42 @@ class Bodies(base.ApiEndpoint):
|
||||||
|
|
||||||
json = cls.query({'systemId': str(systemId)})
|
json = cls.query({'systemId': str(systemId)})
|
||||||
return json
|
return json
|
||||||
|
|
||||||
|
class Traffic(base.ApiEndpoint):
|
||||||
|
"""
|
||||||
|
The "traffic" endpoint of the "system" API
|
||||||
|
|
||||||
|
:attribute url: the API endpoint URL
|
||||||
|
"""
|
||||||
|
|
||||||
|
url = base.ApiEndpoint.url + "system-v1/traffic"
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def query(cls, params):
|
||||||
|
try:
|
||||||
|
json = super().query(params)
|
||||||
|
except exception.NotFoundError:
|
||||||
|
raise exception.SystemNotFoundError(params)
|
||||||
|
return json
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def getTraffic(cls, systemName):
|
||||||
|
"""
|
||||||
|
Requests information about traffic in a system.
|
||||||
|
|
||||||
|
:param systemName: name of the system in question
|
||||||
|
"""
|
||||||
|
|
||||||
|
json = cls.query({'systemName': systemName})
|
||||||
|
return json
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def getTrafficbyId(cls, systemId):
|
||||||
|
"""
|
||||||
|
Requests information about traffic in a system.
|
||||||
|
|
||||||
|
:param systemName: ID of the system in question
|
||||||
|
"""
|
||||||
|
|
||||||
|
json = cls.query({'systemId' : str(systemId)})
|
||||||
|
return json
|
Loading…
Reference in a new issue