phase in vpn
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
parent
8fb3ad7fe8
commit
5d084a5716
11 changed files with 190 additions and 116 deletions
|
|
@ -1,4 +1,36 @@
|
|||
from django.db import models
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.core.validators import MinValueValidator, MaxValueValidator
|
||||
|
||||
|
||||
from uncloud_pay.models import Product, RecurringPeriod
|
||||
from uncloud.models import UncloudModel, UncloudStatus
|
||||
|
||||
class VPNPool(UncloudModel):
|
||||
"""
|
||||
Network address pools from which VPNs can be created
|
||||
"""
|
||||
|
||||
network = models.GenericIPAddressField(primary_key=True,
|
||||
editable=False)
|
||||
|
||||
network_size = models.IntegerField(validators=[MinValueValidator(0),
|
||||
MaxValueValidator(128)])
|
||||
|
||||
class VPNNetwork(UncloudModel):
|
||||
"""
|
||||
A selected network. Used for tracking reservations / used networks
|
||||
"""
|
||||
vpnpool = models.ForeignKey(VPNPool,
|
||||
on_delete=models.CASCADE)
|
||||
|
||||
network = models.GenericIPAddressField(primary_key=True,
|
||||
editable=False)
|
||||
|
||||
class VPNProduct(Product):
|
||||
network = models.ForeignKey(VPNPool,
|
||||
on_delete=models.CASCADE)
|
||||
|
||||
|
||||
class MACAdress(models.Model):
|
||||
prefix = 0x420000000000
|
||||
default_prefix = 0x420000000000
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue