2020-02-20 16:52:50 +01:00
|
|
|
"""uncloud URL Configuration
|
|
|
|
|
|
|
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
|
|
https://docs.djangoproject.com/en/3.0/topics/http/urls/
|
|
|
|
"""
|
2020-04-03 18:41:17 +02:00
|
|
|
|
2020-02-20 16:52:50 +01:00
|
|
|
from django.contrib import admin
|
2020-02-20 18:58:07 +01:00
|
|
|
from django.urls import path, include
|
2020-04-03 18:41:17 +02:00
|
|
|
from django.conf import settings
|
|
|
|
from django.conf.urls.static import static
|
|
|
|
|
2020-02-20 18:58:07 +01:00
|
|
|
from rest_framework import routers
|
2020-04-12 22:55:22 +02:00
|
|
|
from rest_framework.schemas import get_schema_view
|
2020-02-20 18:58:07 +01:00
|
|
|
|
2020-09-28 20:59:08 +02:00
|
|
|
#from opennebula import views as oneviews
|
2020-12-25 10:31:42 +01:00
|
|
|
from uncloud import views as uncloudviews
|
2020-03-18 14:36:40 +01:00
|
|
|
from uncloud_auth import views as authviews
|
2020-04-03 19:27:49 +02:00
|
|
|
from uncloud_net import views as netviews
|
|
|
|
from uncloud_pay import views as payviews
|
|
|
|
from uncloud_vm import views as vmviews
|
2021-07-26 16:11:19 +02:00
|
|
|
import notifications.urls
|
2020-04-13 11:39:49 +02:00
|
|
|
from uncloud_service import views as serviceviews
|
2021-07-19 16:36:10 +02:00
|
|
|
from matrixhosting import views as matrixviews
|
2020-02-21 20:33:37 +05:00
|
|
|
|
2020-02-20 18:58:07 +01:00
|
|
|
router = routers.DefaultRouter()
|
2020-02-26 11:31:17 +01:00
|
|
|
|
2020-05-02 19:15:48 +02:00
|
|
|
# Beta endpoints
|
|
|
|
router.register(r'beta/vm', vmviews.NicoVMProductViewSet, basename='nicovmproduct')
|
|
|
|
|
2020-12-13 13:28:43 +01:00
|
|
|
################################################################################
|
|
|
|
# v2
|
|
|
|
|
|
|
|
# Net
|
|
|
|
router.register(r'v2/net/wireguardvpn', netviews.WireGuardVPNViewSet, basename='wireguardvpnnetwork')
|
2020-12-20 21:45:47 +01:00
|
|
|
router.register(r'v2/net/wireguardvpnsizes', netviews.WireGuardVPNSizes, basename='wireguardvpnnetworksizes')
|
2020-12-13 13:28:43 +01:00
|
|
|
|
2021-06-20 11:51:27 +02:00
|
|
|
# Payment related for a user
|
2021-01-01 13:25:52 +01:00
|
|
|
router.register(r'v2/payment/credit-card', payviews.CreditCardViewSet, basename='stripecreditcard')
|
2020-12-29 01:43:33 +01:00
|
|
|
router.register(r'v2/payment/payment', payviews.PaymentViewSet, basename='payment')
|
2021-01-01 12:41:54 +01:00
|
|
|
router.register(r'v2/payment/balance', payviews.BalanceViewSet, basename='payment-balance')
|
2021-01-17 15:53:30 +01:00
|
|
|
router.register(r'v2/payment/address', payviews.BillingAddressViewSet, basename='billingaddress')
|
2021-07-19 16:36:10 +02:00
|
|
|
router.register(r'v2/orders', payviews.OrderViewSet, basename='orders')
|
|
|
|
router.register(r'v2/bill', payviews.BillViewSet, basename='bills')
|
2020-12-13 13:28:43 +01:00
|
|
|
|
2021-06-20 11:51:27 +02:00
|
|
|
# Generic helper views that are usually not needed
|
|
|
|
router.register(r'v2/generic/vat-rate', payviews.VATRateViewSet, basename='vatrate')
|
|
|
|
|
|
|
|
|
2020-02-20 16:52:50 +01:00
|
|
|
urlpatterns = [
|
2020-12-28 23:35:34 +01:00
|
|
|
path(r'api/', include(router.urls), name='api'),
|
2020-04-03 19:27:49 +02:00
|
|
|
|
2020-04-12 22:55:22 +02:00
|
|
|
path('api-auth/', include('rest_framework.urls', namespace='rest_framework')), # for login to REST API
|
|
|
|
path('openapi', get_schema_view(
|
|
|
|
title="uncloud",
|
|
|
|
description="uncloud API",
|
2020-12-29 01:43:33 +01:00
|
|
|
version="2.0.0"
|
2020-04-12 22:55:22 +02:00
|
|
|
), name='openapi-schema'),
|
2020-12-13 13:28:43 +01:00
|
|
|
|
2020-12-29 01:43:33 +01:00
|
|
|
path('admin/', admin.site.urls),
|
2021-07-19 16:36:10 +02:00
|
|
|
path('accounts/', include('allauth.urls')),
|
2021-07-30 09:04:32 +02:00
|
|
|
path('pricing/<slug:name>/calculate/', payviews.PricingView.as_view(), name='pricing_calculator'),
|
2020-12-25 10:31:42 +01:00
|
|
|
path('cc/reg/', payviews.RegisterCard.as_view(), name="cc_register"),
|
2021-07-26 16:11:19 +02:00
|
|
|
path('inbox/notifications/', include(notifications.urls, namespace='notifications')),
|
2021-08-12 12:28:19 +02:00
|
|
|
path('payments/', include('uncloud_pay.urls', namespace='payments')),
|
2021-07-26 16:11:19 +02:00
|
|
|
path('', include('matrixhosting.urls', namespace='matrix')),
|
|
|
|
# path('', uncloudviews.UncloudIndex.as_view(), name="uncloudindex"),
|
2020-02-20 16:52:50 +01:00
|
|
|
]
|