autogenerated xosapi.py to resolve merge conflict
diff --git a/xos/xos/xosapi.py b/xos/xos/xosapi.py
index 9948313..62234f2 100644
--- a/xos/xos/xosapi.py
+++ b/xos/xos/xosapi.py
@@ -1,4 +1,3 @@
-
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
@@ -75,12 +74,12 @@
url(r'xos/slice_privileges/$', SlicePrivilegeList.as_view(), name='sliceprivilege-list'),
url(r'xos/slice_privileges/(?P<pk>[a-zA-Z0-9\-]+)/$', SlicePrivilegeDetail.as_view(), name ='sliceprivilege-detail'),
- url(r'xos/networkinstances/$', NetworkInstanceList.as_view(), name='networkinstance-list'),
- url(r'xos/networkinstances/(?P<pk>[a-zA-Z0-9\-]+)/$', NetworkInstanceDetail.as_view(), name ='networkinstance-detail'),
-
url(r'xos/flavors/$', FlavorList.as_view(), name='flavor-list'),
url(r'xos/flavors/(?P<pk>[a-zA-Z0-9\-]+)/$', FlavorDetail.as_view(), name ='flavor-detail'),
+ url(r'xos/ports/$', PortList.as_view(), name='port-list'),
+ url(r'xos/ports/(?P<pk>[a-zA-Z0-9\-]+)/$', PortDetail.as_view(), name ='port-detail'),
+
url(r'xos/controllersites/$', ControllerSiteList.as_view(), name='controllersite-list'),
url(r'xos/controllersites/(?P<pk>[a-zA-Z0-9\-]+)/$', ControllerSiteDetail.as_view(), name ='controllersite-detail'),
@@ -105,6 +104,9 @@
url(r'xos/subscribers/$', SubscriberList.as_view(), name='subscriber-list'),
url(r'xos/subscribers/(?P<pk>[a-zA-Z0-9\-]+)/$', SubscriberDetail.as_view(), name ='subscriber-detail'),
+ url(r'xos/instances/$', InstanceList.as_view(), name='instance-list'),
+ url(r'xos/instances/(?P<pk>[a-zA-Z0-9\-]+)/$', InstanceDetail.as_view(), name ='instance-detail'),
+
url(r'xos/charges/$', ChargeList.as_view(), name='charge-list'),
url(r'xos/charges/(?P<pk>[a-zA-Z0-9\-]+)/$', ChargeDetail.as_view(), name ='charge-detail'),
@@ -123,9 +125,6 @@
url(r'xos/slicecredentials/$', SliceCredentialList.as_view(), name='slicecredential-list'),
url(r'xos/slicecredentials/(?P<pk>[a-zA-Z0-9\-]+)/$', SliceCredentialDetail.as_view(), name ='slicecredential-detail'),
- url(r'xos/instances/$', InstanceList.as_view(), name='instance-list'),
- url(r'xos/instances/(?P<pk>[a-zA-Z0-9\-]+)/$', InstanceDetail.as_view(), name ='instance-detail'),
-
url(r'xos/nodes/$', NodeList.as_view(), name='node-list'),
url(r'xos/nodes/(?P<pk>[a-zA-Z0-9\-]+)/$', NodeDetail.as_view(), name ='node-detail'),
@@ -156,9 +155,6 @@
url(r'xos/controllers/$', ControllerList.as_view(), name='controller-list'),
url(r'xos/controllers/(?P<pk>[a-zA-Z0-9\-]+)/$', ControllerDetail.as_view(), name ='controller-detail'),
- url(r'xos/ports/$', PortList.as_view(), name='port-list'),
- url(r'xos/ports/(?P<pk>[a-zA-Z0-9\-]+)/$', PortDetail.as_view(), name ='port-detail'),
-
url(r'xos/users/$', UserList.as_view(), name='user-list'),
url(r'xos/users/(?P<pk>[a-zA-Z0-9\-]+)/$', UserDetail.as_view(), name ='user-detail'),
@@ -204,6 +200,9 @@
url(r'xos/sitedeployments/$', SiteDeploymentList.as_view(), name='sitedeployment-list'),
url(r'xos/sitedeployments/(?P<pk>[a-zA-Z0-9\-]+)/$', SiteDeploymentDetail.as_view(), name ='sitedeployment-detail'),
+ url(r'xos/tenantwithcontainers/$', TenantWithContainerList.as_view(), name='tenantwithcontainer-list'),
+ url(r'xos/tenantwithcontainers/(?P<pk>[a-zA-Z0-9\-]+)/$', TenantWithContainerDetail.as_view(), name ='tenantwithcontainer-detail'),
+
url(r'xos/deploymentroles/$', DeploymentRoleList.as_view(), name='deploymentrole-list'),
url(r'xos/deploymentroles/(?P<pk>[a-zA-Z0-9\-]+)/$', DeploymentRoleDetail.as_view(), name ='deploymentrole-detail'),
@@ -213,6 +212,9 @@
url(r'xos/tenantrootprivileges/$', TenantRootPrivilegeList.as_view(), name='tenantrootprivilege-list'),
url(r'xos/tenantrootprivileges/(?P<pk>[a-zA-Z0-9\-]+)/$', TenantRootPrivilegeDetail.as_view(), name ='tenantrootprivilege-detail'),
+ url(r'xos/networkinstances/$', NetworkInstanceList.as_view(), name='networkinstance-list'),
+ url(r'xos/networkinstances/(?P<pk>[a-zA-Z0-9\-]+)/$', NetworkInstanceDetail.as_view(), name ='networkinstance-detail'),
+
url(r'xos/slicetags/$', SliceTagList.as_view(), name='slicetag-list'),
url(r'xos/slicetags/(?P<pk>[a-zA-Z0-9\-]+)/$', SliceTagDetail.as_view(), name ='slicetag-detail'),
@@ -245,8 +247,8 @@
'tags': reverse('tag-list', request=request, format=format),
'invoices': reverse('invoice-list', request=request, format=format),
'sliceprivileges': reverse('sliceprivilege-list', request=request, format=format),
- 'networkinstances': reverse('networkinstance-list', request=request, format=format),
'flavors': reverse('flavor-list', request=request, format=format),
+ 'ports': reverse('port-list', request=request, format=format),
'controllersites': reverse('controllersite-list', request=request, format=format),
'projects': reverse('project-list', request=request, format=format),
'slices': reverse('slice-list', request=request, format=format),
@@ -255,13 +257,13 @@
'serviceclasses': reverse('serviceclass-list', request=request, format=format),
'payments': reverse('payment-list', request=request, format=format),
'subscribers': reverse('subscriber-list', request=request, format=format),
+ 'instances': reverse('instance-list', request=request, format=format),
'charges': reverse('charge-list', request=request, format=format),
'programs': reverse('program-list', request=request, format=format),
'roles': reverse('role-list', request=request, format=format),
'usableobjects': reverse('usableobject-list', request=request, format=format),
'providers': reverse('provider-list', request=request, format=format),
'slicecredentials': reverse('slicecredential-list', request=request, format=format),
- 'instances': reverse('instance-list', request=request, format=format),
'nodes': reverse('node-list', request=request, format=format),
'dashboardviews': reverse('dashboardview-list', request=request, format=format),
'controllernetworks': reverse('controllernetwork-list', request=request, format=format),
@@ -272,7 +274,6 @@
'networkslices': reverse('networkslice-list', request=request, format=format),
'userdashboardviews': reverse('userdashboardview-list', request=request, format=format),
'controllers': reverse('controller-list', request=request, format=format),
- 'ports': reverse('port-list', request=request, format=format),
'users': reverse('user-list', request=request, format=format),
'deployments': reverse('deployment-list', request=request, format=format),
'reservations': reverse('reservation-list', request=request, format=format),
@@ -288,9 +289,11 @@
'deploymentprivileges': reverse('deploymentprivilege-list', request=request, format=format),
'controllersliceprivileges': reverse('controllersliceprivilege-list', request=request, format=format),
'sitedeployments': reverse('sitedeployment-list', request=request, format=format),
+ 'tenantwithcontainers': reverse('tenantwithcontainer-list', request=request, format=format),
'deploymentroles': reverse('deploymentrole-list', request=request, format=format),
'usercredentials': reverse('usercredential-list', request=request, format=format),
'tenantrootprivileges': reverse('tenantrootprivilege-list', request=request, format=format),
+ 'networkinstances': reverse('networkinstance-list', request=request, format=format),
'slicetags': reverse('slicetag-list', request=request, format=format),
'coarsetenants': reverse('coarsetenant-list', request=request, format=format),
'routers': reverse('router-list', request=request, format=format),
@@ -791,41 +794,6 @@
-class NetworkInstanceSerializer(serializers.HyperlinkedModelSerializer):
- id = IdField()
-
- humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
- validators = serializers.SerializerMethodField("getValidators")
- def getHumanReadableName(self, obj):
- return str(obj)
- def getValidators(self, obj):
- try:
- return obj.getValidators()
- except:
- return None
- class Meta:
- model = NetworkInstance
- fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id',)
-
-class NetworkInstanceIdSerializer(XOSModelSerializer):
- id = IdField()
-
- humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
- validators = serializers.SerializerMethodField("getValidators")
- def getHumanReadableName(self, obj):
- return str(obj)
- def getValidators(self, obj):
- try:
- return obj.getValidators()
- except:
- return None
- class Meta:
- model = NetworkInstance
- fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id',)
-
-
-
-
class FlavorSerializer(serializers.HyperlinkedModelSerializer):
id = IdField()
@@ -869,6 +837,41 @@
+class PortSerializer(serializers.HyperlinkedModelSerializer):
+ id = IdField()
+
+ humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+ validators = serializers.SerializerMethodField("getValidators")
+ def getHumanReadableName(self, obj):
+ return str(obj)
+ def getValidators(self, obj):
+ try:
+ return obj.getValidators()
+ except:
+ return None
+ class Meta:
+ model = Port
+ fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id','mac',)
+
+class PortIdSerializer(XOSModelSerializer):
+ id = IdField()
+
+ humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+ validators = serializers.SerializerMethodField("getValidators")
+ def getHumanReadableName(self, obj):
+ return str(obj)
+ def getValidators(self, obj):
+ try:
+ return obj.getValidators()
+ except:
+ return None
+ class Meta:
+ model = Port
+ fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id','mac',)
+
+
+
+
class ControllerSiteSerializer(serializers.HyperlinkedModelSerializer):
id = IdField()
@@ -961,7 +964,7 @@
return None
class Meta:
model = Slice
- fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','enabled','omf_friendly','description','slice_url','site','max_instance','service','network','serviceClass','creator','default_flavor','default_image','mount_data_sets','networks','networks',)
+ fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','enabled','omf_friendly','description','slice_url','site','max_instances','service','network','serviceClass','creator','default_flavor','default_image','mount_data_sets','networks','networks',)
class SliceIdSerializer(XOSModelSerializer):
id = IdField()
@@ -989,6 +992,7 @@
+
class NetworkSerializer(serializers.HyperlinkedModelSerializer):
id = IdField()
@@ -1204,6 +1208,49 @@
+class InstanceSerializer(serializers.HyperlinkedModelSerializer):
+ id = IdField()
+
+
+ networks = serializers.HyperlinkedRelatedField(many=True, read_only=True, view_name='network-detail')
+
+
+ humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+ validators = serializers.SerializerMethodField("getValidators")
+ def getHumanReadableName(self, obj):
+ return str(obj)
+ def getValidators(self, obj):
+ try:
+ return obj.getValidators()
+ except:
+ return None
+ class Meta:
+ model = Instance
+ fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','instance_id','instance_uuid','name','instance_name','ip','image','creator','slice','deployment','node','numberCores','flavor','userData','networks',)
+
+class InstanceIdSerializer(XOSModelSerializer):
+ id = IdField()
+
+
+ networks = serializers.PrimaryKeyRelatedField(many=True, queryset = Network.objects.all())
+
+
+ humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+ validators = serializers.SerializerMethodField("getValidators")
+ def getHumanReadableName(self, obj):
+ return str(obj)
+ def getValidators(self, obj):
+ try:
+ return obj.getValidators()
+ except:
+ return None
+ class Meta:
+ model = Instance
+ fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','instance_id','instance_uuid','name','instance_name','ip','image','creator','slice','deployment','node','numberCores','flavor','userData','networks',)
+
+
+
+
class ChargeSerializer(serializers.HyperlinkedModelSerializer):
id = IdField()
@@ -1414,59 +1461,6 @@
-class InstanceSerializer(serializers.HyperlinkedModelSerializer):
- id = IdField()
-
-
- networks = serializers.HyperlinkedRelatedField(many=True, read_only=True, view_name='network-detail')
-
-
- humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
- validators = serializers.SerializerMethodField("getValidators")
- def getHumanReadableName(self, obj):
- return str(obj)
- def getValidators(self, obj):
- try:
- return obj.getValidators()
- except:
- return None
- class Meta:
-<<<<<<< HEAD
- model = Instance
- fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','instance_id','instance_uuid','name','instance_name','ip','image','creator','slice','deployment','node','numberCores','flavor','userData','networks',)
-=======
- model = Instance
- fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','instance_id','instance_uuid','name','instance_name','ip','image','creator','slice','deployment','node','numberCores','flavor','userData','networks',)
->>>>>>> origin/master
-
-class InstanceIdSerializer(XOSModelSerializer):
- id = IdField()
-
-
- networks = serializers.PrimaryKeyRelatedField(many=True, queryset = Network.objects.all())
-
-
- humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
- validators = serializers.SerializerMethodField("getValidators")
- def getHumanReadableName(self, obj):
- return str(obj)
- def getValidators(self, obj):
- try:
- return obj.getValidators()
- except:
- return None
- class Meta:
-<<<<<<< HEAD
- model = Instance
- fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','instance_id','instance_uuid','name','instance_name','ip','image','creator','slice','deployment','node','numberCores','flavor','userData','networks',)
-=======
- model = Instance
- fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','instance_id','instance_uuid','name','instance_name','ip','image','creator','slice','deployment','node','numberCores','flavor','userData','networks',)
->>>>>>> origin/master
-
-
-
-
class NodeSerializer(serializers.HyperlinkedModelSerializer):
id = IdField()
@@ -1724,7 +1718,6 @@
class Meta:
model = NetworkTemplate
fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','name','description','guaranteed_bandwidth','visibility','translation','shared_network_name','shared_network_id','topology_kind','controller_kind',)
->>>>>>> origin/master
@@ -1842,41 +1835,6 @@
-class PortSerializer(serializers.HyperlinkedModelSerializer):
- id = IdField()
-
- humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
- validators = serializers.SerializerMethodField("getValidators")
- def getHumanReadableName(self, obj):
- return str(obj)
- def getValidators(self, obj):
- try:
- return obj.getValidators()
- except:
- return None
- class Meta:
- model = Port
- fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id',)
-
-class PortIdSerializer(XOSModelSerializer):
- id = IdField()
-
- humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
- validators = serializers.SerializerMethodField("getValidators")
- def getHumanReadableName(self, obj):
- return str(obj)
- def getValidators(self, obj):
- try:
- return obj.getValidators()
- except:
- return None
- class Meta:
- model = Port
- fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id',)
-
-
-
-
class UserSerializer(serializers.HyperlinkedModelSerializer):
id = IdField()
@@ -2434,6 +2392,41 @@
+class TenantWithContainerSerializer(serializers.HyperlinkedModelSerializer):
+ id = IdField()
+
+ humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+ validators = serializers.SerializerMethodField("getValidators")
+ def getHumanReadableName(self, obj):
+ return str(obj)
+ def getValidators(self, obj):
+ try:
+ return obj.getValidators()
+ except:
+ return None
+ class Meta:
+ model = TenantWithContainer
+ fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','kind','provider_service','subscriber_service','subscriber_tenant','subscriber_user','subscriber_root','service_specific_id','service_specific_attribute','connect_method',)
+
+class TenantWithContainerIdSerializer(XOSModelSerializer):
+ id = IdField()
+
+ humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+ validators = serializers.SerializerMethodField("getValidators")
+ def getHumanReadableName(self, obj):
+ return str(obj)
+ def getValidators(self, obj):
+ try:
+ return obj.getValidators()
+ except:
+ return None
+ class Meta:
+ model = TenantWithContainer
+ fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','kind','provider_service','subscriber_service','subscriber_tenant','subscriber_user','subscriber_root','service_specific_id','service_specific_attribute','connect_method',)
+
+
+
+
class DeploymentRoleSerializer(serializers.HyperlinkedModelSerializer):
id = IdField()
@@ -2539,6 +2532,41 @@
+class NetworkInstanceSerializer(serializers.HyperlinkedModelSerializer):
+ id = IdField()
+
+ humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+ validators = serializers.SerializerMethodField("getValidators")
+ def getHumanReadableName(self, obj):
+ return str(obj)
+ def getValidators(self, obj):
+ try:
+ return obj.getValidators()
+ except:
+ return None
+ class Meta:
+ model = NetworkInstance
+ fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id','mac',)
+
+class NetworkInstanceIdSerializer(XOSModelSerializer):
+ id = IdField()
+
+ humanReadableName = serializers.SerializerMethodField("getHumanReadableName")
+ validators = serializers.SerializerMethodField("getValidators")
+ def getHumanReadableName(self, obj):
+ return str(obj)
+ def getValidators(self, obj):
+ try:
+ return obj.getValidators()
+ except:
+ return None
+ class Meta:
+ model = NetworkInstance
+ fields = ('humanReadableName', 'validators', 'id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id','mac',)
+
+
+
+
class SliceTagSerializer(serializers.HyperlinkedModelSerializer):
id = IdField()
@@ -2756,10 +2784,10 @@
SlicePrivilege: SlicePrivilegeSerializer,
- NetworkInstance: NetworkInstanceSerializer,
-
Flavor: FlavorSerializer,
+ Port: PortSerializer,
+
ControllerSite: ControllerSiteSerializer,
Project: ProjectSerializer,
@@ -2776,6 +2804,8 @@
Subscriber: SubscriberSerializer,
+ Instance: InstanceSerializer,
+
Charge: ChargeSerializer,
Program: ProgramSerializer,
@@ -2788,8 +2818,6 @@
SliceCredential: SliceCredentialSerializer,
- Instance: InstanceSerializer,
-
Node: NodeSerializer,
DashboardView: DashboardViewSerializer,
@@ -2810,8 +2838,6 @@
Controller: ControllerSerializer,
- Port: PortSerializer,
-
User: UserSerializer,
Deployment: DeploymentSerializer,
@@ -2842,12 +2868,16 @@
SiteDeployment: SiteDeploymentSerializer,
+ TenantWithContainer: TenantWithContainerSerializer,
+
DeploymentRole: DeploymentRoleSerializer,
UserCredential: UserCredentialSerializer,
TenantRootPrivilege: TenantRootPrivilegeSerializer,
+ NetworkInstance: NetworkInstanceSerializer,
+
SliceTag: SliceTagSerializer,
CoarseTenant: CoarseTenantSerializer,
@@ -3428,53 +3458,6 @@
-class NetworkInstanceList(XOSListCreateAPIView):
- queryset = NetworkInstance.objects.select_related().all()
- serializer_class = NetworkInstanceSerializer
- id_serializer_class = NetworkInstanceIdSerializer
- filter_backends = (filters.DjangoFilterBackend,)
- filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id',)
-
- def get_serializer_class(self):
- no_hyperlinks=False
- if hasattr(self.request,"QUERY_PARAMS"):
- no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
- if (no_hyperlinks):
- return self.id_serializer_class
- else:
- return self.serializer_class
-
- def get_queryset(self):
- if (not self.request.user.is_authenticated()):
- raise XOSNotAuthenticated()
- return NetworkInstance.select_by_user(self.request.user)
-
-
-class NetworkInstanceDetail(XOSRetrieveUpdateDestroyAPIView):
- queryset = NetworkInstance.objects.select_related().all()
- serializer_class = NetworkInstanceSerializer
- id_serializer_class = NetworkInstanceIdSerializer
-
- def get_serializer_class(self):
- no_hyperlinks=False
- if hasattr(self.request,"QUERY_PARAMS"):
- no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
- if (no_hyperlinks):
- return self.id_serializer_class
- else:
- return self.serializer_class
-
- def get_queryset(self):
- if (not self.request.user.is_authenticated()):
- raise XOSNotAuthenticated()
- return NetworkInstance.select_by_user(self.request.user)
-
- # update() is handled by XOSRetrieveUpdateDestroyAPIView
-
- # destroy() is handled by XOSRetrieveUpdateDestroyAPIView
-
-
-
class FlavorList(XOSListCreateAPIView):
queryset = Flavor.objects.select_related().all()
serializer_class = FlavorSerializer
@@ -3522,6 +3505,53 @@
+class PortList(XOSListCreateAPIView):
+ queryset = Port.objects.select_related().all()
+ serializer_class = PortSerializer
+ id_serializer_class = PortIdSerializer
+ filter_backends = (filters.DjangoFilterBackend,)
+ filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id','mac',)
+
+ def get_serializer_class(self):
+ no_hyperlinks=False
+ if hasattr(self.request,"QUERY_PARAMS"):
+ no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
+ if (no_hyperlinks):
+ return self.id_serializer_class
+ else:
+ return self.serializer_class
+
+ def get_queryset(self):
+ if (not self.request.user.is_authenticated()):
+ raise XOSNotAuthenticated()
+ return Port.select_by_user(self.request.user)
+
+
+class PortDetail(XOSRetrieveUpdateDestroyAPIView):
+ queryset = Port.objects.select_related().all()
+ serializer_class = PortSerializer
+ id_serializer_class = PortIdSerializer
+
+ def get_serializer_class(self):
+ no_hyperlinks=False
+ if hasattr(self.request,"QUERY_PARAMS"):
+ no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
+ if (no_hyperlinks):
+ return self.id_serializer_class
+ else:
+ return self.serializer_class
+
+ def get_queryset(self):
+ if (not self.request.user.is_authenticated()):
+ raise XOSNotAuthenticated()
+ return Port.select_by_user(self.request.user)
+
+ # update() is handled by XOSRetrieveUpdateDestroyAPIView
+
+ # destroy() is handled by XOSRetrieveUpdateDestroyAPIView
+
+
+
class ControllerSiteList(XOSListCreateAPIView):
queryset = ControllerSite.objects.select_related().all()
serializer_class = ControllerSiteSerializer
@@ -3898,6 +3928,53 @@
+class InstanceList(XOSListCreateAPIView):
+ queryset = Instance.objects.select_related().all()
+ serializer_class = InstanceSerializer
+ id_serializer_class = InstanceIdSerializer
+ filter_backends = (filters.DjangoFilterBackend,)
+ filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','instance_id','instance_uuid','name','instance_name','ip','image','creator','slice','deployment','node','numberCores','flavor','userData','networks',)
+
+ def get_serializer_class(self):
+ no_hyperlinks=False
+ if hasattr(self.request,"QUERY_PARAMS"):
+ no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
+ if (no_hyperlinks):
+ return self.id_serializer_class
+ else:
+ return self.serializer_class
+
+ def get_queryset(self):
+ if (not self.request.user.is_authenticated()):
+ raise XOSNotAuthenticated()
+ return Instance.select_by_user(self.request.user)
+
+
+class InstanceDetail(XOSRetrieveUpdateDestroyAPIView):
+ queryset = Instance.objects.select_related().all()
+ serializer_class = InstanceSerializer
+ id_serializer_class = InstanceIdSerializer
+
+ def get_serializer_class(self):
+ no_hyperlinks=False
+ if hasattr(self.request,"QUERY_PARAMS"):
+ no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
+ if (no_hyperlinks):
+ return self.id_serializer_class
+ else:
+ return self.serializer_class
+
+ def get_queryset(self):
+ if (not self.request.user.is_authenticated()):
+ raise XOSNotAuthenticated()
+ return Instance.select_by_user(self.request.user)
+
+ # update() is handled by XOSRetrieveUpdateDestroyAPIView
+
+ # destroy() is handled by XOSRetrieveUpdateDestroyAPIView
+
+
+
class ChargeList(XOSListCreateAPIView):
queryset = Charge.objects.select_related().all()
serializer_class = ChargeSerializer
@@ -4180,53 +4257,6 @@
-class InstanceList(XOSListCreateAPIView):
- queryset = Instance.objects.select_related().all()
- serializer_class = InstanceSerializer
- id_serializer_class = InstanceIdSerializer
- filter_backends = (filters.DjangoFilterBackend,)
- filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','instance_id','instance_uuid','name','instance_name','ip','image','creator','slice','deployment','node','numberCores','flavor','userData','networks',)
-
- def get_serializer_class(self):
- no_hyperlinks=False
- if hasattr(self.request,"QUERY_PARAMS"):
- no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
- if (no_hyperlinks):
- return self.id_serializer_class
- else:
- return self.serializer_class
-
- def get_queryset(self):
- if (not self.request.user.is_authenticated()):
- raise XOSNotAuthenticated()
- return Instance.select_by_user(self.request.user)
-
-
-class InstanceDetail(XOSRetrieveUpdateDestroyAPIView):
- queryset = Instance.objects.select_related().all()
- serializer_class = InstanceSerializer
- id_serializer_class = InstanceIdSerializer
-
- def get_serializer_class(self):
- no_hyperlinks=False
- if hasattr(self.request,"QUERY_PARAMS"):
- no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
- if (no_hyperlinks):
- return self.id_serializer_class
- else:
- return self.serializer_class
-
- def get_queryset(self):
- if (not self.request.user.is_authenticated()):
- raise XOSNotAuthenticated()
- return Instance.select_by_user(self.request.user)
-
- # update() is handled by XOSRetrieveUpdateDestroyAPIView
-
- # destroy() is handled by XOSRetrieveUpdateDestroyAPIView
-
-
-
class NodeList(XOSListCreateAPIView):
queryset = Node.objects.select_related().all()
serializer_class = NodeSerializer
@@ -4697,53 +4727,6 @@
-class PortList(XOSListCreateAPIView):
- queryset = Port.objects.select_related().all()
- serializer_class = PortSerializer
- id_serializer_class = PortIdSerializer
- filter_backends = (filters.DjangoFilterBackend,)
- filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id',)
-
- def get_serializer_class(self):
- no_hyperlinks=False
- if hasattr(self.request,"QUERY_PARAMS"):
- no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
- if (no_hyperlinks):
- return self.id_serializer_class
- else:
- return self.serializer_class
-
- def get_queryset(self):
- if (not self.request.user.is_authenticated()):
- raise XOSNotAuthenticated()
- return Port.select_by_user(self.request.user)
-
-
-class PortDetail(XOSRetrieveUpdateDestroyAPIView):
- queryset = Port.objects.select_related().all()
- serializer_class = PortSerializer
- id_serializer_class = PortIdSerializer
-
- def get_serializer_class(self):
- no_hyperlinks=False
- if hasattr(self.request,"QUERY_PARAMS"):
- no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
- if (no_hyperlinks):
- return self.id_serializer_class
- else:
- return self.serializer_class
-
- def get_queryset(self):
- if (not self.request.user.is_authenticated()):
- raise XOSNotAuthenticated()
- return Port.select_by_user(self.request.user)
-
- # update() is handled by XOSRetrieveUpdateDestroyAPIView
-
- # destroy() is handled by XOSRetrieveUpdateDestroyAPIView
-
-
-
class UserList(XOSListCreateAPIView):
queryset = User.objects.select_related().all()
serializer_class = UserSerializer
@@ -5449,6 +5432,53 @@
+class TenantWithContainerList(XOSListCreateAPIView):
+ queryset = TenantWithContainer.objects.select_related().all()
+ serializer_class = TenantWithContainerSerializer
+ id_serializer_class = TenantWithContainerIdSerializer
+ filter_backends = (filters.DjangoFilterBackend,)
+ filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','kind','provider_service','subscriber_service','subscriber_tenant','subscriber_user','subscriber_root','service_specific_id','service_specific_attribute','connect_method',)
+
+ def get_serializer_class(self):
+ no_hyperlinks=False
+ if hasattr(self.request,"QUERY_PARAMS"):
+ no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
+ if (no_hyperlinks):
+ return self.id_serializer_class
+ else:
+ return self.serializer_class
+
+ def get_queryset(self):
+ if (not self.request.user.is_authenticated()):
+ raise XOSNotAuthenticated()
+ return TenantWithContainer.select_by_user(self.request.user)
+
+
+class TenantWithContainerDetail(XOSRetrieveUpdateDestroyAPIView):
+ queryset = TenantWithContainer.objects.select_related().all()
+ serializer_class = TenantWithContainerSerializer
+ id_serializer_class = TenantWithContainerIdSerializer
+
+ def get_serializer_class(self):
+ no_hyperlinks=False
+ if hasattr(self.request,"QUERY_PARAMS"):
+ no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
+ if (no_hyperlinks):
+ return self.id_serializer_class
+ else:
+ return self.serializer_class
+
+ def get_queryset(self):
+ if (not self.request.user.is_authenticated()):
+ raise XOSNotAuthenticated()
+ return TenantWithContainer.select_by_user(self.request.user)
+
+ # update() is handled by XOSRetrieveUpdateDestroyAPIView
+
+ # destroy() is handled by XOSRetrieveUpdateDestroyAPIView
+
+
+
class DeploymentRoleList(XOSListCreateAPIView):
queryset = DeploymentRole.objects.select_related().all()
serializer_class = DeploymentRoleSerializer
@@ -5590,6 +5620,53 @@
+class NetworkInstanceList(XOSListCreateAPIView):
+ queryset = NetworkInstance.objects.select_related().all()
+ serializer_class = NetworkInstanceSerializer
+ id_serializer_class = NetworkInstanceIdSerializer
+ filter_backends = (filters.DjangoFilterBackend,)
+ filter_fields = ('id','created','updated','enacted','policed','backend_register','backend_status','deleted','write_protect','lazy_blocked','no_sync','network','instance','ip','port_id','mac',)
+
+ def get_serializer_class(self):
+ no_hyperlinks=False
+ if hasattr(self.request,"QUERY_PARAMS"):
+ no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
+ if (no_hyperlinks):
+ return self.id_serializer_class
+ else:
+ return self.serializer_class
+
+ def get_queryset(self):
+ if (not self.request.user.is_authenticated()):
+ raise XOSNotAuthenticated()
+ return NetworkInstance.select_by_user(self.request.user)
+
+
+class NetworkInstanceDetail(XOSRetrieveUpdateDestroyAPIView):
+ queryset = NetworkInstance.objects.select_related().all()
+ serializer_class = NetworkInstanceSerializer
+ id_serializer_class = NetworkInstanceIdSerializer
+
+ def get_serializer_class(self):
+ no_hyperlinks=False
+ if hasattr(self.request,"QUERY_PARAMS"):
+ no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
+ if (no_hyperlinks):
+ return self.id_serializer_class
+ else:
+ return self.serializer_class
+
+ def get_queryset(self):
+ if (not self.request.user.is_authenticated()):
+ raise XOSNotAuthenticated()
+ return NetworkInstance.select_by_user(self.request.user)
+
+ # update() is handled by XOSRetrieveUpdateDestroyAPIView
+
+ # destroy() is handled by XOSRetrieveUpdateDestroyAPIView
+
+
+
class SliceTagList(XOSListCreateAPIView):
queryset = SliceTag.objects.select_related().all()
serializer_class = SliceTagSerializer
@@ -5822,3 +5899,6 @@
# update() is handled by XOSRetrieveUpdateDestroyAPIView
# destroy() is handled by XOSRetrieveUpdateDestroyAPIView
+
+
+