Dashboard ReOrg - Move APIs into app/core

This patch relocates the 'openstack-service-api' directory because
they are application specific, but needed by multiple dashboards.

Co-Authored-By: Tyr Johanson <tyr@hp.com>
Co-Authored-By: Shaoquan Chen <sean.chen2@hp.com>

Change-Id: Ie5455f3ca4cfaacb99cbccd66c95fb3ad31da272
Partial-Bug: #1478717
This commit is contained in:
Shaoquan Chen 2015-07-09 11:24:05 -07:00 committed by Tyr Johanson
parent d6f5c24c06
commit 0d4cf1661e
33 changed files with 148 additions and 153 deletions

View File

@ -33,8 +33,8 @@
'hz.dashboard.identity.basePath', 'hz.dashboard.identity.basePath',
'horizon.framework.widgets.toast.service', 'horizon.framework.widgets.toast.service',
'horizon.framework.util.i18n.gettext', 'horizon.framework.util.i18n.gettext',
'horizon.openstack-service-api.policy', 'horizon.app.core.openstack-service-api.policy',
'horizon.openstack-service-api.keystone' 'horizon.app.core.openstack-service-api.keystone'
]; ];
function identityUsersTableController(basepath, toast, gettext, policy, keystone) { function identityUsersTableController(basepath, toast, gettext, policy, keystone) {

View File

@ -47,7 +47,7 @@
beforeEach(module('horizon.framework.util.http')); beforeEach(module('horizon.framework.util.http'));
beforeEach(module('horizon.framework.util.i18n')); beforeEach(module('horizon.framework.util.i18n'));
beforeEach(module('horizon.framework.widgets.toast')); beforeEach(module('horizon.framework.widgets.toast'));
beforeEach(module('horizon.openstack-service-api')); beforeEach(module('horizon.app.core.openstack-service-api'));
beforeEach(module('hz.dashboard')); beforeEach(module('hz.dashboard'));
beforeEach(module('hz.dashboard.identity')); beforeEach(module('hz.dashboard.identity'));
@ -55,8 +55,8 @@
beforeEach(inject(function($injector) { beforeEach(inject(function($injector) {
toastService = $injector.get('horizon.framework.widgets.toast.service'); toastService = $injector.get('horizon.framework.widgets.toast.service');
policyAPI = $injector.get('horizon.openstack-service-api.policy'); policyAPI = $injector.get('horizon.app.core.openstack-service-api.policy');
keystoneAPI = $injector.get('horizon.openstack-service-api.keystone'); keystoneAPI = $injector.get('horizon.app.core.openstack-service-api.keystone');
controller = $injector.get('$controller'); controller = $injector.get('$controller');
staticUrl = $injector.get('$window').STATIC_URL; staticUrl = $injector.get('$window').STATIC_URL;

View File

@ -35,8 +35,7 @@
'horizon.app.tech-debt', 'horizon.app.tech-debt',
'horizon.auth', 'horizon.auth',
'hz.dashboard', 'hz.dashboard',
'horizon.framework', 'horizon.framework'
'horizon.openstack-service-api'
]; ];
/** /**

View File

@ -42,15 +42,15 @@
*/ */
.factory('cloudServices', [ .factory('cloudServices', [
'horizon.openstack-service-api.cinder', 'horizon.app.core.openstack-service-api.cinder',
'horizon.openstack-service-api.glance', 'horizon.app.core.openstack-service-api.glance',
'horizon.openstack-service-api.keystone', 'horizon.app.core.openstack-service-api.keystone',
'horizon.openstack-service-api.neutron', 'horizon.app.core.openstack-service-api.neutron',
'horizon.openstack-service-api.nova', 'horizon.app.core.openstack-service-api.nova',
'horizon.openstack-service-api.novaExtensions', 'horizon.app.core.openstack-service-api.novaExtensions',
'horizon.openstack-service-api.security-group', 'horizon.app.core.openstack-service-api.security-group',
'horizon.openstack-service-api.serviceCatalog', 'horizon.app.core.openstack-service-api.serviceCatalog',
'horizon.openstack-service-api.settings', 'horizon.app.core.openstack-service-api.settings',
function (cinderAPI, function (cinderAPI,
glanceAPI, glanceAPI,

View File

@ -25,15 +25,15 @@
var cloudServices; var cloudServices;
beforeEach(module('horizon.app.core', function ($provide) { beforeEach(module('horizon.app.core', function ($provide) {
$provide.value('horizon.openstack-service-api.cinder', {}); $provide.value('horizon.app.core.openstack-service-api.cinder', {});
$provide.value('horizon.openstack-service-api.glance', {}); $provide.value('horizon.app.core.openstack-service-api.glance', {});
$provide.value('horizon.openstack-service-api.keystone', {}); $provide.value('horizon.app.core.openstack-service-api.keystone', {});
$provide.value('horizon.openstack-service-api.neutron', {}); $provide.value('horizon.app.core.openstack-service-api.neutron', {});
$provide.value('horizon.openstack-service-api.nova', {}); $provide.value('horizon.app.core.openstack-service-api.nova', {});
$provide.value('horizon.openstack-service-api.novaExtensions', {}); $provide.value('horizon.app.core.openstack-service-api.novaExtensions', {});
$provide.value('horizon.openstack-service-api.security-group', {}); $provide.value('horizon.app.core.openstack-service-api.security-group', {});
$provide.value('horizon.openstack-service-api.serviceCatalog', {}); $provide.value('horizon.app.core.openstack-service-api.serviceCatalog', {});
$provide.value('horizon.openstack-service-api.settings', {}); $provide.value('horizon.app.core.openstack-service-api.settings', {});
})); }));
beforeEach(inject(function ($injector) { beforeEach(inject(function ($injector) {

View File

@ -29,7 +29,8 @@
angular angular
.module('horizon.app.core', [ .module('horizon.app.core', [
'horizon.app.core.images', 'horizon.app.core.images',
'horizon.app.core.workflow' 'horizon.app.core.workflow',
'horizon.app.core.openstack-service-api'
]); ]);
})(); })();

View File

@ -31,7 +31,7 @@
ImagesTableController.$inject = [ ImagesTableController.$inject = [
'horizon.app.core.images.basePath', 'horizon.app.core.images.basePath',
'horizon.openstack-service-api.glance' 'horizon.app.core.openstack-service-api.glance'
]; ];
function ImagesTableController(basepath, glance) { function ImagesTableController(basepath, glance) {

View File

@ -35,13 +35,13 @@
beforeEach(module('horizon.framework.util.http')); beforeEach(module('horizon.framework.util.http'));
beforeEach(module('horizon.framework.widgets.toast')); beforeEach(module('horizon.framework.widgets.toast'));
beforeEach(module('horizon.openstack-service-api')); beforeEach(module('horizon.app.core.openstack-service-api'));
beforeEach(module('horizon.app.core')); beforeEach(module('horizon.app.core'));
beforeEach(module('horizon.app.core.images')); beforeEach(module('horizon.app.core.images'));
beforeEach(inject(function($injector) { beforeEach(inject(function($injector) {
glanceAPI = $injector.get('horizon.openstack-service-api.glance'); glanceAPI = $injector.get('horizon.app.core.openstack-service-api.glance');
controller = $injector.get('$controller'); controller = $injector.get('$controller');
staticUrl = $injector.get('$window').STATIC_URL; staticUrl = $injector.get('$window').STATIC_URL;

View File

@ -17,15 +17,15 @@ limitations under the License.
'use strict'; 'use strict';
angular angular
.module('horizon.openstack-service-api') .module('horizon.app.core.openstack-service-api')
.service('horizon.openstack-service-api.cinder', CinderAPI); .service('horizon.app.core.openstack-service-api.cinder', CinderAPI);
CinderAPI.$inject = ['horizon.framework.util.http.service', CinderAPI.$inject = ['horizon.framework.util.http.service',
'horizon.framework.widgets.toast.service']; 'horizon.framework.widgets.toast.service'];
/** /**
* @ngdoc service * @ngdoc service
* @name horizon.openstack-service-api.cinder * @name horizon.app.core.openstack-service-api.cinder
* @description Provides direct access to Cinder APIs. * @description Provides direct access to Cinder APIs.
*/ */
function CinderAPI(apiService, toastService) { function CinderAPI(apiService, toastService) {
@ -33,7 +33,7 @@ limitations under the License.
// Volumes // Volumes
/** /**
* @name horizon.openstack-service-api.cinder.getVolumes * @name horizon.app.core.openstack-service-api.cinder.getVolumes
* @description * @description
* Get a list of volumes. * Get a list of volumes.
* *
@ -58,7 +58,7 @@ limitations under the License.
// Volume Snapshots // Volume Snapshots
/** /**
* @name horizon.openstack-service-api.cinder.getVolumeSnapshots * @name horizon.app.core.openstack-service-api.cinder.getVolumeSnapshots
* @description * @description
* Get a list of volume snapshots. * Get a list of volume snapshots.
* *

View File

@ -22,13 +22,13 @@
var apiService = {}; var apiService = {};
var toastService = {}; var toastService = {};
beforeEach(module('horizon.openstack-service-api')); beforeEach(module('horizon.app.core.openstack-service-api'));
beforeEach(module(function($provide) { beforeEach(module(function($provide) {
window.apiTest.initServices($provide, apiService, toastService); window.apiTest.initServices($provide, apiService, toastService);
})); }));
beforeEach(inject(['horizon.openstack-service-api.cinder', function(cinderAPI) { beforeEach(inject(['horizon.app.core.openstack-service-api.cinder', function(cinderAPI) {
service = cinderAPI; service = cinderAPI;
}])); }]));

View File

@ -17,15 +17,15 @@ limitations under the License.
'use strict'; 'use strict';
angular angular
.module('horizon.openstack-service-api') .module('horizon.app.core.openstack-service-api')
.service('horizon.openstack-service-api.glance', GlanceAPI); .service('horizon.app.core.openstack-service-api.glance', GlanceAPI);
GlanceAPI.$inject = ['horizon.framework.util.http.service', GlanceAPI.$inject = ['horizon.framework.util.http.service',
'horizon.framework.widgets.toast.service']; 'horizon.framework.widgets.toast.service'];
/** /**
* @ngdoc service * @ngdoc service
* @name horizon.openstack-service-api.glance * @name horizon.app.core.openstack-service-api.glance
* @description Provides direct pass through to Glance with NO abstraction. * @description Provides direct pass through to Glance with NO abstraction.
*/ */
function GlanceAPI(apiService, toastService) { function GlanceAPI(apiService, toastService) {
@ -33,7 +33,7 @@ limitations under the License.
// Images // Images
/** /**
* @name horizon.openstack-service-api.glance.getImage * @name horizon.app.core.openstack-service-api.glance.getImage
* @description * @description
* Get a single image by ID * Get a single image by ID
* @param {string} id * @param {string} id
@ -47,7 +47,7 @@ limitations under the License.
}; };
/** /**
* @name horizon.openstack-service-api.glance.getImages * @name horizon.app.core.openstack-service-api.glance.getImages
* @description * @description
* Get a list of images. * Get a list of images.
* *
@ -91,7 +91,7 @@ limitations under the License.
// Metadata Definitions - Namespaces // Metadata Definitions - Namespaces
/** /**
* @name horizon.openstack-service-api.glance.getNamespaces * @name horizon.app.core.openstack-service-api.glance.getNamespaces
* @description * @description
* Get a list of metadata definition namespaces. * Get a list of metadata definition namespaces.
* *

View File

@ -22,13 +22,13 @@
var apiService = {}; var apiService = {};
var toastService = {}; var toastService = {};
beforeEach(module('horizon.openstack-service-api')); beforeEach(module('horizon.app.core.openstack-service-api'));
beforeEach(module(function($provide) { beforeEach(module(function($provide) {
window.apiTest.initServices($provide, apiService, toastService); window.apiTest.initServices($provide, apiService, toastService);
})); }));
beforeEach(inject(['horizon.openstack-service-api.glance', function(glanceAPI) { beforeEach(inject(['horizon.app.core.openstack-service-api.glance', function(glanceAPI) {
service = glanceAPI; service = glanceAPI;
}])); }]));

View File

@ -17,8 +17,8 @@ limitations under the License.
'use strict'; 'use strict';
angular angular
.module('horizon.openstack-service-api') .module('horizon.app.core.openstack-service-api')
.service('horizon.openstack-service-api.keystone', KeystoneAPI); .service('horizon.app.core.openstack-service-api.keystone', KeystoneAPI);
KeystoneAPI.$inject = ['horizon.framework.util.http.service', KeystoneAPI.$inject = ['horizon.framework.util.http.service',
'horizon.framework.widgets.toast.service']; 'horizon.framework.widgets.toast.service'];
@ -56,7 +56,7 @@ limitations under the License.
}; };
/** /**
* @name horizon.openstack-service-api.keystone.getCurrentUserSession * @name horizon.app.core.openstack-service-api.keystone.getCurrentUserSession
* @description * @description
* Gets the current User Session Information * Gets the current User Session Information
* @example * @example
@ -254,7 +254,7 @@ limitations under the License.
}; };
/** /**
* @name horizon.openstack-service-api.keystone.serviceCatalog * @name horizon.app.core.openstack-service-api.keystone.serviceCatalog
* @description * @description
* Returns the service catalog. * Returns the service catalog.
* @param {Object} config * @param {Object} config
@ -270,7 +270,7 @@ limitations under the License.
/** /**
* @ngdoc service * @ngdoc service
* @name horizon.openstack-service-api.userSession * @name horizon.app.core.openstack-service-api.userSession
* @description * @description
* Provides cached access to the user session. The cache may be reset * Provides cached access to the user session. The cache may be reset
* at any time by accessing the cache and calling removeAll, which means * at any time by accessing the cache and calling removeAll, which means
@ -290,16 +290,16 @@ limitations under the License.
* pass it through as an argument. * pass it through as an argument.
*/ */
angular angular
.module('horizon.openstack-service-api') .module('horizon.app.core.openstack-service-api')
.factory('horizon.openstack-service-api.userSession', userSession); .factory('horizon.app.core.openstack-service-api.userSession', userSession);
userSession.$inject = ['$cacheFactory', 'horizon.openstack-service-api.keystone']; userSession.$inject = ['$cacheFactory', 'horizon.app.core.openstack-service-api.keystone'];
function userSession($cacheFactory, keystoneAPI) { function userSession($cacheFactory, keystoneAPI) {
var service = {}; var service = {};
service.cache = $cacheFactory('horizon.openstack-service-api.userSession', {capacity: 1}); service.cache = $cacheFactory('horizon.app.core.openstack-service-api.userSession', {capacity: 1});
service.get = function () { service.get = function () {
return keystoneAPI.getCurrentUserSession({cache: service.cache}) return keystoneAPI.getCurrentUserSession({cache: service.cache})
@ -314,7 +314,7 @@ limitations under the License.
/** /**
* @ngdoc service * @ngdoc service
* @name horizon.openstack-service-api.serviceCatalog * @name horizon.app.core.openstack-service-api.serviceCatalog
* @description * @description
* Provides cached access to the Service Catalog with utilities to help * Provides cached access to the Service Catalog with utilities to help
* with asynchronous data loading. The cache may be reset at any time * with asynchronous data loading. The cache may be reset at any time
@ -333,21 +333,21 @@ limitations under the License.
* pass it through as an argument. * pass it through as an argument.
*/ */
angular angular
.module('horizon.openstack-service-api') .module('horizon.app.core.openstack-service-api')
.factory('horizon.openstack-service-api.serviceCatalog', serviceCatalog); .factory('horizon.app.core.openstack-service-api.serviceCatalog', serviceCatalog);
serviceCatalog.$inject = ['$cacheFactory', serviceCatalog.$inject = ['$cacheFactory',
'$q', '$q',
'horizon.openstack-service-api.keystone', 'horizon.app.core.openstack-service-api.keystone',
'horizon.openstack-service-api.userSession']; 'horizon.app.core.openstack-service-api.userSession'];
function serviceCatalog($cacheFactory, $q, keystoneAPI, userSession) { function serviceCatalog($cacheFactory, $q, keystoneAPI, userSession) {
var service = {}; var service = {};
service.cache = $cacheFactory('horizon.openstack-service-api.serviceCatalog', {capacity: 1}); service.cache = $cacheFactory('horizon.app.core.openstack-service-api.serviceCatalog', {capacity: 1});
/** /**
* @name horizon.openstack-service-api.serviceCatalog.get * @name horizon.app.core.openstack-service-api.serviceCatalog.get
* @description * @description
* Returns the service catalog. This is cached. * Returns the service catalog. This is cached.
* *
@ -367,7 +367,7 @@ limitations under the License.
}; };
/** /**
* @name horizon.openstack-service-api.serviceCatalog.ifTypeEnabled * @name horizon.app.core.openstack-service-api.serviceCatalog.ifTypeEnabled
* @description * @description
* Checks if the desired service is enabled. If it is enabled, use the * Checks if the desired service is enabled. If it is enabled, use the
* promise returned to execute the desired function. If it is not enabled, * promise returned to execute the desired function. If it is not enabled,

View File

@ -22,13 +22,13 @@
var apiService = {}; var apiService = {};
var toastService = {}; var toastService = {};
beforeEach(module('horizon.openstack-service-api')); beforeEach(module('horizon.app.core.openstack-service-api'));
beforeEach(module(function($provide) { beforeEach(module(function($provide) {
window.apiTest.initServices($provide, apiService, toastService); window.apiTest.initServices($provide, apiService, toastService);
})); }));
beforeEach(inject(['horizon.openstack-service-api.keystone', function(keystoneAPI) { beforeEach(inject(['horizon.app.core.openstack-service-api.keystone', function(keystoneAPI) {
service = keystoneAPI; service = keystoneAPI;
}])); }]));
@ -391,15 +391,15 @@
describe("userSession", function() { describe("userSession", function() {
var factory, keystoneAPI; var factory, keystoneAPI;
beforeEach(module('horizon.openstack-service-api')); beforeEach(module('horizon.app.core.openstack-service-api'));
beforeEach(module(function($provide) { beforeEach(module(function($provide) {
keystoneAPI = {getCurrentUserSession: angular.noop}; keystoneAPI = {getCurrentUserSession: angular.noop};
$provide.value('horizon.openstack-service-api.keystone', keystoneAPI); $provide.value('horizon.app.core.openstack-service-api.keystone', keystoneAPI);
$provide.value('$cacheFactory', function() { return 'cache'; }); $provide.value('$cacheFactory', function() { return 'cache'; });
})); }));
beforeEach(inject(['horizon.openstack-service-api.userSession', function(userSession) { beforeEach(inject(['horizon.app.core.openstack-service-api.userSession', function(userSession) {
factory = userSession; factory = userSession;
}])); }]));
@ -439,13 +439,13 @@
describe("serviceCatalog", function() { describe("serviceCatalog", function() {
var factory, q, keystoneAPI, userSession, deferred; var factory, q, keystoneAPI, userSession, deferred;
beforeEach(module('horizon.openstack-service-api')); beforeEach(module('horizon.app.core.openstack-service-api'));
beforeEach(module(function($provide) { beforeEach(module(function($provide) {
keystoneAPI = {serviceCatalog: angular.noop}; keystoneAPI = {serviceCatalog: angular.noop};
$provide.value('horizon.openstack-service-api.keystone', keystoneAPI); $provide.value('horizon.app.core.openstack-service-api.keystone', keystoneAPI);
userSession = {get: angular.noop}; userSession = {get: angular.noop};
$provide.value('horizon.openstack-service-api.userSession', userSession); $provide.value('horizon.app.core.openstack-service-api.userSession', userSession);
deferred = {promise: angular.noop, reject: angular.noop, resolve: angular.noop}; deferred = {promise: angular.noop, reject: angular.noop, resolve: angular.noop};
q = {all: function() {return {then: angular.noop};}, q = {all: function() {return {then: angular.noop};},
defer: function() { return deferred;}}; defer: function() { return deferred;}};
@ -453,7 +453,7 @@
$provide.value('$cacheFactory', function() { return 'cache'; }); $provide.value('$cacheFactory', function() { return 'cache'; });
})); }));
beforeEach(inject(['horizon.openstack-service-api.serviceCatalog', function(serviceCatalog) { beforeEach(inject(['horizon.app.core.openstack-service-api.serviceCatalog', function(serviceCatalog) {
factory = serviceCatalog; factory = serviceCatalog;
}])); }]));

View File

@ -17,15 +17,15 @@
'use strict'; 'use strict';
angular angular
.module('horizon.openstack-service-api') .module('horizon.app.core.openstack-service-api')
.service('horizon.openstack-service-api.neutron', NeutronAPI); .service('horizon.app.core.openstack-service-api.neutron', NeutronAPI);
NeutronAPI.$inject = ['horizon.framework.util.http.service', NeutronAPI.$inject = ['horizon.framework.util.http.service',
'horizon.framework.widgets.toast.service']; 'horizon.framework.widgets.toast.service'];
/** /**
* @ngdoc service * @ngdoc service
* @name horizon.openstack-service-api.neutron * @name horizon.app.core.openstack-service-api.neutron
* @description Provides access to Neutron APIs. * @description Provides access to Neutron APIs.
*/ */
function NeutronAPI(apiService, toastService) { function NeutronAPI(apiService, toastService) {
@ -33,7 +33,7 @@
// Networks // Networks
/** /**
* @name horizon.openstack-service-api.neturonAPI.getNetworks * @name horizon.app.core.openstack-service-api.neturonAPI.getNetworks
* @description * @description
* Get a list of networks for a tenant. * Get a list of networks for a tenant.
* *
@ -48,7 +48,7 @@
}; };
/** /**
* @name horizon.openstack-service-api.neutron.createNetwork * @name horizon.app.core.openstack-service-api.neutron.createNetwork
* @description * @description
* Create a new network. * Create a new network.
* @returns The new network object on success. * @returns The new network object on success.
@ -99,7 +99,7 @@
// Subnets // Subnets
/** /**
* @name horizon.openstack-service-api.neutron.getSubnets * @name horizon.app.core.openstack-service-api.neutron.getSubnets
* @description * @description
* Get a list of subnets for a network. * Get a list of subnets for a network.
* *
@ -117,7 +117,7 @@
}; };
/** /**
* @name horizon.openstack-service-api.neutron.createSubnet * @name horizon.app.core.openstack-service-api.neutron.createSubnet
* @description * @description
* Create a Subnet for given Network. * Create a Subnet for given Network.
* @returns The JSON representation of Subnet on success. * @returns The JSON representation of Subnet on success.
@ -183,7 +183,7 @@
// Ports // Ports
/** /**
* @name horizon.openstack-service-api.neutron.getPorts * @name horizon.app.core.openstack-service-api.neutron.getPorts
* @description * @description
* Get a list of ports for a network. * Get a list of ports for a network.
* *

View File

@ -22,13 +22,13 @@
var apiService = {}; var apiService = {};
var toastService = {}; var toastService = {};
beforeEach(module('horizon.openstack-service-api')); beforeEach(module('horizon.app.core.openstack-service-api'));
beforeEach(module(function($provide) { beforeEach(module(function($provide) {
window.apiTest.initServices($provide, apiService, toastService); window.apiTest.initServices($provide, apiService, toastService);
})); }));
beforeEach(inject(['horizon.openstack-service-api.neutron', function(neutronAPI) { beforeEach(inject(['horizon.app.core.openstack-service-api.neutron', function(neutronAPI) {
service = neutronAPI; service = neutronAPI;
}])); }]));

View File

@ -17,15 +17,15 @@ limitations under the License.
'use strict'; 'use strict';
angular angular
.module('horizon.openstack-service-api') .module('horizon.app.core.openstack-service-api')
.service('horizon.openstack-service-api.nova', NovaAPI); .service('horizon.app.core.openstack-service-api.nova', NovaAPI);
NovaAPI.$inject = ['horizon.framework.util.http.service', NovaAPI.$inject = ['horizon.framework.util.http.service',
'horizon.framework.widgets.toast.service']; 'horizon.framework.widgets.toast.service'];
/** /**
* @ngdoc service * @ngdoc service
* @name horizon.openstack-service-api.nova * @name horizon.app.core.openstack-service-api.nova
* @description Provides access to Nova APIs. * @description Provides access to Nova APIs.
*/ */
function NovaAPI(apiService, toastService) { function NovaAPI(apiService, toastService) {
@ -33,7 +33,7 @@ limitations under the License.
// Keypairs // Keypairs
/** /**
* @name horizon.openstack-service-api.nova.getKeypairs * @name horizon.app.core.openstack-service-api.nova.getKeypairs
* @description * @description
* Get a list of keypairs. * Get a list of keypairs.
* *
@ -48,7 +48,7 @@ limitations under the License.
}; };
/** /**
* @name horizon.openstack-service-api.nova.createKeypair * @name horizon.app.core.openstack-service-api.nova.createKeypair
* @description * @description
* Create a new keypair. This returns the new keypair object on success. * Create a new keypair. This returns the new keypair object on success.
* *
@ -75,7 +75,7 @@ limitations under the License.
// Availability Zones // Availability Zones
/** /**
* @name horizon.openstack-service-api.nova.getAvailabilityZones * @name horizon.app.core.openstack-service-api.nova.getAvailabilityZones
* @description * @description
* Get a list of Availability Zones. * Get a list of Availability Zones.
* *
@ -93,7 +93,7 @@ limitations under the License.
// Limits // Limits
/** /**
* @name horizon.openstack-service-api.nova.getLimits * @name horizon.app.core.openstack-service-api.nova.getLimits
* @description * @description
* Returns current limits. * Returns current limits.
* *
@ -131,7 +131,7 @@ limitations under the License.
// Servers // Servers
/** /**
* @name horizon.openstack-service-api.nova.createServer * @name horizon.app.core.openstack-service-api.nova.createServer
* @description * @description
* Create a server using the parameters supplied in the * Create a server using the parameters supplied in the
* newServer. The required parameters: * newServer. The required parameters:
@ -156,7 +156,7 @@ limitations under the License.
}; };
/** /**
* @name horizon.openstack-service-api.nova.getServer * @name horizon.app.core.openstack-service-api.nova.getServer
* @description * @description
* Get a single server by ID * Get a single server by ID
* @param {string} id * @param {string} id
@ -170,7 +170,7 @@ limitations under the License.
}; };
/** /**
* @name horizon.openstack-service-api.nova.getExtensions * @name horizon.app.core.openstack-service-api.nova.getExtensions
* @description * @description
* Returns a list of enabled extensions. * Returns a list of enabled extensions.
* *
@ -200,7 +200,7 @@ limitations under the License.
}; };
/** /**
* @name horizon.openstack-service-api.nova.getFlavors * @name horizon.app.core.openstack-service-api.nova.getFlavors
* @description * @description
* Returns a list of flavors. * Returns a list of flavors.
* *
@ -245,7 +245,7 @@ limitations under the License.
}; };
/** /**
* @name horizon.openstack-service-api.nova.getFlavor * @name horizon.app.core.openstack-service-api.nova.getFlavor
* @description * @description
* Get a single flavor by ID. * Get a single flavor by ID.
* @param {string} id * @param {string} id
@ -263,7 +263,7 @@ limitations under the License.
}; };
/** /**
* @name horizon.openstack-service-api.nova.getFlavorExtraSpecs * @name horizon.app.core.openstack-service-api.nova.getFlavorExtraSpecs
* @description * @description
* Get a single flavor's extra specs by ID. * Get a single flavor's extra specs by ID.
* @param {string} id * @param {string} id
@ -279,7 +279,7 @@ limitations under the License.
/** /**
* @ngdoc service * @ngdoc service
* @name horizon.openstack-service-api.novaExtensions * @name horizon.app.core.openstack-service-api.novaExtensions
* @description * @description
* Provides cached access to Nova Extensions with utilities to help * Provides cached access to Nova Extensions with utilities to help
* with asynchronous data loading. The cache may be reset at any time * with asynchronous data loading. The cache may be reset at any time
@ -291,16 +291,16 @@ limitations under the License.
* this saved between 30 - 100 ms per request. * this saved between 30 - 100 ms per request.
*/ */
angular angular
.module('horizon.openstack-service-api') .module('horizon.app.core.openstack-service-api')
.factory('horizon.openstack-service-api.novaExtensions', NovaExtensionsAPI); .factory('horizon.app.core.openstack-service-api.novaExtensions', NovaExtensionsAPI);
NovaExtensionsAPI.$inject = ['$cacheFactory', NovaExtensionsAPI.$inject = ['$cacheFactory',
'$q', '$q',
'horizon.openstack-service-api.nova']; 'horizon.app.core.openstack-service-api.nova'];
function NovaExtensionsAPI($cacheFactory, $q, novaAPI) { function NovaExtensionsAPI($cacheFactory, $q, novaAPI) {
var service = {}; var service = {};
service.cache = $cacheFactory('horizon.openstack-service-api.novaExtensions', {capacity: 1}); service.cache = $cacheFactory('horizon.app.core.openstack-service-api.novaExtensions', {capacity: 1});
service.get = function () { service.get = function () {
return novaAPI.getExtensions({cache: service.cache}) return novaAPI.getExtensions({cache: service.cache})

View File

@ -22,13 +22,13 @@
var apiService = {}; var apiService = {};
var toastService = {}; var toastService = {};
beforeEach(module('horizon.openstack-service-api')); beforeEach(module('horizon.app.core.openstack-service-api'));
beforeEach(module(function($provide) { beforeEach(module(function($provide) {
window.apiTest.initServices($provide, apiService, toastService); window.apiTest.initServices($provide, apiService, toastService);
})); }));
beforeEach(inject(['horizon.openstack-service-api.nova', function(novaAPI) { beforeEach(inject(['horizon.app.core.openstack-service-api.nova', function(novaAPI) {
service = novaAPI; service = novaAPI;
}])); }]));
@ -247,18 +247,18 @@
describe("novaExtensions", function() { describe("novaExtensions", function() {
var factory, q, novaAPI; var factory, q, novaAPI;
beforeEach(module('horizon.openstack-service-api')); beforeEach(module('horizon.app.core.openstack-service-api'));
beforeEach(module(function($provide) { beforeEach(module(function($provide) {
novaAPI = {getExtensions: function() {return {then: angular.noop};}}; novaAPI = {getExtensions: function() {return {then: angular.noop};}};
q = {defer: function() { return {resolve: angular.noop}; }}; q = {defer: function() { return {resolve: angular.noop}; }};
$provide.value('$cacheFactory', function() {return "cache";}); $provide.value('$cacheFactory', function() {return "cache";});
$provide.value('$q', q); $provide.value('$q', q);
$provide.value('horizon.openstack-service-api.nova', novaAPI); $provide.value('horizon.app.core.openstack-service-api.nova', novaAPI);
})); }));
beforeEach(inject(function($injector) { beforeEach(inject(function($injector) {
factory = $injector.get('horizon.openstack-service-api.novaExtensions'); factory = $injector.get('horizon.app.core.openstack-service-api.novaExtensions');
})); }));
it("is defined", function() { it("is defined", function() {

View File

@ -17,5 +17,5 @@ limitations under the License.
'use strict'; 'use strict';
angular angular
.module('horizon.openstack-service-api', []); .module('horizon.app.core.openstack-service-api', []);
}()); }());

View File

@ -15,22 +15,22 @@ limitations under the License.
'use strict'; 'use strict';
angular angular
.module('horizon.openstack-service-api') .module('horizon.app.core.openstack-service-api')
.service('horizon.openstack-service-api.policy', PolicyService); .service('horizon.app.core.openstack-service-api.policy', PolicyService);
PolicyService.$inject = ['horizon.framework.util.http.service', PolicyService.$inject = ['horizon.framework.util.http.service',
'horizon.framework.widgets.toast.service']; 'horizon.framework.widgets.toast.service'];
/** /**
* @ngdoc service * @ngdoc service
* @name horizon.openstack-service-api.policy * @name horizon.app.core.openstack-service-api.policy
* @description Provides a direct pass through to the policy engine in * @description Provides a direct pass through to the policy engine in
* Horizon. * Horizon.
*/ */
function PolicyService(apiService, toastService) { function PolicyService(apiService, toastService) {
/** /**
* @name horizon.openstack-service-api.policy.check * @name horizon.app.core.openstack-service-api.policy.check
* @description * @description
* Check the passed in policy rule list to determine if the user has * Check the passed in policy rule list to determine if the user has
* permission to perform the actions specified by the rules. The service * permission to perform the actions specified by the rules. The service

View File

@ -22,13 +22,13 @@
var apiService = {}; var apiService = {};
var toastService = {}; var toastService = {};
beforeEach(module('horizon.openstack-service-api')); beforeEach(module('horizon.app.core.openstack-service-api'));
beforeEach(module(function($provide) { beforeEach(module(function($provide) {
window.apiTest.initServices($provide, apiService, toastService); window.apiTest.initServices($provide, apiService, toastService);
})); }));
beforeEach(inject(['horizon.openstack-service-api.policy', function(policyAPI) { beforeEach(inject(['horizon.app.core.openstack-service-api.policy', function(policyAPI) {
service = policyAPI; service = policyAPI;
}])); }]));

View File

@ -16,21 +16,21 @@ limitations under the License.
(function () { (function () {
'use strict'; 'use strict';
angular.module('horizon.openstack-service-api') angular.module('horizon.app.core.openstack-service-api')
.service('horizon.openstack-service-api.security-group', SecurityGroupAPI); .service('horizon.app.core.openstack-service-api.security-group', SecurityGroupAPI);
SecurityGroupAPI.$inject = ['horizon.framework.util.http.service', SecurityGroupAPI.$inject = ['horizon.framework.util.http.service',
'horizon.framework.widgets.toast.service']; 'horizon.framework.widgets.toast.service'];
/** /**
* @ngdoc service * @ngdoc service
* @name horizon.openstack-service-api.security-group * @name horizon.app.core.openstack-service-api.security-group
* @description Provides access to Security Groups * @description Provides access to Security Groups
*/ */
function SecurityGroupAPI(apiService, toastService) { function SecurityGroupAPI(apiService, toastService) {
/** /**
* @name horizon.openstack-service-api.security-group.list * @name horizon.app.core.openstack-service-api.security-group.list
* @description * @description
* Get a list of security groups. * Get a list of security groups.
* *

View File

@ -22,13 +22,13 @@
var apiService = {}; var apiService = {};
var toastService = {}; var toastService = {};
beforeEach(module('horizon.openstack-service-api')); beforeEach(module('horizon.app.core.openstack-service-api'));
beforeEach(module(function($provide) { beforeEach(module(function($provide) {
window.apiTest.initServices($provide, apiService, toastService); window.apiTest.initServices($provide, apiService, toastService);
})); }));
beforeEach(inject(['horizon.openstack-service-api.security-group', function(securityGroup) { beforeEach(inject(['horizon.app.core.openstack-service-api.security-group', function(securityGroup) {
service = securityGroup; service = securityGroup;
}])); }]));

View File

@ -18,14 +18,14 @@
'use strict'; 'use strict';
angular angular
.module('horizon.openstack-service-api') .module('horizon.app.core.openstack-service-api')
.factory('horizon.openstack-service-api.settings', settingsService); .factory('horizon.app.core.openstack-service-api.settings', settingsService);
settingsService.$inject = ['$q', 'horizon.framework.util.http.service']; settingsService.$inject = ['$q', 'horizon.framework.util.http.service'];
/** /**
* @ngdoc service * @ngdoc service
* @name horizon.openstack-service-api.settings * @name horizon.app.core.openstack-service-api.settings
* @description * @description
* Provides utilities to the cached settings data. This helps * Provides utilities to the cached settings data. This helps
* with asynchronous data loading. * with asynchronous data loading.
@ -46,7 +46,7 @@
var service = {}; var service = {};
/** /**
* @name horizon.openstack-service-api.config.getSettings * @name horizon.app.core.openstack-service-api.config.getSettings
* @description * @description
* Gets all the allowed settings * Gets all the allowed settings
* *
@ -74,7 +74,7 @@
}; };
/** /**
* @name horizon.openstack-service-api.settings.getSetting * @name horizon.app.core.openstack-service-api.settings.getSetting
* @description * @description
* This retrieves a specific setting. * This retrieves a specific setting.
* *
@ -143,7 +143,7 @@
}; };
/** /**
* @name horizon.openstack-service-api.settings.ifEnabled * @name horizon.app.core.openstack-service-api.settings.ifEnabled
* @description * @description
* Checks if the desired setting is enabled. This returns a promise. * Checks if the desired setting is enabled. This returns a promise.
* If the setting is enabled, the promise will be resolved. * If the setting is enabled, the promise will be resolved.

View File

@ -32,14 +32,14 @@
return responseMockOpts.succeed ? [200, testData, {}] : [500, 'Fail', {}]; return responseMockOpts.succeed ? [200, testData, {}] : [500, 'Fail', {}];
} }
describe('horizon.openstack-service-api.settings', function () { describe('horizon.app.core.openstack-service-api.settings', function () {
var settingsService; var settingsService;
beforeEach(module('horizon.openstack-service-api')); beforeEach(module('horizon.app.core.openstack-service-api'));
beforeEach(module('horizon.framework.util.http')); beforeEach(module('horizon.framework.util.http'));
beforeEach(inject(function (_$httpBackend_, $injector) { beforeEach(inject(function (_$httpBackend_, $injector) {
responseMockOpts.succeed = true; responseMockOpts.succeed = true;
settingsService = $injector.get('horizon.openstack-service-api.settings'); settingsService = $injector.get('horizon.app.core.openstack-service-api.settings');
$httpBackend = _$httpBackend_; $httpBackend = _$httpBackend_;
$httpBackend.whenGET('/api/settings/').respond(responseMockReturn); $httpBackend.whenGET('/api/settings/').respond(responseMockReturn);
$httpBackend.expectGET('/api/settings/'); $httpBackend.expectGET('/api/settings/');

View File

@ -32,7 +32,7 @@
* *
* Injected dependencies: * Injected dependencies:
* - $q * - $q
* - serviceCatalog horizon.openstack-service-api.serviceCatalog * - serviceCatalog horizon.app.core.openstack-service-api.serviceCatalog
* *
* @param {Object} spec The input workflow specification object. * @param {Object} spec The input workflow specification object.
* @returns {Object} The decorated workflow specification object, the same * @returns {Object} The decorated workflow specification object, the same
@ -49,7 +49,7 @@
dashboardWorkflowDecorator.$inject = [ dashboardWorkflowDecorator.$inject = [
'$q', '$q',
'horizon.openstack-service-api.serviceCatalog' 'horizon.app.core.openstack-service-api.serviceCatalog'
]; ];
///////////// /////////////

View File

@ -159,7 +159,7 @@
*/ */
module.controller('LaunchInstanceCreateKeyPairCtrl', [ module.controller('LaunchInstanceCreateKeyPairCtrl', [
'$modalInstance', '$modalInstance',
'horizon.openstack-service-api.nova', 'horizon.app.core.openstack-service-api.nova',
'horizon.framework.widgets.toast.service', 'horizon.framework.widgets.toast.service',
LaunchInstanceCreateKeyPairCtrl LaunchInstanceCreateKeyPairCtrl
]); ]);
@ -235,7 +235,7 @@
*/ */
module.controller('LaunchInstanceImportKeyPairCtrl', [ module.controller('LaunchInstanceImportKeyPairCtrl', [
'$modalInstance', '$modalInstance',
'horizon.openstack-service-api.nova', 'horizon.app.core.openstack-service-api.nova',
'horizon.framework.widgets.toast.service', 'horizon.framework.widgets.toast.service',
LaunchInstanceImportKeyPairCtrl LaunchInstanceImportKeyPairCtrl
]); ]);

View File

@ -100,7 +100,7 @@
beforeEach(module(function ($provide) { beforeEach(module(function ($provide) {
$provide.value('$modalInstance', {}); $provide.value('$modalInstance', {});
$provide.value('horizon.openstack-service-api.nova', {}); $provide.value('horizon.app.core.openstack-service-api.nova', {});
$provide.value('horizon.framework.widgets.toast.service', {}); $provide.value('horizon.framework.widgets.toast.service', {});
})); }));
@ -159,7 +159,7 @@
beforeEach(module(function ($provide) { beforeEach(module(function ($provide) {
$provide.value('$modalInstance', {}); $provide.value('$modalInstance', {});
$provide.value('horizon.openstack-service-api.nova', {}); $provide.value('horizon.app.core.openstack-service-api.nova', {});
$provide.value('horizon.framework.widgets.toast.service', {}); $provide.value('horizon.framework.widgets.toast.service', {});
})); }));

View File

@ -28,14 +28,14 @@
*/ */
module.factory('launchInstanceModel', ['$q', '$log', module.factory('launchInstanceModel', ['$q', '$log',
'horizon.openstack-service-api.cinder', 'horizon.app.core.openstack-service-api.cinder',
'horizon.openstack-service-api.glance', 'horizon.app.core.openstack-service-api.glance',
'horizon.openstack-service-api.keystone', 'horizon.app.core.openstack-service-api.keystone',
'horizon.openstack-service-api.neutron', 'horizon.app.core.openstack-service-api.neutron',
'horizon.openstack-service-api.nova', 'horizon.app.core.openstack-service-api.nova',
'horizon.openstack-service-api.novaExtensions', 'horizon.app.core.openstack-service-api.novaExtensions',
'horizon.openstack-service-api.security-group', 'horizon.app.core.openstack-service-api.security-group',
'horizon.openstack-service-api.serviceCatalog', 'horizon.app.core.openstack-service-api.serviceCatalog',
function ($q, function ($q,
$log, $log,

View File

@ -27,7 +27,7 @@
beforeEach(module('hz.dashboard.launch-instance')); beforeEach(module('hz.dashboard.launch-instance'));
beforeEach(module(function($provide) { beforeEach(module(function($provide) {
$provide.value('horizon.openstack-service-api.glance', { $provide.value('horizon.app.core.openstack-service-api.glance', {
getImages: function() { getImages: function() {
var images = [ var images = [
{ container_format: 'aki', properties: {} }, { container_format: 'aki', properties: {} },
@ -53,7 +53,7 @@
} }
}); });
$provide.value('horizon.openstack-service-api.nova', { $provide.value('horizon.app.core.openstack-service-api.nova', {
createServer: function(finalSpec) { createServer: function(finalSpec) {
return finalSpec; return finalSpec;
}, },
@ -97,7 +97,7 @@
} }
}); });
$provide.value('horizon.openstack-service-api.security-group', { $provide.value('horizon.app.core.openstack-service-api.security-group', {
query: function() { query: function() {
var secGroups = [ var secGroups = [
{ name: 'security-group-1' }, { name: 'security-group-1' },
@ -111,7 +111,7 @@
} }
}); });
$provide.value('horizon.openstack-service-api.neutron', { $provide.value('horizon.app.core.openstack-service-api.neutron', {
getNetworks: function() { getNetworks: function() {
var networks = [ { id: 'net-1' }, { id: 'net-2' } ]; var networks = [ { id: 'net-1' }, { id: 'net-2' } ];
@ -122,7 +122,7 @@
} }
}); });
$provide.value('horizon.openstack-service-api.cinder', { $provide.value('horizon.app.core.openstack-service-api.cinder', {
getVolumes: function() { getVolumes: function() {
var volumes = [ { id: 'vol-1' }, { id: 'vol-2' } ]; var volumes = [ { id: 'vol-1' }, { id: 'vol-2' } ];
@ -141,7 +141,7 @@
} }
}); });
$provide.value('horizon.openstack-service-api.serviceCatalog', { $provide.value('horizon.app.core.openstack-service-api.serviceCatalog', {
ifTypeEnabled: function(theType) { ifTypeEnabled: function(theType) {
var deferred = $q.defer(); var deferred = $q.defer();
@ -157,7 +157,7 @@
} }
}); });
$provide.value('horizon.openstack-service-api.novaExtensions', { $provide.value('horizon.app.core.openstack-service-api.novaExtensions', {
ifNameEnabled: function() { ifNameEnabled: function() {
var deferred = $q.defer(); var deferred = $q.defer();
@ -171,7 +171,7 @@
} }
}); });
$provide.value('horizon.openstack-service-api.keystone', {}); $provide.value('horizon.app.core.openstack-service-api.keystone', {});
})); }));
beforeEach(inject(function(launchInstanceModel, $rootScope, _$q_) { beforeEach(inject(function(launchInstanceModel, $rootScope, _$q_) {

View File

@ -29,7 +29,7 @@
}); });
return spec; return spec;
}; };
$provide.value('horizon.openstack-service-api.serviceCatalog', {}); $provide.value('horizon.app.core.openstack-service-api.serviceCatalog', {});
$provide.value('horizon.framework.util.workflow.service', workflow); $provide.value('horizon.framework.util.workflow.service', workflow);
})); }));

View File

@ -145,11 +145,6 @@ def find_static_files(ROOT_PATH, HORIZON_CONFIG):
# note the path must end in a '/' or the resultant file paths will have a # note the path must end in a '/' or the resultant file paths will have a
# leading "/" # leading "/"
file_discovery.populate_horizon_config(
HORIZON_CONFIG,
os.path.join(ROOT_PATH, 'static/'),
sub_path='openstack-service-api/'
)
file_discovery.populate_horizon_config( file_discovery.populate_horizon_config(
HORIZON_CONFIG, HORIZON_CONFIG,
os.path.join(ROOT_PATH, 'static/'), os.path.join(ROOT_PATH, 'static/'),