Commit 1877c381 by Kálmán Viktor

occi: rename disk to storage

it seems occi doesn't support custom namespaces for storages
parent d263bf24
...@@ -339,7 +339,7 @@ class Storage(Resource): ...@@ -339,7 +339,7 @@ class Storage(Resource):
def __init__(self, disk=None, data=None): def __init__(self, disk=None, data=None):
self.attrs = {} self.attrs = {}
if disk: if disk:
self.location = "/disk/%d/" % (disk.pk) self.location = "/storage/%d/" % (disk.pk)
self.disk = disk self.disk = disk
self.init_attrs() self.init_attrs()
...@@ -373,7 +373,7 @@ class Storage(Resource): ...@@ -373,7 +373,7 @@ class Storage(Resource):
disk = Disk.create(**params) disk = Disk.create(**params)
disk.full_clean() disk.full_clean()
cls.location = "%sdisk/%d" % (OCCI_ADDR, disk.pk) cls.location = "%sstorage/%d" % (OCCI_ADDR, disk.pk)
return cls return cls
def render_location(self): def render_location(self):
...@@ -479,13 +479,13 @@ class StorageLink(Link): ...@@ -479,13 +479,13 @@ class StorageLink(Link):
except: except:
pass pass
cls.location = "%sstoragelink/%svm_%sdisk" % (OCCI_ADDR, vm_pk, cls.location = "%sstoragelink/vm_%s_storage_%s" % (OCCI_ADDR, vm_pk,
disk_pk) disk_pk)
return cls return cls
def render_location(self): def render_location(self):
return "/link/storagelink/vm%d_disk%d" % (self.instance.pk, return "/link/storagelink/vm_%d_storage_%d" % (self.instance.pk,
self.disk.pk) self.disk.pk)
def render_as_link(self): def render_as_link(self):
kind = STORAGE_LINK_KIND kind = STORAGE_LINK_KIND
......
...@@ -30,7 +30,7 @@ urlpatterns = patterns( ...@@ -30,7 +30,7 @@ urlpatterns = patterns(
url(r'^os_tpl/$', OsTplInterface.as_view(), name="occi.os_tpl"), url(r'^os_tpl/$', OsTplInterface.as_view(), name="occi.os_tpl"),
url(r'^vm/(?P<pk>\d+)/?$', VmInterface.as_view(), name="occi.vm"), url(r'^vm/(?P<pk>\d+)/?$', VmInterface.as_view(), name="occi.vm"),
url(r'^storage/$', StorageInterface.as_view(), name="occi.storage"), url(r'^storage/$', StorageInterface.as_view(), name="occi.storage"),
url(r'^disk/(?P<pk>\d+)/$', DiskInterface.as_view(), name="occi.disk"), url(r'^storage/(?P<pk>\d+)/?$', DiskInterface.as_view(), name="occi.disk"),
url(r'^link/storagelink/$', StorageLinkInterface.as_view()), url(r'^link/storagelink/$', StorageLinkInterface.as_view()),
url(r'^link/storagelink/vm(?P<vm_pk>\d+)_disk(?P<disk_pk>\d+)/?$', url(r'^link/storagelink/vm(?P<vm_pk>\d+)_disk(?P<disk_pk>\d+)/?$',
......
...@@ -185,7 +185,7 @@ class DiskInterface(DetailView): ...@@ -185,7 +185,7 @@ class DiskInterface(DetailView):
) )
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
# TODO # TODO actions (we only support resize)
data = get_post_data_from_request(request) data = get_post_data_from_request(request)
action = request.GET.get("action") action = request.GET.get("action")
disk = self.get_object() disk = self.get_object()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment