jumpserver/apps/assets/urls/api_urls.py

57 lines
2.5 KiB
Python
Raw Normal View History

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')
urlpatterns = [
2017-07-10 02:26:17 +00:00
url(r'^v1/assets-bulk/$', api.AssetListUpdateApi.as_view(), name='asset-bulk-update'),
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'),
url(r'^v1/assets/(?P<pk>[0-9a-zA-Z\-]{36})/groups/$',
2016-12-15 11:55:15 +00:00
api.AssetUpdateGroupApi.as_view(), name='asset-update-group'),
2017-01-06 12:34:24 +00:00
url(r'^v1/assets/(?P<pk>[0-9a-zA-Z\-]{36})/refresh/$',
2017-04-04 11:16:34 +00:00
api.AssetRefreshHardwareView.as_view(), name='asset-refresh'),
url(r'^v1/assets/(?P<pk>[0-9a-zA-Z\-]{36})/admin-user-test/$',
api.AssetAdminUserTestView.as_view(), name='asset-admin-user-test'),
2017-04-04 11:16:34 +00:00
url(r'^v1/assets/(?P<pk>[0-9a-zA-Z\-]{36})/system-users/$',
2016-12-29 11:17:00 +00:00
api.SystemUserUpdateApi.as_view(), name='asset-update-system-users'),
2017-01-06 12:34:24 +00:00
url(r'^v1/groups/(?P<pk>[0-9a-zA-Z\-]{36})/push-system-user/$',
2017-04-12 10:06:32 +00:00
api.AssetGroupPushSystemUserView.as_view(), name='asset-group-push-system-user'),
2017-01-07 14:34:12 +00:00
# update the system users, which add and delete the asset to the system user
url(r'^v1/system-user/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$',
2017-01-07 14:34:12 +00:00
api.SystemUserUpdateAssetsApi.as_view(), name='systemuser-update-assets'),
2017-01-06 12:34:24 +00:00
url(r'^v1/system-user/(?P<pk>[0-9a-zA-Z\-]{36})/groups/$',
2017-01-06 12:34:24 +00:00
api.SystemUserUpdateAssetGroupApi.as_view(), name='systemuser-update-assetgroups'),
2017-01-07 14:34:12 +00:00
# update the asset group, which add or delete the asset to the group
url(r'^v1/groups/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$',
2017-01-06 12:34:24 +00:00
api.AssetGroupUpdateApi.as_view(), name='asset-groups-update'),
2017-01-07 14:34:12 +00:00
# update the asset group, and add or delete the system_user to the group
url(r'^v1/groups/(?P<pk>[0-9a-zA-Z\-]{36})/system-users/$',
2017-01-06 12:34:24 +00:00
api.AssetGroupUpdateSystemUserApi.as_view(), name='asset-groups-update-systemusers'),
2017-01-07 14:34:12 +00:00
2017-12-07 08:25:50 +00:00
# update the Cluster, and add or delete the assets to the Cluster
url(r'^v1/cluster/(?P<pk>[0-9a-zA-Z\-]{36})/assets/$',
2017-12-07 08:25:50 +00:00
api.ClusterUpdateAssetsApi.as_view(), name='cluster-update-assets'),
2017-01-06 12:34:24 +00:00
2016-11-16 10:12:14 +00:00
]
urlpatterns += router.urls