use id as url pk
diff --git a/plstackapi/planetstack/serializers.py b/plstackapi/planetstack/serializers.py
index b1ea4ec..a0a502e 100644
--- a/plstackapi/planetstack/serializers.py
+++ b/plstackapi/planetstack/serializers.py
@@ -7,7 +7,8 @@
class Meta:
model = Role
- fields = ('role_id',
+ fields = ('id',
+ 'role_id',
'role_type')
class SliceSerializer(serializers.HyperlinkedModelSerializer):
@@ -16,7 +17,8 @@
class Meta:
model = Slice
- fields = ('url',
+ fields = ('id',
+ 'url',
'name',
'instantiation',
'omf_friendly',
@@ -37,7 +39,8 @@
class Meta:
model = Site
- fields = ('url',
+ fields = ('id',
+ 'url',
'name',
'deployment_networks',
'slices',
@@ -57,7 +60,8 @@
sites = serializers.HyperlinkedRelatedField(view_name='sitedeploymentnetwork-detail')
class Meta:
model = DeploymentNetwork
- fields = ('name',
+ fields = ('id',
+ 'name',
'sites'
)
@@ -93,7 +97,8 @@
class Meta:
model = Image
- fields = ('image_id',
+ fields = ('id',
+ 'image_id',
'name',
'disk_format',
'container_format')
@@ -102,7 +107,8 @@
class Meta:
model = Flavor
- fields = ('flavor_id',
+ fields = ('id',
+ 'flavor_id',
'name',
'memory_mb',
'disk_gb',
diff --git a/plstackapi/planetstack/views/images.py b/plstackapi/planetstack/views/images.py
index af26799..8df0aa9 100644
--- a/plstackapi/planetstack/views/images.py
+++ b/plstackapi/planetstack/views/images.py
@@ -36,7 +36,7 @@
data = parse_request(request.DATA)
if 'auth' not in data:
return Response(status=status.HTTP_400_BAD_REQUEST)
- images = get_images(data['auth'], {'name': pk})
+ images = get_images(data['auth'], {'id': pk})
if not images:
return Response(status=status.HTTP_404_NOT_FOUND)
serializer = ImageSerializer(images[0])