import - rancher dashboard by quota usage
This commit is contained in:
@@ -71,7 +71,7 @@ class RancherDashboardService:
|
||||
return rancher_data
|
||||
|
||||
@staticmethod
|
||||
def rancher_dashboard_by_quota_usage(self, rancher: Rancher):
|
||||
def get_rancher_dashboard_by_quota_usage(self, rancher: Rancher):
|
||||
"""
|
||||
get rancher dashboard by quota usage
|
||||
"""
|
||||
@@ -83,4 +83,6 @@ class RancherDashboardService:
|
||||
transaction__transaction_status='success',
|
||||
).values('quota_stat')
|
||||
|
||||
return
|
||||
print(list(set(transaction_sale_items)))
|
||||
|
||||
return {}
|
||||
|
||||
@@ -217,3 +217,25 @@ class RancherViewSet(BaseViewSet, RancherDashboardService, SoftDeleteMixin, view
|
||||
rancher=rancher
|
||||
)
|
||||
return Response(rancher_dashboard_data)
|
||||
|
||||
@action(
|
||||
methods=['get'],
|
||||
detail=True,
|
||||
url_path='rancher_dashboard_by_quota_usage',
|
||||
url_name='rancher_dashboard_by_quota_usage',
|
||||
name='rancher_dashboard_by_quota_usage'
|
||||
)
|
||||
def rancher_dashboard_by_quota_usage(self, request, pk=None):
|
||||
""" rancher dashboard """
|
||||
|
||||
rancher = self.get_object()
|
||||
|
||||
query_param = self.request.query_params # noqa
|
||||
|
||||
query_string = query_param.get('search', None)
|
||||
|
||||
rancher_dashboard_data = self.get_rancher_dashboard_by_quota_usage(
|
||||
self,
|
||||
rancher=rancher
|
||||
)
|
||||
return Response(rancher_dashboard_data)
|
||||
|
||||
Reference in New Issue
Block a user