"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "openstack_dashboard/static/app/core/openstack-service-api/glance.service.js" between
horizon-22.1.0.tar.gz and horizon-23.0.0.tar.gz

About: OpenStack Horizon (Optional Service: Dashboard) provides a web-based self-service portal to interact with underlying OpenStack services, such as launching an instance, assigning IP addresses and configuring access controls.
The "Zed" series (latest release).

glance.service.js  (horizon-22.1.0):glance.service.js  (horizon-23.0.0)
skipping to change at line 64 skipping to change at line 64
// Version // Version
/** /**
* @name getVersion * @name getVersion
* @description * @description
* Get the version of the Glance API * Get the version of the Glance API
* @returns {Object} The result of the API call * @returns {Object} The result of the API call
*/ */
function getVersion() { function getVersion() {
return apiService.get('/api/glance/version/') return apiService.get('/api/glance/version/')
.error(function () { .catch(function onError() {
toastService.add('error', gettext('Unable to get the Glance service ve rsion.')); toastService.add('error', gettext('Unable to get the Glance service ve rsion.'));
}); });
} }
// Images // Images
/** /**
* @name getImage * @name getImage
* @description * @description
* Get a single image by ID * Get a single image by ID
* *
* @param {string} id * @param {string} id
* Specifies the id of the image to request. * Specifies the id of the image to request.
* *
* @returns {Object} The result of the API call * @returns {Object} The result of the API call
*/ */
function getImage(id) { function getImage(id) {
return apiService.get('/api/glance/images/' + id + '/') return apiService.get('/api/glance/images/' + id + '/')
.error(function () { .catch(function onError() {
toastService.add('error', gettext('Unable to retrieve the image.')); toastService.add('error', gettext('Unable to retrieve the image.'));
}); });
} }
/** /**
* @name createImage * @name createImage
* @description * @description
* Create a new image. This returns the new image object on success. * Create a new image. This returns the new image object on success.
* *
* @param {object} image * @param {object} image
skipping to change at line 174 skipping to change at line 174
return response; return response;
} }
} }
function notify(event) { function notify(event) {
onProgress(Math.round(event.loaded / event.total * 100)); onProgress(Math.round(event.loaded / event.total * 100));
} }
function onError(error) { function onError(error) {
if (error && error.data) { if (error && error.data) {
throw error; toastService.add('error', error);
} else { } else {
throw gettext('Unable to create the image.'); toastService.add('error', gettext('Unable to create the image.'));
} }
} }
return apiService[method]('/api/glance/images/', image) return apiService[method]('/api/glance/images/', image)
.then(onImageQueued, onError, notify); .then(onImageQueued, onError, notify);
} }
/** /**
* @name getImage * @name getImage
* @description * @description
skipping to change at line 230 skipping to change at line 230
* Values of 'public', 'private', 'shared' and 'community' are valid. Requir ed. * Values of 'public', 'private', 'shared' and 'community' are valid. Requir ed.
* *
* @param {boolean} image.protected * @param {boolean} image.protected
* True if the image is protected, false otherwise. Required. * True if the image is protected, false otherwise. Required.
* *
* Any parameters not listed above will be assigned as custom properites. * Any parameters not listed above will be assigned as custom properites.
* @returns {Object} The result of the API call * @returns {Object} The result of the API call
*/ */
function updateImage(image) { function updateImage(image) {
return apiService.patch('/api/glance/images/' + image.id + '/', image) return apiService.patch('/api/glance/images/' + image.id + '/', image)
.error(function () { .catch(function onError() {
toastService.add('error', gettext('Unable to update the image.')); toastService.add('error', gettext('Unable to update the image.'));
}); });
} }
/** /**
* @name deleteImage * @name deleteImage
* @description * @description
* Deletes single Image by ID. * Deletes single Image by ID.
* *
* @param {string} imageId * @param {string} imageId
* The Id of the image to delete. * The Id of the image to delete.
* *
* @param {boolean} suppressError * @param {boolean} suppressError
* If passed in, this will not show the default error handling * If passed in, this will not show the default error handling
* *
* @returns {Object} The result of the API call * @returns {Object} The result of the API call
*/ */
function deleteImage(imageId, suppressError) { function deleteImage(imageId, suppressError) {
var promise = apiService.delete('/api/glance/images/' + imageId + '/'); var promise = apiService.delete('/api/glance/images/' + imageId + '/');
return suppressError ? promise : promise.error(function() { return suppressError ? promise : promise.catch(function onError() {
var msg = gettext('Unable to delete the image with id: %(id)s'); var msg = gettext('Unable to delete the image with id: %(id)s');
toastService.add('error', interpolate(msg, { id: imageId }, true)); toastService.add('error', interpolate(msg, { id: imageId }, true));
}); });
} }
/** /**
* @name getImageProps * @name getImageProps
* @description * @description
* Get an image custom properties by image ID * Get an image custom properties by image ID
* @param {string} id Specifies the id of the image to request. * @param {string} id Specifies the id of the image to request.
* @returns {Object} The result of the API call * @returns {Object} The result of the API call
*/ */
function getImageProps(id) { function getImageProps(id) {
return apiService.get('/api/glance/images/' + id + '/properties/') return apiService.get('/api/glance/images/' + id + '/properties/')
.error(function () { .catch(function onError() {
toastService.add('error', gettext('Unable to retrieve the image custom properties.')); toastService.add('error', gettext('Unable to retrieve the image custom properties.'));
}); });
} }
/** /**
* @name editImageProps * @name editImageProps
* @description * @description
* Update an image custom properties by image ID * Update an image custom properties by image ID
* @param {string} id Specifies the id of the image to request. * @param {string} id Specifies the id of the image to request.
* @param {object} updated New metadata definitions. * @param {object} updated New metadata definitions.
skipping to change at line 288 skipping to change at line 288
* @returns {Object} The result of the API call * @returns {Object} The result of the API call
*/ */
function editImageProps(id, updated, removed) { function editImageProps(id, updated, removed) {
return apiService.patch( return apiService.patch(
'/api/glance/images/' + id + '/properties/', '/api/glance/images/' + id + '/properties/',
{ {
updated: updated, updated: updated,
removed: removed removed: removed
} }
) )
.error(function () { .catch(function onError() {
toastService.add('error', gettext('Unable to edit the image custom prope rties.')); toastService.add('error', gettext('Unable to edit the image custom prope rties.'));
}); });
} }
/** /**
* @name getImages * @name getImages
* @description * @description
* Get a list of images. * Get a list of images.
* *
* The listing result is an object with property "items". Each item is * The listing result is an object with property "items". Each item is
skipping to change at line 331 skipping to change at line 331
* Default is created_at. * Default is created_at.
* *
* @param {string} params.other * @param {string} params.other
* Any additional request parameters will be passed through the API as * Any additional request parameters will be passed through the API as
* filters. For example "name" : "fedora" would filter on the fedora name. * filters. For example "name" : "fedora" would filter on the fedora name.
* @returns {Object} The result of the API call * @returns {Object} The result of the API call
*/ */
function getImages(params) { function getImages(params) {
var config = params ? { 'params' : params} : {}; var config = params ? { 'params' : params} : {};
return apiService.get('/api/glance/images/', config) return apiService.get('/api/glance/images/', config)
.error(function () { .catch(function onError() {
toastService.add('error', gettext('Unable to retrieve the images.')); toastService.add('error', gettext('Unable to retrieve the images.'));
}); });
} }
// Metadata Definitions - Namespaces // Metadata Definitions - Namespaces
/** /**
* @name getNamespaces * @name getNamespaces
* @description * @description
* Get a list of metadata definition namespaces. * Get a list of metadata definition namespaces.
skipping to change at line 400 skipping to change at line 400
* (horizon alert). The glance API may not have metadata definitions * (horizon alert). The glance API may not have metadata definitions
* enabled. * enabled.
* @returns {Object} The result of the API call * @returns {Object} The result of the API call
*/ */
function getNamespaces(params, suppressError) { function getNamespaces(params, suppressError) {
var config = params ? {'params' : params} : {}; var config = params ? {'params' : params} : {};
config.cache = true; config.cache = true;
var promise = apiService.get('/api/glance/metadefs/namespaces/', config); var promise = apiService.get('/api/glance/metadefs/namespaces/', config);
return suppressError ? promise : promise.error(function() { return suppressError ? promise : promise.catch(function onError() {
toastService.add('error', gettext('Unable to retrieve the namespaces.')) ; toastService.add('error', gettext('Unable to retrieve the namespaces.')) ;
}); });
} }
/** /**
* @name getResourceTypes * @name getResourceTypes
* @description * @description
* Get a list of metadata definition resource types. * Get a list of metadata definition resource types.
* *
* https://docs.openstack.org/glance/latest/user/metadefs-concepts.html * https://docs.openstack.org/glance/latest/user/metadefs-concepts.html
skipping to change at line 426 skipping to change at line 426
* *
* @returns {Object} The result of the API call * @returns {Object} The result of the API call
*/ */
function getResourceTypes() { function getResourceTypes() {
var config = { var config = {
cache: true cache: true
}; };
return apiService return apiService
.get('/api/glance/metadefs/resourcetypes/', config) .get('/api/glance/metadefs/resourcetypes/', config)
.error(function() { .catch(function onError() {
toastService.add('error', gettext('Unable to retrieve the resource typ es.')); toastService.add('error', gettext('Unable to retrieve the resource typ es.'));
}); });
} }
} }
}()); }());
 End of changes. 11 change blocks. 
11 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)