2016-11-16 10:12:14 +00:00
|
|
|
# coding:utf-8
|
|
|
|
from django.conf.urls import url
|
|
|
|
from .. import api
|
2017-01-06 12:34:24 +00:00
|
|
|
from rest_framework_bulk.routes import BulkRouter
|
2016-11-16 10:12:14 +00:00
|
|
|
|
|
|
|
app_name = 'assets'
|
|
|
|
|
|
|
|
|
2017-01-06 12:34:24 +00:00
|
|
|
router = BulkRouter()
|
2017-07-10 02:26:17 +00:00
|
|
|
router.register(r'v1/groups', api.AssetGroupViewSet, 'asset-group')
|
2016-11-16 10:12:14 +00:00
|
|
|
router.register(r'v1/assets', api.AssetViewSet, 'asset')
|
2017-12-07 08:25:50 +00:00
|
|
|
router.register(r'v1/clusters', api.ClusterViewSet, 'cluster')
|
2016-11-16 10:12:14 +00:00
|
|
|
router.register(r'v1/admin-user', api.AdminUserViewSet, 'admin-user')
|
|
|
|
router.register(r'v1/system-user', api.SystemUserViewSet, 'system-user')
|
2018-01-16 08:32:06 +00:00
|
|
|
router.register(r'v1/labels', api.LabelViewSet, 'label')
|
2018-01-31 09:01:21 +00:00
|
|
|
router.register(r'v1/nodes', api.NodeViewSet, 'node')
|
2016-11-16 10:12:14 +00:00
|
|
|
|
|
|
|
urlpatterns = [
|
2017-07-10 02:26:17 +00:00
|
|
|
url(r'^v1/assets-bulk/$', api.AssetListUpdateApi.as_view(), name='asset-bulk-update'),
|
2017-12-12 07:45:01 +00:00
|
|
|
url(r'^v1/system-user/(?P<pk>[0-9a-zA-Z\-]{36})/auth-info/', api.SystemUserAuthInfoApi.as_view(),
|
2016-12-29 11:17:00 +00:00
|
|
|
name='system-user-auth-info'),
|
2017-12-12 07:45:01 +00:00
|
|
|
url(r'^v1/assets/(?P<pk>[0-9a-zA-Z\-]{36})/refresh/$',
|
2017-12-19 04:41:00 +00:00
|
|
|
api.AssetRefreshHardwareApi.as_view(), name='asset-refresh'),
|
|
|
|
url(r'^v1/assets/(?P<pk>[0-9a-zA-Z\-]{36})/alive/$',
|
|
|
|
api.AssetAdminUserTestApi.as_view(), name='asset-alive-test'),
|
2018-01-08 03:22:19 +00:00
|
|
|
url(r'^v1/assets/user-assets/$',
|
|
|
|
api.UserAssetListView.as_view(), name='user-asset-list'),
|
2017-01-07 14:34:12 +00:00
|
|
|
# update the asset group, which add or delete the asset to the group
|
2017-12-12 07:45:01 +00:00
|
|
|
url(r'^v1/groups/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$',
|
2017-12-18 14:48:19 +00:00
|
|
|
api.GroupUpdateAssetsApi.as_view(), name='group-update-assets'),
|
|
|
|
url(r'^v1/groups/(?P<pk>[0-9a-zA-Z\-]{36})/assets/add/$',
|
|
|
|
api.GroupAddAssetsApi.as_view(), name='group-add-assets'),
|
2017-12-07 08:25:50 +00:00
|
|
|
# update the Cluster, and add or delete the assets to the Cluster
|
2017-12-18 14:48:19 +00:00
|
|
|
url(r'^v1/cluster/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$',
|
|
|
|
api.ClusterAddAssetsApi.as_view(), name='cluster-add-assets'),
|
2018-01-05 09:57:02 +00:00
|
|
|
url(r'^v1/cluster/(?P<pk>[0-9a-zA-Z\-]{36})/assets/connective/$',
|
|
|
|
api.ClusterTestAssetsAliveApi.as_view(), name='cluster-test-connective'),
|
2017-12-18 14:48:19 +00:00
|
|
|
url(r'^v1/admin-user/(?P<pk>[0-9a-zA-Z\-]{36})/clusters/$',
|
|
|
|
api.AdminUserAddClustersApi.as_view(), name='admin-user-add-clusters'),
|
2017-12-19 04:41:00 +00:00
|
|
|
url(r'^v1/admin-user/(?P<pk>[0-9a-zA-Z\-]{36})/connective/$',
|
|
|
|
api.AdminUserTestConnectiveApi.as_view(), name='admin-user-connective'),
|
|
|
|
url(r'^v1/system-user/(?P<pk>[0-9a-zA-Z\-]{36})/push/$',
|
|
|
|
api.SystemUserPushApi.as_view(), name='system-user-push'),
|
|
|
|
url(r'^v1/system-user/(?P<pk>[0-9a-zA-Z\-]{36})/connective/$',
|
|
|
|
api.SystemUserTestConnectiveApi.as_view(), name='system-user-connective'),
|
2018-02-01 09:14:15 +00:00
|
|
|
url(r'^v1/nodes/(?P<pk>[0-9a-zA-Z\-]{36})/children/$', api.NodeChildrenApi.as_view(), name='node-children'),
|
2018-02-07 05:39:45 +00:00
|
|
|
url(r'^v1/nodes/(?P<pk>[0-9a-zA-Z\-]{36})/assets/add/$', api.NodeAddAssetsApi.as_view(), name='node-add-assets'),
|
|
|
|
url(r'^v1/nodes/(?P<pk>[0-9a-zA-Z\-]{36})/assets/remove/$', api.NodeRemoveAssetsApi.as_view(), name='node-remove-assets'),
|
2016-11-16 10:12:14 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
urlpatterns += router.urls
|
|
|
|
|