# (c) cavaliba.com - data - urls_api.py

from django.urls import path

from app_data import api

# url namespace
app_name = "api"


# first match is used
urlpatterns = [
    # ping / no auth
    path("", api.ping.index, name="api"),
    path("ping/", api.ping.ping, name="api_ping"),
    # test
    path("test/", api.testapi.testapi, name="api_test"),
    path("version/", api.version.version, name="api_version"),
    path("info/", api.info.info, name="api_info"),
    # schemas
    path("schemas/", api.schema.schema, name="api_schema"),
    path("schemas/<int:id>/", api.schema.schema, name="api_schema"),
    path("schemas/<str:skey>/", api.schema.schema, name="api_schema"),
    # users
    # path('users/', api.user.user, name='api_user'),
    # path('users/<int:id>/', api.user.user, name='api_user'),
    # path('users/<str:key>/', api.user.user, name='api_user'),
    # assets
    path("assets/", api.asset.asset, name="api_asset"),
    path("assets/<int:id>/", api.asset.asset, name="api_asset"),
    path("assets/<str:skey>/", api.asset.asset, name="api_asset"),
    path("assets/<str:skey>/<str:key>/", api.asset.asset, name="api_asset"),
    # import
    path("import/", api.importer.index, name="api_import"),
    # app_status
    path("appstatus/worklist/", api.app_status.worklist, name="api_appstatus_worklist"),
    # path('appstatus/workresult/', api.app_status.workresult, name='api_appstatus_workresult'),
    # groups
    # path('groups/', api.group.group, name='api_group'),
    # path('groups/<int:id>/', api.group.group, name='api_group'),
    # path('groups/<str:key>/', api.group.group, name='api_group'),
    # roles
    # path('roles/', api.role.role, name='api_role'),
    # path('roles/<int:id>/', api.role.role, name='api_role'),
    # path('roles/<str:key>/', api.role.role, name='api_role'),
    # permissions
    path("permissions/", api.permission.permission, name="api_permission"),
    path("permissions/<int:id>/", api.permission.permission, name="api_permission"),
    path("permissions/<str:key>/", api.permission.permission, name="api_permission"),
    # pipeline
    path("pipelines/", api.pipeline.pipeline_list, name="api_pipeline_list"),
    path("pipelines/<int:id>/", api.pipeline.pipeline, name="api_pipeline"),
    path("pipelines/<str:key>/", api.pipeline.pipeline, name="api_pipeline"),
    # tasks
    path("tasks/", api.task.task_list, name="api_task_list"),
    path("tasks/<uuid:handle>/", api.task.task_detail, name="api_task_detail"),
    path("tasks/<uuid:handle>/stop/", api.task.task_stop, name="api_task_stop"),
    # user
    # group
    # role
    # permission
    # sirene
    # ipam
    # revision
    # status
    # speed
    # log
    # stats
    # admintools
]
