diff --git a/apps/assets/api/__init__.py b/apps/assets/api/__init__.py index 45afd4379..7a8ce9a60 100644 --- a/apps/assets/api/__init__.py +++ b/apps/assets/api/__init__.py @@ -10,4 +10,4 @@ from .domain import * from .cmd_filter import * from .gathered_user import * from .favorite_asset import * -from .backup import * +from .account_backup import * diff --git a/apps/assets/api/backup.py b/apps/assets/api/account_backup.py similarity index 96% rename from apps/assets/api/backup.py rename to apps/assets/api/account_backup.py index d507b4655..bce4ce55b 100644 --- a/apps/assets/api/backup.py +++ b/apps/assets/api/account_backup.py @@ -28,7 +28,7 @@ class AccountBackupPlanExecutionViewSet(viewsets.ModelViewSet): serializer_class = serializers.AccountBackupPlanExecutionSerializer search_fields = ('trigger',) filterset_fields = ('trigger', 'plan_id') - http_method_names = ['get', 'post'] + http_method_names = ['get', 'post', 'options'] def get_queryset(self): queryset = AccountBackupPlanExecution.objects.all() diff --git a/apps/assets/task_handlers/backup/handlers.py b/apps/assets/task_handlers/backup/handlers.py index d0e9fe365..a73bced59 100644 --- a/apps/assets/task_handlers/backup/handlers.py +++ b/apps/assets/task_handlers/backup/handlers.py @@ -88,7 +88,7 @@ class AssetAccountHandler(BaseAccountHandler): for k, v in df_dict.items(): df_dict[k] = pd.DataFrame(v) - logger.info('\n\033[33m- 共收集{}条资产账号\033[0m'.format(accounts.count())) + logger.info('\n\033[33m- 共收集 {} 条资产账号\033[0m'.format(accounts.count())) return df_dict diff --git a/apps/assets/urls/api_urls.py b/apps/assets/urls/api_urls.py index fee5b9a9c..59d4ab171 100644 --- a/apps/assets/urls/api_urls.py +++ b/apps/assets/urls/api_urls.py @@ -26,8 +26,8 @@ router.register(r'favorite-assets', api.FavoriteAssetViewSet, 'favorite-asset') router.register(r'system-users-assets-relations', api.SystemUserAssetRelationViewSet, 'system-users-assets-relation') router.register(r'system-users-nodes-relations', api.SystemUserNodeRelationViewSet, 'system-users-nodes-relation') router.register(r'system-users-users-relations', api.SystemUserUserRelationViewSet, 'system-users-users-relation') -router.register(r'backup', api.AccountBackupPlanViewSet, 'backup') -router.register(r'backup-execution', api.AccountBackupPlanExecutionViewSet, 'backup-execution') +router.register(r'account-backup-plans', api.AccountBackupPlanViewSet, 'account-backup') +router.register(r'account-backup-plan-executions', api.AccountBackupPlanExecutionViewSet, 'account-backup-execution') cmd_filter_router = routers.NestedDefaultRouter(router, r'cmd-filters', lookup='filter') cmd_filter_router.register(r'rules', api.CommandFilterRuleViewSet, 'cmd-filter-rule')