2016-11-16 10:12:14 +00:00
|
|
|
# coding:utf-8
|
2018-07-27 10:56:40 +00:00
|
|
|
from django.urls import path
|
2018-10-10 07:37:20 +00:00
|
|
|
from rest_framework_nested import routers
|
|
|
|
# from rest_framework.routers import DefaultRouter
|
2017-01-06 12:34:24 +00:00
|
|
|
from rest_framework_bulk.routes import BulkRouter
|
2016-11-16 10:12:14 +00:00
|
|
|
|
2018-10-10 07:37:20 +00:00
|
|
|
from .. import api
|
|
|
|
|
2016-11-16 10:12:14 +00:00
|
|
|
app_name = 'assets'
|
|
|
|
|
2017-01-06 12:34:24 +00:00
|
|
|
router = BulkRouter()
|
2018-07-13 16:47:21 +00:00
|
|
|
router.register(r'assets', api.AssetViewSet, 'asset')
|
|
|
|
router.register(r'admin-user', api.AdminUserViewSet, 'admin-user')
|
|
|
|
router.register(r'system-user', api.SystemUserViewSet, 'system-user')
|
|
|
|
router.register(r'labels', api.LabelViewSet, 'label')
|
|
|
|
router.register(r'nodes', api.NodeViewSet, 'node')
|
|
|
|
router.register(r'domain', api.DomainViewSet, 'domain')
|
|
|
|
router.register(r'gateway', api.GatewayViewSet, 'gateway')
|
2018-10-10 07:37:20 +00:00
|
|
|
router.register(r'cmd-filter', api.CommandFilterViewSet, 'cmd-filter')
|
2019-03-18 02:15:33 +00:00
|
|
|
router.register(r'asset-user', api.AssetUserViewSet, 'asset-user')
|
2019-06-19 03:31:38 +00:00
|
|
|
router.register(r'asset-user-info', api.AssetUserExportViewSet, 'asset-user-info')
|
2018-10-10 07:37:20 +00:00
|
|
|
|
|
|
|
cmd_filter_router = routers.NestedDefaultRouter(router, r'cmd-filter', lookup='filter')
|
|
|
|
cmd_filter_router.register(r'rules', api.CommandFilterRuleViewSet, 'cmd-filter-rule')
|
|
|
|
|
2016-11-16 10:12:14 +00:00
|
|
|
|
|
|
|
urlpatterns = [
|
2018-07-27 10:56:40 +00:00
|
|
|
path('assets-bulk/', api.AssetListUpdateApi.as_view(), name='asset-bulk-update'),
|
2019-04-15 06:33:16 +00:00
|
|
|
path('asset/update/select/',
|
|
|
|
api.AssetBulkUpdateSelectAPI.as_view(), name='asset-bulk-update-select'),
|
2018-07-27 10:56:40 +00:00
|
|
|
path('assets/<uuid:pk>/refresh/',
|
|
|
|
api.AssetRefreshHardwareApi.as_view(), name='asset-refresh'),
|
|
|
|
path('assets/<uuid:pk>/alive/',
|
|
|
|
api.AssetAdminUserTestApi.as_view(), name='asset-alive-test'),
|
|
|
|
path('assets/<uuid:pk>/gateway/',
|
|
|
|
api.AssetGatewayApi.as_view(), name='asset-gateway'),
|
2018-12-18 09:28:45 +00:00
|
|
|
|
2019-03-18 02:15:33 +00:00
|
|
|
path('asset-user/auth-info/',
|
|
|
|
api.AssetUserAuthInfoApi.as_view(), name='asset-user-auth-info'),
|
|
|
|
path('asset-user/test-connective/',
|
|
|
|
api.AssetUserTestConnectiveApi.as_view(), name='asset-user-connective'),
|
|
|
|
|
|
|
|
|
2018-07-27 10:56:40 +00:00
|
|
|
path('admin-user/<uuid:pk>/nodes/',
|
|
|
|
api.ReplaceNodesAdminUserApi.as_view(), name='replace-nodes-admin-user'),
|
|
|
|
path('admin-user/<uuid:pk>/auth/',
|
|
|
|
api.AdminUserAuthApi.as_view(), name='admin-user-auth'),
|
|
|
|
path('admin-user/<uuid:pk>/connective/',
|
|
|
|
api.AdminUserTestConnectiveApi.as_view(), name='admin-user-connective'),
|
2018-12-18 09:28:45 +00:00
|
|
|
path('admin-user/<uuid:pk>/assets/',
|
|
|
|
api.AdminUserAssetsListView.as_view(), name='admin-user-assets'),
|
2018-09-03 03:24:25 +00:00
|
|
|
|
2018-12-18 09:28:45 +00:00
|
|
|
path('system-user/<uuid:pk>/auth-info/',
|
|
|
|
api.SystemUserAuthInfoApi.as_view(), name='system-user-auth-info'),
|
2019-03-18 02:15:33 +00:00
|
|
|
path('system-user/<uuid:pk>/asset/<uuid:aid>/auth-info/',
|
|
|
|
api.SystemUserAssetAuthInfoApi.as_view(), name='system-user-asset-auth-info'),
|
2018-12-18 09:28:45 +00:00
|
|
|
path('system-user/<uuid:pk>/assets/',
|
|
|
|
api.SystemUserAssetsListView.as_view(), name='system-user-assets'),
|
2018-07-27 10:56:40 +00:00
|
|
|
path('system-user/<uuid:pk>/push/',
|
|
|
|
api.SystemUserPushApi.as_view(), name='system-user-push'),
|
2018-09-03 03:24:25 +00:00
|
|
|
path('system-user/<uuid:pk>/asset/<uuid:aid>/push/',
|
|
|
|
api.SystemUserPushToAssetApi.as_view(), name='system-user-push-to-asset'),
|
|
|
|
path('system-user/<uuid:pk>/asset/<uuid:aid>/test/',
|
2018-12-18 09:28:45 +00:00
|
|
|
api.SystemUserTestAssetConnectivityApi.as_view(), name='system-user-test-to-asset'),
|
2018-07-27 10:56:40 +00:00
|
|
|
path('system-user/<uuid:pk>/connective/',
|
|
|
|
api.SystemUserTestConnectiveApi.as_view(), name='system-user-connective'),
|
2018-10-10 07:37:20 +00:00
|
|
|
path('system-user/<uuid:pk>/cmd-filter-rules/',
|
|
|
|
api.SystemUserCommandFilterRuleListApi.as_view(), name='system-user-cmd-filter-rule-list'),
|
|
|
|
|
2018-12-17 10:20:44 +00:00
|
|
|
path('nodes/tree/', api.NodeListAsTreeApi.as_view(), name='node-tree'),
|
|
|
|
path('nodes/children/tree/', api.NodeChildrenAsTreeApi.as_view(), name='node-children-tree'),
|
2018-07-27 10:56:40 +00:00
|
|
|
path('nodes/<uuid:pk>/children/',
|
|
|
|
api.NodeChildrenApi.as_view(), name='node-children'),
|
|
|
|
path('nodes/children/', api.NodeChildrenApi.as_view(), name='node-children-2'),
|
|
|
|
path('nodes/<uuid:pk>/children/add/',
|
|
|
|
api.NodeAddChildrenApi.as_view(), name='node-add-children'),
|
|
|
|
path('nodes/<uuid:pk>/assets/',
|
|
|
|
api.NodeAssetsApi.as_view(), name='node-assets'),
|
|
|
|
path('nodes/<uuid:pk>/assets/add/',
|
|
|
|
api.NodeAddAssetsApi.as_view(), name='node-add-assets'),
|
|
|
|
path('nodes/<uuid:pk>/assets/replace/',
|
|
|
|
api.NodeReplaceAssetsApi.as_view(), name='node-replace-assets'),
|
|
|
|
path('nodes/<uuid:pk>/assets/remove/',
|
|
|
|
api.NodeRemoveAssetsApi.as_view(), name='node-remove-assets'),
|
|
|
|
path('nodes/<uuid:pk>/refresh-hardware-info/',
|
|
|
|
api.RefreshNodeHardwareInfoApi.as_view(), name='node-refresh-hardware-info'),
|
|
|
|
path('nodes/<uuid:pk>/test-connective/',
|
|
|
|
api.TestNodeConnectiveApi.as_view(), name='node-test-connective'),
|
2018-12-26 05:54:42 +00:00
|
|
|
path('nodes/refresh-assets-amount/',
|
|
|
|
api.RefreshAssetsAmount.as_view(), name='refresh-assets-amount'),
|
2018-03-23 11:46:46 +00:00
|
|
|
|
2018-07-27 10:56:40 +00:00
|
|
|
path('gateway/<uuid:pk>/test-connective/',
|
|
|
|
api.GatewayTestConnectionApi.as_view(), name='test-gateway-connective'),
|
2019-03-18 02:15:33 +00:00
|
|
|
|
2016-11-16 10:12:14 +00:00
|
|
|
]
|
|
|
|
|
2018-10-10 07:37:20 +00:00
|
|
|
urlpatterns += router.urls + cmd_filter_router.urls
|
2016-11-16 10:12:14 +00:00
|
|
|
|