Skip to content

Commit

Permalink
删除工程配置
Browse files Browse the repository at this point in the history
  • Loading branch information
YoLoveLife committed May 22, 2018
1 parent 3e41844 commit 1dad380
Show file tree
Hide file tree
Showing 10 changed files with 837 additions and 728 deletions.
9 changes: 1 addition & 8 deletions .idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/devEops.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/remote-mappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 4 additions & 12 deletions .idea/webServers.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,475 changes: 799 additions & 676 deletions .idea/workspace.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/dashboard/api/expired.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ 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


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
29 changes: 27 additions & 2 deletions apps/dashboard/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
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)

2 changes: 1 addition & 1 deletion apps/dashboard/urls/api_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down
25 changes: 0 additions & 25 deletions apps/manager/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1dad380

Please sign in to comment.