Commit 40048b3f authored by Kostas Papadimitriou's avatar Kostas Papadimitriou Committed by Christos Stavrakakis
Browse files

ui: Implement snapshot create api call

parent b03f4cff
...@@ -52,6 +52,7 @@ if not BASE_PATH.startswith("/"): ...@@ -52,6 +52,7 @@ if not BASE_PATH.startswith("/"):
cyclades_services = cyclades_settings.cyclades_services cyclades_services = cyclades_settings.cyclades_services
VOLUME_URL = endpoint(cyclades_services, 'volume', 'v2.0').rstrip('/')
GLANCE_URL = endpoint(cyclades_services, 'image', 'v1.0').rstrip('/') GLANCE_URL = endpoint(cyclades_services, 'image', 'v1.0').rstrip('/')
COMPUTE_URL = endpoint(cyclades_services, 'compute', 'v2.0').rstrip('/') COMPUTE_URL = endpoint(cyclades_services, 'compute', 'v2.0').rstrip('/')
NETWORK_URL = endpoint(cyclades_services, 'network', 'v2.0').rstrip('/') NETWORK_URL = endpoint(cyclades_services, 'network', 'v2.0').rstrip('/')
......
...@@ -1514,6 +1514,22 @@ ...@@ -1514,6 +1514,22 @@
skip_api_error: false skip_api_error: false
}); });
}, },
create_snapshot: function(snapshot_params, callback) {
var volume = this.get('volumes') && this.get('volumes').length ?
this.get('volumes')[0] : undefined;
var params = _.extend({
'metadata': {},
'volume_id': volume
}, snapshot_params);
snf.api.sync('create', undefined, {
url: synnefo.config.api_urls.volume,
data: params,
success: callback,
skip_api_error: false
});
},
// action helper // action helper
call: function(action_name, success, error, params) { call: function(action_name, success, error, params) {
......
...@@ -633,6 +633,7 @@ ...@@ -633,6 +633,7 @@
'userdata': '{% url ui_userdata %}', 'userdata': '{% url ui_userdata %}',
'compute': {{ compute_api_url|safe }}, 'compute': {{ compute_api_url|safe }},
'network': {{ network_api_url|safe }}, 'network': {{ network_api_url|safe }},
'volume': {{ volume_api_url|safe }},
'glance': {{ glance_api_url|safe }}, 'glance': {{ glance_api_url|safe }},
'accounts': {{ accounts_api_url|safe }}, 'accounts': {{ accounts_api_url|safe }},
}; };
......
...@@ -195,6 +195,7 @@ def home(request): ...@@ -195,6 +195,7 @@ def home(request):
'request': request, 'request': request,
'current_lang': get_language() or 'en', 'current_lang': get_language() or 'en',
'compute_api_url': json.dumps(uisettings.COMPUTE_URL), 'compute_api_url': json.dumps(uisettings.COMPUTE_URL),
'volumes_api_url': json.dumps(uisettings.VOLUME_URL),
'network_api_url': json.dumps(uisettings.NETWORK_URL), 'network_api_url': json.dumps(uisettings.NETWORK_URL),
'user_catalog_url': json.dumps(uisettings.USER_CATALOG_URL), 'user_catalog_url': json.dumps(uisettings.USER_CATALOG_URL),
'feedback_post_url': json.dumps(uisettings.FEEDBACK_URL), 'feedback_post_url': json.dumps(uisettings.FEEDBACK_URL),
......
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 to comment