rest api from the big rename
diff --git a/planetstack/genapi.py b/planetstack/genapi.py
index 1e1fa9f..6fdc919 100644
--- a/planetstack/genapi.py
+++ b/planetstack/genapi.py
@@ -96,9 +96,9 @@
url(r'plstackapi/serviceclasses/(?P<pk>[a-zA-Z0-9\-]+)/$', ServiceClassDetail.as_view(), name ='serviceclass-detail'),
# url(r'plstackapi/serviceclasses/!new/$', ServiceClassNew.as_view(), name ='serviceclass-new'),
- url(r'plstackapi/payments/$', PaymentList.as_view(), name='payment-list'),
- url(r'plstackapi/payments/(?P<pk>[a-zA-Z0-9\-]+)/$', PaymentDetail.as_view(), name ='payment-detail'),
-# url(r'plstackapi/payments/!new/$', PaymentNew.as_view(), name ='payment-new'),
+ url(r'plstackapi/planetstacks/$', PlanetStackList.as_view(), name='planetstack-list'),
+ url(r'plstackapi/planetstacks/(?P<pk>[a-zA-Z0-9\-]+)/$', PlanetStackDetail.as_view(), name ='planetstack-detail'),
+# url(r'plstackapi/planetstacks/!new/$', PlanetStackNew.as_view(), name ='planetstack-new'),
url(r'plstackapi/charges/$', ChargeList.as_view(), name='charge-list'),
url(r'plstackapi/charges/(?P<pk>[a-zA-Z0-9\-]+)/$', ChargeDetail.as_view(), name ='charge-detail'),
@@ -132,14 +132,14 @@
url(r'plstackapi/dashboardviews/(?P<pk>[a-zA-Z0-9\-]+)/$', DashboardViewDetail.as_view(), name ='dashboardview-detail'),
# url(r'plstackapi/dashboardviews/!new/$', DashboardViewNew.as_view(), name ='dashboardview-new'),
- url(r'plstackapi/imagedeployments/$', ImageDeploymentsList.as_view(), name='imagedeployments-list'),
- url(r'plstackapi/imagedeployments/(?P<pk>[a-zA-Z0-9\-]+)/$', ImageDeploymentsDetail.as_view(), name ='imagedeployments-detail'),
-# url(r'plstackapi/imagedeployments/!new/$', ImageDeploymentsNew.as_view(), name ='imagedeployments-new'),
-
url(r'plstackapi/reservedresources/$', ReservedResourceList.as_view(), name='reservedresource-list'),
url(r'plstackapi/reservedresources/(?P<pk>[a-zA-Z0-9\-]+)/$', ReservedResourceDetail.as_view(), name ='reservedresource-detail'),
# url(r'plstackapi/reservedresources/!new/$', ReservedResourceNew.as_view(), name ='reservedresource-new'),
+ url(r'plstackapi/payments/$', PaymentList.as_view(), name='payment-list'),
+ url(r'plstackapi/payments/(?P<pk>[a-zA-Z0-9\-]+)/$', PaymentDetail.as_view(), name ='payment-detail'),
+# url(r'plstackapi/payments/!new/$', PaymentNew.as_view(), name ='payment-new'),
+
url(r'plstackapi/networkslices/$', NetworkSliceList.as_view(), name='networkslice-list'),
url(r'plstackapi/networkslices/(?P<pk>[a-zA-Z0-9\-]+)/$', NetworkSliceDetail.as_view(), name ='networkslice-detail'),
# url(r'plstackapi/networkslices/!new/$', NetworkSliceNew.as_view(), name ='networkslice-new'),
@@ -148,6 +148,10 @@
url(r'plstackapi/userdashboardviews/(?P<pk>[a-zA-Z0-9\-]+)/$', UserDashboardViewDetail.as_view(), name ='userdashboardview-detail'),
# url(r'plstackapi/userdashboardviews/!new/$', UserDashboardViewNew.as_view(), name ='userdashboardview-new'),
+ url(r'plstackapi/sitedeployments/$', SiteDeploymentList.as_view(), name='sitedeployment-list'),
+ url(r'plstackapi/sitedeployments/(?P<pk>[a-zA-Z0-9\-]+)/$', SiteDeploymentDetail.as_view(), name ='sitedeployment-detail'),
+# url(r'plstackapi/sitedeployments/!new/$', SiteDeploymentNew.as_view(), name ='sitedeployment-new'),
+
url(r'plstackapi/planetstackprivileges/$', PlanetStackPrivilegeList.as_view(), name='planetstackprivilege-list'),
url(r'plstackapi/planetstackprivileges/(?P<pk>[a-zA-Z0-9\-]+)/$', PlanetStackPrivilegeDetail.as_view(), name ='planetstackprivilege-detail'),
# url(r'plstackapi/planetstackprivileges/!new/$', PlanetStackPrivilegeNew.as_view(), name ='planetstackprivilege-new'),
@@ -164,21 +168,17 @@
url(r'plstackapi/reservations/(?P<pk>[a-zA-Z0-9\-]+)/$', ReservationDetail.as_view(), name ='reservation-detail'),
# url(r'plstackapi/reservations/!new/$', ReservationNew.as_view(), name ='reservation-new'),
- url(r'plstackapi/slice_deployments/$', SliceDeploymentsList.as_view(), name='slicedeployments-list'),
- url(r'plstackapi/slice_deployments/(?P<pk>[a-zA-Z0-9\-]+)/$', SliceDeploymentsDetail.as_view(), name ='slicedeployments-detail'),
-# url(r'plstackapi/slice_deployments/!new/$', SliceDeploymentsNew.as_view(), name ='slicedeployments-new'),
-
url(r'plstackapi/siteprivileges/$', SitePrivilegeList.as_view(), name='siteprivilege-list'),
url(r'plstackapi/siteprivileges/(?P<pk>[a-zA-Z0-9\-]+)/$', SitePrivilegeDetail.as_view(), name ='siteprivilege-detail'),
# url(r'plstackapi/siteprivileges/!new/$', SitePrivilegeNew.as_view(), name ='siteprivilege-new'),
- url(r'plstackapi/planetstacks/$', PlanetStackList.as_view(), name='planetstack-list'),
- url(r'plstackapi/planetstacks/(?P<pk>[a-zA-Z0-9\-]+)/$', PlanetStackDetail.as_view(), name ='planetstack-detail'),
-# url(r'plstackapi/planetstacks/!new/$', PlanetStackNew.as_view(), name ='planetstack-new'),
+ url(r'plstackapi/slicedeployments/$', SliceDeploymentList.as_view(), name='slicedeployment-list'),
+ url(r'plstackapi/slicedeployments/(?P<pk>[a-zA-Z0-9\-]+)/$', SliceDeploymentDetail.as_view(), name ='slicedeployment-detail'),
+# url(r'plstackapi/slicedeployments/!new/$', SliceDeploymentNew.as_view(), name ='slicedeployment-new'),
- url(r'plstackapi/user_deployments/$', UserDeploymentsList.as_view(), name='userdeployments-list'),
- url(r'plstackapi/user_deployments/(?P<pk>[a-zA-Z0-9\-]+)/$', UserDeploymentsDetail.as_view(), name ='userdeployments-detail'),
-# url(r'plstackapi/user_deployments/!new/$', UserDeploymentsNew.as_view(), name ='userdeployments-new'),
+ url(r'plstackapi/userdeployments/$', UserDeploymentList.as_view(), name='userdeployment-list'),
+ url(r'plstackapi/userdeployments/(?P<pk>[a-zA-Z0-9\-]+)/$', UserDeploymentDetail.as_view(), name ='userdeployment-detail'),
+# url(r'plstackapi/userdeployments/!new/$', UserDeploymentNew.as_view(), name ='userdeployment-new'),
url(r'plstackapi/accounts/$', AccountList.as_view(), name='account-list'),
url(r'plstackapi/accounts/(?P<pk>[a-zA-Z0-9\-]+)/$', AccountDetail.as_view(), name ='account-detail'),
@@ -196,6 +196,10 @@
url(r'plstackapi/deploymentprivileges/(?P<pk>[a-zA-Z0-9\-]+)/$', DeploymentPrivilegeDetail.as_view(), name ='deploymentprivilege-detail'),
# url(r'plstackapi/deploymentprivileges/!new/$', DeploymentPrivilegeNew.as_view(), name ='deploymentprivilege-new'),
+ url(r'plstackapi/imagedeployments/$', ImageDeploymentList.as_view(), name='imagedeployment-list'),
+ url(r'plstackapi/imagedeployments/(?P<pk>[a-zA-Z0-9\-]+)/$', ImageDeploymentDetail.as_view(), name ='imagedeployment-detail'),
+# url(r'plstackapi/imagedeployments/!new/$', ImageDeploymentNew.as_view(), name ='imagedeployment-new'),
+
url(r'plstackapi/deploymentroles/$', DeploymentRoleList.as_view(), name='deploymentrole-list'),
url(r'plstackapi/deploymentroles/(?P<pk>[a-zA-Z0-9\-]+)/$', DeploymentRoleDetail.as_view(), name ='deploymentrole-detail'),
# url(r'plstackapi/deploymentroles/!new/$', DeploymentRoleNew.as_view(), name ='deploymentrole-new'),
@@ -204,10 +208,6 @@
url(r'plstackapi/usercredentials/(?P<pk>[a-zA-Z0-9\-]+)/$', UserCredentialDetail.as_view(), name ='usercredential-detail'),
# url(r'plstackapi/usercredentials/!new/$', UserCredentialNew.as_view(), name ='usercredential-new'),
- url(r'plstackapi/sitedeployments/$', SiteDeploymentsList.as_view(), name='sitedeployments-list'),
- url(r'plstackapi/sitedeployments/(?P<pk>[a-zA-Z0-9\-]+)/$', SiteDeploymentsDetail.as_view(), name ='sitedeployments-detail'),
-# url(r'plstackapi/sitedeployments/!new/$', SiteDeploymentsNew.as_view(), name ='sitedeployments-new'),
-
url(r'plstackapi/slicetags/$', SliceTagList.as_view(), name='slicetag-list'),
url(r'plstackapi/slicetags/(?P<pk>[a-zA-Z0-9\-]+)/$', SliceTagDetail.as_view(), name ='slicetag-detail'),
# url(r'plstackapi/slicetags/!new/$', SliceTagNew.as_view(), name ='slicetag-new'),
@@ -246,7 +246,7 @@
'networks': reverse('network-list', request=request, format=format),
'services': reverse('service-list', request=request, format=format),
'serviceclasses': reverse('serviceclass-list', request=request, format=format),
- 'payments': reverse('payment-list', request=request, format=format),
+ 'planetstacks': reverse('planetstack-list', request=request, format=format),
'charges': reverse('charge-list', request=request, format=format),
'roles': reverse('role-list', request=request, format=format),
'usableobjects': reverse('usableobject-list', request=request, format=format),
@@ -255,25 +255,25 @@
'slivers': reverse('sliver-list', request=request, format=format),
'nodes': reverse('node-list', request=request, format=format),
'dashboardviews': reverse('dashboardview-list', request=request, format=format),
- 'imagedeploymentses': reverse('imagedeployments-list', request=request, format=format),
'reservedresources': reverse('reservedresource-list', request=request, format=format),
+ 'payments': reverse('payment-list', request=request, format=format),
'networkslices': reverse('networkslice-list', request=request, format=format),
'userdashboardviews': reverse('userdashboardview-list', request=request, format=format),
+ 'sitedeployments': reverse('sitedeployment-list', request=request, format=format),
'planetstackprivileges': reverse('planetstackprivilege-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),
- 'slicedeploymentses': reverse('slicedeployments-list', request=request, format=format),
'siteprivileges': reverse('siteprivilege-list', request=request, format=format),
- 'planetstacks': reverse('planetstack-list', request=request, format=format),
- 'userdeploymentses': reverse('userdeployments-list', request=request, format=format),
+ 'slicedeployments': reverse('slicedeployment-list', request=request, format=format),
+ 'userdeployments': reverse('userdeployment-list', request=request, format=format),
'accounts': reverse('account-list', request=request, format=format),
'networkparametertypes': reverse('networkparametertype-list', request=request, format=format),
'sitecredentials': reverse('sitecredential-list', request=request, format=format),
'deploymentprivileges': reverse('deploymentprivilege-list', request=request, format=format),
+ 'imagedeployments': reverse('imagedeployment-list', request=request, format=format),
'deploymentroles': reverse('deploymentrole-list', request=request, format=format),
'usercredentials': reverse('usercredential-list', request=request, format=format),
- 'sitedeploymentses': reverse('sitedeployments-list', request=request, format=format),
'slicetags': reverse('slicetag-list', request=request, format=format),
'networktemplates': reverse('networktemplate-list', request=request, format=format),
'routers': reverse('router-list', request=request, format=format),
@@ -576,7 +576,7 @@
class Meta:
model = Network
- fields = ('id','created','updated','enacted','backend_status','deleted','name','template','subnet','ports','labels','owner','guaranteedBandwidth','permitAllSlices','network_id','router_id','subnet_id','routers','availableRouters','routers','routers',)
+ fields = ('id','created','updated','enacted','backend_status','deleted','name','template','subnet','ports','labels','owner','guaranteedBandwidth','permitAllSlices','topologyParameters','controllerUrl','controllerParameters','network_id','router_id','subnet_id','routers','availableRouters','routers','routers',)
class NetworkIdSerializer(serializers.ModelSerializer):
id = serializers.Field()
@@ -599,7 +599,7 @@
class Meta:
model = Network
- fields = ('id','created','updated','enacted','backend_status','deleted','name','template','subnet','ports','labels','owner','guaranteedBandwidth','permitAllSlices','network_id','router_id','subnet_id','routers','availableRouters','routers','routers',)
+ fields = ('id','created','updated','enacted','backend_status','deleted','name','template','subnet','ports','labels','owner','guaranteedBandwidth','permitAllSlices','topologyParameters','controllerUrl','controllerParameters','network_id','router_id','subnet_id','routers','availableRouters','routers','routers',)
@@ -638,19 +638,19 @@
-class PaymentSerializer(serializers.HyperlinkedModelSerializer):
+class PlanetStackSerializer(serializers.HyperlinkedModelSerializer):
id = serializers.Field()
class Meta:
- model = Payment
- fields = ('id','created','updated','enacted','backend_status','deleted','account','amount','date',)
+ model = PlanetStack
+ fields = ('id','created','updated','enacted','backend_status','deleted','description',)
-class PaymentIdSerializer(serializers.ModelSerializer):
+class PlanetStackIdSerializer(serializers.ModelSerializer):
id = serializers.Field()
class Meta:
- model = Payment
- fields = ('id','created','updated','enacted','backend_status','deleted','account','amount','date',)
+ model = PlanetStack
+ fields = ('id','created','updated','enacted','backend_status','deleted','description',)
@@ -807,23 +807,6 @@
-class ImageDeploymentsSerializer(serializers.HyperlinkedModelSerializer):
- id = serializers.Field()
-
- class Meta:
- model = ImageDeployments
- fields = ('id','created','updated','enacted','backend_status','deleted','image','deployment','glance_image_id',)
-
-class ImageDeploymentsIdSerializer(serializers.ModelSerializer):
- id = serializers.Field()
-
- class Meta:
- model = ImageDeployments
- fields = ('id','created','updated','enacted','backend_status','deleted','image','deployment','glance_image_id',)
-
-
-
-
class ReservedResourceSerializer(serializers.HyperlinkedModelSerializer):
id = serializers.Field()
@@ -841,6 +824,23 @@
+class PaymentSerializer(serializers.HyperlinkedModelSerializer):
+ id = serializers.Field()
+
+ class Meta:
+ model = Payment
+ fields = ('id','created','updated','enacted','backend_status','deleted','account','amount','date',)
+
+class PaymentIdSerializer(serializers.ModelSerializer):
+ id = serializers.Field()
+
+ class Meta:
+ model = Payment
+ fields = ('id','created','updated','enacted','backend_status','deleted','account','amount','date',)
+
+
+
+
class NetworkSliceSerializer(serializers.HyperlinkedModelSerializer):
id = serializers.Field()
@@ -875,6 +875,23 @@
+class SiteDeploymentSerializer(serializers.HyperlinkedModelSerializer):
+ id = serializers.Field()
+
+ class Meta:
+ model = SiteDeployment
+ fields = ('id','created','updated','enacted','backend_status','deleted','site','deployment','tenant_id',)
+
+class SiteDeploymentIdSerializer(serializers.ModelSerializer):
+ id = serializers.Field()
+
+ class Meta:
+ model = SiteDeployment
+ fields = ('id','created','updated','enacted','backend_status','deleted','site','deployment','tenant_id',)
+
+
+
+
class PlanetStackPrivilegeSerializer(serializers.HyperlinkedModelSerializer):
id = serializers.Field()
@@ -975,23 +992,6 @@
-class SliceDeploymentsSerializer(serializers.HyperlinkedModelSerializer):
- id = serializers.Field()
-
- class Meta:
- model = SliceDeployments
- fields = ('id','created','updated','enacted','backend_status','deleted','slice','deployment','tenant_id','network_id','router_id','subnet_id',)
-
-class SliceDeploymentsIdSerializer(serializers.ModelSerializer):
- id = serializers.Field()
-
- class Meta:
- model = SliceDeployments
- fields = ('id','created','updated','enacted','backend_status','deleted','slice','deployment','tenant_id','network_id','router_id','subnet_id',)
-
-
-
-
class SitePrivilegeSerializer(serializers.HyperlinkedModelSerializer):
id = serializers.Field()
@@ -1009,35 +1009,35 @@
-class PlanetStackSerializer(serializers.HyperlinkedModelSerializer):
+class SliceDeploymentSerializer(serializers.HyperlinkedModelSerializer):
id = serializers.Field()
class Meta:
- model = PlanetStack
- fields = ('id','created','updated','enacted','backend_status','deleted','description',)
+ model = SliceDeployment
+ fields = ('id','created','updated','enacted','backend_status','deleted','slice','deployment','tenant_id','network_id','router_id','subnet_id',)
-class PlanetStackIdSerializer(serializers.ModelSerializer):
+class SliceDeploymentIdSerializer(serializers.ModelSerializer):
id = serializers.Field()
class Meta:
- model = PlanetStack
- fields = ('id','created','updated','enacted','backend_status','deleted','description',)
+ model = SliceDeployment
+ fields = ('id','created','updated','enacted','backend_status','deleted','slice','deployment','tenant_id','network_id','router_id','subnet_id',)
-class UserDeploymentsSerializer(serializers.HyperlinkedModelSerializer):
+class UserDeploymentSerializer(serializers.HyperlinkedModelSerializer):
id = serializers.Field()
class Meta:
- model = UserDeployments
+ model = UserDeployment
fields = ('id','created','updated','enacted','backend_status','deleted','user','deployment','kuser_id',)
-class UserDeploymentsIdSerializer(serializers.ModelSerializer):
+class UserDeploymentIdSerializer(serializers.ModelSerializer):
id = serializers.Field()
class Meta:
- model = UserDeployments
+ model = UserDeployment
fields = ('id','created','updated','enacted','backend_status','deleted','user','deployment','kuser_id',)
@@ -1111,6 +1111,23 @@
+class ImageDeploymentSerializer(serializers.HyperlinkedModelSerializer):
+ id = serializers.Field()
+
+ class Meta:
+ model = ImageDeployment
+ fields = ('id','created','updated','enacted','backend_status','deleted','image','deployment','glance_image_id',)
+
+class ImageDeploymentIdSerializer(serializers.ModelSerializer):
+ id = serializers.Field()
+
+ class Meta:
+ model = ImageDeployment
+ fields = ('id','created','updated','enacted','backend_status','deleted','image','deployment','glance_image_id',)
+
+
+
+
class DeploymentRoleSerializer(serializers.HyperlinkedModelSerializer):
id = serializers.Field()
@@ -1145,23 +1162,6 @@
-class SiteDeploymentsSerializer(serializers.HyperlinkedModelSerializer):
- id = serializers.Field()
-
- class Meta:
- model = SiteDeployments
- fields = ('id','created','updated','enacted','backend_status','deleted','site','deployment','tenant_id',)
-
-class SiteDeploymentsIdSerializer(serializers.ModelSerializer):
- id = serializers.Field()
-
- class Meta:
- model = SiteDeployments
- fields = ('id','created','updated','enacted','backend_status','deleted','site','deployment','tenant_id',)
-
-
-
-
class SliceTagSerializer(serializers.HyperlinkedModelSerializer):
id = serializers.Field()
@@ -1184,14 +1184,14 @@
class Meta:
model = NetworkTemplate
- fields = ('id','created','updated','enacted','backend_status','deleted','name','description','guaranteedBandwidth','visibility','translation','sharedNetworkName','sharedNetworkId',)
+ fields = ('id','created','updated','enacted','backend_status','deleted','name','description','guaranteedBandwidth','visibility','translation','sharedNetworkName','sharedNetworkId','topologyKind','controllerKind',)
class NetworkTemplateIdSerializer(serializers.ModelSerializer):
id = serializers.Field()
class Meta:
model = NetworkTemplate
- fields = ('id','created','updated','enacted','backend_status','deleted','name','description','guaranteedBandwidth','visibility','translation','sharedNetworkName','sharedNetworkId',)
+ fields = ('id','created','updated','enacted','backend_status','deleted','name','description','guaranteedBandwidth','visibility','translation','sharedNetworkName','sharedNetworkId','topologyKind','controllerKind',)
@@ -1266,7 +1266,7 @@
ServiceClass: ServiceClassSerializer,
- Payment: PaymentSerializer,
+ PlanetStack: PlanetStackSerializer,
Charge: ChargeSerializer,
@@ -1284,14 +1284,16 @@
DashboardView: DashboardViewSerializer,
- ImageDeployments: ImageDeploymentsSerializer,
-
ReservedResource: ReservedResourceSerializer,
+ Payment: PaymentSerializer,
+
NetworkSlice: NetworkSliceSerializer,
UserDashboardView: UserDashboardViewSerializer,
+ SiteDeployment: SiteDeploymentSerializer,
+
PlanetStackPrivilege: PlanetStackPrivilegeSerializer,
User: UserSerializer,
@@ -1300,13 +1302,11 @@
Reservation: ReservationSerializer,
- SliceDeployments: SliceDeploymentsSerializer,
-
SitePrivilege: SitePrivilegeSerializer,
- PlanetStack: PlanetStackSerializer,
+ SliceDeployment: SliceDeploymentSerializer,
- UserDeployments: UserDeploymentsSerializer,
+ UserDeployment: UserDeploymentSerializer,
Account: AccountSerializer,
@@ -1316,12 +1316,12 @@
DeploymentPrivilege: DeploymentPrivilegeSerializer,
+ ImageDeployment: ImageDeploymentSerializer,
+
DeploymentRole: DeploymentRoleSerializer,
UserCredential: UserCredentialSerializer,
- SiteDeployments: SiteDeploymentsSerializer,
-
SliceTag: SliceTagSerializer,
NetworkTemplate: NetworkTemplateSerializer,
@@ -2520,7 +2520,7 @@
serializer_class = NetworkSerializer
id_serializer_class = NetworkIdSerializer
filter_backends = (filters.DjangoFilterBackend,)
- filter_fields = ('id','created','updated','enacted','backend_status','deleted','name','template','subnet','ports','labels','owner','guaranteedBandwidth','permitAllSlices','network_id','router_id','subnet_id','routers','availableRouters','routers','routers',)
+ filter_fields = ('id','created','updated','enacted','backend_status','deleted','name','template','subnet','ports','labels','owner','guaranteedBandwidth','permitAllSlices','topologyParameters','controllerUrl','controllerParameters','network_id','router_id','subnet_id','routers','availableRouters','routers','routers',)
def get_serializer_class(self):
no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
@@ -2758,12 +2758,12 @@
-class PaymentList(generics.ListCreateAPIView):
- queryset = Payment.objects.select_related().all()
- serializer_class = PaymentSerializer
- id_serializer_class = PaymentIdSerializer
+class PlanetStackList(generics.ListCreateAPIView):
+ queryset = PlanetStack.objects.select_related().all()
+ serializer_class = PlanetStackSerializer
+ id_serializer_class = PlanetStackIdSerializer
filter_backends = (filters.DjangoFilterBackend,)
- filter_fields = ('id','created','updated','enacted','backend_status','deleted','account','amount','date',)
+ filter_fields = ('id','created','updated','enacted','backend_status','deleted','description',)
def get_serializer_class(self):
no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
@@ -2773,7 +2773,7 @@
return self.serializer_class
def get_queryset(self):
- return Payment.select_by_user(self.request.user)
+ return PlanetStack.select_by_user(self.request.user)
def create(self, request, *args, **kwargs):
serializer = self.get_serializer(data=request.DATA, files=request.FILES)
@@ -2782,21 +2782,21 @@
obj = serializer.object
obj.caller = request.user
if obj.can_update(request.user):
- return super(PaymentList, self).create(request, *args, **kwargs)
+ return super(PlanetStackList, self).create(request, *args, **kwargs)
else:
raise Exception("failed obj.can_update")
- ret = super(PaymentList, self).create(request, *args, **kwargs)
+ ret = super(PlanetStackList, self).create(request, *args, **kwargs)
if (ret.status_code%100 != 200):
raise Exception(ret.data)
return ret
-class PaymentDetail(PlanetStackRetrieveUpdateDestroyAPIView):
- queryset = Payment.objects.select_related().all()
- serializer_class = PaymentSerializer
- id_serializer_class = PaymentIdSerializer
+class PlanetStackDetail(PlanetStackRetrieveUpdateDestroyAPIView):
+ queryset = PlanetStack.objects.select_related().all()
+ serializer_class = PlanetStackSerializer
+ id_serializer_class = PlanetStackIdSerializer
def get_serializer_class(self):
no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
@@ -2806,7 +2806,7 @@
return self.serializer_class
def get_queryset(self):
- return Payment.select_by_user(self.request.user)
+ return PlanetStack.select_by_user(self.request.user)
# update() is handled by PlanetStackRetrieveUpdateDestroyAPIView
@@ -2817,9 +2817,9 @@
filled with defaults. I solved it another way, so this code may soon be
abandoned.
-class PaymentNew(GenericAPIView):
- serializer_class = PaymentSerializer
- id_serializer_class = PaymentIdSerializer
+class PlanetStackNew(GenericAPIView):
+ serializer_class = PlanetStackSerializer
+ id_serializer_class = PlanetStackIdSerializer
def get(self, request, *args, **kwargs):
return self.makenew(request, *args, **kwargs)
@@ -2832,7 +2832,7 @@
return self.serializer_class
def makenew(self, request, *args, **kwargs):
- obj = Payment()
+ obj = PlanetStack()
serializer = self.get_serializer(obj)
return Response(serializer.data)
"""
@@ -3487,87 +3487,6 @@
-class ImageDeploymentsList(generics.ListCreateAPIView):
- queryset = ImageDeployments.objects.select_related().all()
- serializer_class = ImageDeploymentsSerializer
- id_serializer_class = ImageDeploymentsIdSerializer
- filter_backends = (filters.DjangoFilterBackend,)
- filter_fields = ('id','created','updated','enacted','backend_status','deleted','image','deployment','glance_image_id',)
-
- def get_serializer_class(self):
- 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):
- return ImageDeployments.select_by_user(self.request.user)
-
- def create(self, request, *args, **kwargs):
- serializer = self.get_serializer(data=request.DATA, files=request.FILES)
- if not (serializer.is_valid()):
- raise Exception("failed serializer.is_valid: " + str(serializer.errors))
- obj = serializer.object
- obj.caller = request.user
- if obj.can_update(request.user):
- return super(ImageDeploymentsList, self).create(request, *args, **kwargs)
- else:
- raise Exception("failed obj.can_update")
-
- ret = super(ImageDeploymentsList, self).create(request, *args, **kwargs)
- if (ret.status_code%100 != 200):
- raise Exception(ret.data)
-
- return ret
-
-
-class ImageDeploymentsDetail(PlanetStackRetrieveUpdateDestroyAPIView):
- queryset = ImageDeployments.objects.select_related().all()
- serializer_class = ImageDeploymentsSerializer
- id_serializer_class = ImageDeploymentsIdSerializer
-
- def get_serializer_class(self):
- 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):
- return ImageDeployments.select_by_user(self.request.user)
-
- # update() is handled by PlanetStackRetrieveUpdateDestroyAPIView
-
- # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
-
-"""
- XXX smbaker: my intent was to create a view that would return 'new' objects
- filled with defaults. I solved it another way, so this code may soon be
- abandoned.
-
-class ImageDeploymentsNew(GenericAPIView):
- serializer_class = ImageDeploymentsSerializer
- id_serializer_class = ImageDeploymentsIdSerializer
-
- def get(self, request, *args, **kwargs):
- return self.makenew(request, *args, **kwargs)
-
- def get_serializer_class(self):
- no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
- if (no_hyperlinks):
- return self.id_serializer_class
- else:
- return self.serializer_class
-
- def makenew(self, request, *args, **kwargs):
- obj = ImageDeployments()
- serializer = self.get_serializer(obj)
- return Response(serializer.data)
-"""
-
-
-
class ReservedResourceList(generics.ListCreateAPIView):
queryset = ReservedResource.objects.select_related().all()
serializer_class = ReservedResourceSerializer
@@ -3649,6 +3568,87 @@
+class PaymentList(generics.ListCreateAPIView):
+ queryset = Payment.objects.select_related().all()
+ serializer_class = PaymentSerializer
+ id_serializer_class = PaymentIdSerializer
+ filter_backends = (filters.DjangoFilterBackend,)
+ filter_fields = ('id','created','updated','enacted','backend_status','deleted','account','amount','date',)
+
+ def get_serializer_class(self):
+ 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):
+ return Payment.select_by_user(self.request.user)
+
+ def create(self, request, *args, **kwargs):
+ serializer = self.get_serializer(data=request.DATA, files=request.FILES)
+ if not (serializer.is_valid()):
+ raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+ obj = serializer.object
+ obj.caller = request.user
+ if obj.can_update(request.user):
+ return super(PaymentList, self).create(request, *args, **kwargs)
+ else:
+ raise Exception("failed obj.can_update")
+
+ ret = super(PaymentList, self).create(request, *args, **kwargs)
+ if (ret.status_code%100 != 200):
+ raise Exception(ret.data)
+
+ return ret
+
+
+class PaymentDetail(PlanetStackRetrieveUpdateDestroyAPIView):
+ queryset = Payment.objects.select_related().all()
+ serializer_class = PaymentSerializer
+ id_serializer_class = PaymentIdSerializer
+
+ def get_serializer_class(self):
+ 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):
+ return Payment.select_by_user(self.request.user)
+
+ # update() is handled by PlanetStackRetrieveUpdateDestroyAPIView
+
+ # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
+
+"""
+ XXX smbaker: my intent was to create a view that would return 'new' objects
+ filled with defaults. I solved it another way, so this code may soon be
+ abandoned.
+
+class PaymentNew(GenericAPIView):
+ serializer_class = PaymentSerializer
+ id_serializer_class = PaymentIdSerializer
+
+ def get(self, request, *args, **kwargs):
+ return self.makenew(request, *args, **kwargs)
+
+ def get_serializer_class(self):
+ no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
+ if (no_hyperlinks):
+ return self.id_serializer_class
+ else:
+ return self.serializer_class
+
+ def makenew(self, request, *args, **kwargs):
+ obj = Payment()
+ serializer = self.get_serializer(obj)
+ return Response(serializer.data)
+"""
+
+
+
class NetworkSliceList(generics.ListCreateAPIView):
queryset = NetworkSlice.objects.select_related().all()
serializer_class = NetworkSliceSerializer
@@ -3811,6 +3811,87 @@
+class SiteDeploymentList(generics.ListCreateAPIView):
+ queryset = SiteDeployment.objects.select_related().all()
+ serializer_class = SiteDeploymentSerializer
+ id_serializer_class = SiteDeploymentIdSerializer
+ filter_backends = (filters.DjangoFilterBackend,)
+ filter_fields = ('id','created','updated','enacted','backend_status','deleted','site','deployment','tenant_id',)
+
+ def get_serializer_class(self):
+ 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):
+ return SiteDeployment.select_by_user(self.request.user)
+
+ def create(self, request, *args, **kwargs):
+ serializer = self.get_serializer(data=request.DATA, files=request.FILES)
+ if not (serializer.is_valid()):
+ raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+ obj = serializer.object
+ obj.caller = request.user
+ if obj.can_update(request.user):
+ return super(SiteDeploymentList, self).create(request, *args, **kwargs)
+ else:
+ raise Exception("failed obj.can_update")
+
+ ret = super(SiteDeploymentList, self).create(request, *args, **kwargs)
+ if (ret.status_code%100 != 200):
+ raise Exception(ret.data)
+
+ return ret
+
+
+class SiteDeploymentDetail(PlanetStackRetrieveUpdateDestroyAPIView):
+ queryset = SiteDeployment.objects.select_related().all()
+ serializer_class = SiteDeploymentSerializer
+ id_serializer_class = SiteDeploymentIdSerializer
+
+ def get_serializer_class(self):
+ 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):
+ return SiteDeployment.select_by_user(self.request.user)
+
+ # update() is handled by PlanetStackRetrieveUpdateDestroyAPIView
+
+ # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
+
+"""
+ XXX smbaker: my intent was to create a view that would return 'new' objects
+ filled with defaults. I solved it another way, so this code may soon be
+ abandoned.
+
+class SiteDeploymentNew(GenericAPIView):
+ serializer_class = SiteDeploymentSerializer
+ id_serializer_class = SiteDeploymentIdSerializer
+
+ def get(self, request, *args, **kwargs):
+ return self.makenew(request, *args, **kwargs)
+
+ def get_serializer_class(self):
+ no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
+ if (no_hyperlinks):
+ return self.id_serializer_class
+ else:
+ return self.serializer_class
+
+ def makenew(self, request, *args, **kwargs):
+ obj = SiteDeployment()
+ serializer = self.get_serializer(obj)
+ return Response(serializer.data)
+"""
+
+
+
class PlanetStackPrivilegeList(generics.ListCreateAPIView):
queryset = PlanetStackPrivilege.objects.select_related().all()
serializer_class = PlanetStackPrivilegeSerializer
@@ -4135,87 +4216,6 @@
-class SliceDeploymentsList(generics.ListCreateAPIView):
- queryset = SliceDeployments.objects.select_related().all()
- serializer_class = SliceDeploymentsSerializer
- id_serializer_class = SliceDeploymentsIdSerializer
- filter_backends = (filters.DjangoFilterBackend,)
- filter_fields = ('id','created','updated','enacted','backend_status','deleted','slice','deployment','tenant_id','network_id','router_id','subnet_id',)
-
- def get_serializer_class(self):
- 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):
- return SliceDeployments.select_by_user(self.request.user)
-
- def create(self, request, *args, **kwargs):
- serializer = self.get_serializer(data=request.DATA, files=request.FILES)
- if not (serializer.is_valid()):
- raise Exception("failed serializer.is_valid: " + str(serializer.errors))
- obj = serializer.object
- obj.caller = request.user
- if obj.can_update(request.user):
- return super(SliceDeploymentsList, self).create(request, *args, **kwargs)
- else:
- raise Exception("failed obj.can_update")
-
- ret = super(SliceDeploymentsList, self).create(request, *args, **kwargs)
- if (ret.status_code%100 != 200):
- raise Exception(ret.data)
-
- return ret
-
-
-class SliceDeploymentsDetail(PlanetStackRetrieveUpdateDestroyAPIView):
- queryset = SliceDeployments.objects.select_related().all()
- serializer_class = SliceDeploymentsSerializer
- id_serializer_class = SliceDeploymentsIdSerializer
-
- def get_serializer_class(self):
- 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):
- return SliceDeployments.select_by_user(self.request.user)
-
- # update() is handled by PlanetStackRetrieveUpdateDestroyAPIView
-
- # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
-
-"""
- XXX smbaker: my intent was to create a view that would return 'new' objects
- filled with defaults. I solved it another way, so this code may soon be
- abandoned.
-
-class SliceDeploymentsNew(GenericAPIView):
- serializer_class = SliceDeploymentsSerializer
- id_serializer_class = SliceDeploymentsIdSerializer
-
- def get(self, request, *args, **kwargs):
- return self.makenew(request, *args, **kwargs)
-
- def get_serializer_class(self):
- no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
- if (no_hyperlinks):
- return self.id_serializer_class
- else:
- return self.serializer_class
-
- def makenew(self, request, *args, **kwargs):
- obj = SliceDeployments()
- serializer = self.get_serializer(obj)
- return Response(serializer.data)
-"""
-
-
-
class SitePrivilegeList(generics.ListCreateAPIView):
queryset = SitePrivilege.objects.select_related().all()
serializer_class = SitePrivilegeSerializer
@@ -4297,12 +4297,12 @@
-class PlanetStackList(generics.ListCreateAPIView):
- queryset = PlanetStack.objects.select_related().all()
- serializer_class = PlanetStackSerializer
- id_serializer_class = PlanetStackIdSerializer
+class SliceDeploymentList(generics.ListCreateAPIView):
+ queryset = SliceDeployment.objects.select_related().all()
+ serializer_class = SliceDeploymentSerializer
+ id_serializer_class = SliceDeploymentIdSerializer
filter_backends = (filters.DjangoFilterBackend,)
- filter_fields = ('id','created','updated','enacted','backend_status','deleted','description',)
+ filter_fields = ('id','created','updated','enacted','backend_status','deleted','slice','deployment','tenant_id','network_id','router_id','subnet_id',)
def get_serializer_class(self):
no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
@@ -4312,7 +4312,7 @@
return self.serializer_class
def get_queryset(self):
- return PlanetStack.select_by_user(self.request.user)
+ return SliceDeployment.select_by_user(self.request.user)
def create(self, request, *args, **kwargs):
serializer = self.get_serializer(data=request.DATA, files=request.FILES)
@@ -4321,21 +4321,21 @@
obj = serializer.object
obj.caller = request.user
if obj.can_update(request.user):
- return super(PlanetStackList, self).create(request, *args, **kwargs)
+ return super(SliceDeploymentList, self).create(request, *args, **kwargs)
else:
raise Exception("failed obj.can_update")
- ret = super(PlanetStackList, self).create(request, *args, **kwargs)
+ ret = super(SliceDeploymentList, self).create(request, *args, **kwargs)
if (ret.status_code%100 != 200):
raise Exception(ret.data)
return ret
-class PlanetStackDetail(PlanetStackRetrieveUpdateDestroyAPIView):
- queryset = PlanetStack.objects.select_related().all()
- serializer_class = PlanetStackSerializer
- id_serializer_class = PlanetStackIdSerializer
+class SliceDeploymentDetail(PlanetStackRetrieveUpdateDestroyAPIView):
+ queryset = SliceDeployment.objects.select_related().all()
+ serializer_class = SliceDeploymentSerializer
+ id_serializer_class = SliceDeploymentIdSerializer
def get_serializer_class(self):
no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
@@ -4345,7 +4345,7 @@
return self.serializer_class
def get_queryset(self):
- return PlanetStack.select_by_user(self.request.user)
+ return SliceDeployment.select_by_user(self.request.user)
# update() is handled by PlanetStackRetrieveUpdateDestroyAPIView
@@ -4356,9 +4356,9 @@
filled with defaults. I solved it another way, so this code may soon be
abandoned.
-class PlanetStackNew(GenericAPIView):
- serializer_class = PlanetStackSerializer
- id_serializer_class = PlanetStackIdSerializer
+class SliceDeploymentNew(GenericAPIView):
+ serializer_class = SliceDeploymentSerializer
+ id_serializer_class = SliceDeploymentIdSerializer
def get(self, request, *args, **kwargs):
return self.makenew(request, *args, **kwargs)
@@ -4371,17 +4371,17 @@
return self.serializer_class
def makenew(self, request, *args, **kwargs):
- obj = PlanetStack()
+ obj = SliceDeployment()
serializer = self.get_serializer(obj)
return Response(serializer.data)
"""
-class UserDeploymentsList(generics.ListCreateAPIView):
- queryset = UserDeployments.objects.select_related().all()
- serializer_class = UserDeploymentsSerializer
- id_serializer_class = UserDeploymentsIdSerializer
+class UserDeploymentList(generics.ListCreateAPIView):
+ queryset = UserDeployment.objects.select_related().all()
+ serializer_class = UserDeploymentSerializer
+ id_serializer_class = UserDeploymentIdSerializer
filter_backends = (filters.DjangoFilterBackend,)
filter_fields = ('id','created','updated','enacted','backend_status','deleted','user','deployment','kuser_id',)
@@ -4393,7 +4393,7 @@
return self.serializer_class
def get_queryset(self):
- return UserDeployments.select_by_user(self.request.user)
+ return UserDeployment.select_by_user(self.request.user)
def create(self, request, *args, **kwargs):
serializer = self.get_serializer(data=request.DATA, files=request.FILES)
@@ -4402,21 +4402,21 @@
obj = serializer.object
obj.caller = request.user
if obj.can_update(request.user):
- return super(UserDeploymentsList, self).create(request, *args, **kwargs)
+ return super(UserDeploymentList, self).create(request, *args, **kwargs)
else:
raise Exception("failed obj.can_update")
- ret = super(UserDeploymentsList, self).create(request, *args, **kwargs)
+ ret = super(UserDeploymentList, self).create(request, *args, **kwargs)
if (ret.status_code%100 != 200):
raise Exception(ret.data)
return ret
-class UserDeploymentsDetail(PlanetStackRetrieveUpdateDestroyAPIView):
- queryset = UserDeployments.objects.select_related().all()
- serializer_class = UserDeploymentsSerializer
- id_serializer_class = UserDeploymentsIdSerializer
+class UserDeploymentDetail(PlanetStackRetrieveUpdateDestroyAPIView):
+ queryset = UserDeployment.objects.select_related().all()
+ serializer_class = UserDeploymentSerializer
+ id_serializer_class = UserDeploymentIdSerializer
def get_serializer_class(self):
no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
@@ -4426,7 +4426,7 @@
return self.serializer_class
def get_queryset(self):
- return UserDeployments.select_by_user(self.request.user)
+ return UserDeployment.select_by_user(self.request.user)
# update() is handled by PlanetStackRetrieveUpdateDestroyAPIView
@@ -4437,9 +4437,9 @@
filled with defaults. I solved it another way, so this code may soon be
abandoned.
-class UserDeploymentsNew(GenericAPIView):
- serializer_class = UserDeploymentsSerializer
- id_serializer_class = UserDeploymentsIdSerializer
+class UserDeploymentNew(GenericAPIView):
+ serializer_class = UserDeploymentSerializer
+ id_serializer_class = UserDeploymentIdSerializer
def get(self, request, *args, **kwargs):
return self.makenew(request, *args, **kwargs)
@@ -4452,7 +4452,7 @@
return self.serializer_class
def makenew(self, request, *args, **kwargs):
- obj = UserDeployments()
+ obj = UserDeployment()
serializer = self.get_serializer(obj)
return Response(serializer.data)
"""
@@ -4783,6 +4783,87 @@
+class ImageDeploymentList(generics.ListCreateAPIView):
+ queryset = ImageDeployment.objects.select_related().all()
+ serializer_class = ImageDeploymentSerializer
+ id_serializer_class = ImageDeploymentIdSerializer
+ filter_backends = (filters.DjangoFilterBackend,)
+ filter_fields = ('id','created','updated','enacted','backend_status','deleted','image','deployment','glance_image_id',)
+
+ def get_serializer_class(self):
+ 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):
+ return ImageDeployment.select_by_user(self.request.user)
+
+ def create(self, request, *args, **kwargs):
+ serializer = self.get_serializer(data=request.DATA, files=request.FILES)
+ if not (serializer.is_valid()):
+ raise Exception("failed serializer.is_valid: " + str(serializer.errors))
+ obj = serializer.object
+ obj.caller = request.user
+ if obj.can_update(request.user):
+ return super(ImageDeploymentList, self).create(request, *args, **kwargs)
+ else:
+ raise Exception("failed obj.can_update")
+
+ ret = super(ImageDeploymentList, self).create(request, *args, **kwargs)
+ if (ret.status_code%100 != 200):
+ raise Exception(ret.data)
+
+ return ret
+
+
+class ImageDeploymentDetail(PlanetStackRetrieveUpdateDestroyAPIView):
+ queryset = ImageDeployment.objects.select_related().all()
+ serializer_class = ImageDeploymentSerializer
+ id_serializer_class = ImageDeploymentIdSerializer
+
+ def get_serializer_class(self):
+ 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):
+ return ImageDeployment.select_by_user(self.request.user)
+
+ # update() is handled by PlanetStackRetrieveUpdateDestroyAPIView
+
+ # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
+
+"""
+ XXX smbaker: my intent was to create a view that would return 'new' objects
+ filled with defaults. I solved it another way, so this code may soon be
+ abandoned.
+
+class ImageDeploymentNew(GenericAPIView):
+ serializer_class = ImageDeploymentSerializer
+ id_serializer_class = ImageDeploymentIdSerializer
+
+ def get(self, request, *args, **kwargs):
+ return self.makenew(request, *args, **kwargs)
+
+ def get_serializer_class(self):
+ no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
+ if (no_hyperlinks):
+ return self.id_serializer_class
+ else:
+ return self.serializer_class
+
+ def makenew(self, request, *args, **kwargs):
+ obj = ImageDeployment()
+ serializer = self.get_serializer(obj)
+ return Response(serializer.data)
+"""
+
+
+
class DeploymentRoleList(generics.ListCreateAPIView):
queryset = DeploymentRole.objects.select_related().all()
serializer_class = DeploymentRoleSerializer
@@ -4945,87 +5026,6 @@
-class SiteDeploymentsList(generics.ListCreateAPIView):
- queryset = SiteDeployments.objects.select_related().all()
- serializer_class = SiteDeploymentsSerializer
- id_serializer_class = SiteDeploymentsIdSerializer
- filter_backends = (filters.DjangoFilterBackend,)
- filter_fields = ('id','created','updated','enacted','backend_status','deleted','site','deployment','tenant_id',)
-
- def get_serializer_class(self):
- 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):
- return SiteDeployments.select_by_user(self.request.user)
-
- def create(self, request, *args, **kwargs):
- serializer = self.get_serializer(data=request.DATA, files=request.FILES)
- if not (serializer.is_valid()):
- raise Exception("failed serializer.is_valid: " + str(serializer.errors))
- obj = serializer.object
- obj.caller = request.user
- if obj.can_update(request.user):
- return super(SiteDeploymentsList, self).create(request, *args, **kwargs)
- else:
- raise Exception("failed obj.can_update")
-
- ret = super(SiteDeploymentsList, self).create(request, *args, **kwargs)
- if (ret.status_code%100 != 200):
- raise Exception(ret.data)
-
- return ret
-
-
-class SiteDeploymentsDetail(PlanetStackRetrieveUpdateDestroyAPIView):
- queryset = SiteDeployments.objects.select_related().all()
- serializer_class = SiteDeploymentsSerializer
- id_serializer_class = SiteDeploymentsIdSerializer
-
- def get_serializer_class(self):
- 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):
- return SiteDeployments.select_by_user(self.request.user)
-
- # update() is handled by PlanetStackRetrieveUpdateDestroyAPIView
-
- # destroy() is handled by PlanetStackRetrieveUpdateDestroyAPIView
-
-"""
- XXX smbaker: my intent was to create a view that would return 'new' objects
- filled with defaults. I solved it another way, so this code may soon be
- abandoned.
-
-class SiteDeploymentsNew(GenericAPIView):
- serializer_class = SiteDeploymentsSerializer
- id_serializer_class = SiteDeploymentsIdSerializer
-
- def get(self, request, *args, **kwargs):
- return self.makenew(request, *args, **kwargs)
-
- def get_serializer_class(self):
- no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)
- if (no_hyperlinks):
- return self.id_serializer_class
- else:
- return self.serializer_class
-
- def makenew(self, request, *args, **kwargs):
- obj = SiteDeployments()
- serializer = self.get_serializer(obj)
- return Response(serializer.data)
-"""
-
-
-
class SliceTagList(generics.ListCreateAPIView):
queryset = SliceTag.objects.select_related().all()
serializer_class = SliceTagSerializer
@@ -5112,7 +5112,7 @@
serializer_class = NetworkTemplateSerializer
id_serializer_class = NetworkTemplateIdSerializer
filter_backends = (filters.DjangoFilterBackend,)
- filter_fields = ('id','created','updated','enacted','backend_status','deleted','name','description','guaranteedBandwidth','visibility','translation','sharedNetworkName','sharedNetworkId',)
+ filter_fields = ('id','created','updated','enacted','backend_status','deleted','name','description','guaranteedBandwidth','visibility','translation','sharedNetworkName','sharedNetworkId','topologyKind','controllerKind',)
def get_serializer_class(self):
no_hyperlinks = self.request.QUERY_PARAMS.get('no_hyperlinks', False)