2016-11-16 10:12:14 +00:00
|
|
|
# coding:utf-8
|
2019-08-21 12:27:21 +00:00
|
|
|
from django.urls import path, re_path
|
2018-10-10 07:37:20 +00:00
|
|
|
from rest_framework_nested import routers
|
2017-01-06 12:34:24 +00:00
|
|
|
from rest_framework_bulk.routes import BulkRouter
|
2016-11-16 10:12:14 +00:00
|
|
|
|
2019-08-21 12:27:21 +00:00
|
|
|
from common import api as capi
|
|
|
|
|
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')
|
2022-04-29 10:28:12 +00:00
|
|
|
router.register(r'hosts', api.HostViewSet, 'host')
|
|
|
|
router.register(r'databases', api.DatabaseViewSet, 'database')
|
2021-07-08 06:23:18 +00:00
|
|
|
router.register(r'accounts', api.AccountViewSet, 'account')
|
|
|
|
router.register(r'account-secrets', api.AccountSecretsViewSet, 'account-secret')
|
2022-07-04 10:54:47 +00:00
|
|
|
router.register(r'accounts-history', api.AccountHistoryViewSet, 'account-history')
|
|
|
|
router.register(r'account-history-secrets', api.AccountHistorySecretsViewSet, 'account-history-secret')
|
2019-12-16 08:53:29 +00:00
|
|
|
router.register(r'platforms', api.AssetPlatformViewSet, 'platform')
|
2018-07-13 16:47:21 +00:00
|
|
|
router.register(r'labels', api.LabelViewSet, 'label')
|
|
|
|
router.register(r'nodes', api.NodeViewSet, 'node')
|
2019-08-21 12:27:21 +00:00
|
|
|
router.register(r'domains', api.DomainViewSet, 'domain')
|
|
|
|
router.register(r'gateways', api.GatewayViewSet, 'gateway')
|
2019-09-18 14:06:46 +00:00
|
|
|
router.register(r'gathered-users', api.GatheredUserViewSet, 'gathered-user')
|
2019-10-18 07:05:45 +00:00
|
|
|
router.register(r'favorite-assets', api.FavoriteAssetViewSet, 'favorite-asset')
|
2022-03-07 11:49:45 +00:00
|
|
|
router.register(r'account-backup-plans', api.AccountBackupPlanViewSet, 'account-backup')
|
|
|
|
router.register(r'account-backup-plan-executions', api.AccountBackupPlanExecutionViewSet, 'account-backup-execution')
|
2018-10-10 07:37:20 +00:00
|
|
|
|
2016-11-16 10:12:14 +00:00
|
|
|
|
|
|
|
urlpatterns = [
|
2022-04-06 02:15:06 +00:00
|
|
|
# path('assets/<uuid:pk>/gateways/', api.AssetGatewayListApi.as_view(), name='asset-gateway-list'),
|
2020-03-12 08:24:38 +00:00
|
|
|
path('assets/<uuid:pk>/tasks/', api.AssetTaskCreateApi.as_view(), name='asset-task-create'),
|
2021-01-06 03:08:35 +00:00
|
|
|
path('assets/tasks/', api.AssetsTaskCreateApi.as_view(), name='assets-task-create'),
|
2021-10-15 06:02:32 +00:00
|
|
|
path('assets/<uuid:pk>/perm-users/', api.AssetPermUserListApi.as_view(), name='asset-perm-user-list'),
|
|
|
|
path('assets/<uuid:pk>/perm-users/<uuid:perm_user_id>/permissions/', api.AssetPermUserPermissionsListApi.as_view(), name='asset-perm-user-permission-list'),
|
|
|
|
path('assets/<uuid:pk>/perm-user-groups/', api.AssetPermUserGroupListApi.as_view(), name='asset-perm-user-group-list'),
|
|
|
|
path('assets/<uuid:pk>/perm-user-groups/<uuid:perm_user_group_id>/permissions/', api.AssetPermUserGroupPermissionsListApi.as_view(), name='asset-perm-user-group-permission-list'),
|
2020-03-12 08:24:38 +00:00
|
|
|
|
2021-07-13 04:18:19 +00:00
|
|
|
path('accounts/tasks/', api.AccountTaskCreateAPI.as_view(), name='account-task-create'),
|
|
|
|
|
2022-08-08 02:41:37 +00:00
|
|
|
path('nodes/category/tree/', api.CategoryTreeApi.as_view(), name='asset-category-tree'),
|
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'),
|
2020-03-12 08:24:38 +00:00
|
|
|
path('nodes/<uuid:pk>/children/', api.NodeChildrenApi.as_view(), name='node-children'),
|
2018-07-27 10:56:40 +00:00
|
|
|
path('nodes/children/', api.NodeChildrenApi.as_view(), name='node-children-2'),
|
2020-03-12 08:24:38 +00:00
|
|
|
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'),
|
2021-02-05 05:29:29 +00:00
|
|
|
path('nodes/<uuid:pk>/assets/add/', api.NodeAddAssetsApi.as_view(), name='node-add-assets'),
|
|
|
|
path('nodes/<uuid:pk>/assets/replace/', api.MoveAssetsToNodeApi.as_view(), name='node-replace-assets'),
|
|
|
|
path('nodes/<uuid:pk>/assets/remove/', api.NodeRemoveAssetsApi.as_view(), name='node-remove-assets'),
|
2020-03-12 08:24:38 +00:00
|
|
|
path('nodes/<uuid:pk>/tasks/', api.NodeTaskCreateApi.as_view(), name='node-task-create'),
|
|
|
|
|
|
|
|
path('gateways/<uuid:pk>/test-connective/', api.GatewayTestConnectionApi.as_view(), name='test-gateway-connective'),
|
2019-08-21 12:27:21 +00:00
|
|
|
]
|
|
|
|
|
2022-07-28 11:27:42 +00:00
|
|
|
urlpatterns += router.urls
|
2016-11-16 10:12:14 +00:00
|
|
|
|