mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 20:26:13 +01:00
cf036df68b
Add more metrics validation Signed-off-by: Yang Jiao <jiaoya@vmware.com>
22 lines
763 B
Python
22 lines
763 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
import base
|
|
import v2_swagger_client
|
|
from v2_swagger_client.rest import ApiException
|
|
|
|
|
|
class Statistic(base.Base):
|
|
|
|
def __init__(self):
|
|
super(Statistic, self).__init__(api_type="statistic")
|
|
|
|
def get_statistic(self, expect_status_code=200, expect_response_body=None, **kwargs):
|
|
try:
|
|
return_data, status_code, _ = self._get_client(**kwargs).get_statistic_with_http_info()
|
|
except ApiException as e:
|
|
base._assert_status_code(expect_status_code, e.status)
|
|
if expect_response_body is not None:
|
|
base._assert_status_body(expect_response_body, e.body)
|
|
return
|
|
base._assert_status_code(expect_status_code, status_code)
|
|
return return_data |