[Kimchi-devel] [PATCH V2 1/2] Issue #363: Add new rest api function - getStoragePoolVolume
Aline Manera
alinefm at linux.vnet.ibm.com
Fri Apr 11 01:26:24 UTC 2014
On 04/08/2014 11:53 PM, Rodrigo Trujillo wrote:
> This patch adds new api AJAX method to retrieve specific storage pool
> volume information. This method is used in template edit window.
>
> Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
> ---
> ui/js/src/kimchi.api.js | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js
> index 376bc86..963d2d7 100644
> --- a/ui/js/src/kimchi.api.js
> +++ b/ui/js/src/kimchi.api.js
> @@ -744,6 +744,19 @@ var kimchi = {
> });
> },
>
> + getStoragePoolVolume: function(pool, volume, suc, err) {
> + var url = kimchi.url + 'storagepools/' + pool + '/storagevolumes/' + volume;
You need to encode the pool and volume names to avoid problems with
special characters
> + kimchi.requestJSON({
> + url : url,
> + type : 'GET',
> + contentType : 'application/json',
> + timeout: 2000,
> + dataType : 'json',
> + success : suc,
> + error : err
> + });
> + },
> +
> addVMStorage : function(settings, suc, err) {
> var vm = encodeURIComponent(settings['vm']);
> delete settings['vm'];
More information about the Kimchi-devel
mailing list