"""
Mesting qualities API
"""
from collections.abc import Generator
from typing import Optional
from ...api_child import ApiChild
from ...base import ApiModel
from ...base import SafeEnum as Enum
__all__ = ['MediaSessionQuality', 'MeetingQualitiesApi', 'NetworkType', 'QualityResources', 'TransportType', 'VideoIn']
[docs]
class NetworkType(str, Enum):
wifi = 'wifi'
cellular = 'cellular'
ethernet = 'ethernet'
unknown = 'unknown'
[docs]
class TransportType(str, Enum):
udp = 'UDP'
tcp = 'TCP'
[docs]
class VideoIn(ApiModel):
#: The sampling interval, in seconds, of the downstream video quality data.
sampling_interval: Optional[int] = None
#: The date and time when this video session started.
start_time: Optional[str] = None
#: The date and time when this video session ended.
end_time: Optional[str] = None
#: The percentage of video packet loss, as a float between 0.0 and 100.0, during each sampling interval.
packet_loss: Optional[list[int]] = None
#: The average latency, in milliseconds, during each sampling interval.
latency: Optional[list[int]] = None
#: The pixel height of the incoming video.
resolution_height: Optional[list[int]] = None
#: The frames per second of the incoming video.
frame_rate: Optional[list[int]] = None
#: The bit rate of the incoming video.
media_bit_rate: Optional[list[int]] = None
#: The incoming video codec.
codec: Optional[str] = None
#: The incoming video jitter.
jitter: Optional[list[int]] = None
#: The network protocol used for video transmission.
transport_type: Optional[TransportType] = None
[docs]
class QualityResources(ApiModel):
#: The average percent CPU for the process.
process_average_cpu: Optional[list[int]] = None
#: The max percent CPU for the process.
process_max_cpu: Optional[list[int]] = None
#: The average percent CPU for the system.
system_average_cpu: Optional[list[int]] = None
#: The max percent CPU for the system.
system_max_cpu: Optional[list[int]] = None
[docs]
class MeetingQualitiesApi(ApiChild, base=''):
"""
To retrieve quality information, you must use an administrator token with the analytics:read_all scope. The
authenticated user must be a read-only or full administrator of the organization to which the meeting belongs and
must not be an external administrator.
To use this endpoint, the org needs to be licensed for the Webex Pro Pack.
For CI-Native site, no additional settings are required.
For CI-linked site, the admin must also be set as the Full/ReadOnly Site Admin of the site.
A minimum Webex and Teams client version is required. For details, see Troubleshooting Help Doc.
Quality information is available 10 minutes after a meeting has started and may be retrieved for up to 7 days.
A rate limit of 1 API call every 5 minutes for the same meeting instance ID applies.
"""
[docs]
def meeting_qualities(
self, meeting_id: str, offset: int = None, **params
) -> Generator[MediaSessionQuality, None, None]:
"""
Get quality data for a meeting, by meetingId. Only organization administrators can retrieve meeting quality
data.
:param meeting_id: Unique identifier for the specific meeting instance. Note: The meetingId can be obtained via
the Meeting List API when meetingType=meeting. The id attribute in the Meeting List Response is what is
needed, for example, e5dba9613a9d455aa49f6ffdafb6e7db_I_191395283063545470.
:type meeting_id: str
:param offset: Offset from the first result that you want to fetch.
:type offset: int
documentation: https://developer.webex.com/docs/api/v1/meeting-qualities/get-meeting-qualities
"""
params['meetingId'] = meeting_id
if offset is not None:
params['offset'] = offset
url = self.ep('https://analytics.webexapis.com/v1/meeting/qualities')
return self.session.follow_pagination(url=url, model=MediaSessionQuality, params=params)