Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 1 | from rest_framework.decorators import api_view |
| 2 | from rest_framework.response import Response |
| 3 | from rest_framework.reverse import reverse |
| 4 | from rest_framework import serializers |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 5 | from rest_framework import generics |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 6 | from core.models import * |
| 7 | from django.forms import widgets |
| 8 | |
| 9 | """ |
| 10 | Schema of the generator object: |
| 11 | all: Set of all Model objects |
| 12 | all_if(regex): Set of Model objects that match regex |
| 13 | |
| 14 | Model object: |
| 15 | plural: English plural of object name |
| 16 | camel: CamelCase version of object name |
| 17 | refs: list of references to other Model objects |
| 18 | props: list of properties minus refs |
| 19 | |
| 20 | TODO: Deal with subnets |
| 21 | """ |
| 22 | |
| 23 | # Based on api_root.py |
| 24 | |
| 25 | @api_view(['GET']) |
| 26 | def api_root(request, format=None): |
| 27 | return Response({ |
| 28 | 'serviceattributes': reverse('serviceattribute-list', request=request, format=format), |
| 29 | 'images': reverse('image-list', request=request, format=format), |
| 30 | 'networkparameters': reverse('networkparameter-list', request=request, format=format), |
| 31 | 'sites': reverse('site-list', request=request, format=format), |
| 32 | 'sliceroles': reverse('slicerole-list', request=request, format=format), |
| 33 | 'tags': reverse('tag-list', request=request, format=format), |
| 34 | 'invoices': reverse('invoice-list', request=request, format=format), |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 35 | 'planetstackroles': reverse('planetstackrole-list', request=request, format=format), |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 36 | 'sliceprivileges': reverse('sliceprivilege-list', request=request, format=format), |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 37 | 'networkslivers': reverse('networksliver-list', request=request, format=format), |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 38 | 'slices': reverse('slice-list', request=request, format=format), |
| 39 | 'networks': reverse('network-list', request=request, format=format), |
| 40 | 'services': reverse('service-list', request=request, format=format), |
| 41 | 'serviceclasses': reverse('serviceclass-list', request=request, format=format), |
| 42 | 'siteroles': reverse('siterole-list', request=request, format=format), |
| 43 | 'charges': reverse('charge-list', request=request, format=format), |
| 44 | 'roles': reverse('role-list', request=request, format=format), |
| 45 | 'usableobjects': reverse('usableobject-list', request=request, format=format), |
| 46 | 'slivers': reverse('sliver-list', request=request, format=format), |
| 47 | 'nodes': reverse('node-list', request=request, format=format), |
| 48 | 'reservedresources': reverse('reservedresource-list', request=request, format=format), |
| 49 | 'payments': reverse('payment-list', request=request, format=format), |
| 50 | 'networkslices': reverse('networkslice-list', request=request, format=format), |
| 51 | 'planetstackprivileges': reverse('planetstackprivilege-list', request=request, format=format), |
| 52 | 'users': reverse('user-list', request=request, format=format), |
| 53 | 'deployments': reverse('deployment-list', request=request, format=format), |
| 54 | 'reservations': reverse('reservation-list', request=request, format=format), |
| 55 | 'siteprivileges': reverse('siteprivilege-list', request=request, format=format), |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 56 | 'planetstacks': reverse('planetstack-list', request=request, format=format), |
| 57 | 'accounts': reverse('account-list', request=request, format=format), |
| 58 | 'networkparametertypes': reverse('networkparametertype-list', request=request, format=format), |
| 59 | 'sitedeploymentses': reverse('sitedeployments-list', request=request, format=format), |
| 60 | 'deploymentprivileges': reverse('deploymentprivilege-list', request=request, format=format), |
| 61 | 'deploymentroles': reverse('deploymentrole-list', request=request, format=format), |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 62 | 'projects': reverse('project-list', request=request, format=format), |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 63 | 'slicetags': reverse('slicetag-list', request=request, format=format), |
| 64 | 'networktemplates': reverse('networktemplate-list', request=request, format=format), |
| 65 | 'routers': reverse('router-list', request=request, format=format), |
| 66 | 'serviceresources': reverse('serviceresource-list', request=request, format=format), |
| 67 | |
| 68 | }) |
| 69 | |
| 70 | # Based on serializers.py |
| 71 | |
| 72 | |
| 73 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 74 | class ServiceAttributeSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 75 | id = serializers.Field() |
| 76 | |
| 77 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 78 | service = serializers.HyperlinkedRelatedField(read_only=True, view_name='service-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 79 | |
| 80 | |
| 81 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 82 | model = ServiceAttribute |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 83 | fields = ('id','created','updated','enacted','name','value','service',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 84 | |
| 85 | |
| 86 | class ImageSerializer(serializers.HyperlinkedModelSerializer): |
| 87 | id = serializers.Field() |
| 88 | |
| 89 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 90 | model = Image |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 91 | fields = ('id','created','updated','enacted','image_id','name','disk_format','container_format',) |
| 92 | |
| 93 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 94 | class NetworkParameterSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 95 | id = serializers.Field() |
| 96 | |
| 97 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 98 | model = NetworkParameter |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 99 | fields = ('id','created','updated','enacted','parameter','value','content_type','object_id',) |
| 100 | |
| 101 | |
| 102 | class SiteSerializer(serializers.HyperlinkedModelSerializer): |
| 103 | id = serializers.Field() |
| 104 | |
| 105 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 106 | model = Site |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 107 | fields = ('id','created','updated','enacted','tenant_id','name','site_url','enabled','location','longitude','latitude','login_base','is_public','abbreviated_name',) |
| 108 | |
| 109 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 110 | class SliceRoleSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 111 | id = serializers.Field() |
| 112 | |
| 113 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 114 | model = SliceRole |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 115 | fields = ('id','created','updated','enacted','role',) |
| 116 | |
| 117 | |
| 118 | class TagSerializer(serializers.HyperlinkedModelSerializer): |
| 119 | id = serializers.Field() |
| 120 | |
| 121 | |
| 122 | sites = serializers.HyperlinkedRelatedField(many=True, read_only=True, view_name='site-detail') |
| 123 | |
| 124 | |
| 125 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 126 | service = serializers.HyperlinkedRelatedField(read_only=True, view_name='service-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 127 | |
| 128 | |
| 129 | |
| 130 | slices = serializers.HyperlinkedRelatedField(many=True, read_only=True, view_name='slice-detail') |
| 131 | |
| 132 | |
| 133 | |
| 134 | slivers = serializers.HyperlinkedRelatedField(many=True, read_only=True, view_name='sliver-detail') |
| 135 | |
| 136 | |
| 137 | |
| 138 | nodes = serializers.HyperlinkedRelatedField(many=True, read_only=True, view_name='node-detail') |
| 139 | |
| 140 | |
| 141 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 142 | model = Tag |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 143 | fields = ('id','created','updated','enacted','name','value','content_type','object_id','site','service','slice','sliver','node',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 144 | |
| 145 | |
| 146 | class InvoiceSerializer(serializers.HyperlinkedModelSerializer): |
| 147 | id = serializers.Field() |
| 148 | |
| 149 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 150 | account = serializers.HyperlinkedRelatedField(read_only=True, view_name='account-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 151 | |
| 152 | |
| 153 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 154 | model = Invoice |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 155 | fields = ('id','created','updated','enacted','date','account',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 156 | |
| 157 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 158 | class PlanetStackRoleSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 159 | id = serializers.Field() |
| 160 | |
| 161 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 162 | model = PlanetStackRole |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 163 | fields = ('id','created','updated','enacted','role',) |
| 164 | |
| 165 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 166 | class SlicePrivilegeSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 167 | id = serializers.Field() |
| 168 | |
| 169 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 170 | user = serializers.HyperlinkedRelatedField(read_only=True, view_name='user-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 171 | |
| 172 | |
| 173 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 174 | slice = serializers.HyperlinkedRelatedField(read_only=True, view_name='slice-detail') |
| 175 | |
| 176 | |
| 177 | |
| 178 | role = serializers.HyperlinkedRelatedField(read_only=True, view_name='role-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 179 | |
| 180 | |
| 181 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 182 | model = SlicePrivilege |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 183 | fields = ('id','created','updated','enacted','user','slice','role',) |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 184 | |
| 185 | |
| 186 | class NetworkSliverSerializer(serializers.HyperlinkedModelSerializer): |
| 187 | id = serializers.Field() |
| 188 | |
| 189 | |
| 190 | network = serializers.HyperlinkedRelatedField(read_only=True, view_name='network-detail') |
| 191 | |
| 192 | |
| 193 | |
| 194 | sliver = serializers.HyperlinkedRelatedField(read_only=True, view_name='sliver-detail') |
| 195 | |
| 196 | |
| 197 | class Meta: |
| 198 | model = NetworkSliver |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 199 | fields = ('id','created','updated','enacted','ip','port_id','network','sliver',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 200 | |
| 201 | |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 202 | class SliceSerializer(serializers.HyperlinkedModelSerializer): |
| 203 | id = serializers.Field() |
| 204 | |
| 205 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 206 | site = serializers.HyperlinkedRelatedField(read_only=True, view_name='site-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 207 | |
| 208 | |
| 209 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 210 | service = serializers.HyperlinkedRelatedField(read_only=True, view_name='service-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 211 | |
| 212 | |
| 213 | |
| 214 | networks = serializers.HyperlinkedRelatedField(many=True, read_only=True, view_name='network-detail') |
| 215 | |
| 216 | |
| 217 | |
| 218 | networks = serializers.HyperlinkedRelatedField(many=True, read_only=True, view_name='network-detail') |
| 219 | |
| 220 | |
| 221 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 222 | model = Slice |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 223 | fields = ('id','created','updated','enacted','tenant_id','name','enabled','omf_friendly','description','slice_url','network_id','router_id','subnet_id','serviceClass','creator','site','service','network','network',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 224 | |
| 225 | |
| 226 | class NetworkSerializer(serializers.HyperlinkedModelSerializer): |
| 227 | id = serializers.Field() |
| 228 | |
| 229 | |
| 230 | routers = serializers.HyperlinkedRelatedField(many=True, read_only=True, view_name='router-detail') |
| 231 | |
| 232 | |
| 233 | |
| 234 | routers = serializers.HyperlinkedRelatedField(many=True, read_only=True, view_name='router-detail') |
| 235 | |
| 236 | |
| 237 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 238 | model = Network |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 239 | fields = ('id','created','updated','enacted','name','template','subnet','ports','labels','owner','guaranteedBandwidth','permitAllSlices','network_id','router_id','subnet_id','router','router',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 240 | |
| 241 | |
| 242 | class ServiceSerializer(serializers.HyperlinkedModelSerializer): |
| 243 | id = serializers.Field() |
| 244 | |
| 245 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 246 | model = Service |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 247 | fields = ('id','created','updated','enacted','description','enabled','name','versionNumber','published',) |
| 248 | |
| 249 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 250 | class ServiceClassSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 251 | id = serializers.Field() |
| 252 | |
| 253 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 254 | model = ServiceClass |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 255 | fields = ('id','created','updated','enacted','name','description','commitment','membershipFee','membershipFeeMonths','upgradeRequiresApproval',) |
| 256 | |
| 257 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 258 | class SiteRoleSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 259 | id = serializers.Field() |
| 260 | |
| 261 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 262 | model = SiteRole |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 263 | fields = ('id','created','updated','enacted','role',) |
| 264 | |
| 265 | |
| 266 | class ChargeSerializer(serializers.HyperlinkedModelSerializer): |
| 267 | id = serializers.Field() |
| 268 | |
| 269 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 270 | account = serializers.HyperlinkedRelatedField(read_only=True, view_name='account-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 271 | |
| 272 | |
| 273 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 274 | slice = serializers.HyperlinkedRelatedField(read_only=True, view_name='slice-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 275 | |
| 276 | |
| 277 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 278 | invoice = serializers.HyperlinkedRelatedField(read_only=True, view_name='invoice-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 279 | |
| 280 | |
| 281 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 282 | model = Charge |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 283 | fields = ('id','created','updated','enacted','kind','state','date','object','amount','coreHours','account','slice','invoice',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 284 | |
| 285 | |
| 286 | class RoleSerializer(serializers.HyperlinkedModelSerializer): |
| 287 | id = serializers.Field() |
| 288 | |
| 289 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 290 | model = Role |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 291 | fields = ('id','created','updated','enacted','role_type','role','description','content_type',) |
| 292 | |
| 293 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 294 | class UsableObjectSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 295 | id = serializers.Field() |
| 296 | |
| 297 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 298 | model = UsableObject |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 299 | fields = ('id','created','updated','enacted','name',) |
| 300 | |
| 301 | |
| 302 | class SliverSerializer(serializers.HyperlinkedModelSerializer): |
| 303 | id = serializers.Field() |
| 304 | |
| 305 | |
| 306 | networks = serializers.HyperlinkedRelatedField(many=True, read_only=True, view_name='network-detail') |
| 307 | |
| 308 | |
| 309 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 310 | image = serializers.HyperlinkedRelatedField(read_only=True, view_name='image-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 311 | |
| 312 | |
| 313 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 314 | slice = serializers.HyperlinkedRelatedField(read_only=True, view_name='slice-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 315 | |
| 316 | |
| 317 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 318 | node = serializers.HyperlinkedRelatedField(read_only=True, view_name='node-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 319 | |
| 320 | |
| 321 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 322 | model = Sliver |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 323 | fields = ('id','created','updated','enacted','instance_id','name','instance_name','ip','creator','deploymentNetwork','numberCores','network','image','slice','node',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 324 | |
| 325 | |
| 326 | class NodeSerializer(serializers.HyperlinkedModelSerializer): |
| 327 | id = serializers.Field() |
| 328 | |
| 329 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 330 | site = serializers.HyperlinkedRelatedField(read_only=True, view_name='site-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 331 | |
| 332 | |
| 333 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 334 | deployment = serializers.HyperlinkedRelatedField(read_only=True, view_name='deployment-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 335 | |
| 336 | |
| 337 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 338 | model = Node |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 339 | fields = ('id','created','updated','enacted','name','site','deployment',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 340 | |
| 341 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 342 | class ReservedResourceSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 343 | id = serializers.Field() |
| 344 | |
| 345 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 346 | sliver = serializers.HyperlinkedRelatedField(read_only=True, view_name='sliver-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 347 | |
| 348 | |
| 349 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 350 | model = ReservedResource |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 351 | fields = ('id','created','updated','enacted','resource','quantity','reservationSet','sliver',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 352 | |
| 353 | |
| 354 | class PaymentSerializer(serializers.HyperlinkedModelSerializer): |
| 355 | id = serializers.Field() |
| 356 | |
| 357 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 358 | account = serializers.HyperlinkedRelatedField(read_only=True, view_name='account-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 359 | |
| 360 | |
| 361 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 362 | model = Payment |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 363 | fields = ('id','created','updated','enacted','amount','date','account',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 364 | |
| 365 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 366 | class NetworkSliceSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 367 | id = serializers.Field() |
| 368 | |
| 369 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 370 | network = serializers.HyperlinkedRelatedField(read_only=True, view_name='network-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 371 | |
| 372 | |
| 373 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 374 | slice = serializers.HyperlinkedRelatedField(read_only=True, view_name='slice-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 375 | |
| 376 | |
| 377 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 378 | model = NetworkSlice |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 379 | fields = ('id','created','updated','enacted','network','slice',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 380 | |
| 381 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 382 | class PlanetStackPrivilegeSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 383 | id = serializers.Field() |
| 384 | |
| 385 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 386 | user = serializers.HyperlinkedRelatedField(read_only=True, view_name='user-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 387 | |
| 388 | |
| 389 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 390 | planetstack = serializers.HyperlinkedRelatedField(read_only=True, view_name='planetstack-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 391 | |
| 392 | |
| 393 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 394 | role = serializers.HyperlinkedRelatedField(read_only=True, view_name='role-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 395 | |
| 396 | |
| 397 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 398 | model = PlanetStackPrivilege |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 399 | fields = ('id','created','updated','enacted','user','planetstack','role',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 400 | |
| 401 | |
| 402 | class UserSerializer(serializers.HyperlinkedModelSerializer): |
| 403 | id = serializers.Field() |
| 404 | |
| 405 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 406 | site = serializers.HyperlinkedRelatedField(read_only=True, view_name='site-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 407 | |
| 408 | |
| 409 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 410 | model = User |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 411 | fields = ('id','password','last_login','email','username','kuser_id','firstname','lastname','phone','user_url','public_key','is_active','is_admin','is_staff','is_readonly','created','updated','enacted','timezone','site',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 412 | |
| 413 | |
| 414 | class DeploymentSerializer(serializers.HyperlinkedModelSerializer): |
| 415 | id = serializers.Field() |
| 416 | |
| 417 | |
| 418 | sites = serializers.HyperlinkedRelatedField(many=True, read_only=True, view_name='site-detail') |
| 419 | |
| 420 | |
| 421 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 422 | model = Deployment |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 423 | fields = ('id','created','updated','enacted','name','site',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 424 | |
| 425 | |
| 426 | class ReservationSerializer(serializers.HyperlinkedModelSerializer): |
| 427 | id = serializers.Field() |
| 428 | |
| 429 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 430 | slice = serializers.HyperlinkedRelatedField(read_only=True, view_name='slice-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 431 | |
| 432 | |
| 433 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 434 | model = Reservation |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 435 | fields = ('id','created','updated','enacted','startTime','duration','slice',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 436 | |
| 437 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 438 | class SitePrivilegeSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 439 | id = serializers.Field() |
| 440 | |
| 441 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 442 | user = serializers.HyperlinkedRelatedField(read_only=True, view_name='user-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 443 | |
| 444 | |
| 445 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 446 | site = serializers.HyperlinkedRelatedField(read_only=True, view_name='site-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 447 | |
| 448 | |
| 449 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 450 | role = serializers.HyperlinkedRelatedField(read_only=True, view_name='role-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 451 | |
| 452 | |
| 453 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 454 | model = SitePrivilege |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 455 | fields = ('id','created','updated','enacted','user','site','role',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 456 | |
| 457 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 458 | class PlanetStackSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 459 | id = serializers.Field() |
| 460 | |
| 461 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 462 | model = PlanetStack |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 463 | fields = ('id','created','updated','enacted','description',) |
| 464 | |
| 465 | |
| 466 | class AccountSerializer(serializers.HyperlinkedModelSerializer): |
| 467 | id = serializers.Field() |
| 468 | |
| 469 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 470 | site = serializers.HyperlinkedRelatedField(read_only=True, view_name='site-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 471 | |
| 472 | |
| 473 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 474 | model = Account |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 475 | fields = ('id','created','updated','enacted','site',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 476 | |
| 477 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 478 | class NetworkParameterTypeSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 479 | id = serializers.Field() |
| 480 | |
| 481 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 482 | model = NetworkParameterType |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 483 | fields = ('id','created','updated','enacted','name','description',) |
| 484 | |
| 485 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 486 | class SiteDeploymentsSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 487 | id = serializers.Field() |
| 488 | |
| 489 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 490 | site = serializers.HyperlinkedRelatedField(read_only=True, view_name='site-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 491 | |
| 492 | |
| 493 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 494 | deployment = serializers.HyperlinkedRelatedField(read_only=True, view_name='deployment-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 495 | |
| 496 | |
| 497 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 498 | model = SiteDeployments |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 499 | fields = ('id','created','updated','enacted','site','deployment',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 500 | |
| 501 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 502 | class DeploymentPrivilegeSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 503 | id = serializers.Field() |
| 504 | |
| 505 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 506 | user = serializers.HyperlinkedRelatedField(read_only=True, view_name='user-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 507 | |
| 508 | |
| 509 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 510 | deployment = serializers.HyperlinkedRelatedField(read_only=True, view_name='deployment-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 511 | |
| 512 | |
| 513 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 514 | role = serializers.HyperlinkedRelatedField(read_only=True, view_name='role-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 515 | |
| 516 | |
| 517 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 518 | model = DeploymentPrivilege |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 519 | fields = ('id','created','updated','enacted','user','deployment','role',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 520 | |
| 521 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 522 | class DeploymentRoleSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 523 | id = serializers.Field() |
| 524 | |
| 525 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 526 | model = DeploymentRole |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 527 | fields = ('id','created','updated','enacted','role',) |
| 528 | |
| 529 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 530 | class ProjectSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 531 | id = serializers.Field() |
| 532 | |
| 533 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 534 | model = Project |
| 535 | fields = ('id','created','updated','enacted','name',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 536 | |
| 537 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 538 | class SliceTagSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 539 | id = serializers.Field() |
| 540 | |
| 541 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 542 | slice = serializers.HyperlinkedRelatedField(read_only=True, view_name='slice-detail') |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 543 | |
| 544 | |
| 545 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 546 | model = SliceTag |
Sapan Bhatia | 60af03d | 2014-01-28 20:12:08 -0500 | [diff] [blame^] | 547 | fields = ('id','created','updated','enacted','name','value','slice',) |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 548 | |
| 549 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 550 | class NetworkTemplateSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 551 | id = serializers.Field() |
| 552 | |
| 553 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 554 | model = NetworkTemplate |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 555 | fields = ('id','created','updated','enacted','name','description','guaranteedBandwidth','visibility','translation','sharedNetworkName','sharedNetworkId',) |
| 556 | |
| 557 | |
| 558 | class RouterSerializer(serializers.HyperlinkedModelSerializer): |
| 559 | id = serializers.Field() |
| 560 | |
| 561 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 562 | model = Router |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 563 | fields = ('id','created','updated','enacted','name','owner',) |
| 564 | |
| 565 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 566 | class ServiceResourceSerializer(serializers.HyperlinkedModelSerializer): |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 567 | id = serializers.Field() |
| 568 | |
| 569 | class Meta: |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 570 | model = ServiceResource |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 571 | fields = ('id','created','updated','enacted','serviceClass','name','maxUnitsDeployment','maxUnitsNode','maxDuration','bucketInRate','bucketMaxSize','cost','calendarReservable',) |
| 572 | |
| 573 | |
| 574 | serializerLookUp = { |
| 575 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 576 | ServiceAttribute: ServiceAttributeSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 577 | |
| 578 | Image: ImageSerializer, |
| 579 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 580 | NetworkParameter: NetworkParameterSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 581 | |
| 582 | Site: SiteSerializer, |
| 583 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 584 | SliceRole: SliceRoleSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 585 | |
| 586 | Tag: TagSerializer, |
| 587 | |
| 588 | Invoice: InvoiceSerializer, |
| 589 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 590 | PlanetStackRole: PlanetStackRoleSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 591 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 592 | SlicePrivilege: SlicePrivilegeSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 593 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 594 | NetworkSliver: NetworkSliverSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 595 | |
| 596 | Slice: SliceSerializer, |
| 597 | |
| 598 | Network: NetworkSerializer, |
| 599 | |
| 600 | Service: ServiceSerializer, |
| 601 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 602 | ServiceClass: ServiceClassSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 603 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 604 | SiteRole: SiteRoleSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 605 | |
| 606 | Charge: ChargeSerializer, |
| 607 | |
| 608 | Role: RoleSerializer, |
| 609 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 610 | UsableObject: UsableObjectSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 611 | |
| 612 | Sliver: SliverSerializer, |
| 613 | |
| 614 | Node: NodeSerializer, |
| 615 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 616 | ReservedResource: ReservedResourceSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 617 | |
| 618 | Payment: PaymentSerializer, |
| 619 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 620 | NetworkSlice: NetworkSliceSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 621 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 622 | PlanetStackPrivilege: PlanetStackPrivilegeSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 623 | |
| 624 | User: UserSerializer, |
| 625 | |
| 626 | Deployment: DeploymentSerializer, |
| 627 | |
| 628 | Reservation: ReservationSerializer, |
| 629 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 630 | SitePrivilege: SitePrivilegeSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 631 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 632 | PlanetStack: PlanetStackSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 633 | |
| 634 | Account: AccountSerializer, |
| 635 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 636 | NetworkParameterType: NetworkParameterTypeSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 637 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 638 | SiteDeployments: SiteDeploymentsSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 639 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 640 | DeploymentPrivilege: DeploymentPrivilegeSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 641 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 642 | DeploymentRole: DeploymentRoleSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 643 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 644 | Project: ProjectSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 645 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 646 | SliceTag: SliceTagSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 647 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 648 | NetworkTemplate: NetworkTemplateSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 649 | |
| 650 | Router: RouterSerializer, |
| 651 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 652 | ServiceResource: ServiceResourceSerializer, |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 653 | |
| 654 | None: None, |
| 655 | } |
| 656 | |
| 657 | # Based on core/views/*.py |
| 658 | |
| 659 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 660 | class ServiceAttributeList(generics.ListCreateAPIView): |
| 661 | queryset = ServiceAttribute.objects.select_related().all() |
| 662 | serializer_class = ServiceAttributeSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 663 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 664 | class ServiceAttributeDetail(generics.RetrieveUpdateDestroyAPIView): |
| 665 | queryset = ServiceAttribute.objects.select_related().all() |
| 666 | serializer_class = ServiceAttributeSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 667 | |
| 668 | |
| 669 | |
| 670 | class ImageList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 671 | queryset = Image.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 672 | serializer_class = ImageSerializer |
| 673 | |
| 674 | class ImageDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 675 | queryset = Image.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 676 | serializer_class = ImageSerializer |
| 677 | |
| 678 | |
| 679 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 680 | class NetworkParameterList(generics.ListCreateAPIView): |
| 681 | queryset = NetworkParameter.objects.select_related().all() |
| 682 | serializer_class = NetworkParameterSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 683 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 684 | class NetworkParameterDetail(generics.RetrieveUpdateDestroyAPIView): |
| 685 | queryset = NetworkParameter.objects.select_related().all() |
| 686 | serializer_class = NetworkParameterSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 687 | |
| 688 | |
| 689 | |
| 690 | class SiteList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 691 | queryset = Site.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 692 | serializer_class = SiteSerializer |
| 693 | |
| 694 | class SiteDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 695 | queryset = Site.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 696 | serializer_class = SiteSerializer |
| 697 | |
| 698 | |
| 699 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 700 | class SliceRoleList(generics.ListCreateAPIView): |
| 701 | queryset = SliceRole.objects.select_related().all() |
| 702 | serializer_class = SliceRoleSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 703 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 704 | class SliceRoleDetail(generics.RetrieveUpdateDestroyAPIView): |
| 705 | queryset = SliceRole.objects.select_related().all() |
| 706 | serializer_class = SliceRoleSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 707 | |
| 708 | |
| 709 | |
| 710 | class TagList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 711 | queryset = Tag.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 712 | serializer_class = TagSerializer |
| 713 | |
| 714 | class TagDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 715 | queryset = Tag.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 716 | serializer_class = TagSerializer |
| 717 | |
| 718 | |
| 719 | |
| 720 | class InvoiceList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 721 | queryset = Invoice.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 722 | serializer_class = InvoiceSerializer |
| 723 | |
| 724 | class InvoiceDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 725 | queryset = Invoice.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 726 | serializer_class = InvoiceSerializer |
| 727 | |
| 728 | |
| 729 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 730 | class PlanetStackRoleList(generics.ListCreateAPIView): |
| 731 | queryset = PlanetStackRole.objects.select_related().all() |
| 732 | serializer_class = PlanetStackRoleSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 733 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 734 | class PlanetStackRoleDetail(generics.RetrieveUpdateDestroyAPIView): |
| 735 | queryset = PlanetStackRole.objects.select_related().all() |
| 736 | serializer_class = PlanetStackRoleSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 737 | |
| 738 | |
| 739 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 740 | class SlicePrivilegeList(generics.ListCreateAPIView): |
| 741 | queryset = SlicePrivilege.objects.select_related().all() |
| 742 | serializer_class = SlicePrivilegeSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 743 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 744 | class SlicePrivilegeDetail(generics.RetrieveUpdateDestroyAPIView): |
| 745 | queryset = SlicePrivilege.objects.select_related().all() |
| 746 | serializer_class = SlicePrivilegeSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 747 | |
| 748 | |
| 749 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 750 | class NetworkSliverList(generics.ListCreateAPIView): |
| 751 | queryset = NetworkSliver.objects.select_related().all() |
| 752 | serializer_class = NetworkSliverSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 753 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 754 | class NetworkSliverDetail(generics.RetrieveUpdateDestroyAPIView): |
| 755 | queryset = NetworkSliver.objects.select_related().all() |
| 756 | serializer_class = NetworkSliverSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 757 | |
| 758 | |
| 759 | |
| 760 | class SliceList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 761 | queryset = Slice.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 762 | serializer_class = SliceSerializer |
| 763 | |
| 764 | class SliceDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 765 | queryset = Slice.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 766 | serializer_class = SliceSerializer |
| 767 | |
| 768 | |
| 769 | |
| 770 | class NetworkList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 771 | queryset = Network.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 772 | serializer_class = NetworkSerializer |
| 773 | |
| 774 | class NetworkDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 775 | queryset = Network.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 776 | serializer_class = NetworkSerializer |
| 777 | |
| 778 | |
| 779 | |
| 780 | class ServiceList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 781 | queryset = Service.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 782 | serializer_class = ServiceSerializer |
| 783 | |
| 784 | class ServiceDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 785 | queryset = Service.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 786 | serializer_class = ServiceSerializer |
| 787 | |
| 788 | |
| 789 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 790 | class ServiceClassList(generics.ListCreateAPIView): |
| 791 | queryset = ServiceClass.objects.select_related().all() |
| 792 | serializer_class = ServiceClassSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 793 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 794 | class ServiceClassDetail(generics.RetrieveUpdateDestroyAPIView): |
| 795 | queryset = ServiceClass.objects.select_related().all() |
| 796 | serializer_class = ServiceClassSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 797 | |
| 798 | |
| 799 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 800 | class SiteRoleList(generics.ListCreateAPIView): |
| 801 | queryset = SiteRole.objects.select_related().all() |
| 802 | serializer_class = SiteRoleSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 803 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 804 | class SiteRoleDetail(generics.RetrieveUpdateDestroyAPIView): |
| 805 | queryset = SiteRole.objects.select_related().all() |
| 806 | serializer_class = SiteRoleSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 807 | |
| 808 | |
| 809 | |
| 810 | class ChargeList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 811 | queryset = Charge.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 812 | serializer_class = ChargeSerializer |
| 813 | |
| 814 | class ChargeDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 815 | queryset = Charge.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 816 | serializer_class = ChargeSerializer |
| 817 | |
| 818 | |
| 819 | |
| 820 | class RoleList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 821 | queryset = Role.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 822 | serializer_class = RoleSerializer |
| 823 | |
| 824 | class RoleDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 825 | queryset = Role.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 826 | serializer_class = RoleSerializer |
| 827 | |
| 828 | |
| 829 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 830 | class UsableObjectList(generics.ListCreateAPIView): |
| 831 | queryset = UsableObject.objects.select_related().all() |
| 832 | serializer_class = UsableObjectSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 833 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 834 | class UsableObjectDetail(generics.RetrieveUpdateDestroyAPIView): |
| 835 | queryset = UsableObject.objects.select_related().all() |
| 836 | serializer_class = UsableObjectSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 837 | |
| 838 | |
| 839 | |
| 840 | class SliverList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 841 | queryset = Sliver.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 842 | serializer_class = SliverSerializer |
| 843 | |
| 844 | class SliverDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 845 | queryset = Sliver.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 846 | serializer_class = SliverSerializer |
| 847 | |
| 848 | |
| 849 | |
| 850 | class NodeList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 851 | queryset = Node.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 852 | serializer_class = NodeSerializer |
| 853 | |
| 854 | class NodeDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 855 | queryset = Node.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 856 | serializer_class = NodeSerializer |
| 857 | |
| 858 | |
| 859 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 860 | class ReservedResourceList(generics.ListCreateAPIView): |
| 861 | queryset = ReservedResource.objects.select_related().all() |
| 862 | serializer_class = ReservedResourceSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 863 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 864 | class ReservedResourceDetail(generics.RetrieveUpdateDestroyAPIView): |
| 865 | queryset = ReservedResource.objects.select_related().all() |
| 866 | serializer_class = ReservedResourceSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 867 | |
| 868 | |
| 869 | |
| 870 | class PaymentList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 871 | queryset = Payment.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 872 | serializer_class = PaymentSerializer |
| 873 | |
| 874 | class PaymentDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 875 | queryset = Payment.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 876 | serializer_class = PaymentSerializer |
| 877 | |
| 878 | |
| 879 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 880 | class NetworkSliceList(generics.ListCreateAPIView): |
| 881 | queryset = NetworkSlice.objects.select_related().all() |
| 882 | serializer_class = NetworkSliceSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 883 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 884 | class NetworkSliceDetail(generics.RetrieveUpdateDestroyAPIView): |
| 885 | queryset = NetworkSlice.objects.select_related().all() |
| 886 | serializer_class = NetworkSliceSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 887 | |
| 888 | |
| 889 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 890 | class PlanetStackPrivilegeList(generics.ListCreateAPIView): |
| 891 | queryset = PlanetStackPrivilege.objects.select_related().all() |
| 892 | serializer_class = PlanetStackPrivilegeSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 893 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 894 | class PlanetStackPrivilegeDetail(generics.RetrieveUpdateDestroyAPIView): |
| 895 | queryset = PlanetStackPrivilege.objects.select_related().all() |
| 896 | serializer_class = PlanetStackPrivilegeSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 897 | |
| 898 | |
| 899 | |
| 900 | class UserList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 901 | queryset = User.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 902 | serializer_class = UserSerializer |
| 903 | |
| 904 | class UserDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 905 | queryset = User.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 906 | serializer_class = UserSerializer |
| 907 | |
| 908 | |
| 909 | |
| 910 | class DeploymentList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 911 | queryset = Deployment.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 912 | serializer_class = DeploymentSerializer |
| 913 | |
| 914 | class DeploymentDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 915 | queryset = Deployment.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 916 | serializer_class = DeploymentSerializer |
| 917 | |
| 918 | |
| 919 | |
| 920 | class ReservationList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 921 | queryset = Reservation.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 922 | serializer_class = ReservationSerializer |
| 923 | |
| 924 | class ReservationDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 925 | queryset = Reservation.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 926 | serializer_class = ReservationSerializer |
| 927 | |
| 928 | |
| 929 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 930 | class SitePrivilegeList(generics.ListCreateAPIView): |
| 931 | queryset = SitePrivilege.objects.select_related().all() |
| 932 | serializer_class = SitePrivilegeSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 933 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 934 | class SitePrivilegeDetail(generics.RetrieveUpdateDestroyAPIView): |
| 935 | queryset = SitePrivilege.objects.select_related().all() |
| 936 | serializer_class = SitePrivilegeSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 937 | |
| 938 | |
| 939 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 940 | class PlanetStackList(generics.ListCreateAPIView): |
| 941 | queryset = PlanetStack.objects.select_related().all() |
| 942 | serializer_class = PlanetStackSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 943 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 944 | class PlanetStackDetail(generics.RetrieveUpdateDestroyAPIView): |
| 945 | queryset = PlanetStack.objects.select_related().all() |
| 946 | serializer_class = PlanetStackSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 947 | |
| 948 | |
| 949 | |
| 950 | class AccountList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 951 | queryset = Account.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 952 | serializer_class = AccountSerializer |
| 953 | |
| 954 | class AccountDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 955 | queryset = Account.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 956 | serializer_class = AccountSerializer |
| 957 | |
| 958 | |
| 959 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 960 | class NetworkParameterTypeList(generics.ListCreateAPIView): |
| 961 | queryset = NetworkParameterType.objects.select_related().all() |
| 962 | serializer_class = NetworkParameterTypeSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 963 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 964 | class NetworkParameterTypeDetail(generics.RetrieveUpdateDestroyAPIView): |
| 965 | queryset = NetworkParameterType.objects.select_related().all() |
| 966 | serializer_class = NetworkParameterTypeSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 967 | |
| 968 | |
| 969 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 970 | class SiteDeploymentsList(generics.ListCreateAPIView): |
| 971 | queryset = SiteDeployments.objects.select_related().all() |
| 972 | serializer_class = SiteDeploymentsSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 973 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 974 | class SiteDeploymentsDetail(generics.RetrieveUpdateDestroyAPIView): |
| 975 | queryset = SiteDeployments.objects.select_related().all() |
| 976 | serializer_class = SiteDeploymentsSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 977 | |
| 978 | |
| 979 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 980 | class DeploymentPrivilegeList(generics.ListCreateAPIView): |
| 981 | queryset = DeploymentPrivilege.objects.select_related().all() |
| 982 | serializer_class = DeploymentPrivilegeSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 983 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 984 | class DeploymentPrivilegeDetail(generics.RetrieveUpdateDestroyAPIView): |
| 985 | queryset = DeploymentPrivilege.objects.select_related().all() |
| 986 | serializer_class = DeploymentPrivilegeSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 987 | |
| 988 | |
| 989 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 990 | class DeploymentRoleList(generics.ListCreateAPIView): |
| 991 | queryset = DeploymentRole.objects.select_related().all() |
| 992 | serializer_class = DeploymentRoleSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 993 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 994 | class DeploymentRoleDetail(generics.RetrieveUpdateDestroyAPIView): |
| 995 | queryset = DeploymentRole.objects.select_related().all() |
| 996 | serializer_class = DeploymentRoleSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 997 | |
| 998 | |
| 999 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 1000 | class ProjectList(generics.ListCreateAPIView): |
| 1001 | queryset = Project.objects.select_related().all() |
| 1002 | serializer_class = ProjectSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 1003 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 1004 | class ProjectDetail(generics.RetrieveUpdateDestroyAPIView): |
| 1005 | queryset = Project.objects.select_related().all() |
| 1006 | serializer_class = ProjectSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 1007 | |
| 1008 | |
| 1009 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 1010 | class SliceTagList(generics.ListCreateAPIView): |
| 1011 | queryset = SliceTag.objects.select_related().all() |
| 1012 | serializer_class = SliceTagSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 1013 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 1014 | class SliceTagDetail(generics.RetrieveUpdateDestroyAPIView): |
| 1015 | queryset = SliceTag.objects.select_related().all() |
| 1016 | serializer_class = SliceTagSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 1017 | |
| 1018 | |
| 1019 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 1020 | class NetworkTemplateList(generics.ListCreateAPIView): |
| 1021 | queryset = NetworkTemplate.objects.select_related().all() |
| 1022 | serializer_class = NetworkTemplateSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 1023 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 1024 | class NetworkTemplateDetail(generics.RetrieveUpdateDestroyAPIView): |
| 1025 | queryset = NetworkTemplate.objects.select_related().all() |
| 1026 | serializer_class = NetworkTemplateSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 1027 | |
| 1028 | |
| 1029 | |
| 1030 | class RouterList(generics.ListCreateAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 1031 | queryset = Router.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 1032 | serializer_class = RouterSerializer |
| 1033 | |
| 1034 | class RouterDetail(generics.RetrieveUpdateDestroyAPIView): |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 1035 | queryset = Router.objects.select_related().all() |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 1036 | serializer_class = RouterSerializer |
| 1037 | |
| 1038 | |
| 1039 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 1040 | class ServiceResourceList(generics.ListCreateAPIView): |
| 1041 | queryset = ServiceResource.objects.select_related().all() |
| 1042 | serializer_class = ServiceResourceSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 1043 | |
Sapan Bhatia | cdd90b7 | 2014-01-28 20:03:13 -0500 | [diff] [blame] | 1044 | class ServiceResourceDetail(generics.RetrieveUpdateDestroyAPIView): |
| 1045 | queryset = ServiceResource.objects.select_related().all() |
| 1046 | serializer_class = ServiceResourceSerializer |
Sapan Bhatia | 643b709 | 2014-01-28 14:31:06 -0500 | [diff] [blame] | 1047 | |
| 1048 | |
| 1049 | |