Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1877c381
authored
Nov 12, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
occi: rename disk to storage
it seems occi doesn't support custom namespaces for storages
parent
d263bf24
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
circle/occi/occi.py
+6
-6
circle/occi/urls.py
+1
-1
circle/occi/views.py
+1
-1
No files found.
circle/occi/occi.py
View file @
1877c381
...
@@ -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
=
"
%
s
disk
/
%
d"
%
(
OCCI_ADDR
,
disk
.
pk
)
cls
.
location
=
"
%
s
storage
/
%
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
...
...
circle/occi/urls.py
View file @
1877c381
...
@@ -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+)/?$'
,
...
...
circle/occi/views.py
View file @
1877c381
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment