diff --git a/README.rst b/README.rst index 061baf6f..3c92fffc 100644 --- a/README.rst +++ b/README.rst @@ -48,9 +48,9 @@ Install Magnum UI with all dependencies in your virtual environment:: And enable it in Horizon:: - cp ../magnum-ui/magnum_ui/enabled/_1370_project_container-infra_panelgroup.py openstack_dashboard/local/enabled - cp ../magnum-ui/magnum_ui/enabled/_1371_project_container-infra_bays_panel.py openstack_dashboard/local/enabled - cp ../magnum-ui/magnum_ui/enabled/_1372_project_container-infra_baymodels_panel.py openstack_dashboard/local/enabled + cp ../magnum-ui/magnum_ui/enabled/_1370_project_container_infra_panel_group.py openstack_dashboard/local/enabled + cp ../magnum-ui/magnum_ui/enabled/_1371_project_container_infra_clusters_panel.py openstack_dashboard/local/enabled + cp ../magnum-ui/magnum_ui/enabled/_1372_project_container_infra_cluster_templates_panel.py openstack_dashboard/local/enabled To run horizon with the newly enabled Magnum UI plugin run:: diff --git a/doc/source/index.rst b/doc/source/index.rst index dff17a64..7c636e23 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -48,9 +48,9 @@ Install Magnum UI with all dependencies in your virtual environment:: And enable it in Horizon:: - cp ../magnum-ui/magnum_ui/enabled/_1370_project_containers-infra_panelgroup.py openstack_dashboard/local/enabled - cp ../magnum-ui/magnum_ui/enabled/_1371_project_containers-infra_bays_panel.py openstack_dashboard/local/enabled - cp ../magnum-ui/magnum_ui/enabled/_1372_project_containers-infra_baymodels_panel.py openstack_dashboard/local/enabled + cp ../magnum-ui/magnum_ui/enabled/_1370_project_container_infra_panelgroup.py openstack_dashboard/local/enabled + cp ../magnum-ui/magnum_ui/enabled/_1371_project_container_infra_clusters_panel.py openstack_dashboard/local/enabled + cp ../magnum-ui/magnum_ui/enabled/_1372_project_container_infra_cluster_templates_panel.py openstack_dashboard/local/enabled To run horizon with the newly enabled Magnum UI plugin run:: diff --git a/magnum_ui/api/magnum.py b/magnum_ui/api/magnum.py index ffb13a9c..276f6595 100644 --- a/magnum_ui/api/magnum.py +++ b/magnum_ui/api/magnum.py @@ -25,16 +25,17 @@ from openstack_dashboard.api import base LOG = logging.getLogger(__name__) -BAYMODEL_CREATE_ATTRS = ['name', 'image_id', 'flavor_id', 'master_flavor_id', - 'keypair_id', 'external_network_id', 'fixed_network', - 'dns_nameserver', 'docker_volume_size', 'labels', - 'coe', 'http_proxy', - 'https_proxy', 'no_proxy', 'network_driver', - 'volume_driver', - 'public', 'registry_enabled', 'tls_disabled'] +CLUSTER_TEMPLATE_CREATE_ATTRS = ['name', 'image_id', 'flavor_id', + 'master_flavor_id', 'keypair_id', + 'external_network_id', 'fixed_network', + 'dns_nameserver', 'docker_volume_size', + 'labels', 'coe', 'http_proxy', 'https_proxy', + 'no_proxy', 'network_driver', 'volume_driver', + 'public', 'registry_enabled', 'tls_disabled'] -BAY_CREATE_ATTRS = ['name', 'baymodel_id', 'node_count', 'discovery_url', - 'bay_create_timeout', 'master_count'] +CLUSTER_CREATE_ATTRS = ['name', 'baymodel_id', 'node_count', + 'discovery_url', 'cluster_create_timeout', + 'master_count'] @memoized @@ -62,14 +63,14 @@ def magnumclient(request): return c -def baymodel_create(request, **kwargs): +def cluster_template_create(request, **kwargs): args = {} for (key, value) in kwargs.items(): - if key in BAYMODEL_CREATE_ATTRS: + if key in CLUSTER_TEMPLATE_CREATE_ATTRS: args[str(key)] = str(value) else: raise exceptions.InvalidAttribute( - "Key must be in %s" % ",".join(BAYMODEL_CREATE_ATTRS)) + "Key must be in %s" % ",".join(CLUSTER_TEMPLATE_CREATE_ATTRS)) if key == "labels": labels = {} vals = value.split(",") @@ -80,44 +81,44 @@ def baymodel_create(request, **kwargs): return magnumclient(request).baymodels.create(**args) -def baymodel_delete(request, id): +def cluster_template_delete(request, id): return magnumclient(request).baymodels.delete(id) -def baymodel_list(request, limit=None, marker=None, sort_key=None, - sort_dir=None, detail=True): +def cluster_template_list(request, limit=None, marker=None, sort_key=None, + sort_dir=None, detail=True): return magnumclient(request).baymodels.list(limit, marker, sort_key, sort_dir, detail) -def baymodel_show(request, id): +def cluster_template_show(request, id): return magnumclient(request).baymodels.get(id) -def bay_create(request, **kwargs): +def cluster_create(request, **kwargs): args = {} for (key, value) in kwargs.items(): - if key in BAY_CREATE_ATTRS: + if key in CLUSTER_CREATE_ATTRS: args[key] = value else: raise exceptions.InvalidAttribute( - "Key must be in %s" % ",".join(BAY_CREATE_ATTRS)) + "Key must be in %s" % ",".join(CLUSTER_CREATE_ATTRS)) return magnumclient(request).bays.create(**args) -def bay_update(request, id, patch): +def cluster_update(request, id, patch): return magnumclient(request).bays.update(id, patch) -def bay_delete(request, id): +def cluster_delete(request, id): return magnumclient(request).bays.delete(id) -def bay_list(request, limit=None, marker=None, sort_key=None, - sort_dir=None, detail=True): +def cluster_list(request, limit=None, marker=None, sort_key=None, + sort_dir=None, detail=True): return magnumclient(request).bays.list(limit, marker, sort_key, sort_dir, detail) -def bay_show(request, id): +def cluster_show(request, id): return magnumclient(request).bays.get(id) diff --git a/magnum_ui/api/rest/magnum.py b/magnum_ui/api/rest/magnum.py index 758ed419..fc75c461 100644 --- a/magnum_ui/api/rest/magnum.py +++ b/magnum_ui/api/rest/magnum.py @@ -31,95 +31,95 @@ def change_to_id(obj): @urls.register -class Baymodel(generic.View): - """API for retrieving a single baymodel""" - url_regex = r'container-infra/baymodels/(?P[^/]+)$' +class ClusterTemplate(generic.View): + """API for retrieving a single cluster template""" + url_regex = r'container_infra/cluster_templates/(?P[^/]+)$' @rest_utils.ajax() - def get(self, request, baymodel_id): - """Get a specific baymodel""" - return change_to_id(magnum.baymodel_show(request, baymodel_id) + def get(self, request, template_id): + """Get a specific cluster template""" + return change_to_id(magnum.cluster_template_show(request, template_id) .to_dict()) @urls.register -class Baymodels(generic.View): - """API for Magnum Baymodels""" - url_regex = r'container-infra/baymodels/$' +class ClusterTemplates(generic.View): + """API for Magnum Cluster Templates""" + url_regex = r'container_infra/cluster_templates/$' @rest_utils.ajax() def get(self, request): - """Get a list of the Baymodels for a project. + """Get a list of the Cluster Templates for a project. The returned result is an object with property 'items' and each - item under this is a Baymodel. + item under this is a Cluster Template. """ - result = magnum.baymodel_list(request) + result = magnum.cluster_template_list(request) return {'items': [change_to_id(n.to_dict()) for n in result]} @rest_utils.ajax(data_required=True) def delete(self, request): - """Delete one or more Baymodels by id. + """Delete one or more Cluster Templates by id. Returns HTTP 204 (no content) on successful deletion. """ - for baymodel_id in request.DATA: - magnum.baymodel_delete(request, baymodel_id) + for template_id in request.DATA: + magnum.cluster_template_delete(request, template_id) @rest_utils.ajax(data_required=True) def post(self, request): - """Create a new Baymodel. + """Create a new Cluster Template. - Returns the new Baymodel object on success. + Returns the new ClusterTemplate object on success. """ - new_baymodel = magnum.baymodel_create(request, **request.DATA) + new_template = magnum.cluster_template_create(request, **request.DATA) return rest_utils.CreatedResponse( - '/api/container-infra/baymodel/%s' % new_baymodel.uuid, - new_baymodel.to_dict()) + '/api/container_infra/cluster_template/%s' % new_template.uuid, + new_template.to_dict()) @urls.register -class Bay(generic.View): - """API for retrieving a single bay""" - url_regex = r'container-infra/bays/(?P[^/]+)$' +class Cluster(generic.View): + """API for retrieving a single cluster""" + url_regex = r'container_infra/clusters/(?P[^/]+)$' @rest_utils.ajax() - def get(self, request, bay_id): - """Get a specific bay""" - return change_to_id(magnum.bay_show(request, bay_id).to_dict()) + def get(self, request, cluster_id): + """Get a specific cluster""" + return change_to_id(magnum.cluster_show(request, cluster_id).to_dict()) @urls.register -class Bays(generic.View): - """API for Magnum Bays""" - url_regex = r'container-infra/bays/$' +class Clusters(generic.View): + """API for Magnum Clusters""" + url_regex = r'container_infra/clusters/$' @rest_utils.ajax() def get(self, request): - """Get a list of the Bays for a project. + """Get a list of the Clusters for a project. The returned result is an object with property 'items' and each - item under this is a Bay. + item under this is a Cluster. """ - result = magnum.bay_list(request) + result = magnum.cluster_list(request) return {'items': [change_to_id(n.to_dict()) for n in result]} @rest_utils.ajax(data_required=True) def delete(self, request): - """Delete one or more Bays by id. + """Delete one or more Clusters by id. Returns HTTP 204 (no content) on successful deletion. """ - for bay_id in request.DATA: - magnum.bay_delete(request, bay_id) + for cluster_id in request.DATA: + magnum.cluster_delete(request, cluster_id) @rest_utils.ajax(data_required=True) def post(self, request): - """Create a new Bay. + """Create a new Cluster. - Returns the new Bay object on success. + Returns the new Cluster object on success. """ - new_bay = magnum.bay_create(request, **request.DATA) + new_cluster = magnum.cluster_create(request, **request.DATA) return rest_utils.CreatedResponse( - '/api/container-infra/bay/%s' % new_bay.uuid, - new_bay.to_dict()) + '/api/container_infra/cluster/%s' % new_cluster.uuid, + new_cluster.to_dict()) diff --git a/magnum_ui/content/baymodels/__init__.py b/magnum_ui/content/cluster_templates/__init__.py similarity index 100% rename from magnum_ui/content/baymodels/__init__.py rename to magnum_ui/content/cluster_templates/__init__.py diff --git a/magnum_ui/content/baymodels/panel.py b/magnum_ui/content/cluster_templates/panel.py similarity index 86% rename from magnum_ui/content/baymodels/panel.py rename to magnum_ui/content/cluster_templates/panel.py index de421bcc..98580d9e 100644 --- a/magnum_ui/content/baymodels/panel.py +++ b/magnum_ui/content/cluster_templates/panel.py @@ -16,6 +16,6 @@ from django.utils.translation import ugettext_lazy as _ import horizon -class Baymodels(horizon.Panel): - name = _("Baymodels") - slug = "baymodels" +class ClusterTemplates(horizon.Panel): + name = _("Cluster Templates") + slug = "cluster_templates" diff --git a/magnum_ui/content/baymodels/tests.py b/magnum_ui/content/cluster_templates/tests.py similarity index 89% rename from magnum_ui/content/baymodels/tests.py rename to magnum_ui/content/cluster_templates/tests.py index ff8adfcb..c4d9a88b 100644 --- a/magnum_ui/content/baymodels/tests.py +++ b/magnum_ui/content/cluster_templates/tests.py @@ -15,7 +15,7 @@ from openstack_dashboard.test import helpers as test -class BayModelTests(test.TestCase): - # Unit tests for bay model. +class ClusterTemplateTests(test.TestCase): + # Unit tests for cluster template. def test_me(self): self.assertTrue(1 + 1 == 2) diff --git a/magnum_ui/content/baymodels/urls.py b/magnum_ui/content/cluster_templates/urls.py similarity index 92% rename from magnum_ui/content/baymodels/urls.py rename to magnum_ui/content/cluster_templates/urls.py index dc51c1ee..29d30e59 100644 --- a/magnum_ui/content/baymodels/urls.py +++ b/magnum_ui/content/cluster_templates/urls.py @@ -13,7 +13,7 @@ # under the License. from django.conf.urls import url -from magnum_ui.content.baymodels.views import IndexView +from magnum_ui.content.cluster_templates.views import IndexView urlpatterns = [ diff --git a/magnum_ui/content/baymodels/views.py b/magnum_ui/content/cluster_templates/views.py similarity index 100% rename from magnum_ui/content/baymodels/views.py rename to magnum_ui/content/cluster_templates/views.py diff --git a/magnum_ui/content/bays/__init__.py b/magnum_ui/content/clusters/__init__.py similarity index 100% rename from magnum_ui/content/bays/__init__.py rename to magnum_ui/content/clusters/__init__.py diff --git a/magnum_ui/content/bays/panel.py b/magnum_ui/content/clusters/panel.py similarity index 89% rename from magnum_ui/content/bays/panel.py rename to magnum_ui/content/clusters/panel.py index 3879fe15..3bc12e89 100644 --- a/magnum_ui/content/bays/panel.py +++ b/magnum_ui/content/clusters/panel.py @@ -16,6 +16,6 @@ from django.utils.translation import ugettext_lazy as _ import horizon -class Bays(horizon.Panel): - name = _("Bays") - slug = "bays" +class Clusters(horizon.Panel): + name = _("Clusters") + slug = "clusters" diff --git a/magnum_ui/content/bays/tests.py b/magnum_ui/content/clusters/tests.py similarity index 91% rename from magnum_ui/content/bays/tests.py rename to magnum_ui/content/clusters/tests.py index 1b1cbb1c..10695626 100644 --- a/magnum_ui/content/bays/tests.py +++ b/magnum_ui/content/clusters/tests.py @@ -15,7 +15,7 @@ from openstack_dashboard.test import helpers as test -class BayTests(test.TestCase): - # Unit tests for bay. +class ClusterTests(test.TestCase): + # Unit tests for cluster. def test_me(self): self.assertTrue(1 + 1 == 2) diff --git a/magnum_ui/content/bays/urls.py b/magnum_ui/content/clusters/urls.py similarity index 93% rename from magnum_ui/content/bays/urls.py rename to magnum_ui/content/clusters/urls.py index a194d179..00024499 100644 --- a/magnum_ui/content/bays/urls.py +++ b/magnum_ui/content/clusters/urls.py @@ -13,7 +13,7 @@ # under the License. from django.conf.urls import url -from magnum_ui.content.bays.views import IndexView +from magnum_ui.content.clusters.views import IndexView urlpatterns = [ diff --git a/magnum_ui/content/bays/views.py b/magnum_ui/content/clusters/views.py similarity index 100% rename from magnum_ui/content/bays/views.py rename to magnum_ui/content/clusters/views.py diff --git a/magnum_ui/enabled/_1370_project_container-infra_panelgroup.py b/magnum_ui/enabled/_1370_project_container_infra_panel_group.py similarity index 97% rename from magnum_ui/enabled/_1370_project_container-infra_panelgroup.py rename to magnum_ui/enabled/_1370_project_container_infra_panel_group.py index b807a172..587aa7f8 100644 --- a/magnum_ui/enabled/_1370_project_container-infra_panelgroup.py +++ b/magnum_ui/enabled/_1370_project_container_infra_panel_group.py @@ -14,7 +14,7 @@ from django.utils.translation import ugettext_lazy as _ # The slug of the panel group to be added to HORIZON_CONFIG. Required. -PANEL_GROUP = 'container-infra' +PANEL_GROUP = 'container_infra' # The display name of the PANEL_GROUP. Required. PANEL_GROUP_NAME = _('Container Infrastructure') # The slug of the dashboard the PANEL_GROUP associated with. Required. diff --git a/magnum_ui/enabled/_1371_project_container-infra_bays_panel.py b/magnum_ui/enabled/_1371_project_container_infra_clusters_panel.py similarity index 89% rename from magnum_ui/enabled/_1371_project_container-infra_bays_panel.py rename to magnum_ui/enabled/_1371_project_container_infra_clusters_panel.py index 80eb03d2..61b94e83 100644 --- a/magnum_ui/enabled/_1371_project_container-infra_bays_panel.py +++ b/magnum_ui/enabled/_1371_project_container_infra_clusters_panel.py @@ -13,11 +13,11 @@ # under the License. # The slug of the panel to be added to HORIZON_CONFIG. Required. -PANEL = 'bays' +PANEL = 'clusters' # The slug of the panel group the PANEL is associated with. -PANEL_GROUP = 'container-infra' +PANEL_GROUP = 'container_infra' # The slug of the dashboard the PANEL associated with. Required. PANEL_DASHBOARD = 'project' # Python panel class of the PANEL to be added. -ADD_PANEL = 'magnum_ui.content.bays.panel.Bays' +ADD_PANEL = 'magnum_ui.content.clusters.panel.Clusters' diff --git a/magnum_ui/enabled/_1372_project_container-infra_baymodels_panel.py b/magnum_ui/enabled/_1372_project_container_infra_cluster_templates_panel.py similarity index 86% rename from magnum_ui/enabled/_1372_project_container-infra_baymodels_panel.py rename to magnum_ui/enabled/_1372_project_container_infra_cluster_templates_panel.py index c40e2be5..7f61d3ba 100644 --- a/magnum_ui/enabled/_1372_project_container-infra_baymodels_panel.py +++ b/magnum_ui/enabled/_1372_project_container_infra_cluster_templates_panel.py @@ -13,11 +13,11 @@ # under the License. # The slug of the panel to be added to HORIZON_CONFIG. Required. -PANEL = 'baymodels' +PANEL = 'cluster_templates' # The slug of the panel group the PANEL is associated with. -PANEL_GROUP = 'container-infra' +PANEL_GROUP = 'container_infra' # The slug of the dashboard the PANEL associated with. Required. PANEL_DASHBOARD = 'project' # Python panel class of the PANEL to be added. -ADD_PANEL = 'magnum_ui.content.baymodels.panel.Baymodels' +ADD_PANEL = 'magnum_ui.content.cluster_templates.panel.ClusterTemplates' diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/actions.module.js b/magnum_ui/static/dashboard/container-infra/baymodels/actions.module.js deleted file mode 100644 index b27e1823..00000000 --- a/magnum_ui/static/dashboard/container-infra/baymodels/actions.module.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain - * a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ - -(function() { - 'use strict'; - - /** - * @ngdoc overview - * @ngname horizon.dashboard.container-infra.baymodels.actions - * - * @description - * Provides all of the actions for baymodels. - */ - angular.module('horizon.dashboard.container-infra.baymodels.actions', ['horizon.framework', 'horizon.dashboard.container-infra']) - .run(registerBaymodelActions); - - registerBaymodelActions.$inject = [ - 'horizon.framework.conf.resource-type-registry.service', - 'horizon.framework.util.i18n.gettext', - 'horizon.dashboard.container-infra.baymodels.create.service', - 'horizon.dashboard.container-infra.baymodels.delete.service', - 'horizon.dashboard.container-infra.bays.create.service', - 'horizon.dashboard.container-infra.baymodels.resourceType', - ]; - - function registerBaymodelActions( - registry, - gettext, - createBaymodelService, - deleteBaymodelService, - createBayService, - resourceType) - { - var baymodelResourceType = registry.getResourceType(resourceType); - baymodelResourceType.itemActions - .append({ - id: 'createBayAction', - service: createBayService, - template: { - text: gettext('Create Bay') - } - }) - .append({ - id: 'deleteBaymodelAction', - service: deleteBaymodelService, - template: { - type: 'delete', - text: gettext('Delete Baymodel') - } - }); - - baymodelResourceType.batchActions - .append({ - id: 'createBaymodelAction', - service: createBaymodelService, - template: { - type: 'create', - text: gettext('Create Baymodel') - } - }) - .append({ - id: 'batchDeleteBaymodelAction', - service: deleteBaymodelService, - template: { - type: 'delete-selected', - text: gettext('Delete Baymodels') - } - }); - } - -})(); diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/create/info/info.html b/magnum_ui/static/dashboard/container-infra/baymodels/create/info/info.html deleted file mode 100644 index 796aff9a..00000000 --- a/magnum_ui/static/dashboard/container-infra/baymodels/create/info/info.html +++ /dev/null @@ -1,45 +0,0 @@ -
-
-
-
- - -
-
- - -
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
-
diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/create/labels/labels.help.html b/magnum_ui/static/dashboard/container-infra/baymodels/create/labels/labels.help.html deleted file mode 100644 index ccfac7a0..00000000 --- a/magnum_ui/static/dashboard/container-infra/baymodels/create/labels/labels.help.html +++ /dev/null @@ -1 +0,0 @@ -

Arbitrary labels in the form of key=value pairs to associate with a baymodel. May be used multiple times.

diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/create/labels/labels.html b/magnum_ui/static/dashboard/container-infra/baymodels/create/labels/labels.html deleted file mode 100644 index 26c93781..00000000 --- a/magnum_ui/static/dashboard/container-infra/baymodels/create/labels/labels.html +++ /dev/null @@ -1,11 +0,0 @@ -
-
-
-
- - -
-
-
diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/create/network/network.html b/magnum_ui/static/dashboard/container-infra/baymodels/create/network/network.html deleted file mode 100644 index 62f59875..00000000 --- a/magnum_ui/static/dashboard/container-infra/baymodels/create/network/network.html +++ /dev/null @@ -1,60 +0,0 @@ -
-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/create/spec/spec.html b/magnum_ui/static/dashboard/container-infra/baymodels/create/spec/spec.html deleted file mode 100644 index 02e39c9a..00000000 --- a/magnum_ui/static/dashboard/container-infra/baymodels/create/spec/spec.html +++ /dev/null @@ -1,67 +0,0 @@ -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/panel.html b/magnum_ui/static/dashboard/container-infra/baymodels/panel.html deleted file mode 100644 index 813bacbd..00000000 --- a/magnum_ui/static/dashboard/container-infra/baymodels/panel.html +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/magnum_ui/static/dashboard/container-infra/bays/actions.module.js b/magnum_ui/static/dashboard/container-infra/bays/actions.module.js deleted file mode 100644 index d8a46cec..00000000 --- a/magnum_ui/static/dashboard/container-infra/bays/actions.module.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain - * a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ - -(function() { - 'use strict'; - - /** - * @ngdoc overview - * @ngname horizon.dashboard.container-infra.bays.actions - * - * @description - * Provides all of the actions for bays. - */ - angular.module('horizon.dashboard.container-infra.bays.actions', ['horizon.framework', 'horizon.dashboard.container-infra']) - .run(registerBayActions); - - registerBayActions.$inject = [ - 'horizon.framework.conf.resource-type-registry.service', - 'horizon.framework.util.i18n.gettext', - 'horizon.dashboard.container-infra.bays.create.service', - 'horizon.dashboard.container-infra.bays.delete.service', - 'horizon.dashboard.container-infra.bays.resourceType', - ]; - - function registerBayActions( - registry, - gettext, - createBayService, - deleteBayService, - resourceType) - { - var bayResourceType = registry.getResourceType(resourceType); - bayResourceType.itemActions - .append({ - id: 'deleteBayAction', - service: deleteBayService, - template: { - type: 'delete', - text: gettext('Delete Bay') - } - }); - - bayResourceType.batchActions - .append({ - id: 'createBayAction', - service: createBayService, - template: { - type: 'create', - text: gettext('Create Bay') - } - }) - .append({ - id: 'batchDeleteBayAction', - service: deleteBayService, - template: { - type: 'delete-selected', - text: gettext('Delete Bays') - } - }); - } - -})(); diff --git a/magnum_ui/static/dashboard/container-infra/bays/create/info/bay.info.controller.js b/magnum_ui/static/dashboard/container-infra/bays/create/info/bay.info.controller.js deleted file mode 100644 index e4ac1f9c..00000000 --- a/magnum_ui/static/dashboard/container-infra/bays/create/info/bay.info.controller.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Copyright 2015 NEC Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain - * a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - */ - -(function() { - 'use strict'; - - /** - * @ngdoc controller - * @name createBayInfoController - * @ngController - * - * @description - * Controller for the container-infra bay info step in create workflow - */ - angular - .module('horizon.dashboard.container-infra.bays') - .controller('createBayInfoController', createBayInfoController); - - createBayInfoController.$inject = [ - '$q', - '$scope', - 'horizon.dashboard.container-infra.basePath', - 'horizon.app.core.openstack-service-api.magnum' - ]; - - function createBayInfoController($q, $scope, basePath, magnum) { - var ctrl = this; - ctrl.baymodels = [{id:"", name: gettext("Choose a Baymodel")}]; - $scope.model.newBaySpec.baymodel_id = ""; - $scope.baymodeldetail = { - name: "", - id: "", - coe: "", - image_id: "", - public: "", - registry_enabled: "", - tls_disabled: "", - apiserver_port: "" - }; - - $scope.changeBaymodel = function(){ - angular.forEach(ctrl.baymodels, function(model, idx){ - if($scope.model.newBaySpec.baymodel_id === model.id){ - $scope.baymodeldetail.name = model.name; - $scope.baymodeldetail.id = model.id; - $scope.baymodeldetail.coe = model.coe; - $scope.baymodeldetail.image_id = model.image_id; - $scope.baymodeldetail.public = model.public; - $scope.baymodeldetail.registry_enabled = model.registry_enabled; - $scope.baymodeldetail.tls_disabled = model.tls_disabled; - $scope.baymodeldetail.apiserver_port = model.apiserver_port; - } - }); - }; - - init(); - - function init() { - magnum.getBaymodels({paginate: false}).success(onGetBaymodels); - } - - function onGetBaymodels(response) { - Array.prototype.push.apply(ctrl.baymodels, response.items); - if($scope.selected instanceof Object){ - $scope.model.newBaySpec.baymodel_id = $scope.selected.id; - $scope.changeBaymodel(); - } - } - - } - -})(); diff --git a/magnum_ui/static/dashboard/container-infra/bays/create/info/info.help.html b/magnum_ui/static/dashboard/container-infra/bays/create/info/info.help.html deleted file mode 100644 index 567351d9..00000000 --- a/magnum_ui/static/dashboard/container-infra/bays/create/info/info.help.html +++ /dev/null @@ -1 +0,0 @@ -

Specify bay name and choose baymodel

diff --git a/magnum_ui/static/dashboard/container-infra/bays/create/info/info.html b/magnum_ui/static/dashboard/container-infra/bays/create/info/info.html deleted file mode 100644 index 8b2f6fe1..00000000 --- a/magnum_ui/static/dashboard/container-infra/bays/create/info/info.html +++ /dev/null @@ -1,50 +0,0 @@ -
-
-
- -
- - -
- -
- - -
- -
- Baymodel Detail -
-
Name
-
- {$ baymodeldetail.name|noName $} -
-
ID
-
{$ baymodeldetail.id $}
-
COE
-
{$ baymodeldetail.coe $}
-
Image ID
-
{$ baymodeldetail.image_id $}
-
Public
-
{$ baymodeldetail.public $}
-
Registry Enabled
-
{$ baymodeldetail.registry_enabled $}
-
TLS Disabled
-
{$ baymodeldetail.tls_disabled $}
-
API Server Port
-
{$ baymodeldetail.apiserver_port $}
-
-
-
-
-
diff --git a/magnum_ui/static/dashboard/container-infra/bays/create/misc/misc.help.html b/magnum_ui/static/dashboard/container-infra/bays/create/misc/misc.help.html deleted file mode 100644 index 387bf666..00000000 --- a/magnum_ui/static/dashboard/container-infra/bays/create/misc/misc.help.html +++ /dev/null @@ -1 +0,0 @@ -

Specify conditions for bay creation.

diff --git a/magnum_ui/static/dashboard/container-infra/bays/create/misc/misc.html b/magnum_ui/static/dashboard/container-infra/bays/create/misc/misc.html deleted file mode 100644 index 2fab6713..00000000 --- a/magnum_ui/static/dashboard/container-infra/bays/create/misc/misc.html +++ /dev/null @@ -1,17 +0,0 @@ -
-
-
-
- - -
-
- - -
-
-
diff --git a/magnum_ui/static/dashboard/container-infra/bays/create/size/size.help.html b/magnum_ui/static/dashboard/container-infra/bays/create/size/size.help.html deleted file mode 100644 index 5c17106d..00000000 --- a/magnum_ui/static/dashboard/container-infra/bays/create/size/size.help.html +++ /dev/null @@ -1 +0,0 @@ -

Specify the number of master nodes and bay nodes for the bay.

diff --git a/magnum_ui/static/dashboard/container-infra/bays/create/size/size.html b/magnum_ui/static/dashboard/container-infra/bays/create/size/size.html deleted file mode 100644 index 84ee6fd0..00000000 --- a/magnum_ui/static/dashboard/container-infra/bays/create/size/size.html +++ /dev/null @@ -1,20 +0,0 @@ -
-
-
-
- - -
-
-
-
- - -
-
-
-
diff --git a/magnum_ui/static/dashboard/container-infra/bays/details/overview.html b/magnum_ui/static/dashboard/container-infra/bays/details/overview.html deleted file mode 100644 index 68fb26d0..00000000 --- a/magnum_ui/static/dashboard/container-infra/bays/details/overview.html +++ /dev/null @@ -1,77 +0,0 @@ -
-
-
-

Baymodel

-
-
-
Name
-
{$ ctrl.baymodel.name|noName $}
-
ID
-
{$ ctrl.baymodel.id $}
-
COE
-
{$ ctrl.baymodel.coe $}
-
Image ID
-
{$ ctrl.baymodel.image_id $}
-
-
-
-

Nodes

-
-
-
Master Count
-
{$ ctrl.bay.master_count $}
-
Node Count
-
{$ ctrl.bay.node_count $}
-
API Address
-
{$ ctrl.bay.api_address $}
-
Master Addresses
-
-
{$ addr $}
-
-
Node Addresses
-
-
{$ addr $}
-
-
-
-
-
-
-

Miscellaneous

-
-
-
Stack ID
-
- {$ ctrl.bay.stack_id $} -
-
Discovery URL
-
{$ ctrl.bay.discovery_url $}
-
Bay Create Timeout
-
-
-
Infinite
-
- {$ ctrl.bay.bay_create_timeout $} minute -
-
-
-
-
-
-

Record Properties

-
-
-
Created
-
{$ ctrl.bay.created_at | date:'short' $}
-
Updated
-
{$ ctrl.bay.updated_at | date:'short' $}
-
ID
-
{$ ctrl.bay.id $}
-
Status
-
{$ ctrl.bay.status $}
-
-
-
-
diff --git a/magnum_ui/static/dashboard/container-infra/bays/panel.html b/magnum_ui/static/dashboard/container-infra/bays/panel.html deleted file mode 100644 index 96ad5f1d..00000000 --- a/magnum_ui/static/dashboard/container-infra/bays/panel.html +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/actions.module.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/actions.module.js new file mode 100644 index 00000000..9b337cb6 --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/actions.module.js @@ -0,0 +1,82 @@ +/** + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +(function() { + 'use strict'; + + /** + * @ngdoc overview + * @ngname horizon.dashboard.container-infra.cluster-templates.actions + * + * @description + * Provides all of the actions for cluster templates. + */ + angular.module('horizon.dashboard.container-infra.cluster-templates.actions', ['horizon.framework', 'horizon.dashboard.container-infra']) + .run(registerClusterTemplateActions); + + registerClusterTemplateActions.$inject = [ + 'horizon.framework.conf.resource-type-registry.service', + 'horizon.framework.util.i18n.gettext', + 'horizon.dashboard.container-infra.cluster-templates.create.service', + 'horizon.dashboard.container-infra.cluster-templates.delete.service', + 'horizon.dashboard.container-infra.clusters.create.service', + 'horizon.dashboard.container-infra.cluster-templates.resourceType', + ]; + + function registerClusterTemplateActions( + registry, + gettext, + createClusterTemplateService, + deleteClusterTemplateService, + createClusterService, + resourceType) + { + var templateResourceType = registry.getResourceType(resourceType); + templateResourceType.itemActions + .append({ + id: 'createClusterAction', + service: createClusterService, + template: { + text: gettext('Create Cluster') + } + }) + .append({ + id: 'deleteClusterTemplateAction', + service: deleteClusterTemplateService, + template: { + type: 'delete', + text: gettext('Delete Cluster Template') + } + }); + + templateResourceType.batchActions + .append({ + id: 'createClusterTemplateAction', + service: createClusterTemplateService, + template: { + type: 'create', + text: gettext('Create Cluster Template') + } + }) + .append({ + id: 'batchDeleteClusterTemplateAction', + service: deleteClusterTemplateService, + template: { + type: 'delete-selected', + text: gettext('Delete Cluster Templates') + } + }); + } + +})(); diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/baymodels.module.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.module.js similarity index 68% rename from magnum_ui/static/dashboard/container-infra/baymodels/baymodels.module.js rename to magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.module.js index 8fb8ef7c..85459b59 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/baymodels.module.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.module.js @@ -19,46 +19,46 @@ /** * @ngdoc overview - * @name horizon.dashboard.container-infra.baymodels + * @name horizon.dashboard.container-infra.cluster-templates * @ngModule * * @description - * Provides all the services and widgets require to display the baymodel + * Provides all the services and widgets require to display the cluster template * panel */ angular - .module('horizon.dashboard.container-infra.baymodels', [ + .module('horizon.dashboard.container-infra.cluster-templates', [ 'ngRoute', - 'horizon.dashboard.container-infra.baymodels.actions', - 'horizon.dashboard.container-infra.baymodels.details' + 'horizon.dashboard.container-infra.cluster-templates.actions', + 'horizon.dashboard.container-infra.cluster-templates.details' ]) - .constant('horizon.dashboard.container-infra.baymodels.events', events()) - .constant('horizon.dashboard.container-infra.baymodels.resourceType', 'OS::Magnum::Baymodel') + .constant('horizon.dashboard.container-infra.cluster-templates.events', events()) + .constant('horizon.dashboard.container-infra.cluster-templates.resourceType', 'OS::Magnum::ClusterTemplate') .run(run) .config(config); /** * @ngdoc constant - * @name horizon.dashboard.container-infra.baymodels.events - * @description A list of events used by Baymodels + * @name horizon.dashboard.container-infra.cluster-templates.events + * @description A list of events used by cluster templates */ function events() { return { - CREATE_SUCCESS: 'horizon.dashboard.container-infra.baymodels.CREATE_SUCCESS', - DELETE_SUCCESS: 'horizon.dashboard.container-infra.baymodels.DELETE_SUCCESS' + CREATE_SUCCESS: 'horizon.dashboard.container-infra.cluster-templates.CREATE_SUCCESS', + DELETE_SUCCESS: 'horizon.dashboard.container-infra.cluster-templates.DELETE_SUCCESS' }; } run.$inject = [ 'horizon.framework.conf.resource-type-registry.service', 'horizon.app.core.openstack-service-api.magnum', - 'horizon.dashboard.container-infra.baymodels.basePath', - 'horizon.dashboard.container-infra.baymodels.resourceType' + 'horizon.dashboard.container-infra.cluster-templates.basePath', + 'horizon.dashboard.container-infra.cluster-templates.resourceType' ]; function run(registry, magnum, basePath, resourceType) { registry.getResourceType(resourceType) - .setNames(gettext('Baymodel'), gettext('Baymodels')) + .setNames(gettext('Cluster Template'), gettext('Cluster Templates')) // for detail summary view on table row .setSummaryTemplateUrl(basePath + 'details/drawer.html') @@ -121,20 +121,20 @@ }) function listFunction(params) { - return magnum.getBaymodels(params).then(modifyResponse); + return magnum.getClusterTemplates(params).then(modifyResponse); function modifyResponse(response) { return {data: {items: response.data.items.map(addTrackBy)}}; - function addTrackBy(baymodel) { - baymodel.trackBy = baymodel.id; - return baymodel; + function addTrackBy(cluster_template) { + cluster_template.trackBy = cluster_template.id; + return cluster_template; } } } function urlFunction(item) { - return 'project/ngdetails/OS::Magnum::Baymodel/' + item.id; + return 'project/ngdetails/OS::Magnum::ClusterTemplate/' + item.id; } } @@ -153,9 +153,9 @@ * @returns {undefined} Returns nothing */ function config($provide, $windowProvider, $routeProvider) { - var path = $windowProvider.$get().STATIC_URL + 'dashboard/container-infra/baymodels/'; - $provide.constant('horizon.dashboard.container-infra.baymodels.basePath', path); - $routeProvider.when('/project/baymodels/', { + var path = $windowProvider.$get().STATIC_URL + 'dashboard/container-infra/cluster-templates/'; + $provide.constant('horizon.dashboard.container-infra.cluster-templates.basePath', path); + $routeProvider.when('/project/cluster_templates/', { templateUrl: path + 'panel.html' }); } diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/baymodels.module.spec.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.module.spec.js similarity index 79% rename from magnum_ui/static/dashboard/container-infra/baymodels/baymodels.module.spec.js rename to magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.module.spec.js index 63239e1f..a83aebea 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/baymodels.module.spec.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.module.spec.js @@ -16,9 +16,9 @@ (function() { 'use strict'; - describe('horizon.dashboard.container-infra.baymodels', function() { + describe('horizon.dashboard.container-infra.cluster-templates', function() { it('should exist', function() { - expect(angular.module('horizon.dashboard.container-infra.baymodels')).toBeDefined(); + expect(angular.module('horizon.dashboard.container-infra.cluster-templates')).toBeDefined(); }); }); diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/baymodels.scss b/magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.scss similarity index 100% rename from magnum_ui/static/dashboard/container-infra/baymodels/baymodels.scss rename to magnum_ui/static/dashboard/container-infra/cluster-templates/cluster-templates.scss diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/create/baymodel-model.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/cluster-template-model.js similarity index 77% rename from magnum_ui/static/dashboard/container-infra/baymodels/create/baymodel-model.js rename to magnum_ui/static/dashboard/container-infra/cluster-templates/create/cluster-template-model.js index 8feae519..d5b02d0b 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/create/baymodel-model.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/cluster-template-model.js @@ -18,24 +18,24 @@ 'use strict'; angular - .module('horizon.dashboard.container-infra.baymodels') - .factory('horizon.dashboard.container-infra.baymodels.baymodelModel', baymodelModel); + .module('horizon.dashboard.container-infra.cluster-templates') + .factory('horizon.dashboard.container-infra.cluster-templates.model', ClusterTemplateModel); - baymodelModel.$inject = [ + ClusterTemplateModel.$inject = [ 'horizon.app.core.openstack-service-api.magnum' ]; - function baymodelModel(magnum) { + function ClusterTemplateModel(magnum) { var model = { - newBaymodelSpec: {}, + newClusterTemplateSpec: {}, // API methods init: init, - createBaymodel: createBaymodel + createClusterTemplate: createClusterTemplate }; - function initNewBaymodelSpec() { - model.newBaymodelSpec = { + function initNewClusterTemplateSpec() { + model.newClusterTemplateSpec = { name: null, coe: "", public: null, @@ -64,16 +64,16 @@ } function init() { - // Reset the new Baymodel spec - initNewBaymodelSpec(); + // Reset the new cluster template spec + initNewClusterTemplateSpec(); } - function createBaymodel() { - var finalSpec = angular.copy(model.newBaymodelSpec); + function createClusterTemplate() { + var finalSpec = angular.copy(model.newClusterTemplateSpec); cleanNullProperties(finalSpec); - return magnum.createBaymodel(finalSpec); + return magnum.createClusterTemplate(finalSpec); } function cleanNullProperties(finalSpec) { diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/create/create-workflow.service.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/create-workflow.service.js similarity index 50% rename from magnum_ui/static/dashboard/container-infra/baymodels/create/create-workflow.service.js rename to magnum_ui/static/dashboard/container-infra/cluster-templates/create/create-workflow.service.js index aa68fe6e..51f447db 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/create/create-workflow.service.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/create-workflow.service.js @@ -18,42 +18,42 @@ 'use strict'; angular - .module('horizon.dashboard.container-infra.baymodels') - .factory('horizon.dashboard.container-infra.baymodels.workflow', baymodelWorkflow); + .module('horizon.dashboard.container-infra.cluster-templates') + .factory('horizon.dashboard.container-infra.cluster-templates.workflow', ClusterTemplateWorkflow); - baymodelWorkflow.$inject = [ + ClusterTemplateWorkflow.$inject = [ 'horizon.dashboard.container-infra.basePath', 'horizon.app.core.workflow.factory', 'horizon.framework.util.i18n.gettext' ]; - function baymodelWorkflow(basePath, workflowService, gettext) { + function ClusterTemplateWorkflow(basePath, workflowService, gettext) { return workflowService({ - title: gettext('Create Baymodel'), + title: gettext('Create Cluster Template'), steps: [ { title: gettext('Info'), - templateUrl: basePath + 'baymodels/create/info/info.html', - helpUrl: basePath + 'baymodels/create/info/info.help.html', - formName: 'baymodelInfoForm' + templateUrl: basePath + 'cluster-templates/create/info/info.html', + helpUrl: basePath + 'cluster-templates/create/info/info.help.html', + formName: 'ClusterTemplateInfoForm' }, { title: gettext('Node Spec'), - templateUrl: basePath + 'baymodels/create/spec/spec.html', - helpUrl: basePath + 'baymodels/create/spec/spec.help.html', - formName: 'baymodelSpecForm' + templateUrl: basePath + 'cluster-templates/create/spec/spec.html', + helpUrl: basePath + 'cluster-templates/create/spec/spec.help.html', + formName: 'ClusterTemplateSpecForm' }, { title: gettext('Network'), - templateUrl: basePath + 'baymodels/create/network/network.html', - helpUrl: basePath + 'baymodels/create/network/network.help.html', - formName: 'baymodelNetworkForm' + templateUrl: basePath + 'cluster-templates/create/network/network.html', + helpUrl: basePath + 'cluster-templates/create/network/network.help.html', + formName: 'ClusterTemplateNetworkForm' }, { title: gettext('Labels'), - templateUrl: basePath + 'baymodels/create/labels/labels.html', - helpUrl: basePath + 'baymodels/create/labels/labels.help.html', - formName: 'baymodelLabelsForm' + templateUrl: basePath + 'cluster-templates/create/labels/labels.html', + helpUrl: basePath + 'cluster-templates/create/labels/labels.help.html', + formName: 'ClusterTemplateLabelsForm' } ], diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/create/create.service.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/create.service.js similarity index 74% rename from magnum_ui/static/dashboard/container-infra/baymodels/create/create.service.js rename to magnum_ui/static/dashboard/container-infra/cluster-templates/create/create.service.js index 6dfc24f7..3009926c 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/create/create.service.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/create.service.js @@ -19,12 +19,12 @@ /** * @ngdoc overview - * @name horizon.dashboard.container-infra.baymodels.create.service - * @description Service for the container-infra bay model create modal + * @name horizon.dashboard.container-infra.cluster-templates.create.service + * @description Service for the container-infra cluster template create modal */ angular - .module('horizon.dashboard.container-infra.baymodels') - .factory('horizon.dashboard.container-infra.baymodels.create.service', createService); + .module('horizon.dashboard.container-infra.cluster-templates') + .factory('horizon.dashboard.container-infra.cluster-templates.create.service', createService); createService.$inject = [ 'horizon.app.core.openstack-service-api.policy', @@ -33,10 +33,10 @@ 'horizon.framework.util.q.extensions', 'horizon.framework.widgets.modal.wizard-modal.service', 'horizon.framework.widgets.toast.service', - 'horizon.dashboard.container-infra.baymodels.baymodelModel', - 'horizon.dashboard.container-infra.baymodels.events', - 'horizon.dashboard.container-infra.baymodels.resourceType', - 'horizon.dashboard.container-infra.baymodels.workflow' + 'horizon.dashboard.container-infra.cluster-templates.model', + 'horizon.dashboard.container-infra.cluster-templates.events', + 'horizon.dashboard.container-infra.cluster-templates.resourceType', + 'horizon.dashboard.container-infra.cluster-templates.workflow' ]; function createService( @@ -45,7 +45,7 @@ var scope; var message = { - success: gettext('Baymodel %s was successfully created.') + success: gettext('Cluster template %s was successfully created.') }; var service = { @@ -80,7 +80,7 @@ } function submit(){ - return model.createBaymodel().then(success); + return model.createClusterTemplate().then(success); } function success(response) { diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/create/info/baymodel.info.controller.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/info/cluster-template.info.controller.js similarity index 62% rename from magnum_ui/static/dashboard/container-infra/baymodels/create/info/baymodel.info.controller.js rename to magnum_ui/static/dashboard/container-infra/cluster-templates/create/info/cluster-template.info.controller.js index 5b6e44e3..5300eadd 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/create/info/baymodel.info.controller.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/info/cluster-template.info.controller.js @@ -19,17 +19,17 @@ /** * @ngdoc controller - * @name createBaymodelInfoController + * @name createClusterTemplateInfoController * @ngController * * @description - * Controller for the bay model info step in create workflow + * Controller for the cluster template info step in create workflow */ angular - .module('horizon.dashboard.container-infra.baymodels') - .controller('createBaymodelInfoController', createBaymodelInfoController); + .module('horizon.dashboard.container-infra.cluster-templates') + .controller('createClusterTemplateInfoController', createClusterTemplateInfoController); - createBaymodelInfoController.$inject = [ + createClusterTemplateInfoController.$inject = [ '$q', '$scope', 'horizon.dashboard.container-infra.basePath', @@ -37,7 +37,7 @@ 'horizon.framework.util.i18n.gettext' ]; - function createBaymodelInfoController($q, $scope, basePath, magnum, gettext) { + function createClusterTemplateInfoController($q, $scope, basePath, magnum, gettext) { var ctrl = this; ctrl.coes = [{name: "", label: gettext("Choose a Container Orchestration Engine")}, {name: "swarm", label: gettext("Docker Swarm")}, @@ -64,16 +64,16 @@ {name:"rexray", label: gettext("Rexray")}]}; $scope.changeCoes = function(){ - if($scope.model.newBaymodelSpec.coe){ - $scope.model.newBaymodelSpec.network_drivers = ctrl.supportedNetworkDrivers[$scope.model.newBaymodelSpec.coe]; - $scope.model.newBaymodelSpec.network_driver = ctrl.supportedNetworkDrivers[$scope.model.newBaymodelSpec.coe][0].name; - $scope.model.newBaymodelSpec.volume_drivers = ctrl.supportedVolumeDrivers[$scope.model.newBaymodelSpec.coe]; - $scope.model.newBaymodelSpec.volume_driver = ctrl.supportedVolumeDrivers[$scope.model.newBaymodelSpec.coe][0].name; + if($scope.model.newClusterTemplateSpec.coe){ + $scope.model.newClusterTemplateSpec.network_drivers = ctrl.supportedNetworkDrivers[$scope.model.newClusterTemplateSpec.coe]; + $scope.model.newClusterTemplateSpec.network_driver = ctrl.supportedNetworkDrivers[$scope.model.newClusterTemplateSpec.coe][0].name; + $scope.model.newClusterTemplateSpec.volume_drivers = ctrl.supportedVolumeDrivers[$scope.model.newClusterTemplateSpec.coe]; + $scope.model.newClusterTemplateSpec.volume_driver = ctrl.supportedVolumeDrivers[$scope.model.newClusterTemplateSpec.coe][0].name; }else{ - $scope.model.newBaymodelSpec.network_drivers = ctrl.supportedNetworkDrivers.initial; - $scope.model.newBaymodelSpec.network_driver = ctrl.supportedNetworkDrivers.initial[0].name; - $scope.model.newBaymodelSpec.volume_drivers = ctrl.supportedVolumeDrivers.initial; - $scope.model.newBaymodelSpec.volume_driver = ctrl.supportedVolumeDrivers.initial[0].name; + $scope.model.newClusterTemplateSpec.network_drivers = ctrl.supportedNetworkDrivers.initial; + $scope.model.newClusterTemplateSpec.network_driver = ctrl.supportedNetworkDrivers.initial[0].name; + $scope.model.newClusterTemplateSpec.volume_drivers = ctrl.supportedVolumeDrivers.initial; + $scope.model.newClusterTemplateSpec.volume_driver = ctrl.supportedVolumeDrivers.initial[0].name; } }; } diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/create/info/info.help.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/info/info.help.html similarity index 51% rename from magnum_ui/static/dashboard/container-infra/baymodels/create/info/info.help.html rename to magnum_ui/static/dashboard/container-infra/cluster-templates/create/info/info.help.html index d250a50a..27694ea1 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/create/info/info.help.html +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/info/info.help.html @@ -1,12 +1,12 @@
-
Baymodel Name
+
Cluster Template Name
An arbitrary human-readable name
Container Orchestration Engine
Specify the Container Orchestration Engine to use.
Public
-
Make baymodel public. Default: False
+
Make cluster template public. Default: False
Enable Registry
-
Enable docker registry in the Bay. Default: False
+
Enable docker registry in the cluster temlate. Default: False
Disable TLS
-
Disable TLS in the Bay. Default: False
+
Disable TLS in the cluster template. Default: False
diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/info/info.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/info/info.html new file mode 100644 index 00000000..216f3e90 --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/info/info.html @@ -0,0 +1,45 @@ +
+
+
+
+ + +
+
+ + +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/create/labels/baymodel.labels.controller.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/labels/cluster-template.labels.controller.js similarity index 67% rename from magnum_ui/static/dashboard/container-infra/baymodels/create/labels/baymodel.labels.controller.js rename to magnum_ui/static/dashboard/container-infra/cluster-templates/create/labels/cluster-template.labels.controller.js index 29325aa9..cec700a6 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/create/labels/baymodel.labels.controller.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/labels/cluster-template.labels.controller.js @@ -19,24 +19,24 @@ /** * @ngdoc controller - * @name createBaymodelLabelsController + * @name createClusterTemplateLabelsController * @ngController * * @description - * Controller for the bay model labels step in create workflow + * Controller for the cluster template labels step in create workflow */ angular - .module('horizon.dashboard.container-infra.baymodels') - .controller('createBaymodelLabelsController', createBaymodelLabelsController); + .module('horizon.dashboard.container-infra.cluster-templates') + .controller('createClusterTemplateLabelsController', createClusterTemplateLabelsController); - createBaymodelLabelsController.$inject = [ + createClusterTemplateLabelsController.$inject = [ '$q', '$scope', 'horizon.dashboard.container-infra.basePath', 'horizon.app.core.openstack-service-api.magnum' ]; - function createBaymodelLabelsController($q, $scope, basePath, magnum) { + function createClusterTemplateLabelsController($q, $scope, basePath, magnum) { var ctrl = this; } diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/labels/labels.help.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/labels/labels.help.html new file mode 100644 index 00000000..9b76cddf --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/labels/labels.help.html @@ -0,0 +1 @@ +

Arbitrary labels in the form of key=value pairs to associate with a cluster templates. May be used multiple times.

diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/labels/labels.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/labels/labels.html new file mode 100644 index 00000000..0cd20db2 --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/labels/labels.html @@ -0,0 +1,11 @@ +
+
+
+
+ + +
+
+
diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/create/network/baymodel.network.controller.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/cluster-template.network.controller.js similarity index 67% rename from magnum_ui/static/dashboard/container-infra/baymodels/create/network/baymodel.network.controller.js rename to magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/cluster-template.network.controller.js index eef31806..0c687033 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/create/network/baymodel.network.controller.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/cluster-template.network.controller.js @@ -19,24 +19,24 @@ /** * @ngdoc controller - * @name createBaymodelNetworkController + * @name createClusterTemplateNetworkController * @ngController * * @description - * Controller for the bay model network step in create workflow + * Controller for the cluster template network step in create workflow */ angular - .module('horizon.dashboard.container-infra.baymodels') - .controller('createBaymodelNetworkController', createBaymodelNetworkController); + .module('horizon.dashboard.container-infra.cluster-templates') + .controller('createClusterTemplateNetworkController', createClusterTemplateNetworkController); - createBaymodelNetworkController.$inject = [ + createClusterTemplateNetworkController.$inject = [ '$q', '$scope', 'horizon.dashboard.container-infra.basePath', 'horizon.app.core.openstack-service-api.magnum' ]; - function createBaymodelNetworkController($q, $scope, basePath, magnum) { + function createClusterTemplateNetworkController($q, $scope, basePath, magnum) { var ctrl = this; }; diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/create/network/network.help.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/network.help.html similarity index 61% rename from magnum_ui/static/dashboard/container-infra/baymodels/create/network/network.help.html rename to magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/network.help.html index f3c21a22..6718a3ad 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/create/network/network.help.html +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/network.help.html @@ -1,4 +1,4 @@
Fixed Network
This should really be named fixed-network-cidr. Default: 10.0.0.0/24
DNS
-
Specify the nameserver to use for the Bay. Default: 8.8.8.8
+
Specify the nameserver to use for the cluster template. Default: 8.8.8.8
diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/network.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/network.html new file mode 100644 index 00000000..efd12a89 --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/network/network.html @@ -0,0 +1,60 @@ +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/create/spec/baymodel.spec.controller.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/cluster-template.spec.controller.js similarity index 83% rename from magnum_ui/static/dashboard/container-infra/baymodels/create/spec/baymodel.spec.controller.js rename to magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/cluster-template.spec.controller.js index e824b133..b8fafcfe 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/create/spec/baymodel.spec.controller.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/cluster-template.spec.controller.js @@ -19,17 +19,17 @@ /** * @ngdoc controller - * @name createBaymodelSpecController + * @name createClusterTemplateSpecController * @ngController * * @description - * Controller for the bay model spec step in create workflow + * Controller for the cluster template spec step in create workflow */ angular - .module('horizon.dashboard.container-infra.baymodels') - .controller('createBaymodelSpecController', createBaymodelSpecController); + .module('horizon.dashboard.container-infra.cluster-templates') + .controller('createClusterTemplateSpecController', createClusterTemplateSpecController); - createBaymodelSpecController.$inject = [ + createClusterTemplateSpecController.$inject = [ '$q', '$scope', 'horizon.dashboard.container-infra.basePath', @@ -38,7 +38,7 @@ 'horizon.app.core.openstack-service-api.glance' ]; - function createBaymodelSpecController($q, $scope, basePath, magnum, nova, glance) { + function createClusterTemplateSpecController($q, $scope, basePath, magnum, nova, glance) { var ctrl = this; ctrl.images = [{id:"", name: gettext("Choose an Image")}]; ctrl.nflavors = [{id:"", name: gettext("Choose a Flavor for the Node")}]; diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/create/spec/spec.help.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/spec.help.html similarity index 69% rename from magnum_ui/static/dashboard/container-infra/baymodels/create/spec/spec.help.html rename to magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/spec.help.html index 463d1694..f8970011 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/create/spec/spec.help.html +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/spec.help.html @@ -1,12 +1,12 @@
Image
-
The name or UUID of the base image to customize for the bay.
+
The name or UUID of the base image to customize for the cluster.
Flavor
-
The nova flavor id to use when launching the bay. Default: m1.small
+
The nova flavor id to use when launching the cluster. Default: m1.small
Master Flavor
-
The nova flavor id to use when launching the master node of the bay. Default: m1.small
+
The nova flavor id to use when launching the master node of the cluster. Default: m1.small
Docker Volume Size
The size in GB for Docker Volume. Default: 25
Keypair
-
The name or UUID of the SSH keypair to load into the Bay nodes.
+
The name or UUID of the SSH keypair to load into the cluster nodes.
diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/spec.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/spec.html new file mode 100644 index 00000000..c208f405 --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/create/spec/spec.html @@ -0,0 +1,67 @@ +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/delete/delete.service.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/delete/delete.service.js similarity index 76% rename from magnum_ui/static/dashboard/container-infra/baymodels/delete/delete.service.js rename to magnum_ui/static/dashboard/container-infra/cluster-templates/delete/delete.service.js index 1a2a9d88..96ccfbaa 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/delete/delete.service.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/delete/delete.service.js @@ -16,8 +16,8 @@ 'use strict'; angular - .module('horizon.dashboard.container-infra.baymodels') - .factory('horizon.dashboard.container-infra.baymodels.delete.service', deleteService); + .module('horizon.dashboard.container-infra.cluster-templates') + .factory('horizon.dashboard.container-infra.cluster-templates.delete.service', deleteService); deleteService.$inject = [ '$location', @@ -29,16 +29,16 @@ 'horizon.framework.util.q.extensions', 'horizon.framework.widgets.modal.deleteModalService', 'horizon.framework.widgets.toast.service', - 'horizon.dashboard.container-infra.baymodels.resourceType', - 'horizon.dashboard.container-infra.baymodels.events' + 'horizon.dashboard.container-infra.cluster-templates.resourceType', + 'horizon.dashboard.container-infra.cluster-templates.events' ]; /** * @ngDoc factory - * @name horizon.dashboard.container-infra.baymodels.delete.service + * @name horizon.dashboard.container-infra.cluster-templates.delete.service * * @Description - * Brings up the delete baymodels confirmation modal dialog. + * Brings up the delete cluster templates confirmation modal dialog. * On submit, delete selected resources. * On cancel, do nothing. */ @@ -56,7 +56,7 @@ allowed: allowed, perform: perform }; - var notAllowedMessage = gettext("You are not allowed to delete baymodels: %s"); + var notAllowedMessage = gettext("You are not allowed to delete cluster templates: %s"); return service; @@ -81,18 +81,18 @@ function labelize(count){ return { - title: ngettext('Confirm Delete Baymodel', - 'Confirm Delete Baymodels', count), + title: ngettext('Confirm Delete Cluster Template', + 'Confirm Delete Cluster Templates', count), /* eslint-disable max-len */ - message: ngettext('You have selected "%s". Please confirm your selection. Deleted baymodel is not recoverable.', - 'You have selected "%s". Please confirm your selection. Deleted baymodels are not recoverable.', count), + message: ngettext('You have selected "%s". Please confirm your selection. Deleted cluster template is not recoverable.', + 'You have selected "%s". Please confirm your selection. Deleted cluster templates are not recoverable.', count), /* eslint-enable max-len */ - submit: ngettext('Delete Baymodel', - 'Delete Baymodels', count), - success: ngettext('Deleted Baymodel: %s.', - 'Deleted Baymodels: %s.', count), - error: ngettext('Unable to delete Baymodel: %s.', - 'Unable to delete Baymodels: %s.', count) + submit: ngettext('Delete Cluster Template', + 'Delete Cluster Templates', count), + success: ngettext('Deleted cluster template: %s.', + 'Deleted cluster templates: %s.', count), + error: ngettext('Unable to delete cluster template: %s.', + 'Unable to delete cluster templates: %s.', count) }; } @@ -125,7 +125,7 @@ result.failed(resourceType, getEntity(item).id); }); if(result.result.failed.length == 0 && result.result.deleted.length > 0){ - $location.path("/project/baymodels"); + $location.path("/project/cluster_templates"); }else{ return result.result; } @@ -146,7 +146,7 @@ // call delete REST API function deleteEntity(id){ - return magnum.deleteBaymodel(id, true); + return magnum.deleteClusterTemplate(id, true); } } })(); diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/details/details.module.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/details/details.module.js similarity index 67% rename from magnum_ui/static/dashboard/container-infra/baymodels/details/details.module.js rename to magnum_ui/static/dashboard/container-infra/cluster-templates/details/details.module.js index 1c921499..4ac67dc5 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/details/details.module.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/details/details.module.js @@ -17,23 +17,23 @@ /** * @ngdoc overview - * @ngname horizon.dashboard.container-infra.baymodels.details + * @ngname horizon.dashboard.container-infra.cluster-templates.details * * @description - * Provides details features for baymodels. + * Provides details features for cluster templates. */ - angular.module('horizon.dashboard.container-infra.baymodels.details', + angular.module('horizon.dashboard.container-infra.cluster-templates.details', ['horizon.framework.conf', 'horizon.app.core']) - .run(registerBaymodelDetails); + .run(registerClusterTemplateDetails); - registerBaymodelDetails.$inject = [ - 'horizon.dashboard.container-infra.baymodels.basePath', - 'horizon.dashboard.container-infra.baymodels.resourceType', + registerClusterTemplateDetails.$inject = [ + 'horizon.dashboard.container-infra.cluster-templates.basePath', + 'horizon.dashboard.container-infra.cluster-templates.resourceType', 'horizon.app.core.openstack-service-api.magnum', 'horizon.framework.conf.resource-type-registry.service' ]; - function registerBaymodelDetails( + function registerClusterTemplateDetails( basePath, resourceType, magnum, @@ -42,13 +42,13 @@ registry.getResourceType(resourceType) .setLoadFunction(loadFunction) .detailsViews.append({ - id: 'baymodelDetailsOverview', + id: 'templateDetailsOverview', name: gettext('Overview'), template: basePath + 'details/overview.html' }); function loadFunction(identifier) { - return magnum.getBaymodel(identifier); + return magnum.getClusterTemplate(identifier); } } diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/details/drawer.controller.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/details/drawer.controller.js similarity index 70% rename from magnum_ui/static/dashboard/container-infra/baymodels/details/drawer.controller.js rename to magnum_ui/static/dashboard/container-infra/cluster-templates/details/drawer.controller.js index ba4897ae..4b1cfb9e 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/details/drawer.controller.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/details/drawer.controller.js @@ -17,19 +17,19 @@ /** * @ngdoc controller - * @name horizon.dashboard.container-infra.baymodels.DrawerController + * @name horizon.dashboard.container-infra.cluster-templates.DrawerController * @description - * This is the controller for the baymodel drawer (summary) view. + * This is the controller for the cluster templates drawer (summary) view. * Its primary purpose is to provide the metadata definitions to * the template via the ctrl.metadataDefs member. */ angular - .module('horizon.dashboard.container-infra.baymodels') - .controller('horizon.dashboard.container-infra.baymodels.DrawerController', controller); + .module('horizon.dashboard.container-infra.cluster-templates') + .controller('horizon.dashboard.container-infra.cluster-templates.DrawerController', controller); controller.$inject = [ 'horizon.app.core.openstack-service-api.magnum', - 'horizon.dashboard.container-infra.baymodels.resourceType' + 'horizon.dashboard.container-infra.cluster-templates.resourceType' ]; function controller(magnum, resourceType) { diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/details/drawer.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/details/drawer.html similarity index 87% rename from magnum_ui/static/dashboard/container-infra/baymodels/details/drawer.html rename to magnum_ui/static/dashboard/container-infra/cluster-templates/details/drawer.html index ac6347f2..aa75ac28 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/details/drawer.html +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/details/drawer.html @@ -1,4 +1,4 @@ -
+
diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/details/overview.controller.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/details/overview.controller.js similarity index 60% rename from magnum_ui/static/dashboard/container-infra/baymodels/details/overview.controller.js rename to magnum_ui/static/dashboard/container-infra/cluster-templates/details/overview.controller.js index 175dee89..8fb33d89 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/details/overview.controller.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/details/overview.controller.js @@ -15,40 +15,40 @@ "use strict"; angular - .module('horizon.dashboard.container-infra.baymodels') - .controller('BaymodelOverviewController', BaymodelOverviewController); + .module('horizon.dashboard.container-infra.cluster-templates') + .controller('ClusterTemplateOverviewController', ClusterTemplateOverviewController); - BaymodelOverviewController.$inject = [ + ClusterTemplateOverviewController.$inject = [ '$scope', 'horizon.app.core.openstack-service-api.glance', - 'horizon.dashboard.container-infra.baymodels.resourceType', - 'horizon.dashboard.container-infra.baymodels.events', - 'horizon.dashboard.container-infra.bays.events', + 'horizon.dashboard.container-infra.cluster-templates.resourceType', + 'horizon.dashboard.container-infra.cluster-templates.events', + 'horizon.dashboard.container-infra.clusters.events', 'horizon.framework.conf.resource-type-registry.service' ]; - function BaymodelOverviewController( + function ClusterTemplateOverviewController( $scope, glance, resourceType, events, - bayEvents, + clusterEvents, registry ) { var ctrl = this; - ctrl.baymodel = {}; + ctrl.cluster_template = {}; ctrl.image_uuid; - $scope.context.loadPromise.then(onGetBaymodel); + $scope.context.loadPromise.then(onGetClusterTemplate); - function onGetBaymodel(baymodel) { - ctrl.baymodel = baymodel.data; + function onGetClusterTemplate(template) { + ctrl.cluster_template = template.data; glance.getImages().success(onGetImages); } function onGetImages(images) { angular.forEach(images.items, function(image) { - if (image.name === ctrl.baymodel.image_id) { + if (image.name === ctrl.cluster_template.image_id) { ctrl.image_uuid = image.id; } }); diff --git a/magnum_ui/static/dashboard/container-infra/baymodels/details/overview.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/details/overview.html similarity index 54% rename from magnum_ui/static/dashboard/container-infra/baymodels/details/overview.html rename to magnum_ui/static/dashboard/container-infra/cluster-templates/details/overview.html index 5600eb46..849d3957 100644 --- a/magnum_ui/static/dashboard/container-infra/baymodels/details/overview.html +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/details/overview.html @@ -1,21 +1,21 @@ -
+

Cluster Type


COE
-
{$ ctrl.baymodel.coe $}
+
{$ ctrl.cluster_template.coe $}
Cluster Distro
-
{$ ctrl.baymodel.cluster_distro $}
+
{$ ctrl.cluster_template.cluster_distro $}
Server Type
-
{$ ctrl.baymodel.server_type | uppercase $}
+
{$ ctrl.cluster_template.server_type | uppercase $}
Public
-
{$ ctrl.baymodel.public | yesno $}
+
{$ ctrl.cluster_template.public | yesno $}
Registry Enabled
-
{$ ctrl.baymodel.registry_enabled | yesno $}
+
{$ ctrl.cluster_template.registry_enabled | yesno $}
TLS Disabled
-
{$ ctrl.baymodel.tls_disabled | yesno $}
+
{$ ctrl.cluster_template.tls_disabled | yesno $}
@@ -23,17 +23,17 @@
Image ID
-
{$ ctrl.baymodel.image_id $}
+
{$ ctrl.cluster_template.image_id $}
Flavor ID
-
{$ ctrl.baymodel.flavor_id $}
+
{$ ctrl.cluster_template.flavor_id $}
Master Flavor ID
-
{$ ctrl.baymodel.master_flavor_id $}
+
{$ ctrl.cluster_template.master_flavor_id $}
Volume Driver
-
{$ ctrl.baymodel.volume_driver $}
+
{$ ctrl.cluster_template.volume_driver $}
Docker Volume Size
-
{$ ctrl.baymodel.docker_volume_size | gb $}
+
{$ ctrl.cluster_template.docker_volume_size | gb $}
Keypair ID
-
{$ ctrl.baymodel.keypair_id $}
+
{$ ctrl.cluster_template.keypair_id $}
@@ -43,26 +43,26 @@
Network Driver
-
{$ ctrl.baymodel.network_driver $}
+
{$ ctrl.cluster_template.network_driver $}
HTTP Proxy
-
{$ ctrl.baymodel.http_proxy $}
+
{$ ctrl.cluster_template.http_proxy $}
HTTPS Proxy
-
{$ ctrl.baymodel.https_proxy $}
+
{$ ctrl.cluster_template.https_proxy $}
No Proxy
-
{$ ctrl.baymodel.no_proxy $}
+
{$ ctrl.cluster_template.no_proxy $}
External Network ID
-
{$ ctrl.baymodel.external_network_id $}
+
{$ ctrl.cluster_template.external_network_id $}
Fixed Network
-
{$ ctrl.baymodel.fixed_network $}
+
{$ ctrl.cluster_template.fixed_network $}
DNS
-
{$ ctrl.baymodel.dns_nameserver $}
+
{$ ctrl.cluster_template.dns_nameserver $}

Labels


-
+
{$ key $}
{$ value $}
@@ -75,11 +75,11 @@
Created
-
{$ ctrl.baymodel.created_at | date:'short' $}
+
{$ ctrl.cluster_template.created_at | date:'short' $}
Updated
-
{$ ctrl.baymodel.updated_at | date:'short' $}
+
{$ ctrl.cluster_template.updated_at | date:'short' $}
ID
-
{$ ctrl.baymodel.id $}
+
{$ ctrl.cluster_template.id $}
diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/panel.html b/magnum_ui/static/dashboard/container-infra/cluster-templates/panel.html new file mode 100644 index 00000000..8a9b1182 --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/panel.html @@ -0,0 +1,4 @@ + + + diff --git a/magnum_ui/static/dashboard/container-infra/clusters/actions.module.js b/magnum_ui/static/dashboard/container-infra/clusters/actions.module.js new file mode 100644 index 00000000..d36c0510 --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/clusters/actions.module.js @@ -0,0 +1,73 @@ +/** + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +(function() { + 'use strict'; + + /** + * @ngdoc overview + * @ngname horizon.dashboard.container-infra.clusters.actions + * + * @description + * Provides all of the actions for clusters. + */ + angular.module('horizon.dashboard.container-infra.clusters.actions', ['horizon.framework', 'horizon.dashboard.container-infra']) + .run(registerClusterActions); + + registerClusterActions.$inject = [ + 'horizon.framework.conf.resource-type-registry.service', + 'horizon.framework.util.i18n.gettext', + 'horizon.dashboard.container-infra.clusters.create.service', + 'horizon.dashboard.container-infra.clusters.delete.service', + 'horizon.dashboard.container-infra.clusters.resourceType', + ]; + + function registerClusterActions( + registry, + gettext, + createClusterService, + deleteClusterService, + resourceType) + { + var clusterResourceType = registry.getResourceType(resourceType); + clusterResourceType.itemActions + .append({ + id: 'deleteClusterAction', + service: deleteClusterService, + template: { + type: 'delete', + text: gettext('Delete Cluster') + } + }); + + clusterResourceType.batchActions + .append({ + id: 'createClusterAction', + service: createClusterService, + template: { + type: 'create', + text: gettext('Create Cluster') + } + }) + .append({ + id: 'batchDeleteClusterAction', + service: deleteClusterService, + template: { + type: 'delete-selected', + text: gettext('Delete Clusters') + } + }); + } + +})(); diff --git a/magnum_ui/static/dashboard/container-infra/bays/bays.module.js b/magnum_ui/static/dashboard/container-infra/clusters/clusters.module.js similarity index 77% rename from magnum_ui/static/dashboard/container-infra/bays/bays.module.js rename to magnum_ui/static/dashboard/container-infra/clusters/clusters.module.js index 0da56535..f5ad56b8 100644 --- a/magnum_ui/static/dashboard/container-infra/bays/bays.module.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/clusters.module.js @@ -19,46 +19,46 @@ /** * @ngdoc overview - * @name horizon.dashboard.container-infra.bays + * @name horizon.dashboard.container-infra.clusters * @ngModule * * @description - * Provides all the services and widgets require to display the bay + * Provides all the services and widgets require to display the cluster * panel */ angular - .module('horizon.dashboard.container-infra.bays', [ + .module('horizon.dashboard.container-infra.clusters', [ 'ngRoute', - 'horizon.dashboard.container-infra.bays.actions', - 'horizon.dashboard.container-infra.bays.details' + 'horizon.dashboard.container-infra.clusters.actions', + 'horizon.dashboard.container-infra.clusters.details' ]) - .constant('horizon.dashboard.container-infra.bays.events', events()) - .constant('horizon.dashboard.container-infra.bays.resourceType', 'OS::Magnum::Bay') + .constant('horizon.dashboard.container-infra.clusters.events', events()) + .constant('horizon.dashboard.container-infra.clusters.resourceType', 'OS::Magnum::Cluster') .run(run) .config(config); /** * @ngdoc constant - * @name horizon.dashboard.container-infra.bays.events - * @description A list of events used by Bays + * @name horizon.dashboard.container-infra.clusters.events + * @description A list of events used by Clusters */ function events() { return { - CREATE_SUCCESS: 'horizon.dashboard.container-infra.bays.CREATE_SUCCESS', - DELETE_SUCCESS: 'horizon.dashboard.container-infra.bays.DELETE_SUCCESS' + CREATE_SUCCESS: 'horizon.dashboard.container-infra.clusters.CREATE_SUCCESS', + DELETE_SUCCESS: 'horizon.dashboard.container-infra.clusters.DELETE_SUCCESS' }; } run.$inject = [ 'horizon.framework.conf.resource-type-registry.service', 'horizon.app.core.openstack-service-api.magnum', - 'horizon.dashboard.container-infra.bays.basePath', - 'horizon.dashboard.container-infra.bays.resourceType' + 'horizon.dashboard.container-infra.clusters.basePath', + 'horizon.dashboard.container-infra.clusters.resourceType' ]; function run(registry, magnum, basePath, resourceType) { registry.getResourceType(resourceType) - .setNames(gettext('Bay'), gettext('Bays')) + .setNames(gettext('Cluster'), gettext('Clusters')) // for detail summary view on table row .setSummaryTemplateUrl(basePath + 'details/drawer.html') @@ -141,20 +141,20 @@ }); function listFunction(params) { - return magnum.getBays(params).then(modifyResponse); + return magnum.getClusters(params).then(modifyResponse); function modifyResponse(response) { return {data: {items: response.data.items.map(addTrackBy)}}; - function addTrackBy(bay) { - bay.trackBy = bay.id; - return bay; + function addTrackBy(cluster) { + cluster.trackBy = cluster.id; + return cluster; } } } function urlFunction(item) { - return 'project/ngdetails/OS::Magnum::Bay/' + item.id; + return 'project/ngdetails/OS::Magnum::Cluster/' + item.id; } } @@ -173,9 +173,9 @@ * @returns {undefined} Returns nothing */ function config($provide, $windowProvider, $routeProvider) { - var path = $windowProvider.$get().STATIC_URL + 'dashboard/container-infra/bays/'; - $provide.constant('horizon.dashboard.container-infra.bays.basePath', path); - $routeProvider.when('/project/bays/', { + var path = $windowProvider.$get().STATIC_URL + 'dashboard/container-infra/clusters/'; + $provide.constant('horizon.dashboard.container-infra.clusters.basePath', path); + $routeProvider.when('/project/clusters/', { templateUrl: path + 'panel.html' }); } diff --git a/magnum_ui/static/dashboard/container-infra/bays/bays.module.spec.js b/magnum_ui/static/dashboard/container-infra/clusters/clusters.module.spec.js similarity index 81% rename from magnum_ui/static/dashboard/container-infra/bays/bays.module.spec.js rename to magnum_ui/static/dashboard/container-infra/clusters/clusters.module.spec.js index 10cd0e72..568ebdb4 100644 --- a/magnum_ui/static/dashboard/container-infra/bays/bays.module.spec.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/clusters.module.spec.js @@ -16,9 +16,9 @@ (function() { 'use strict'; - describe('horizon.dashboard.container-infra.bays', function() { + describe('horizon.dashboard.container-infra.clusters', function() { it('should exist', function() { - expect(angular.module('horizon.dashboard.container-infra.bays')).toBeDefined(); + expect(angular.module('horizon.dashboard.container-infra.clusters')).toBeDefined(); }); }); diff --git a/magnum_ui/static/dashboard/container-infra/bays/bays.scss b/magnum_ui/static/dashboard/container-infra/clusters/clusters.scss similarity index 100% rename from magnum_ui/static/dashboard/container-infra/bays/bays.scss rename to magnum_ui/static/dashboard/container-infra/clusters/clusters.scss diff --git a/magnum_ui/static/dashboard/container-infra/bays/create/bay-model.js b/magnum_ui/static/dashboard/container-infra/clusters/create/cluster-model.js similarity index 71% rename from magnum_ui/static/dashboard/container-infra/bays/create/bay-model.js rename to magnum_ui/static/dashboard/container-infra/clusters/create/cluster-model.js index 963ad5fd..b52e6ba3 100644 --- a/magnum_ui/static/dashboard/container-infra/bays/create/bay-model.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/create/cluster-model.js @@ -18,24 +18,24 @@ 'use strict'; angular - .module('horizon.dashboard.container-infra.bays') - .factory('horizon.dashboard.container-infra.bays.bayModel', bayModel); + .module('horizon.dashboard.container-infra.clusters') + .factory('horizon.dashboard.container-infra.clusters.model', ClusterModel); - bayModel.$inject = [ + ClusterModel.$inject = [ 'horizon.app.core.openstack-service-api.magnum' ]; - function bayModel(magnum) { + function ClusterModel(magnum) { var model = { - newBaySpec: {}, + newClusterSpec: {}, // API methods init: init, - createBay: createBay + createCluster: createCluster }; - function initNewBaySpec() { - model.newBaySpec = { + function initNewClusterSpec() { + model.newClusterSpec = { name: null, baymodel_id: null, master_count: null, @@ -46,16 +46,16 @@ } function init() { - // Reset the new Bay spec - initNewBaySpec(); + // Reset the new Cluster spec + initNewClusterSpec(); } - function createBay() { - var finalSpec = angular.copy(model.newBaySpec); + function createCluster() { + var finalSpec = angular.copy(model.newClusterSpec); cleanNullProperties(finalSpec); - return magnum.createBay(finalSpec); + return magnum.createCluster(finalSpec); } function cleanNullProperties(finalSpec) { diff --git a/magnum_ui/static/dashboard/container-infra/bays/create/create-workflow.service.js b/magnum_ui/static/dashboard/container-infra/clusters/create/create-workflow.service.js similarity index 58% rename from magnum_ui/static/dashboard/container-infra/bays/create/create-workflow.service.js rename to magnum_ui/static/dashboard/container-infra/clusters/create/create-workflow.service.js index c79aa9dd..38659c8e 100644 --- a/magnum_ui/static/dashboard/container-infra/bays/create/create-workflow.service.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/create/create-workflow.service.js @@ -18,36 +18,36 @@ 'use strict'; angular - .module('horizon.dashboard.container-infra.bays') - .factory('horizon.dashboard.container-infra.bays.workflow', bayWorkflow); + .module('horizon.dashboard.container-infra.clusters') + .factory('horizon.dashboard.container-infra.clusters.workflow', ClusterWorkflow); - bayWorkflow.$inject = [ + ClusterWorkflow.$inject = [ 'horizon.dashboard.container-infra.basePath', 'horizon.app.core.workflow.factory', 'horizon.framework.util.i18n.gettext' ]; - function bayWorkflow(basePath, workflowService, gettext) { + function ClusterWorkflow(basePath, workflowService, gettext) { return workflowService({ - title: gettext('Create Bay'), + title: gettext('Create Cluster'), steps: [ { title: gettext('Info'), - templateUrl: basePath + 'bays/create/info/info.html', - helpUrl: basePath + 'bays/create/info/info.help.html', - formName: 'bayInfoForm' + templateUrl: basePath + 'clusters/create/info/info.html', + helpUrl: basePath + 'clusters/create/info/info.help.html', + formName: 'clusterInfoForm' }, { title: gettext('Size'), - templateUrl: basePath + 'bays/create/size/size.html', - helpUrl: basePath + 'bays/create/size/size.help.html', - formName: 'baySizeForm' + templateUrl: basePath + 'clusters/create/size/size.html', + helpUrl: basePath + 'clusters/create/size/size.help.html', + formName: 'clusterSizeForm' }, { title: gettext('Misc'), - templateUrl: basePath + 'bays/create/misc/misc.html', - helpUrl: basePath + 'bays/create/misc/misc.help.html', - formName: 'bayMiscForm' + templateUrl: basePath + 'clusters/create/misc/misc.html', + helpUrl: basePath + 'clusters/create/misc/misc.help.html', + formName: 'clusterMiscForm' } ], diff --git a/magnum_ui/static/dashboard/container-infra/bays/create/create.service.js b/magnum_ui/static/dashboard/container-infra/clusters/create/create.service.js similarity index 77% rename from magnum_ui/static/dashboard/container-infra/bays/create/create.service.js rename to magnum_ui/static/dashboard/container-infra/clusters/create/create.service.js index 4fdf2ae6..39023b09 100644 --- a/magnum_ui/static/dashboard/container-infra/bays/create/create.service.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/create/create.service.js @@ -17,12 +17,12 @@ /** * @ngdoc overview - * @name horizon.dashboard.container-infra.bays.create.service - * @description Service for the container-infra bay create modal + * @name horizon.dashboard.container-infra.clusters.create.service + * @description Service for the container-infra cluster create modal */ angular - .module('horizon.dashboard.container-infra.bays') - .factory('horizon.dashboard.container-infra.bays.create.service', createService); + .module('horizon.dashboard.container-infra.clusters') + .factory('horizon.dashboard.container-infra.clusters.create.service', createService); createService.$inject = [ '$location', @@ -32,10 +32,10 @@ 'horizon.framework.util.q.extensions', 'horizon.framework.widgets.modal.wizard-modal.service', 'horizon.framework.widgets.toast.service', - 'horizon.dashboard.container-infra.bays.bayModel', - 'horizon.dashboard.container-infra.bays.events', - 'horizon.dashboard.container-infra.bays.resourceType', - 'horizon.dashboard.container-infra.bays.workflow' + 'horizon.dashboard.container-infra.clusters.model', + 'horizon.dashboard.container-infra.clusters.events', + 'horizon.dashboard.container-infra.clusters.resourceType', + 'horizon.dashboard.container-infra.clusters.workflow' ]; function createService( @@ -44,7 +44,7 @@ var scope; var message = { - success: gettext('Bay %s was successfully created.') + success: gettext('Cluster %s was successfully created.') }; var service = { @@ -80,7 +80,7 @@ } function submit(){ - return model.createBay().then(success); + return model.createCluster().then(success); } function success(response) { @@ -89,7 +89,7 @@ var result = actionResult.getActionResult() .created(resourceType, response.data.id); if(result.result.failed.length == 0 && result.result.created.length > 0){ - $location.path("/project/bays"); + $location.path("/project/clusters"); }else{ return result.result; } diff --git a/magnum_ui/static/dashboard/container-infra/clusters/create/info/cluster.info.controller.js b/magnum_ui/static/dashboard/container-infra/clusters/create/info/cluster.info.controller.js new file mode 100644 index 00000000..bf5d49ce --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/clusters/create/info/cluster.info.controller.js @@ -0,0 +1,85 @@ +/** + * Copyright 2015 NEC Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +(function() { + 'use strict'; + + /** + * @ngdoc controller + * @name createClusterInfoController + * @ngController + * + * @description + * Controller for the container-infra cluster info step in create workflow + */ + angular + .module('horizon.dashboard.container-infra.clusters') + .controller('createClusterInfoController', createClusterInfoController); + + createClusterInfoController.$inject = [ + '$q', + '$scope', + 'horizon.dashboard.container-infra.basePath', + 'horizon.app.core.openstack-service-api.magnum' + ]; + + function createClusterInfoController($q, $scope, basePath, magnum) { + var ctrl = this; + ctrl.cluster_templates = [{id:"", name: gettext("Choose a Cluster Template")}]; + $scope.model.newClusterSpec.baymodel_id = ""; + $scope.cluster_template_detail = { + name: "", + id: "", + coe: "", + image_id: "", + public: "", + registry_enabled: "", + tls_disabled: "", + apiserver_port: "" + }; + + $scope.changeClusterTemplate = function(){ + angular.forEach(ctrl.cluster_templates, function(model, idx){ + if($scope.model.newClusterSpec.baymodel_id === model.id){ + $scope.cluster_template_detail.name = model.name; + $scope.cluster_template_detail.id = model.id; + $scope.cluster_template_detail.coe = model.coe; + $scope.cluster_template_detail.image_id = model.image_id; + $scope.cluster_template_detail.public = model.public; + $scope.cluster_template_detail.registry_enabled = model.registry_enabled; + $scope.cluster_template_detail.tls_disabled = model.tls_disabled; + $scope.cluster_template_detail.apiserver_port = model.apiserver_port; + } + }); + }; + + init(); + + function init() { + magnum.getClusterTemplates({paginate: false}).success(onGetClusterTemplates); + } + + function onGetClusterTemplates(response) { + Array.prototype.push.apply(ctrl.cluster_templates, response.items); + if($scope.selected instanceof Object){ + $scope.model.newClusterSpec.baymodel_id = $scope.selected.id; + $scope.changeClusterTemplate(); + } + } + + } + +})(); diff --git a/magnum_ui/static/dashboard/container-infra/clusters/create/info/info.help.html b/magnum_ui/static/dashboard/container-infra/clusters/create/info/info.help.html new file mode 100644 index 00000000..e3490a3a --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/clusters/create/info/info.help.html @@ -0,0 +1 @@ +

Specify cluster name and choose cluster template

diff --git a/magnum_ui/static/dashboard/container-infra/clusters/create/info/info.html b/magnum_ui/static/dashboard/container-infra/clusters/create/info/info.html new file mode 100644 index 00000000..ed5b44ae --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/clusters/create/info/info.html @@ -0,0 +1,50 @@ +
+
+
+ +
+ + +
+ +
+ + +
+ +
+ Cluster Template Detail +
+
Name
+
+ {$ cluster_template_detail.name|noName $} +
+
ID
+
{$ cluster_template_detail.id $}
+
COE
+
{$ cluster_template_detail.coe $}
+
Image ID
+
{$ cluster_template_detail.image_id $}
+
Public
+
{$ cluster_template_detail.public $}
+
Registry Enabled
+
{$ cluster_template_detail.registry_enabled $}
+
TLS Disabled
+
{$ cluster_template_detail.tls_disabled $}
+
API Server Port
+
{$ cluster_template_detail.apiserver_port $}
+
+
+
+
+
diff --git a/magnum_ui/static/dashboard/container-infra/bays/create/misc/bay.misc.controller.js b/magnum_ui/static/dashboard/container-infra/clusters/create/misc/cluster.misc.controller.js similarity index 70% rename from magnum_ui/static/dashboard/container-infra/bays/create/misc/bay.misc.controller.js rename to magnum_ui/static/dashboard/container-infra/clusters/create/misc/cluster.misc.controller.js index ef86e3f4..4ea70c52 100644 --- a/magnum_ui/static/dashboard/container-infra/bays/create/misc/bay.misc.controller.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/create/misc/cluster.misc.controller.js @@ -19,23 +19,23 @@ /** * @ngdoc controller - * @name createBayMiscController + * @name createClusterMiscController * @ngController * * @description - * Controller for the container-infra bay misc step in create workflow + * Controller for the container-infra cluster misc step in create workflow */ angular - .module('horizon.dashboard.container-infra.bays') - .controller('createBayMiscController', createBayMiscController); + .module('horizon.dashboard.container-infra.clusters') + .controller('createClusterMiscController', createClusterMiscController); - createBayMiscController.$inject = [ + createClusterMiscController.$inject = [ '$scope', 'horizon.dashboard.container-infra.basePath', 'horizon.app.core.openstack-service-api.magnum' ]; - function createBayMiscController($scope, basePath, magnum) { + function createClusterMiscController($scope, basePath, magnum) { var ctrl = this; } diff --git a/magnum_ui/static/dashboard/container-infra/clusters/create/misc/misc.help.html b/magnum_ui/static/dashboard/container-infra/clusters/create/misc/misc.help.html new file mode 100644 index 00000000..c3d0339b --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/clusters/create/misc/misc.help.html @@ -0,0 +1 @@ +

Specify conditions for cluster creation.

diff --git a/magnum_ui/static/dashboard/container-infra/clusters/create/misc/misc.html b/magnum_ui/static/dashboard/container-infra/clusters/create/misc/misc.html new file mode 100644 index 00000000..0f88e8f8 --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/clusters/create/misc/misc.html @@ -0,0 +1,17 @@ +
+
+
+
+ + +
+
+ + +
+
+
diff --git a/magnum_ui/static/dashboard/container-infra/bays/create/size/bay.size.controller.js b/magnum_ui/static/dashboard/container-infra/clusters/create/size/cluster.size.controller.js similarity index 70% rename from magnum_ui/static/dashboard/container-infra/bays/create/size/bay.size.controller.js rename to magnum_ui/static/dashboard/container-infra/clusters/create/size/cluster.size.controller.js index 841e850b..baf431d3 100644 --- a/magnum_ui/static/dashboard/container-infra/bays/create/size/bay.size.controller.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/create/size/cluster.size.controller.js @@ -19,23 +19,23 @@ /** * @ngdoc controller - * @name createBaySizeController + * @name createClusterSizeController * @ngController * * @description - * Controller for the container-infra bay size step in create workflow + * Controller for the container-infra cluster size step in create workflow */ angular - .module('horizon.dashboard.container-infra.bays') - .controller('createBaySizeController', createBaySizeController); + .module('horizon.dashboard.container-infra.clusters') + .controller('createClusterSizeController', createClusterSizeController); - createBaySizeController.$inject = [ + createClusterSizeController.$inject = [ '$scope', 'horizon.dashboard.container-infra.basePath', 'horizon.app.core.openstack-service-api.magnum' ]; - function createBaySizeController($scope, basePath, magnum) { + function createClusterSizeController($scope, basePath, magnum) { var ctrl = this; } diff --git a/magnum_ui/static/dashboard/container-infra/clusters/create/size/size.help.html b/magnum_ui/static/dashboard/container-infra/clusters/create/size/size.help.html new file mode 100644 index 00000000..469dd23e --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/clusters/create/size/size.help.html @@ -0,0 +1 @@ +

Specify the number of master nodes and cluster nodes for the cluster.

diff --git a/magnum_ui/static/dashboard/container-infra/clusters/create/size/size.html b/magnum_ui/static/dashboard/container-infra/clusters/create/size/size.html new file mode 100644 index 00000000..26262ad7 --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/clusters/create/size/size.html @@ -0,0 +1,20 @@ +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
diff --git a/magnum_ui/static/dashboard/container-infra/bays/delete/delete.service.js b/magnum_ui/static/dashboard/container-infra/clusters/delete/delete.service.js similarity index 78% rename from magnum_ui/static/dashboard/container-infra/bays/delete/delete.service.js rename to magnum_ui/static/dashboard/container-infra/clusters/delete/delete.service.js index 65275244..3aaaedad 100644 --- a/magnum_ui/static/dashboard/container-infra/bays/delete/delete.service.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/delete/delete.service.js @@ -16,8 +16,8 @@ 'use strict'; angular - .module('horizon.dashboard.container-infra.bays') - .factory('horizon.dashboard.container-infra.bays.delete.service', deleteService); + .module('horizon.dashboard.container-infra.clusters') + .factory('horizon.dashboard.container-infra.clusters.delete.service', deleteService); deleteService.$inject = [ '$location', @@ -29,16 +29,16 @@ 'horizon.framework.util.q.extensions', 'horizon.framework.widgets.modal.deleteModalService', 'horizon.framework.widgets.toast.service', - 'horizon.dashboard.container-infra.bays.resourceType', - 'horizon.dashboard.container-infra.bays.events' + 'horizon.dashboard.container-infra.clusters.resourceType', + 'horizon.dashboard.container-infra.clusters.events' ]; /** * @ngDoc factory - * @name horizon.dashboard.container-infra.bays.delete.service + * @name horizon.dashboard.container-infra.clusters.delete.service * * @Description - * Brings up the delete bays confirmation modal dialog. + * Brings up the delete clusters confirmation modal dialog. * On submit, delete selected resources. * On cancel, do nothing. */ @@ -56,7 +56,7 @@ allowed: allowed, perform: perform }; - var notAllowedMessage = gettext("You are not allowed to delete bays: %s"); + var notAllowedMessage = gettext("You are not allowed to delete clusters: %s"); return service; @@ -81,18 +81,18 @@ function labelize(count){ return { - title: ngettext('Confirm Delete Bay', - 'Confirm Delete Bays', count), + title: ngettext('Confirm Delete Cluster', + 'Confirm Delete Clusters', count), /* eslint-disable max-len */ - message: ngettext('You have selected "%s". Please confirm your selection. Deleted bay is not recoverable.', - 'You have selected "%s". Please confirm your selection. Deleted bays are not recoverable.', count), + message: ngettext('You have selected "%s". Please confirm your selection. Deleted cluster is not recoverable.', + 'You have selected "%s". Please confirm your selection. Deleted clusters are not recoverable.', count), /* eslint-enable max-len */ - submit: ngettext('Delete Bay', - 'Delete Bays', count), - success: ngettext('Deleted Bay: %s.', - 'Deleted Bays: %s.', count), - error: ngettext('Unable to delete Bay: %s.', - 'Unable to delete Bays: %s.', count) + submit: ngettext('Delete Cluster', + 'Delete Clusters', count), + success: ngettext('Deleted cluster: %s.', + 'Deleted clusters: %s.', count), + error: ngettext('Unable to delete cluster: %s.', + 'Unable to delete clusters: %s.', count) }; } @@ -125,7 +125,7 @@ result.failed(resourceType, getEntity(item).id); }); if(result.result.failed.length == 0 && result.result.deleted.length > 0){ - $location.path("/project/bays"); + $location.path("/project/clusters"); }else{ return result.result; } @@ -146,7 +146,7 @@ // call delete REST API function deleteEntity(id){ - return magnum.deleteBay(id, true); + return magnum.deleteCluster(id, true); } } })(); diff --git a/magnum_ui/static/dashboard/container-infra/bays/details/details.module.js b/magnum_ui/static/dashboard/container-infra/clusters/details/details.module.js similarity index 70% rename from magnum_ui/static/dashboard/container-infra/bays/details/details.module.js rename to magnum_ui/static/dashboard/container-infra/clusters/details/details.module.js index 827b0ac0..4f65bf00 100644 --- a/magnum_ui/static/dashboard/container-infra/bays/details/details.module.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/details/details.module.js @@ -17,23 +17,23 @@ /** * @ngdoc overview - * @ngname horizon.dashboard.container-infra.bays.details + * @ngname horizon.dashboard.container-infra.clusters.details * * @description - * Provides details features for bays. + * Provides details features for clusters. */ - angular.module('horizon.dashboard.container-infra.bays.details', + angular.module('horizon.dashboard.container-infra.clusters.details', ['horizon.framework.conf', 'horizon.app.core']) - .run(registerBayDetails); + .run(registerClusterDetails); - registerBayDetails.$inject = [ - 'horizon.dashboard.container-infra.bays.basePath', - 'horizon.dashboard.container-infra.bays.resourceType', + registerClusterDetails.$inject = [ + 'horizon.dashboard.container-infra.clusters.basePath', + 'horizon.dashboard.container-infra.clusters.resourceType', 'horizon.app.core.openstack-service-api.magnum', 'horizon.framework.conf.resource-type-registry.service' ]; - function registerBayDetails( + function registerClusterDetails( basePath, resourceType, magnum, @@ -42,13 +42,13 @@ registry.getResourceType(resourceType) .setLoadFunction(loadFunction) .detailsViews.append({ - id: 'bayDetailsOverview', + id: 'clusterDetailsOverview', name: gettext('Overview'), template: basePath + 'details/overview.html' }); function loadFunction(identifier) { - return magnum.getBay(identifier); + return magnum.getCluster(identifier); } } diff --git a/magnum_ui/static/dashboard/container-infra/bays/details/drawer.controller.js b/magnum_ui/static/dashboard/container-infra/clusters/details/drawer.controller.js similarity index 72% rename from magnum_ui/static/dashboard/container-infra/bays/details/drawer.controller.js rename to magnum_ui/static/dashboard/container-infra/clusters/details/drawer.controller.js index e589f69d..666073b1 100644 --- a/magnum_ui/static/dashboard/container-infra/bays/details/drawer.controller.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/details/drawer.controller.js @@ -17,19 +17,19 @@ /** * @ngdoc controller - * @name horizon.dashboard.container-infra.bays.DrawerController + * @name horizon.dashboard.container-infra.clusters.DrawerController * @description - * This is the controller for the bay drawer (summary) view. + * This is the controller for the cluster drawer (summary) view. * Its primary purpose is to provide the metadata definitions to * the template via the ctrl.metadataDefs member. */ angular - .module('horizon.dashboard.container-infra.bays') - .controller('horizon.dashboard.container-infra.bays.DrawerController', controller); + .module('horizon.dashboard.container-infra.clusters') + .controller('horizon.dashboard.container-infra.clusters.DrawerController', controller); controller.$inject = [ 'horizon.app.core.openstack-service-api.magnum', - 'horizon.dashboard.container-infra.bays.resourceType' + 'horizon.dashboard.container-infra.clusters.resourceType' ]; function controller(magnum, resourceType) { diff --git a/magnum_ui/static/dashboard/container-infra/bays/details/drawer.html b/magnum_ui/static/dashboard/container-infra/clusters/details/drawer.html similarity index 70% rename from magnum_ui/static/dashboard/container-infra/bays/details/drawer.html rename to magnum_ui/static/dashboard/container-infra/clusters/details/drawer.html index 2f71eeba..4d11c2ba 100644 --- a/magnum_ui/static/dashboard/container-infra/bays/details/drawer.html +++ b/magnum_ui/static/dashboard/container-infra/clusters/details/drawer.html @@ -1,4 +1,4 @@ -
+
@@ -17,8 +17,8 @@
-
Baymodel
-
{$ item.baymodel_id $}
+
Cluster Template
+
{$ item.baymodel_id $}
Node Addresses
diff --git a/magnum_ui/static/dashboard/container-infra/bays/details/overview.controller.js b/magnum_ui/static/dashboard/container-infra/clusters/details/overview.controller.js similarity index 55% rename from magnum_ui/static/dashboard/container-infra/bays/details/overview.controller.js rename to magnum_ui/static/dashboard/container-infra/clusters/details/overview.controller.js index aa47ed34..59bbbaf5 100644 --- a/magnum_ui/static/dashboard/container-infra/bays/details/overview.controller.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/details/overview.controller.js @@ -15,18 +15,18 @@ "use strict"; angular - .module('horizon.dashboard.container-infra.bays') - .controller('BayOverviewController', BayOverviewController); + .module('horizon.dashboard.container-infra.clusters') + .controller('ClusterOverviewController', ClusterOverviewController); - BayOverviewController.$inject = [ + ClusterOverviewController.$inject = [ '$scope', 'horizon.app.core.openstack-service-api.magnum', - 'horizon.dashboard.container-infra.bays.resourceType', - 'horizon.dashboard.container-infra.bays.events', + 'horizon.dashboard.container-infra.clusters.resourceType', + 'horizon.dashboard.container-infra.clusters.events', 'horizon.framework.conf.resource-type-registry.service' ]; - function BayOverviewController( + function ClusterOverviewController( $scope, magnum, resourceType, @@ -34,18 +34,18 @@ registry ) { var ctrl = this; - ctrl.bay = {}; - ctrl.baymodel = {}; + ctrl.cluster = {}; + ctrl.cluster_template = {}; - $scope.context.loadPromise.then(onGetBay); + $scope.context.loadPromise.then(onGetCluster); - function onGetBay(bay) { - ctrl.bay = bay.data; - magnum.getBaymodel(ctrl.bay.baymodel_id).success(onGetBaymodel); + function onGetCluster(cluster) { + ctrl.cluster = cluster.data; + magnum.getClusterTemplate(ctrl.cluster.baymodel_id).success(onGetClusterTemplate); } - function onGetBaymodel(baymodel) { - ctrl.baymodel = baymodel; + function onGetClusterTemplate(cluster_template) { + ctrl.cluster_template = cluster_template; } } })(); diff --git a/magnum_ui/static/dashboard/container-infra/clusters/details/overview.html b/magnum_ui/static/dashboard/container-infra/clusters/details/overview.html new file mode 100644 index 00000000..c46ec7ee --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/clusters/details/overview.html @@ -0,0 +1,77 @@ +
+
+
+

Cluster Template

+
+
+
Name
+
{$ ctrl.cluster_template.name|noName $}
+
ID
+
{$ ctrl.cluster_template.id $}
+
COE
+
{$ ctrl.cluster_template.coe $}
+
Image ID
+
{$ ctrl.cluster_template.image_id $}
+
+
+
+

Nodes

+
+
+
Master Count
+
{$ ctrl.cluster.master_count $}
+
Node Count
+
{$ ctrl.cluster.node_count $}
+
API Address
+
{$ ctrl.cluster.api_address $}
+
Master Addresses
+
+
{$ addr $}
+
+
Node Addresses
+
+
{$ addr $}
+
+
+
+
+
+
+

Miscellaneous

+
+
+
Stack ID
+
+ {$ ctrl.cluster.stack_id $} +
+
Discovery URL
+
{$ ctrl.cluster.discovery_url $}
+
Cluster Create Timeout
+
+
+
Infinite
+
+ {$ ctrl.cluster.bay_create_timeout $} minute +
+
+
+
+
+
+

Record Properties

+
+
+
Created
+
{$ ctrl.cluster.created_at | date:'short' $}
+
Updated
+
{$ ctrl.cluster.updated_at | date:'short' $}
+
ID
+
{$ ctrl.cluster.id $}
+
Status
+
{$ ctrl.cluster.status $}
+
+
+
+
diff --git a/magnum_ui/static/dashboard/container-infra/clusters/panel.html b/magnum_ui/static/dashboard/container-infra/clusters/panel.html new file mode 100644 index 00000000..8c69df14 --- /dev/null +++ b/magnum_ui/static/dashboard/container-infra/clusters/panel.html @@ -0,0 +1,4 @@ + + + diff --git a/magnum_ui/static/dashboard/container-infra/container-infra.module.js b/magnum_ui/static/dashboard/container-infra/container-infra.module.js index bd64f5a4..f18dd5b5 100644 --- a/magnum_ui/static/dashboard/container-infra/container-infra.module.js +++ b/magnum_ui/static/dashboard/container-infra/container-infra.module.js @@ -26,8 +26,8 @@ */ angular .module('horizon.dashboard.container-infra', [ - 'horizon.dashboard.container-infra.bays', - 'horizon.dashboard.container-infra.baymodels', + 'horizon.dashboard.container-infra.clusters', + 'horizon.dashboard.container-infra.cluster-templates', 'ngRoute' ]) .config(config) diff --git a/magnum_ui/static/dashboard/container-infra/container-infra.scss b/magnum_ui/static/dashboard/container-infra/container-infra.scss index 0ab5596e..be919636 100644 --- a/magnum_ui/static/dashboard/container-infra/container-infra.scss +++ b/magnum_ui/static/dashboard/container-infra/container-infra.scss @@ -1,5 +1,5 @@ -@import "baymodels/baymodels"; -@import "bays/bays"; +@import "cluster-templates/cluster-templates"; +@import "clusters/clusters"; .batch-action { float: right; diff --git a/magnum_ui/static/dashboard/container-infra/magnum.service.js b/magnum_ui/static/dashboard/container-infra/magnum.service.js index 600bae47..69865e1f 100644 --- a/magnum_ui/static/dashboard/container-infra/magnum.service.js +++ b/magnum_ui/static/dashboard/container-infra/magnum.service.js @@ -28,99 +28,99 @@ function MagnumAPI(apiService, toastService, gettext) { var service = { - createBay: createBay, - getBay: getBay, - getBays: getBays, - deleteBay: deleteBay, - deleteBays: deleteBays, - createBaymodel: createBaymodel, - getBaymodel: getBaymodel, - getBaymodels: getBaymodels, - deleteBaymodel: deleteBaymodel, - deleteBaymodels: deleteBaymodels, + createCluster: createCluster, + getCluster: getCluster, + getClusters: getClusters, + deleteCluster: deleteCluster, + deleteClusters: deleteClusters, + createClusterTemplate: createClusterTemplate, + getClusterTemplate: getClusterTemplate, + getClusterTemplates: getClusterTemplates, + deleteClusterTemplate: deleteClusterTemplate, + deleteClusterTemplates: deleteClusterTemplates, }; return service; ////////// - // Bays // + // Clusters // ////////// - function createBay(params) { - return apiService.post('/api/container-infra/bays/', params) + function createCluster(params) { + return apiService.post('/api/container_infra/clusters/', params) .error(function() { - toastService.add('error', gettext('Unable to create Bay.')); + toastService.add('error', gettext('Unable to create cluster.')); }); } - function getBay(id) { - return apiService.get('/api/container-infra/bays/' + id) + function getCluster(id) { + return apiService.get('/api/container_infra/clusters/' + id) .error(function() { - toastService.add('error', gettext('Unable to retrieve the Bay.')); + toastService.add('error', gettext('Unable to retrieve the cluster.')); }); } - function getBays() { - return apiService.get('/api/container-infra/bays/') + function getClusters() { + return apiService.get('/api/container_infra/clusters/') .error(function() { - toastService.add('error', gettext('Unable to retrieve the Bays.')); + toastService.add('error', gettext('Unable to retrieve the clusters.')); }); } - function deleteBay(id, suppressError) { - var promise = apiService.delete('/api/container-infra/bays/', [id]); + function deleteCluster(id, suppressError) { + var promise = apiService.delete('/api/container_infra/clusters/', [id]); return suppressError ? promise : promise.error(function() { - var msg = gettext('Unable to delete the Bay with id: %(id)s'); + var msg = gettext('Unable to delete the cluster with id: %(id)s'); toastService.add('error', interpolate(msg, { id: id }, true)); }); } // FIXME(shu-mutou): Unused for batch-delete in Horizon framework in Feb, 2016. - function deleteBays(ids) { - return apiService.delete('/api/container-infra/bays/', ids) + function deleteClusters(ids) { + return apiService.delete('/api/container_infra/clusters/', ids) .error(function() { - toastService.add('error', gettext('Unable to delete the Bays.')); + toastService.add('error', gettext('Unable to delete the clusters.')); }); } /////////////// - // Baymodels // + // ClusterTemplates // /////////////// - function createBaymodel(params) { - return apiService.post('/api/container-infra/baymodels/', params) + function createClusterTemplate(params) { + return apiService.post('/api/container_infra/cluster_templates/', params) .error(function() { - toastService.add('error', gettext('Unable to create Baymodel')); + toastService.add('error', gettext('Unable to create cluster template')); }); } - function getBaymodel(id) { - return apiService.get('/api/container-infra/baymodels/' + id) + function getClusterTemplate(id) { + return apiService.get('/api/container_infra/cluster_templates/' + id) .error(function() { - toastService.add('error', gettext('Unable to retrieve the Baymodel.')); + toastService.add('error', gettext('Unable to retrieve the cluster template.')); }); } - function getBaymodels() { - return apiService.get('/api/container-infra/baymodels/') + function getClusterTemplates() { + return apiService.get('/api/container_infra/cluster_templates/') .error(function() { - toastService.add('error', gettext('Unable to retrieve the Baymodels.')); + toastService.add('error', gettext('Unable to retrieve the cluster templates.')); }); } - function deleteBaymodel(id, suppressError) { - var promise = apiService.delete('/api/container-infra/baymodels/', [id]); + function deleteClusterTemplate(id, suppressError) { + var promise = apiService.delete('/api/container_infra/cluster_templates/', [id]); return suppressError ? promise : promise.error(function() { - var msg = gettext('Unable to delete the Baymodel with id: %(id)s'); + var msg = gettext('Unable to delete the cluster template with id: %(id)s'); toastService.add('error', interpolate(msg, { id: id }, true)); }); } // FIXME(shu-mutou): Unused for batch-delete in Horizon framework in Feb, 2016. - function deleteBaymodels(ids) { - return apiService.delete('/api/container-infra/baymodels/', ids) + function deleteClusterTemplates(ids) { + return apiService.delete('/api/container_infra/cluster_templates/', ids) .error(function() { - toastService.add('error', gettext('Unable to delete the Baymodels.')); + toastService.add('error', gettext('Unable to delete the cluster templates.')); }) } } diff --git a/magnum_ui/test/api_tests/rest_api_tests.py b/magnum_ui/test/api_tests/rest_api_tests.py index 5f83a4e2..e42fc8e0 100644 --- a/magnum_ui/test/api_tests/rest_api_tests.py +++ b/magnum_ui/test/api_tests/rest_api_tests.py @@ -25,81 +25,83 @@ TEST = TestData(test_data.data) class MagnumRestTestCase(test.TestCase): - # Baymodels + # Cluster Templates @mock.patch.object(magnum, 'magnum') - def test_baymodel_get(self, client): + def test_cluster_template_get(self, client): request = self.mock_rest_request() - client.baymodel_list.return_value = \ - mock_resource(TEST.baymodels.list()) - response = magnum.Baymodels().get(request) + client.cluster_template_list.return_value = \ + mock_resource(TEST.cluster_templates.list()) + response = magnum.ClusterTemplates().get(request) self.assertStatusCode(response, 200) - self.assertItemsCollectionEqual(response, TEST.baymodels.list()) - client.baymodel_list.assert_called_once_with(request) + self.assertItemsCollectionEqual(response, + TEST.cluster_templates.list()) + client.cluster_template_list.assert_called_once_with(request) @mock.patch.object(magnum, 'magnum') - def test_baymodel_create(self, client): - test_baymodels = mock_resource(TEST.baymodels.list()) - test_bmodel = test_baymodels[0] - test_body = json.dumps(test_bmodel.to_dict()) + def test_cluster_template_create(self, client): + test_cluster_templates = mock_resource(TEST.cluster_templates.list()) + test_cluster_template = test_cluster_templates[0] + test_body = json.dumps(test_cluster_template.to_dict()) request = self.mock_rest_request(body=test_body) - client.baymodel_create.return_value = test_bmodel - response = magnum.Baymodels().post(request) + client.cluster_template_create.return_value = test_cluster_template + response = magnum.ClusterTemplates().post(request) + url = '/api/container_infra/cluster_template/%s' % \ + test_cluster_template.uuid self.assertStatusCode(response, 201) - self.assertEqual(response['location'], - '/api/container-infra/baymodel/%s' % test_bmodel.uuid) - client.baymodel_create.assert_called_once_with(request, - **test_bmodel.to_dict()) + self.assertEqual(response['location'], url) + client.cluster_template_create.assert_called_once_with( + request, **test_cluster_template.to_dict()) @mock.patch.object(magnum, 'magnum') - def test_baymodel_delete(self, client): - test_baymodel = TEST.baymodels.first() + def test_cluster_template_delete(self, client): + test_cluster_template = TEST.cluster_templates.first() request = self.mock_rest_request( - body='{"baymodel_id":' + str(test_baymodel['uuid']) + '}') - response = magnum.Baymodels().delete(request) + body='{"baymodel_id":' + str(test_cluster_template['uuid']) + '}') + response = magnum.ClusterTemplates().delete(request) self.assertStatusCode(response, 204) - client.baymodel_delete.assert_called_once_with( + client.cluster_template_delete.assert_called_once_with( request, u'baymodel_id') - # Bays + # Clusters @mock.patch.object(magnum, 'magnum') - def test_bay_get(self, client): + def test_cluster_get(self, client): request = self.mock_rest_request() - client.bay_list.return_value = \ - mock_resource(TEST.bays.list()) - response = magnum.Bays().get(request) + client.cluster_list.return_value = \ + mock_resource(TEST.clusters.list()) + response = magnum.Clusters().get(request) self.assertStatusCode(response, 200) - self.assertItemsCollectionEqual(response, TEST.bays.list()) - client.bay_list.assert_called_once_with(request) + self.assertItemsCollectionEqual(response, TEST.clusters.list()) + client.cluster_list.assert_called_once_with(request) @mock.patch.object(magnum, 'magnum') - def test_bay_create(self, client): - test_bays = mock_resource(TEST.bays.list()) - test_bay = test_bays[0] - test_body = json.dumps(test_bay.to_dict()) + def test_cluster_create(self, client): + test_clusters = mock_resource(TEST.clusters.list()) + test_cluster = test_clusters[0] + test_body = json.dumps(test_cluster.to_dict()) request = self.mock_rest_request(body=test_body) - client.bay_create.return_value = test_bay - response = magnum.Bays().post(request) + client.cluster_create.return_value = test_cluster + response = magnum.Clusters().post(request) + url = '/api/container_infra/cluster/%s' % test_cluster.uuid self.assertStatusCode(response, 201) - self.assertEqual(response['location'], - '/api/container-infra/bay/%s' % test_bay.uuid) - client.bay_create.assert_called_once_with(request, - **test_bay.to_dict()) + self.assertEqual(response['location'], url) + client.cluster_create.assert_called_once_with(request, + **test_cluster.to_dict()) @mock.patch.object(magnum, 'magnum') - def test_bay_delete(self, client): - test_bay = TEST.bays.first() + def test_cluster_delete(self, client): + test_cluster = TEST.clusters.first() request = self.mock_rest_request( - body='{"bay_id":' + str(test_bay['uuid']) + '}') - response = magnum.Bays().delete(request) + body='{"bay_id":' + str(test_cluster['uuid']) + '}') + response = magnum.Clusters().delete(request) self.assertStatusCode(response, 204) - client.bay_delete.assert_called_once_with( + client.cluster_delete.assert_called_once_with( request, u'bay_id') diff --git a/magnum_ui/test/test_data.py b/magnum_ui/test/test_data.py index 67d8f1b6..7ed94072 100644 --- a/magnum_ui/test/test_data.py +++ b/magnum_ui/test/test_data.py @@ -17,37 +17,37 @@ from openstack_dashboard.test.test_data import utils def data(TEST): # Test Data Container in Horizon - TEST.baymodels = utils.TestDataContainer() - TEST.bays = utils.TestDataContainer() + TEST.cluster_templates = utils.TestDataContainer() + TEST.clusters = utils.TestDataContainer() - # Bay Models - baymodel_dict_1 = {"uuid": 1, - "name": "kindofabigdeal", - "image-id": "", - "keypair-id": "", - "external-network-id": "", - "coe": "", - "fixed-network": "", - "dns-nameserver": "", - "flavor-id": "", - "master-flavor-id": "", - "docker-volume-size": "", - "http-proxy": "", - "https-proxy": "", - "no-proxy": "", - "labels": "", - "tls-disabled": "", - "public": ""} + # Cluster Templates + cluster_template_dict_1 = {"uuid": 1, + "name": "kindofabigdeal", + "image-id": "", + "keypair-id": "", + "external-network-id": "", + "coe": "", + "fixed-network": "", + "dns-nameserver": "", + "flavor-id": "", + "master-flavor-id": "", + "docker-volume-size": "", + "http-proxy": "", + "https-proxy": "", + "no-proxy": "", + "labels": "", + "tls-disabled": "", + "public": ""} - TEST.baymodels.add(baymodel_dict_1) + TEST.cluster_templates.add(cluster_template_dict_1) - # Bays - bay_dict_1 = {"uuid": 1, - "name": "peopleknowme", - "baymodel": baymodel_dict_1["uuid"], - "node-count": "", - "master-count": "", - "discovery-url": "", - "timeout": 0} + # Clusters + cluster_dict_1 = {"uuid": 1, + "name": "peopleknowme", + "baymodel": cluster_template_dict_1["uuid"], + "node-count": "", + "master-count": "", + "discovery-url": "", + "timeout": 0} - TEST.bays.add(bay_dict_1) + TEST.clusters.add(cluster_dict_1)