diff --git a/.idea/deployment.xml b/.idea/deployment.xml
index 8f35b0c7..dcfd6e16 100644
--- a/.idea/deployment.xml
+++ b/.idea/deployment.xml
@@ -9,14 +9,7 @@
-
-
-
-
-
-
-
-
+
diff --git a/.idea/devEops.iml b/.idea/devEops.iml
index e617f5da..4e129bc4 100644
--- a/.idea/devEops.iml
+++ b/.idea/devEops.iml
@@ -12,7 +12,7 @@
-
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 97b5bd89..33144de4 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/.idea/remote-mappings.xml b/.idea/remote-mappings.xml
index a57c9d0b..ed0a671d 100644
--- a/.idea/remote-mappings.xml
+++ b/.idea/remote-mappings.xml
@@ -4,6 +4,7 @@
+
diff --git a/.idea/webServers.xml b/.idea/webServers.xml
index 29196d71..64d82c98 100644
--- a/.idea/webServers.xml
+++ b/.idea/webServers.xml
@@ -2,24 +2,16 @@
-
+
-
+
@@ -281,18 +417,18 @@
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
@@ -308,97 +444,96 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
+
+
+
+
-
+
-
+
-
+
@@ -589,30 +724,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -639,15 +750,15 @@
-
+
-
-
+
+
@@ -660,18 +771,18 @@
-
+
-
+
-
-
+
+
@@ -680,27 +791,32 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ Default
+
@@ -712,230 +828,6 @@
1501062126124
-
- 1502959656464
-
-
-
- 1502959656464
-
-
- 1502965343708
-
-
-
- 1502965343708
-
-
- 1503309845595
-
-
-
- 1503309845595
-
-
- 1503387958948
-
-
-
- 1503387958948
-
-
- 1503399100815
-
-
-
- 1503399100815
-
-
- 1503482967455
-
-
-
- 1503482967455
-
-
- 1503569275030
-
-
-
- 1503569275030
-
-
- 1503655324178
-
-
-
- 1503655324178
-
-
- 1504529869756
-
-
-
- 1504529869756
-
-
- 1504610309123
-
-
-
- 1504610309123
-
-
- 1504692238254
-
-
-
- 1504692238254
-
-
- 1504785243130
-
-
-
- 1504785243130
-
-
- 1504855902323
-
-
-
- 1504855902323
-
-
- 1504860397624
-
-
-
- 1504860397624
-
-
- 1505131098517
-
-
-
- 1505131098517
-
-
- 1505219853929
-
-
-
- 1505219853929
-
-
- 1508161170808
-
-
-
- 1508161170808
-
-
- 1508162690424
-
-
-
- 1508162690424
-
-
- 1508345131076
-
-
-
- 1508345131076
-
-
- 1508491437670
-
-
-
- 1508491437670
-
-
- 1508752886121
-
-
-
- 1508752886121
-
-
- 1508811206647
-
-
-
- 1508811206647
-
-
- 1508838220340
-
-
-
- 1508838220340
-
-
- 1508893612781
-
-
-
- 1508893612781
-
-
- 1508895172809
-
-
-
- 1508895172809
-
-
- 1508900246248
-
-
-
- 1508900246248
-
-
- 1508927997422
-
-
-
- 1508927997422
-
-
- 1509009879979
-
-
-
- 1509009879979
-
-
- 1509932938819
-
-
-
- 1509932938819
-
-
- 1509933266485
-
-
-
- 1509933266486
-
-
- 1510044250018
-
-
-
- 1510044250018
-
-
- 1514275643496
-
-
-
- 1514275643496
-
1514367193993
@@ -1055,7 +947,231 @@
1517318307057
-
+
+ 1517587585354
+
+
+
+ 1517587585354
+
+
+ 1518170943576
+
+
+
+ 1518170943577
+
+
+ 1518427944880
+
+
+
+ 1518427944880
+
+
+ 1519288016741
+
+
+
+ 1519288016742
+
+
+ 1520316746977
+
+
+
+ 1520316746978
+
+
+ 1520414539511
+
+
+
+ 1520414539512
+
+
+ 1520850469730
+
+
+
+ 1520850469730
+
+
+ 1520932679085
+
+
+
+ 1520932679085
+
+
+ 1521074225589
+
+
+
+ 1521074225589
+
+
+ 1521443756664
+
+
+
+ 1521443756664
+
+
+ 1521529135627
+
+
+
+ 1521529135627
+
+
+ 1521789701544
+
+
+
+ 1521789701545
+
+
+ 1522067769111
+
+
+
+ 1522067769111
+
+
+ 1522159428601
+
+
+
+ 1522159428601
+
+
+ 1522166357800
+
+
+
+ 1522166357800
+
+
+ 1522251908311
+
+
+
+ 1522251908311
+
+
+ 1522324333451
+
+
+
+ 1522324333452
+
+
+ 1522425159091
+
+
+
+ 1522425159091
+
+
+ 1522669888395
+
+
+
+ 1522669888395
+
+
+ 1522670171427
+
+
+
+ 1522670171427
+
+
+ 1522748765592
+
+
+
+ 1522748765592
+
+
+ 1522838136956
+
+
+
+ 1522838136957
+
+
+ 1523024905889
+
+
+
+ 1523024905889
+
+
+ 1523183801974
+
+
+
+ 1523183801975
+
+
+ 1523358978711
+
+
+
+ 1523358978711
+
+
+ 1523445473387
+
+
+
+ 1523445473387
+
+
+ 1523613068254
+
+
+
+ 1523613068254
+
+
+ 1523704699938
+
+
+
+ 1523704699939
+
+
+ 1525948759537
+
+
+
+ 1525948759538
+
+
+ 1526971970474
+
+
+
+ 1526971970475
+
+
+ 1526978141094
+
+
+
+ 1526978141094
+
+
+ 1526978233364
+
+
+
+ 1526978233364
+
+
@@ -1072,7 +1188,7 @@
-
+
@@ -1083,34 +1199,37 @@
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
+
+
+
-
+
-
-
-
+
+
+
+
+
@@ -1156,54 +1275,54 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
file://$PROJECT_DIR$/apitry/playbook.py
- 23
+ 26
file://$PROJECT_DIR$/apitry/playbook.py
- 27
+ 30
file://$PROJECT_DIR$/apitry/playbook.py
- 32
+ 35
file://$PROJECT_DIR$/apitry/playbook.py
- 36
+ 39
@@ -1216,11 +1335,6 @@
8
-
- file://$PROJECT_DIR$/apps/execute/api.py
- 44
-
-
file://$PROJECT_DIR$/apps/execute/service/catch/db.py
17
@@ -1231,16 +1345,6 @@
63
-
- file://$PROJECT_DIR$/apps/authority/views/user.py
- 86
-
-
-
- file://$PROJECT_DIR$/apps/authority/api.py
- 20
-
-
file://$PROJECT_DIR$/apps/execute/callback/__init__.py
19
@@ -1270,16 +1374,6 @@
58
-
- file://$PROJECT_DIR$/apps/softlib/views.py
- 8
-
-
-
- file://$PROJECT_DIR$/apps/application/forms.py
- 60
-
-
file://$USER_HOME$/.PyCharm2017.1/system/remote_sources/973181044/454295256/rest_framework/pagination.py
203
@@ -1310,11 +1404,6 @@
265
-
- file://$PROJECT_DIR$/apps/manager/api.py
- 76
-
-
file://$PROJECT_DIR$/apps/upload/views.py
56
@@ -1325,31 +1414,11 @@
45
-
- file://$PROJECT_DIR$/apps/utils/permission/jumper.py
- 1
-
-
-
- file://$PROJECT_DIR$/apps/utils/api.py
- 25
-
-
-
- file://$PROJECT_DIR$/apps/authority/models.py
- 1
-
-
file://$PROJECT_DIR$/apps/xmt/forms.py
28
-
- file://$PROJECT_DIR$/apps/manager/views/host.py
- 34
-
-
file://$PROJECT_DIR$/apps/xmt/forms.py
25
@@ -1360,6 +1429,16 @@
35
+
+ file://$PROJECT_DIR$/apps/manager/consumers.py
+ 36
+
+
+
+ file://$PROJECT_DIR$/apps/ops/models.py
+ 36
+
+
@@ -1371,397 +1450,441 @@
-
+
-
-
-
-
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
+
+
-
+
-
-
+
+
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
+
-
+
-
-
-
-
-
+
+
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
-
-
-
+
+
+
-
+
-
-
+
+
-
+
-
-
+
+
+
-
+
-
-
+
+
-
+
-
-
-
-
-
+
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
-
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
-
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
-
+
+
+
+
+
diff --git a/apps/dashboard/api/expired.py b/apps/dashboard/api/expired.py
index 30f2f745..ae2f5f4e 100644
--- a/apps/dashboard/api/expired.py
+++ b/apps/dashboard/api/expired.py
@@ -28,7 +28,7 @@ class ExpiredPagination(PageNumberPagination):
class DashboardExpiredECSAPI(WebTokenAuthentication,generics.ListAPIView):
module = models.ExpiredAliyunECS
permission_classes = [AllowAny,]
- queryset = models.ExpiredAliyunECS.objects.all().order_by('expired')
+ queryset = models.ExpiredAliyunECS.objects.all()
serializer_class = serializers.DashboardExpiredAliyunECSSerializer
pagination_class = ExpiredPagination
@@ -36,6 +36,6 @@ class DashboardExpiredECSAPI(WebTokenAuthentication,generics.ListAPIView):
class DashboardExpiredRDSAPI(WebTokenAuthentication,generics.ListAPIView):
module = models.ExpiredAliyunRDS
permission_classes = [AllowAny,]
- queryset = models.ExpiredAliyunRDS.objects.all().order_by('expired')
+ queryset = models.ExpiredAliyunRDS.objects.all()
serializer_class = serializers.DashboardExpiredAliyunRDSSerializer
pagination_class = ExpiredPagination
\ No newline at end of file
diff --git a/apps/dashboard/tasks.py b/apps/dashboard/tasks.py
index 6f605ee7..60d11e3e 100644
--- a/apps/dashboard/tasks.py
+++ b/apps/dashboard/tasks.py
@@ -15,7 +15,6 @@
connect = redis.StrictRedis(port=REDIS_PORT,db=REDIS_SPACE)
-
@periodic_task(run_every=crontab(minute='*'))
def aliyunECSExpiredInfoCatch():
from dashboard.models import ExpiredAliyunECS
@@ -48,4 +47,30 @@ def aliyunRDSInfoCatch():
expiredTime = datetime.datetime.strptime(dt['ExpireTime'],'%Y-%m-%dT%H:%M:%SZ')
if 0 < (expiredTime - now).days < EXPIREDTIME:
dt['ExpiredDay'] = (expiredTime - now).days
- ExpiredAliyunRDS(**resolver.AliyunRDS2Json.decode(dt)).save()
\ No newline at end of file
+ ExpiredAliyunRDS(**resolver.AliyunRDS2Json.decode(dt)).save()
+
+
+@periodic_task(run_every=crontab(minute='*'))
+def managerStatusCatch():
+ connect.delete('MANAGER_STATUS')
+ from manager import models as Manager
+ host_count = Manager.Host.objects.count()
+ group_count = Manager.Group.objects.count()
+ status = {
+ 'host_count':host_count,
+ 'group_count':group_count,
+ }
+ systypes = Manager.System_Type.objects.all()
+ for sys in systypes:
+ status[sys.name] = sys.hosts_detail.count()
+
+ positions = Manager.Position.objects.all()
+ for pos in positions:
+ status['pos'+str(pos.id)] = pos.hosts_detail.count()
+
+ groups = Manager.Group.objects.all()
+ for group in groups:
+ status[group.uuid] = group.hosts.count()
+
+ connect.hmset('MANAGER_STATUS', status)
+
diff --git a/apps/dashboard/urls/api_urls.py b/apps/dashboard/urls/api_urls.py
index 57bca2ec..1bd08919 100644
--- a/apps/dashboard/urls/api_urls.py
+++ b/apps/dashboard/urls/api_urls.py
@@ -4,7 +4,7 @@
urlpatterns=[
# Resource dashboard api
- path(r'v1/dashboard/', DashboardAPI.DashboardAPI.as_view()),
+ path(r'v1/manager/', DashboardAPI.DashboardAPI.as_view()),
#
# Resource expire api
path(r'v1/expired/ecs/bypage/', ExpiredAPI.DashboardExpiredECSAPI.as_view()),
diff --git a/apps/manager/tasks.py b/apps/manager/tasks.py
index 0bd3e469..2268e83c 100644
--- a/apps/manager/tasks.py
+++ b/apps/manager/tasks.py
@@ -14,31 +14,6 @@
connect = redis.StrictRedis(port=REDIS_PORT,db=REDIS_SPACE)
-@periodic_task(run_every=crontab(minute='*'))
-def managerStatusCatch():
- connect.delete('MANAGER_STATUS')
- from manager import models as Manager
- host_count = Manager.Host.objects.count()
- group_count = Manager.Group.objects.count()
- status = {
- 'host_count':host_count,
- 'group_count':group_count,
- }
- systypes = Manager.System_Type.objects.all()
- for sys in systypes:
- status[sys.name] = sys.hosts_detail.count()
-
- positions = Manager.Position.objects.all()
- for pos in positions:
- status['pos'+str(pos.id)] = pos.hosts_detail.count()
-
- groups = Manager.Group.objects.all()
- for group in groups:
- status[group.uuid] = group.hosts.count()
-
- connect.hmset('MANAGER_STATUS', status)
-
-
# @periodic_task(run_every=crontab(minute='*'))
# def aliyunECSInfoCatch():
# from deveops.utils import aliyun