diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index 025b86f..0000000
--- a/.editorconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-root = true
-
-[*]
-end_of_line = lf
-insert_final_newline = true
-charset = utf-8
-indent_style = space
-indent_size = 2
-trim_trailing_whitespace = true
-
-[*.md]
-trim_trailing_whitespace = false
diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index d1b12fe..0000000
--- a/.eslintignore
+++ /dev/null
@@ -1,5 +0,0 @@
-cover
-www
-bower_components
-node_modules
-dist
diff --git a/.eslintrc b/.eslintrc
deleted file mode 100644
index 69bd3b9..0000000
--- a/.eslintrc
+++ /dev/null
@@ -1,23 +0,0 @@
-# Enable eslint-plugin-angular
-plugins:
- - angular
-
-extends: openstack
-
-# Set up globals
-globals:
- angular: false
- module: false
-
-env:
- browser: true
- jasmine: true
-
-rules:
- angular/no-private-call: 0
- angular/no-services:
- - 2
- - - $http
- - $resource
- - Restangular
- angular/no-service-method: 0
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index a4722ac..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,14 +0,0 @@
-*.iml
-.idea
-bower_components/
-node_modules/
-cover/
-npm-debug.log
-www/
-.publish/
-*.tar.gz
-*.tgz
-dist
-
-# Operating system specific files
-.DS_Store # OSX Folder Caches
diff --git a/.gitreview b/.gitreview
deleted file mode 100644
index 65a0394..0000000
--- a/.gitreview
+++ /dev/null
@@ -1,4 +0,0 @@
-[gerrit]
-host=review.openstack.org
-port=29418
-project=openstack/ironic-webclient.git
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index e06d208..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- 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.
-
diff --git a/README b/README
new file mode 100644
index 0000000..d98af48
--- /dev/null
+++ b/README
@@ -0,0 +1,10 @@
+This project is no longer maintained.
+
+The contents of this repository are still available in the Git
+source code management system. To see the contents of this
+repository before it reached its end of life, please check out the
+previous commit with "git checkout HEAD^1".
+
+For any further questions, please email
+openstack-dev@lists.openstack.org or join #openstack-dev on
+Freenode.
diff --git a/README.md b/README.md
deleted file mode 100644
index fafc952..0000000
--- a/README.md
+++ /dev/null
@@ -1,115 +0,0 @@
-# ironic-webclient
-
-A webclient for OpenStack Ironic.
-
-
-## Important Things
-
-It is imperative that the design and infrastructure of this project makes it
-easy to package for various linux distributions. As such, the following
-decisions have been made:
-
-
-##### The project must be fully functional directly from source.
-
- * ECMAScript 5 only, no transpiled languages such as TypeScript or
- CoffeeScript.
- * All javascript libraries used at runtime (in the browser) must be committed
- to source.
-
-Note that we do not guarantee performance if running in this mode. Certain
-things, such as in-browser CSS compilation will severely degrade the
-performance of this application.
-
-
-##### The project must be easy to develop on.
-
- * We use common javascript tooling to assist in development (npm, gulp,
- eslint, bower, etc).
- * These tools are supportive, but not required, as such they are considered to
- be environmental, and thus not committed to source.
-
-
-##### The project must be compatible with the OpenStack License.
-
- * All runtime dependencies and development tools must use licenses compatible
- with the Apache2.0 license.
-
-
-## Installation
-
-You will need Node.JS and NPM installed on the target system. For Fedora and/or
-CentOS systemd you can install these as follows:
-
-```
-$ yum install -y nodejs npm #dnf on Fedora
-```
-
-and on Debian/Ubuntu with:
-
-```
-$ apt-get install nodejs nodejs-legacy npm
-```
-
-To install the webclient you have to check out the code and install the
-dependencies. This can be done as follows:
-
-```
-$ git clone https://github.com/openstack/ironic-webclient.git
-$ cd ironic-webclient
-$ npm install
-```
-
-
-### Enable CORS
-
-To be able to access the Ironic API, you have to enable CORS. A description for
-this can be found in the chapter [Cross-origin resource sharing](http://docs.openstack.org/admin-guide/cross_project_cors.html)
-of the OpenStack Administrator's Guide.
-
-
-### Hosting
-
-After installing the dependencies and enabling CORS, you have two options of
-running the web application; using the development server or hosted using
-a webserver.
-
-
-#### Development Server
-
-The webclient offers a built-in webserver option for development purpose. It is
-not recommended to use this in production use. You can start this server with:
-
-```
-$ npm start
-```
-
-Which will start the server on [localhost, port 8000](http://localhost:8000).
-
-If you want to run on a different port or IP, you can specify this from the
-command line as follows:
-
-```
-IP=0.0.0.0 PORT=8080 npm start
-```
-
-
-#### Webserver
-
-For production use, it is recommended to use a webserver. After running
-
-```
-$ npm pack
-```
-
-you will have a package which will contain all assets needed for hosting the
-application.
-
-
-## Other options
-
- * Package the site.
-
-```
-npm pack
-```
diff --git a/app/css/bootstrap.scss b/app/css/bootstrap.scss
deleted file mode 100644
index 15ec3d9..0000000
--- a/app/css/bootstrap.scss
+++ /dev/null
@@ -1,88 +0,0 @@
-@import "./bootstrap_variables";
-@import "../../bower_components/bootstrap-sass/assets/stylesheets/bootstrap";
-@import "./bootstrap_mixins";
-
-
-.pull-right-bottom {
- position: absolute;
- right: $grid-gutter-width / 2;
- bottom: $padding-base-horizontal;
-}
-
-// Navbar form that respects the column-grid
-.navbar-form-grid {
- margin-left: -$navbar-padding-horizontal;
- margin-right: -$navbar-padding-horizontal;
- padding: 8px $navbar-padding-horizontal;
- border-top: 1px solid transparent;
- border-bottom: 1px solid transparent;
- $shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);
- @include box-shadow($shadow);
-}
-
-/**
- * Button default should have button primary active state.
- */
-.btn-default {
- &.active, &.active:active, &.active:focus, &.active:hover {
- background-color: $brand-primary;
- color: $btn-primary-color;
- border-color: $btn-primary-border;
- }
-}
-
-/**
- * Custom button gradient styles.
- */
-.btn-default-gradient {
- @include button-gradient-variant($btn-default-color, $btn-default-bg, $btn-default-border);
-}
-.btn-primary-gradient {
- @include button-gradient-variant($btn-primary-color, $btn-primary-bg, $btn-primary-border);
-}
-// Success appears as green
-.btn-success-gradient {
- @include button-gradient-variant($btn-success-color, $btn-success-bg, $btn-success-border);
-}
-// Info appears as blue-green
-.btn-info-gradient {
- @include button-gradient-variant($btn-info-color, $btn-info-bg, $btn-info-border);
-}
-// Warning appears as orange
-.btn-warning-gradient {
- @include button-gradient-variant($btn-warning-color, $btn-warning-bg, $btn-warning-border);
-}
-// Danger and error appear as red
-.btn-danger-gradient {
- @include button-gradient-variant($btn-danger-color, $btn-danger-bg, $btn-danger-border);
-}
-
-/**
- * Additional spacer styles for vertical padding
- */
-.row {
- &.padding-top {
- padding-top: $padding-large-vertical;
- }
-}
-
-/**
- * Additional table styles
- */
-table.table {
- th {
- background-color: $gray-lighter;
-
- white-space: nowrap;
- }
-}
-
-/**
- * Form controls inside of table columns.
- */
-table th .form-control {
- display: inline-block;
- width: auto;
- padding: $padding-xs-vertical $padding-xs-horizontal;
- height: auto;
-}
diff --git a/app/css/bootstrap_mixins.scss b/app/css/bootstrap_mixins.scss
deleted file mode 100644
index 55702fe..0000000
--- a/app/css/bootstrap_mixins.scss
+++ /dev/null
@@ -1,43 +0,0 @@
-// Button variants
-//
-// Easily pump out default styles, as well as :hover, :focus, :active,
-// and disabled options for all buttons
-
-@mixin button-gradient-variant($color, $background, $border) {
- @include button-variant($color, $background, $border); // Use default styles
-
- //... and override the backgrounds.
- @include gradient-vertical($background, darken($background, 10%));
-
- &:focus,
- &.focus {
- @include gradient-vertical(darken($background, 10%), darken($background, 20%));
- }
- &:hover {
- @include gradient-vertical(darken($background, 10%), darken($background, 20%));
- }
- &:active,
- &.active,
- .open > &.dropdown-toggle {
- @include gradient-vertical(darken($background, 10%), darken($background, 20%));
-
- &:hover,
- &:focus,
- &.focus {
- @include gradient-vertical(darken($background, 17%), darken($background, 27%));
- }
- }
- &.disabled,
- &[disabled],
- fieldset[disabled] & {
- &:hover,
- &:focus,
- &.focus {
- @include gradient-vertical($background, darken($background, 10%));
- }
- }
-
- .badge {
- @include gradient-vertical($color, darken($color, 10%));
- }
-}
diff --git a/app/css/bootstrap_variables.scss b/app/css/bootstrap_variables.scss
deleted file mode 100644
index bb2495e..0000000
--- a/app/css/bootstrap_variables.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-
-// Bootstrap variable overrides for this UI.
-$navbar-default-bg: #f8f8f8;
-$navbar-default-border: $navbar-default-bg;
diff --git a/app/css/font-awesome.scss b/app/css/font-awesome.scss
deleted file mode 100644
index 78dffdf..0000000
--- a/app/css/font-awesome.scss
+++ /dev/null
@@ -1 +0,0 @@
-@import "../../bower_components/fontawesome/scss/font-awesome";
diff --git a/app/css/main.scss b/app/css/main.scss
deleted file mode 100644
index 6252242..0000000
--- a/app/css/main.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-body {
- padding-top: 70px;
- padding-bottom: 70px;
-}
\ No newline at end of file
diff --git a/app/favicon.ico b/app/favicon.ico
deleted file mode 100644
index 6039edb..0000000
Binary files a/app/favicon.ico and /dev/null differ
diff --git a/app/fonts/openstack/openstack-font.css b/app/fonts/openstack/openstack-font.css
deleted file mode 100644
index eecccb7..0000000
--- a/app/fonts/openstack/openstack-font.css
+++ /dev/null
@@ -1,38 +0,0 @@
-@font-face {
- font-family: "<%= fontName %>";
- src: url('<%= fontPath %><%= fontName %>.eot');
- src: url('<%= fontPath %><%= fontName %>.eot?#iefix') format('eot'),
- url('<%= fontPath %><%= fontName %>.woff') format('woff'),
- url('<%= fontPath %><%= fontName %>.ttf') format('truetype'),
- url('<%= fontPath %><%= fontName %>.svg#<%= fontName %>') format('svg');
- font-weight: normal;
- font-style: normal;
-}
-
-.<%= className %>:before {
- display: inline-block;
- font-family: "<%= fontName %>";
- font-style: normal;
- font-weight: normal;
- line-height: 1;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- vertical-align: -15%
- }
-
-.<%= className %>-lg {
- font-size: 1.3333333333333333em;
- line-height: 0.75em;
- vertical-align: -15%;
- }
-.<%= className %>-2x { font-size: 2em; }
-.<%= className %>-3x { font-size: 3em; }
-.<%= className %>-4x { font-size: 4em; }
-.<%= className %>-5x { font-size: 5em; }
-.<%= className %>-fw {
- width: 1.2857142857142858em;
- text-align: center;
- }
-
-<% _.each(glyphs, function(glyph) { %>.<%= className %>-<%= glyph.name %>:before { content: "\<%= glyph.unicode[0].charCodeAt(0).toString(16).toUpperCase() %>" }
-<% }); %>
diff --git a/app/fonts/openstack/uE001-openstack.svg b/app/fonts/openstack/uE001-openstack.svg
deleted file mode 100644
index b61cccb..0000000
--- a/app/fonts/openstack/uE001-openstack.svg
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
diff --git a/app/fonts/openstack/uEA01-ironic.svg b/app/fonts/openstack/uEA01-ironic.svg
deleted file mode 100644
index 9037a41..0000000
--- a/app/fonts/openstack/uEA01-ironic.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
diff --git a/app/index.html b/app/index.html
deleted file mode 100644
index 26a4314..0000000
--- a/app/index.html
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
diff --git a/app/js/modules/api/ironic_api_interceptor.js b/app/js/modules/api/ironic_api_interceptor.js
deleted file mode 100644
index f3d79a4..0000000
--- a/app/js/modules/api/ironic_api_interceptor.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett Packard Enterprise Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * Logic that needs to be applied to every request against the Ironic API. Includes result
- * transformation and other things.
- */
-angular.module('ironic.api').service('ironicApiInterceptor',
- function($q, $http) {
- 'use strict';
-
- /**
- * Ironic's error message is a doubly-encoded JSON string. This checks the body for that
- * field and runs a second decoder.
- *
- * @param {*} responseBody The decoded JSON response body.
- * @param {Function} headers Headers getter.
- * @param {int} status The HTTP Status of the response.
- * @returns {*} The decoded response body.
- */
- function parseErrorResponse (responseBody, headers, status) {
- if (400 <= status && responseBody.hasOwnProperty('error_message')) {
- responseBody.error_message = angular.fromJson(responseBody.error_message);
- }
- return responseBody;
- }
-
- /**
- * In some cases (as with list responses), we need to return the content of a child property
- * of the returned body rather than the whole response. This method returns a transformation
- * function that applies this change.
- *
- * @param {String} propertyName The property name to reduce to.
- * @returns {Function} A function that reduces the response appropriately.
- */
- function parseChildProperty (propertyName) {
- /**
- * Response transformer for a specific ironic list response. If the property is not found
- * (As with error responses), simply returns the original object.
- *
- * @param {*} responseBody The body received from the server.
- * @returns {Array} List of results.
- */
- return function(responseBody) {
- if (responseBody.hasOwnProperty(propertyName)) {
- return responseBody[propertyName];
- }
- return responseBody;
- };
- }
-
- return {
- /**
- * Transform the result of an object query from the Ironic API, accommodating for error
- * and list responses.
- *
- * @param {String} childPropertyName (optional) The name of the child property to reduce to.
- * @returns {Array} An array of transformations.
- */
- response: function(childPropertyName) {
- var transformers = $http.defaults.transformResponse.concat([]);
- transformers.push(parseErrorResponse);
-
- if (childPropertyName) {
- transformers.push(parseChildProperty(childPropertyName));
- }
-
- return transformers;
- }
- };
- });
diff --git a/app/js/modules/api/ironic_api_version.js b/app/js/modules/api/ironic_api_version.js
deleted file mode 100644
index 78f7a00..0000000
--- a/app/js/modules/api/ironic_api_version.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett Packard Enterprise Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * The current supported version of the ironic api. This version is hardcoded until a more
- * sophisticated version negotiation algorithm can be provided. The main blocker is that the
- * current APi abstraction library - ngResource - does not provide pre-flight modificiation of
- * requests via promise resolution. A patch has been provided
- * https://github.com/angular/angular.js/pull/13273; if accepted, this parameter will be
- * incorproated into the ironic_api_interceptor. If not, alternative libraries will have to be
- * evaluated.
- */
-angular.module('ironic.api').constant('ironicApiVersion', function() {
- 'use strict';
- return '1.14';
-});
diff --git a/app/js/modules/api/ironic_chassis.js b/app/js/modules/api/ironic_chassis.js
deleted file mode 100644
index 989b25c..0000000
--- a/app/js/modules/api/ironic_chassis.js
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * IronicChassis is an ngResource abstraction, which switches which Ironic it talks to based on the
- * selected cloud configuration provided by the $$configuration service. It may be used as if it
- * was an ngResource instance, and supports the methods `query`, `create`, `read`, `update`, and
- * `remove`.
- */
-angular.module('ironic.api').factory('IronicChassis',
- function($log, $$selectedConfiguration, $$resourceCache, $resource, $$dummyResource,
- ironicApiInterceptor, ironicApiVersion) {
- 'use strict';
-
- /**
- * This method extracts the current active API root URI from $$configuration, ensures that
- * the appropriate Ironic resources exists in the $$resourceCache, and returns it.
- *
- * @returns {{}} The created, and cached, IronicPort resource.
- */
- function getResource () {
- // Pull the current configuration.
- var currentConfig = $$selectedConfiguration.get();
-
- // This should resolve the API root, except in cases where the selected configuration is
- // invalid and/or has not yet been resolved.
- var ironicConfig = currentConfig.ironic || {};
- var ironicApiRoot = ironicConfig.apiRoot || null;
-
- if (!ironicApiRoot) {
- $log.warn('Ironic API Root for Config [' + currentConfig.id + '] not found.');
- return $$dummyResource;
- }
-
- // Build and/or retrieve a cached instance of the requested service.
- var chassisUrl = ironicApiRoot + '/chassis/:uuid';
-
- if (!$$resourceCache.has(chassisUrl)) {
- $log.debug("Creating new IronicChassis at: " + chassisUrl);
-
- var resource = $resource(chassisUrl, {uuid: '@uuid'}, {
- query: {
- method: 'GET',
- isArray: true,
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response('chassis')
- },
- create: {
- method: 'POST',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- },
- read: {
- method: 'GET',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- },
- update: {
- method: 'PUT',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- },
- remove: {
- method: 'DELETE',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- }
- });
-
- $$resourceCache.set(chassisUrl, resource);
- }
-
- return $$resourceCache.get(chassisUrl);
- }
-
- return {
- query: function() {
- var r = getResource();
- return r.query.apply(r, arguments);
- },
- create: function() {
- var r = getResource();
- return r.create.apply(r, arguments);
- },
- read: function() {
- var r = getResource();
- return r.read.apply(r, arguments);
- },
- update: function() {
- var r = getResource();
- return r.update.apply(r, arguments);
- },
- remove: function() {
- var r = getResource();
- return r.remove.apply(r, arguments);
- }
- };
- });
-
diff --git a/app/js/modules/api/ironic_driver.js b/app/js/modules/api/ironic_driver.js
deleted file mode 100644
index fad4683..0000000
--- a/app/js/modules/api/ironic_driver.js
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * IronicDriver is an ngResource abstraction, which switches which Ironic it talks to based on the
- * selected cloud configuration provided by the $$configuration service. It may be used as if it
- * was an ngResource instance, and supports the methods `query`, `create`, `read`, `update`, and
- * `remove`.
- */
-angular.module('ironic.api').factory('IronicDriver',
- function($log, $$selectedConfiguration, $$resourceCache, $resource, $$dummyResource,
- ironicApiInterceptor, ironicApiVersion) {
- 'use strict';
-
- /**
- * This method extracts the current active API root URI from $$configuration, ensures that
- * the appropriate Ironic resources exists in the $$resourceCache, and returns it.
- *
- * @returns {{}} The created, and cached, IronicPort resource.
- */
- function getResource () {
- // Pull the current configuration.
- var currentConfig = $$selectedConfiguration.get();
-
- // This should resolve the API root, except in cases where the selected configuration is
- // invalid and/or has not yet been resolved.
- var ironicConfig = currentConfig.ironic || {};
- var ironicApiRoot = ironicConfig.apiRoot || null;
-
- if (!ironicApiRoot) {
- $log.warn('Ironic API Root for Config [' + currentConfig.id + '] not found.');
- return $$dummyResource;
- }
-
- // Build and/or retrieve a cached instance of the requested service.
- var driverUrl = ironicApiRoot + '/drivers/:uuid';
-
- if (!$$resourceCache.has(driverUrl)) {
- $log.debug("Creating new IronicDriver at: " + driverUrl);
- var resource = $resource(driverUrl, {uuid: '@uuid'}, {
- query: {
- method: 'GET',
- isArray: true,
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response('drivers')
- },
- create: {
- method: 'POST',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- },
- read: {
- method: 'GET',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- },
- update: {
- method: 'PUT',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- },
- remove: {
- method: 'DELETE',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- }
- });
-
- $$resourceCache.set(driverUrl, resource);
- }
-
- return $$resourceCache.get(driverUrl);
- }
-
- return {
- query: function() {
- var r = getResource();
- return r.query.apply(r, arguments);
- },
- create: function() {
- var r = getResource();
- return r.create.apply(r, arguments);
- },
- read: function() {
- var r = getResource();
- return r.read.apply(r, arguments);
- },
- update: function() {
- var r = getResource();
- return r.update.apply(r, arguments);
- },
- remove: function() {
- var r = getResource();
- return r.remove.apply(r, arguments);
- }
- };
- });
diff --git a/app/js/modules/api/ironic_driver_properties.js b/app/js/modules/api/ironic_driver_properties.js
deleted file mode 100644
index b841932..0000000
--- a/app/js/modules/api/ironic_driver_properties.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Enterprise Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * IronicDriverProperites is an ngResource abstraction, which switches which Ironic it talks to
- * based on the selected cloud configuration provided by the $$configuration service. It may be
- * used as if it was an ngResource instance, and supports the methods `query`, `create`, `read`,
- * `update`, and * `remove`.
- */
-angular.module('ironic.api').factory('IronicDriverProperties',
- function($log, $$selectedConfiguration, $$resourceCache, $resource, $$dummyResource,
- ironicApiInterceptor, ironicApiVersion) {
- 'use strict';
-
- /**
- * This method extracts the current active API root URI from $$configuration, ensures that
- * the appropriate Ironic resources exists in the $$resourceCache, and returns it.
- *
- * @returns {{}} The created, and cached, IronicPort resource.
- */
- function getResource () {
- // Pull the current configuration.
- var currentConfig = $$selectedConfiguration.get();
-
- // This should resolve the API root, except in cases where the selected configuration is
- // invalid and/or has not yet been resolved.
- var ironicConfig = currentConfig.ironic || {};
- var ironicApiRoot = ironicConfig.apiRoot || null;
-
- if (!ironicApiRoot) {
- $log.warn('Ironic API Root for Config [' + currentConfig.id + '] not found.');
- return $$dummyResource;
- }
-
- // Build and/or retrieve a cached instance of the requested service.
- var driverUrl = ironicApiRoot + '/drivers/properties?driver_name=:driver_name';
-
- if (!$$resourceCache.has(driverUrl)) {
- $log.debug("Creating new IronicDriverProperties at: " + driverUrl);
- var resource = $resource(driverUrl, {driver_name: 'driver_name'}, {
- read: {
- method: 'GET',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- }
- });
-
- $$resourceCache.set(driverUrl, resource);
- }
-
- return $$resourceCache.get(driverUrl);
- }
-
- return {
- read: function() {
- var r = getResource();
- return r.read.apply(r, arguments);
- }
- };
- });
diff --git a/app/js/modules/api/ironic_node.js b/app/js/modules/api/ironic_node.js
deleted file mode 100644
index 6a9df27..0000000
--- a/app/js/modules/api/ironic_node.js
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * IronicNode is an ngResource abstraction, which switches which Ironic it talks to based on the
- * selected cloud configuration provided by the $$configuration service. It may be used as if it
- * was an ngResource instance, and supports the methods `query`, `create`, `read`, `update`, and
- * `remove`.
- */
-angular.module('ironic.api').factory('IronicNode',
- function($log, $$selectedConfiguration, $$resourceCache, $resource, $$dummyResource,
- ironicApiInterceptor, ironicApiVersion) {
- 'use strict';
-
- /**
- * This method extracts the current active API root URI from $$configuration, ensures that
- * the appropriate Ironic resources exists in the $$resourceCache, and returns it.
- *
- * @returns {{}} The created, and cached, IronicPort resource.
- */
- function getResource () {
- // Pull the current configuration.
- var currentConfig = $$selectedConfiguration.get();
-
- // This should resolve the API root, except in cases where the selected configuration is
- // invalid and/or has not yet been resolved.
- var ironicConfig = currentConfig.ironic || {};
- var ironicApiRoot = ironicConfig.apiRoot || null;
-
- if (!ironicApiRoot) {
- $log.warn('Ironic API Root for Config [' + currentConfig.id + '] not found.');
- return $$dummyResource;
- }
-
- // Build and/or retrieve a cached instance of the requested service.
- var nodeUrl = ironicApiRoot + '/nodes/:uuid';
-
- if (!$$resourceCache.has(nodeUrl)) {
- $log.debug("Creating new IronicNode at: " + nodeUrl);
- var resource = $resource(nodeUrl, {uuid: '@uuid'}, {
- query: {
- method: 'GET',
- isArray: true,
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response('nodes')
- },
- create: {
- method: 'POST',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- },
- read: {
- method: 'GET',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- },
- update: {
- method: 'PUT',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- },
- remove: {
- method: 'DELETE',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- }
- });
-
- $$resourceCache.set(nodeUrl, resource);
- }
-
- return $$resourceCache.get(nodeUrl);
- }
-
- return {
- query: function() {
- var r = getResource();
- return r.query.apply(r, arguments);
- },
- create: function() {
- var r = getResource();
- return r.create.apply(r, arguments);
- },
- read: function() {
- var r = getResource();
- return r.read.apply(r, arguments);
- },
- update: function() {
- var r = getResource();
- return r.update.apply(r, arguments);
- },
- remove: function() {
- var r = getResource();
- return r.remove.apply(r, arguments);
- }
- };
- });
diff --git a/app/js/modules/api/ironic_node_power_transition.js b/app/js/modules/api/ironic_node_power_transition.js
deleted file mode 100644
index ec9b783..0000000
--- a/app/js/modules/api/ironic_node_power_transition.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, LP
- *
- * 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.
- */
-
-/**
- * IronicNodePowerTransition is a mock API that returns the list of valid power
- * transitions for nodes.
- */
-angular.module('ironic.api').factory('IronicNodePowerTransition',
- function($q) {
- 'use strict';
-
- // Build a dummy resource. The API will return this wrapped in an additional 'transitions'
- // field, but we'll just use the raw array.
- var transitions = [
- {
- from_state: "power on",
- event: "power off",
- target_state: "power off",
- actor: "user"
- },
- {
- from_state: "power off",
- event: "power on",
- target_state: "power on",
- actor: "user"
- },
- {
- from_state: "power on",
- event: "reboot",
- target_state: "rebooting",
- actor: "user"
- },
- {
- from_state: "rebooting",
- event: "power on",
- target_state: "power on",
- actor: "conductor"
- }
- ];
-
- return {
- query: function(params, successHandler, errorHandler) {
- var deferred = $q.defer();
-
- // Build our result array.
- var queryResults = [];
- queryResults.$promise = deferred.promise;
- queryResults.$resolved = false;
- deferred.promise.then(function(results) {
- angular.forEach(results, function(result) {
- queryResults.push(result);
- });
- });
- deferred.promise.finally(function() {
- queryResults.$resolved = true;
- });
-
- // Check for a filter
- if (params) {
- var filteredResults = transitions.filter(function(item) {
- var approved = true;
- angular.forEach(params, function(value, key) {
- if (!item.hasOwnProperty(key) || item[key] !== value) {
- approved = false;
- }
- });
-
- return approved;
- });
- deferred.resolve(filteredResults);
- } else {
- deferred.resolve(transitions);
- }
-
- queryResults.$promise.then(successHandler || null, errorHandler || null);
-
- return queryResults;
- }
- };
- });
diff --git a/app/js/modules/api/ironic_node_provision.js b/app/js/modules/api/ironic_node_provision.js
deleted file mode 100644
index 4fb83ee..0000000
--- a/app/js/modules/api/ironic_node_provision.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2016 Hewlett Packard Enterprise Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * This resource handles node provision state transitions. It only exposes the $update (PUT) method,
- * as that's the only real valid action that can be taken. This service does not validate a
- * change which a user/script may want to take.
- */
-angular.module('ironic.api').factory('IronicNodeProvision',
- function($log, $$selectedConfiguration, $$resourceCache, $resource, $$dummyResource,
- ironicApiInterceptor, ironicApiVersion) {
- 'use strict';
-
- /**
- * This method extracts the current active API root URI from $$configuration, ensures that
- * the appropriate Ironic resources exists in the $$resourceCache, and returns it.
- *
- * @returns {{}} The created, and cached, IronicPort resource.
- */
- function getResource () {
- // Pull the current configuration.
- var currentConfig = $$selectedConfiguration.get();
-
- // This should resolve the API root, except in cases where the selected configuration is
- // invalid and/or has not yet been resolved.
- var ironicConfig = currentConfig.ironic || {};
- var ironicApiRoot = ironicConfig.apiRoot || null;
-
- if (!ironicApiRoot) {
- $log.warn('Ironic API Root for Config [' + currentConfig.id + '] not found.');
- return $$dummyResource;
- }
-
- // Build and/or retrieve a cached instance of the requested service.
- var nodeUrl = ironicApiRoot + '/nodes/:node_ident/states/provision';
-
- if (!$$resourceCache.has(nodeUrl)) {
- $log.debug("Creating new IronicNodeProvision at: " + nodeUrl);
- var resource = $resource(nodeUrl, {node_ident: '@node_ident'}, {
- update: {
- method: 'PUT',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- }
- });
-
- $$resourceCache.set(nodeUrl, resource);
- }
-
- return $$resourceCache.get(nodeUrl);
- }
-
- return {
- update: function() {
- var r = getResource();
- return r.update.apply(r, arguments);
- }
- };
- });
diff --git a/app/js/modules/api/ironic_node_provision_transition.js b/app/js/modules/api/ironic_node_provision_transition.js
deleted file mode 100644
index f6a1c01..0000000
--- a/app/js/modules/api/ironic_node_provision_transition.js
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Enterprise Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * IronicNodeProvisionTransition is a mock API that returns the transitions list for
- * the ironic state machine. It is intended to be supplanted when the work for
- * https://review.openstack.org/#/c/224022/ is completed, though it may continue
- * to exist for legacy API microversions.
- */
-angular.module('ironic.api').factory('IronicNodeProvisionTransition',
- function($q) {
- 'use strict';
-
- // Build a dummy resource. The API will return this wrapped in an additional 'transitions'
- // field, but we'll just use the raw array.
- var transitions = [
- {
- from_state: "active",
- event: "rebuild",
- target_state: "deploying",
- actor: "user"
- },
- {
- from_state: "active",
- event: "delete",
- target_state: "deleting",
- actor: "user"
- },
- {
- from_state: "available",
- event: "manage",
- target_state: "manageable",
- actor: "user"
- },
- {
- from_state: "available",
- event: "active",
- target_state: "deploying",
- actor: "user"
- },
- {
- from_state: "clean failed",
- event: "manage",
- target_state: "manageable",
- actor: "user"
- },
- {
- from_state: "clean wait",
- event: "fail",
- target_state: "clean failed",
- actor: "conductor"
- },
- {
- from_state: "clean wait",
- event: "abort",
- target_state: "clean failed",
- actor: "conductor"
- },
- {
- from_state: "clean wait",
- event: "resume",
- target_state: "cleaning",
- actor: "conductor"
- },
- {
- from_state: "deleting",
- event: "clean",
- target_state: "cleaning",
- actor: "conductor"
- },
- {
- from_state: "deleting",
- event: "error",
- target_state: "error",
- actor: "conductor"
- },
- {
- from_state: "deploy failed",
- event: "rebuild",
- target_state: "deploying",
- actor: "user"
- },
- {
- from_state: "deploy failed",
- event: "delete",
- target_state: "deleting",
- actor: "user"
- },
- {
- from_state: "deploy failed",
- event: "active",
- target_state: "deploying",
- actor: "user"
- },
- {
- from_state: "wait call-back",
- event: "delete",
- target_state: "deleting",
- actor: "conductor"
- },
- {
- from_state: "wait call-back",
- event: "resume",
- target_state: "deploying",
- actor: "conductor"
- },
- {
- from_state: "wait call-back",
- event: "fail",
- target_state: "deploy failed",
- actor: "conductor"
- },
- {
- from_state: "error",
- event: "rebuild",
- target_state: "deploying",
- actor: "user"
- },
- {
- from_state: "error",
- event: "delete",
- target_state: "deleting",
- actor: "user"
- },
- {
- from_state: "enroll",
- event: "manage",
- target_state: "verifying",
- actor: "user"
- },
- {
- from_state: "inspect failed",
- event: "inspect",
- target_state: "inspecting",
- actor: "user"
- },
- {
- from_state: "inspect failed",
- event: "manage",
- target_state: "manageable",
- actor: "user"
- },
- {
- from_state: "manageable",
- event: "inspect",
- target_state: "inspecting",
- actor: "user"
- },
- {
- from_state: "manageable",
- event: "provide",
- target_state: "cleaning",
- actor: "user"
- },
- {
- from_state: "manageable",
- event: "clean",
- target_state: "cleaning",
- actor: "user"
- },
- {
- from_state: "verifying",
- event: "fail",
- target_state: "enroll",
- actor: "conductor"
- },
- {
- from_state: "verifying",
- event: "done",
- target_state: "manageable",
- actor: "conductor"
- },
- {
- from_state: "inspecting",
- event: "fail",
- target_state: "inspect failed",
- actor: "conductor"
- },
- {
- from_state: "inspecting",
- event: "done",
- target_state: "manageable",
- actor: "conductor"
- },
- {
- from_state: "cleaning",
- event: "manage",
- target_state: "manageable",
- actor: "conductor"
- },
- {
- from_state: "cleaning",
- event: "wait",
- target_state: "clean wait",
- actor: "conductor"
- },
- {
- from_state: "cleaning",
- event: "fail",
- target_state: "clean failed",
- actor: "conductor"
- },
- {
- from_state: "cleaning",
- event: "done",
- target_state: "available",
- actor: "conductor"
- },
- {
- from_state: "deploying",
- event: "fail",
- target_state: "deploy failed",
- actor: "conductor"
- },
- {
- from_state: "deploying",
- event: "wait",
- target_state: "wait call-back",
- actor: "conductor"
- },
- {
- from_state: "deploying",
- event: "done",
- target_state: "active",
- actor: "conductor"
- }
- ];
-
- return {
- query: function(params, successHandler, errorHandler) {
- var deferred = $q.defer();
-
- // Build our result array.
- var queryResults = [];
- queryResults.$promise = deferred.promise;
- queryResults.$resolved = false;
- deferred.promise.then(function(results) {
- angular.forEach(results, function(result) {
- queryResults.push(result);
- });
- });
- deferred.promise.finally(function() {
- queryResults.$resolved = true;
- });
-
- // Check for a filter
- if (params) {
- var filteredResults = transitions.filter(function(item) {
- var approved = true;
- angular.forEach(params, function(value, key) {
- if (!item.hasOwnProperty(key) || item[key] !== value) {
- approved = false;
- }
- });
-
- return approved;
- });
- deferred.resolve(filteredResults);
- } else {
- deferred.resolve(transitions);
- }
-
- queryResults.$promise.then(successHandler || null, errorHandler || null);
-
- return queryResults;
- }
- };
- });
diff --git a/app/js/modules/api/ironic_port.js b/app/js/modules/api/ironic_port.js
deleted file mode 100644
index ce9303e..0000000
--- a/app/js/modules/api/ironic_port.js
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * IronicPort is an ngResource abstraction, which switches which Ironic it talks to based on the
- * selected cloud configuration provided by the $$configuration service. It may be used as if it
- * was an ngResource instance, and supports the methods `query`, `create`, `read`, `update`, and
- * `remove`.
- */
-angular.module('ironic.api').factory('IronicPort',
- function($log, $$selectedConfiguration, $$resourceCache, $resource, $$dummyResource,
- ironicApiInterceptor, ironicApiVersion) {
- 'use strict';
-
- /**
- * This method extracts the current active API root URI from $$configuration, ensures that
- * the appropriate Ironic resources exists in the $$resourceCache, and returns it.
- *
- * @returns {{}} The created, and cached, IronicPort resource.
- */
- function getResource () {
- // Pull the current configuration.
- var currentConfig = $$selectedConfiguration.get();
-
- // This should resolve the API root, except in cases where the selected configuration is
- // invalid and/or has not yet been resolved.
- var ironicConfig = currentConfig.ironic || {};
- var ironicApiRoot = ironicConfig.apiRoot || null;
-
- if (!ironicApiRoot) {
- $log.warn('Ironic API Root for Config [' + currentConfig.id + '] not found.');
- return $$dummyResource;
- }
-
- // Build and/or retrieve a cached instance of the requested service.
- var portUrl = ironicApiRoot + '/ports/:uuid';
-
- if (!$$resourceCache.has(portUrl)) {
- $log.debug("Creating new IronicPort at: " + portUrl);
- var resource = $resource(portUrl, {uuid: '@uuid'}, {
- query: {
- method: 'GET',
- isArray: true,
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response('ports')
- },
- create: {
- method: 'POST',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- },
- read: {
- method: 'GET',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- },
- update: {
- method: 'PUT',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- },
- remove: {
- method: 'DELETE',
- headers: {
- 'X-OpenStack-Ironic-API-Version': ironicApiVersion
- },
- transformResponse: ironicApiInterceptor.response()
- }
- });
-
- $$resourceCache.set(portUrl, resource);
- }
-
- return $$resourceCache.get(portUrl);
- }
-
- return {
- query: function() {
- var r = getResource();
- return r.query.apply(r, arguments);
- },
- create: function() {
- var r = getResource();
- return r.create.apply(r, arguments);
- },
- read: function() {
- var r = getResource();
- return r.read.apply(r, arguments);
- },
- update: function() {
- var r = getResource();
- return r.update.apply(r, arguments);
- },
- remove: function() {
- var r = getResource();
- return r.remove.apply(r, arguments);
- }
- };
- });
diff --git a/app/js/modules/api/module.js b/app/js/modules/api/module.js
deleted file mode 100644
index 342f4be..0000000
--- a/app/js/modules/api/module.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * A module of resources that talk with the ironic API.
- */
-angular.module('ironic.api', ['openstack', 'ngResource'])
- .config(function($$configurationProvider, $windowProvider) {
- 'use strict';
-
- // Build a default ironic location from the $window provider
- var location = $windowProvider.$get().location;
- var apiRoot = location.protocol + '//' + location.hostname + ':6385';
-
- // This line registers ironic's default API root, as detected via the current hostname, with
- // the $$configurationProvider's default API detection mechanism.
- $$configurationProvider.$registerDefault('ironic', apiRoot);
- });
diff --git a/app/js/modules/api/validator.js b/app/js/modules/api/validator.js
deleted file mode 100644
index 0218d78..0000000
--- a/app/js/modules/api/validator.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * Form validator that will perform an asynchronous check to see if Ironic is
- * available at the provided url. It will expose a variable on the control to
- * which it is applied, with an array of detected API versions.
- */
-/*eslint-disable angular/no-services */
-angular.module('ironic.api').directive('ironicApiUrl',
- function ($q, $http) {
-/*eslint-enable angular/no-services */
- 'use strict';
-
- return {
- require: 'ngModel',
- link: function (scope, elm, attrs, ctrl) {
-
- ctrl.$ironicVersions = [];
-
- ctrl.$asyncValidators.ironicApiUrl =
- function (modelValue) {
- var def = $q.defer();
-
- $http.get(modelValue).then(function (result) {
- var name = result.data.name;
-
- if (name !== 'OpenStack Ironic API') {
- def.reject();
- }
-
- var versions = result.data.versions || [];
- for (var i = 0; i < versions.length; i++) {
- versions[i] = versions[i].id;
- }
- ctrl.$ironicVersions = versions;
- def.resolve();
- }, function () {
- def.reject();
- });
-
- return def.promise;
- };
- }
- };
- });
diff --git a/app/js/modules/ironic/controller/action/provision_action_modal_controller.js b/app/js/modules/ironic/controller/action/provision_action_modal_controller.js
deleted file mode 100644
index b04aad8..0000000
--- a/app/js/modules/ironic/controller/action/provision_action_modal_controller.js
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2016 Hewlett Packard Enterprise Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * A generic controller which permits a user to issue provision state actions against a list of
- * nodes.
- */
-angular.module('ironic').controller('ProvisionActionModalController',
- function($q, $uibModalInstance, nodeIds, actionName, IronicNode, IronicNodeProvisionTransition,
- IronicNodeProvision) {
- 'use strict';
- var vm = this;
-
- vm.someUpdated = false;
- vm.updating = false;
- vm.someNodesExcluded = false;
- vm.actionName = actionName;
-
- // Setup our nodes.
- vm.nodes = [];
- vm.nodes.$resolved = false;
-
- // This is the data preloader, which drives all of our modal data setup. This logic will
- // execute in sequence.
- vm.nodes.$promise = $q
- .all({
- nodes: loadNodes(),
- states: loadValidStates()
- })
- .then(filterNodes)
- .then(contextWrap)
- .then(applyNodesToContext)
- .then(toggleExclusionFlag)
- .finally(function() {
- vm.nodes.$resolved = true;
- });
-
- /**
- * Resolve all states for which the current action is valid.
- *
- * @return {Promise} A promise that resolves with all valid states.
- */
- function loadValidStates () {
- return IronicNodeProvisionTransition.query().$promise
- .then(function(transitions) {
- return transitions
- .filter(function(transition) {
- return transition.event === actionName;
- })
- .map(function(transition) {
- return transition.from_state;
- });
- });
- }
-
- /**
- * Resolve the node details for all the passed node ID's.
- *
- * @return {Promise} A promise that resolves with all nodes details.
- */
- function loadNodes () {
- var promises = [];
- angular.forEach(nodeIds, function(nodeId) {
- promises.push(IronicNode.read({uuid: nodeId}).$promise);
- });
- return $q.all(promises);
- }
-
- /**
- * Filter the nodes into a valid set.
- *
- * @param {{}} results Results from preloading the valid states and valid nodes.
- * @return {[]} A list of nodes that may be manipulated with this action.
- */
- function filterNodes (results) {
- var nodes = results.nodes;
- var states = results.states;
-
- return nodes.filter(function(node) {
- return states.indexOf(node.provision_state) > -1;
- });
- }
-
- /**
- * Wrap each node in a context object, used to track state.
- *
- * @param {[]} nodes A list of nodes.
- * @return {[]} A list of context wrapped nodes.
- */
- function contextWrap (nodes) {
- return nodes.map(function(node) {
- return {
- node: node,
- error: null,
- state: 'ready', // ready, busy, error, complete
- changed: false
- };
- });
- }
-
- /**
- * Apply the nodes to the controller's variables, in a non-destructive fashion.
- *
- * @param {[]} nodes The list of nodes to apply.
- * @return {void}
- */
- function applyNodesToContext (nodes) {
- return angular.forEach(nodes, function(node) {
- vm.nodes.push(node);
- return node;
- });
- }
-
- /**
- * Toggle the flag on the controller that indicates that some of the selected nodes are not
- * in a valid state for this action.
- *
- * @param {[]} loadedNodes A list of loaded nodes.
- * @return {[]} That same list of loaded nodes, with no modifications.
- */
- function toggleExclusionFlag (loadedNodes) {
- vm.someNodesExcluded = loadedNodes.length !== nodeIds.length;
- return loadedNodes;
- }
-
- /**
- * Apply the action for which this controller has been configured.
- *
- * @return {void}
- */
- vm.apply = function() {
- vm.updating = true;
- var promises = [];
-
- // For each context object in our controller...
- angular.forEach(vm.nodes, function(ctx) {
- // Try to issue the request.
- ctx.state = 'updating';
-
- var state = IronicNodeProvision.update({
- node_ident: ctx.node.uuid,
- target: actionName
- }, function() {
- vm.someUpdated = true;
- ctx.changed = true;
- ctx.state = 'complete';
- }, function(error) {
- ctx.state = 'error';
- ctx.error = error.data.error_message;
- });
-
- promises.push(state.$promise);
- });
-
- // Wait for all the promises...
- $q.all(promises).then(
- function() {
- // If all are successful, just close.
- vm.close();
- })
- .finally(function() {
- // Flip the updating bit.
- vm.updating = false;
- });
- };
-
- /**
- * Close this modal.
- *
- * @return {void}
- */
- vm.close = function() {
- if (vm.someUpdated) {
- // Something was changed, collect the changed nodes and return them.
- var changedNodeIds = [];
- angular.forEach(vm.nodes, function(ctx) {
- if (ctx.changed) {
- changedNodeIds.push(ctx.node.uuid);
- }
- });
- $uibModalInstance.close(changedNodeIds);
- } else {
- // Nothing was changed.
- $uibModalInstance.dismiss();
- }
- };
- });
diff --git a/app/js/modules/ironic/controller/action/remove_node_modal_controller.js b/app/js/modules/ironic/controller/action/remove_node_modal_controller.js
deleted file mode 100644
index 86173fd..0000000
--- a/app/js/modules/ironic/controller/action/remove_node_modal_controller.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2016 Hewlett Packard Enterprise Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * This controller backs the "Remove Node" modal.
- */
-angular.module('ironic').controller('RemoveNodeModalController',
- function($uibModalInstance, nodes, $q) {
- 'use strict';
- var vm = this;
-
- // Wrap all the nodes in their own context objects.
- vm.someDeleted = false;
- vm.deleting = false;
- vm.nodes = [];
- angular.forEach(nodes, function(node) {
- vm.nodes.push({
- node: node,
- error: null,
- state: 'present'
- });
- });
-
- /**
- * Remove all the nodes on this controller.
- *
- * @returns {void}
- */
- vm.remove = function() {
- vm.deleting = true;
- var promises = [];
-
- // For each context object in our controller...
- angular.forEach(vm.nodes, function(ctx) {
- // Try to delete it.
- ctx.state = 'removing';
- var promise = ctx.node.$remove(
- function() {
- vm.someDeleted = true;
- ctx.state = 'removed';
- },
- function(error) {
- ctx.state = 'error';
- ctx.error = error.data.error_message;
- }
- );
- promises.push(promise);
- });
-
- // Wait for all the promises...
- $q.all(promises).then(
- function() {
- // If all are successful, just close.
- vm.deleting = false;
- if (vm.someDeleted) {
- $uibModalInstance.close();
- } else {
- $uibModalInstance.dismiss();
- }
- },
- function() {
- // Flip the deleting bit.
- vm.deleting = false;
- });
- };
-
- /**
- * Close this modal.
- *
- * @returns {void}
- */
- vm.close = function() {
- if (vm.someDeleted) {
- // Something was changed.
- $uibModalInstance.close();
- } else {
- // Nothing was changed.
- $uibModalInstance.dismiss();
- }
- };
- });
diff --git a/app/js/modules/ironic/controller/action/unknown_action_modal_controller.js b/app/js/modules/ironic/controller/action/unknown_action_modal_controller.js
deleted file mode 100644
index 6706473..0000000
--- a/app/js/modules/ironic/controller/action/unknown_action_modal_controller.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2016 Hewlett Packard Enterprise Development Company, LP
- *
- * 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.
- */
-
-/**
- * This controller handles the popup that informs the user that we either do not know, or cannot
- * perform, the node action they've requested.
- */
-angular.module('ironic').controller('UnknownActionModalController',
- function($scope, $uibModalInstance, actionName) {
- 'use strict';
- var vm = this;
-
- vm.actionName = actionName;
- vm.close = function() {
- $uibModalInstance.dismiss();
- };
- });
diff --git a/app/js/modules/ironic/controller/configuration_add_controller.js b/app/js/modules/ironic/controller/configuration_add_controller.js
deleted file mode 100644
index 6088ee0..0000000
--- a/app/js/modules/ironic/controller/configuration_add_controller.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * This controller allows the creation of a new configuration.
- */
-angular.module('ironic').controller('ConfigurationAddController',
- function($scope, $state, $location, $$configuration, $uibModalInstance, configuration) {
- 'use strict';
- var vm = this;
-
- vm.configuration = configuration;
- vm.newConfiguration = {
- name: '',
- ironic: {
- apiRoot: ''
- }
- };
-
- vm.location = {
- host: $location.host(),
- protocol: $location.protocol(),
- port: $location.port()
- };
-
- vm.save = function() {
- vm.newConfiguration.id = vm.newConfiguration.name;
- $uibModalInstance.close(vm.newConfiguration);
- };
-
- vm.close = function() {
- $uibModalInstance.dismiss();
- };
- });
diff --git a/app/js/modules/ironic/controller/configuration_controller.js b/app/js/modules/ironic/controller/configuration_controller.js
deleted file mode 100644
index 283ecd8..0000000
--- a/app/js/modules/ironic/controller/configuration_controller.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * This controller allows the management of all the cloud configuration entries.
- */
-angular.module('ironic').controller('ConfigurationController',
- function($state, $location, $$configuration, $$selectedConfiguration, $uibModal) {
- 'use strict';
- var vm = this;
-
- vm.configurations = [];
-
- vm.location = {
- host: $location.host(),
- protocol: $location.protocol(),
- port: $location.port()
- };
-
- /**
- * Reload all configurations in this controller.
- *
- * @returns {void}
- */
- function reloadConfigurations () {
- vm.configurations = $$configuration.query({});
- }
-
- /**
- * Select a single configuration for the current application runtime.
- *
- * @param {{}} configuration The configuration to select.
- * @returns {void}
- */
- vm.select = function(configuration) {
- $$selectedConfiguration.set(configuration).$promise.then(
- function() {
- $state.go('root.ironic.nodes');
- }
- );
- };
-
- /**
- * Displays the local configuration add modal.
- *
- * @returns {void}
- */
- vm.add = function() {
- // var deferred = $q.defer();
- $uibModal.open({
- templateUrl: 'view/ironic/config_add.html',
- controller: 'ConfigurationAddController as ctrl',
- backdrop: 'static',
- resolve: {
- configuration: function() {
- return $$configuration.query({}).$promise;
- }
- }
- }).result.then(
- function(newConfig) {
- $$configuration.create(newConfig).$promise.then(reloadConfigurations);
- });
- };
-
- /**
- * Remove a configuration.
- * @param {{}} config The configuration to remove.
- * @returns {void}
- */
- vm.remove = function(config) {
- config.$remove().$promise.then(reloadConfigurations);
- };
-
- reloadConfigurations();
- });
diff --git a/app/js/modules/ironic/controller/driver_list_controller.js b/app/js/modules/ironic/controller/driver_list_controller.js
deleted file mode 100644
index d9fd464..0000000
--- a/app/js/modules/ironic/controller/driver_list_controller.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2016 Hewlett Packard Enterprise Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * Driver List for the Ironic UI.
- */
-angular.module('ironic')
- .controller('DriverListController', function($scope, $q, IronicDriver) {
- 'use strict';
- var vm = this;
-
- // Set up controller parameters
- vm.errorMessage = null;
- vm.drivers = [];
-
- /**
- * Initialize the controller.
- *
- * @returns {void}
- */
- vm.init = function() {
- vm.loadDrivers();
- };
-
- /**
- * Load the entire list of drivers.
- *
- * @returns {void}
- */
- vm.loadDrivers = function() {
- vm.errorMessage = null;
- vm.drivers = IronicDriver.query({}, function() {
- // Do nothing.
- }, function(error) {
- vm.errorMessage = error.data.error_message;
- vm.drivers = null;
- });
- };
-
- vm.init();
- });
diff --git a/app/js/modules/ironic/controller/enroll_modal_controller.js b/app/js/modules/ironic/controller/enroll_modal_controller.js
deleted file mode 100644
index ad7acbf..0000000
--- a/app/js/modules/ironic/controller/enroll_modal_controller.js
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * This controller handles the enrollment of a new, single, node
- */
-angular.module('ironic').controller('EnrollModalController',
- function($scope, $uibModalInstance, IronicDriver, IronicDriverProperties,
- IronicNode) {
- 'use strict';
- var vm = this;
-
- vm.drivers = null;
- vm.errorMessage = null;
- vm.driverProperties = null;
- vm.node = null;
-
- vm.loadDrivers = function() {
- vm.errorMessage = null;
- vm.drivers = IronicDriver.query({}, function() {
- // Do nothing on success.
- }, function(error) {
- vm.errorMessage = error.data.error_message;
- vm.drivers = null;
- });
- };
-
- // Given a driver name, retrieve all the driver's options.
- vm.loadDriverProperties = function(driverName) {
- vm.driverProperties = null;
- vm.errorMessage = null;
- vm.node = {
- name: vm.node ? vm.node.name : '', // Preserve previously entered names.
- driver: driverName,
- driver_info: {}
- };
-
- var params = {
- driver_name: driverName
- };
-
- IronicDriverProperties.read(params).$promise.then(
- function(properties) {
- vm.driverProperties = properties;
- },
- function(error) {
- vm.errorMessage = error.data.error_message;
- });
- };
-
- vm.enroll = function() {
- vm.errorMessage = null;
- IronicNode.create(vm.node,
- function(node) {
- $uibModalInstance.close(node);
- },
- function(error) {
- vm.errorMessage = error.data.error_message;
- }
- );
- };
-
- vm.close = function() {
- $uibModalInstance.dismiss();
- };
-
- // Initialize the drivers.
- vm.loadDrivers();
- });
diff --git a/app/js/modules/ironic/controller/header_controller.js b/app/js/modules/ironic/controller/header_controller.js
deleted file mode 100644
index def46a5..0000000
--- a/app/js/modules/ironic/controller/header_controller.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * Controller for our application header.
- */
-angular.module('ironic').controller('HeaderController',
- function ($scope, $state, configurations, currentConfiguration, $$selectedConfiguration) {
- 'use strict';
- var vm = this;
-
- vm.configurations = configurations;
- vm.currentConfiguration = currentConfiguration;
-
- vm.switchCloud = function (cloudConfig) {
- $$selectedConfiguration.set(cloudConfig).$promise.then(
- function() {
- $state.reload();
- });
- };
- });
diff --git a/app/js/modules/ironic/controller/node_action_controller.js b/app/js/modules/ironic/controller/node_action_controller.js
deleted file mode 100644
index 651b22e..0000000
--- a/app/js/modules/ironic/controller/node_action_controller.js
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2016 Hewlett Packard Enterprise Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * Controller which handles manipulation of individual nodes.
- */
-angular.module('ironic').controller('NodeActionController',
- function($uibModal) {
- 'use strict';
-
- var vm = this;
-
- // Set up controller parameters
- vm.errorMessage = null;
-
- /**
- * Generic unknown action handler, here as a placeholder until we get actual actions built out.
- *
- * @param {String} actionName The name of the action to perform.
- * @param {[{}]} nodes An array of nodes on which to perform this action.
- * @returns {Promise} A promise that resolves when the user performs the action.
- */
- function unknownActionHandler (actionName, nodes) {
- return $uibModal.open({
- templateUrl: 'view/ironic/action/unknown.html',
- controller: 'UnknownActionModalController as ctrl',
- resolve: {
- actionName: function() {
- return actionName;
- },
- nodes: function() {
- return nodes;
- }
- }
- }).result;
- }
-
- vm.powerAction = unknownActionHandler;
-
- /**
- * Provision action handler, delegates the provision action to the modal controller.
- *
- * @param {String} actionName The name of the action to perform.
- * @param {[{}]} nodes An array of nodes on which to perform this action.
- * @returns {Promise} A promise that resolves when the user performs the action.
- */
- vm.provisionAction = function provisionActionHandler (actionName, nodes) {
- var modalParams = {
- templateUrl: 'view/ironic/action/provision.html',
- controller: 'ProvisionActionModalController as ctrl',
- resolve: {
- actionName: function() {
- return actionName;
- },
- nodeIds: function() {
- return nodes;
- }
- }
- };
-
- switch (actionName) {
- case 'manage':
- case 'rebuild':
- case 'delete':
- case 'deploy':
- case 'fail':
- case 'abort':
- case 'clean':
- case 'inspect':
- case 'provide':
- default:
- modalParams.templateUrl = 'view/ironic/action/provision.html';
- }
-
- return $uibModal.open(modalParams).result;
- };
-
- /**
- * Delete the node in this controller.
- *
- * @param {IronicNode} node The node instance to remove.
- * @return {Promise} A promise that will resolve true if the modal closed with some deletions.
- */
- vm.remove = function(node) {
-
- // Return the result of the modal.
- return $uibModal.open({
- templateUrl: 'view/ironic/action/remove_node.html',
- controller: 'RemoveNodeModalController as ctrl',
- backdrop: 'static',
- resolve: {
- nodes: function() {
- return [node];
- }
- }
- }).result;
- };
-
- /**
- * Enroll a new node.
- *
- * @return {Promise} A promise that will resolve true if a node has been added.
- */
- vm.enroll = function() {
- return $uibModal.open({
- templateUrl: 'view/ironic/enroll/index.html',
- controller: 'EnrollModalController as ctrl',
- backdrop: 'static'
- }).result;
- };
- });
diff --git a/app/js/modules/ironic/controller/node_detail_controller.js b/app/js/modules/ironic/controller/node_detail_controller.js
deleted file mode 100644
index 579048c..0000000
--- a/app/js/modules/ironic/controller/node_detail_controller.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett Packard Enterprise Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * Node handling for the Ironic UI.
- */
-angular.module('ironic').controller('NodeDetailController',
- function(nodeUuid, IronicNode) {
- 'use strict';
- var vm = this;
-
- // Set up controller parameters
- vm.errorMessage = null;
- vm.node = null;
-
- // Load the node.
- vm.node = IronicNode.read({
- uuid: nodeUuid
- }, angular.noop, function(error) {
- // Set the error message and clear the node promise.
- vm.errorMessage = error.data.error_message;
- vm.node = null;
- });
- });
diff --git a/app/js/modules/ironic/controller/node_detail_driver_controller.js b/app/js/modules/ironic/controller/node_detail_driver_controller.js
deleted file mode 100644
index 24ee0a8..0000000
--- a/app/js/modules/ironic/controller/node_detail_driver_controller.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett Packard Enterprise Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * Node driver handling for the Ironic UI.
- */
-angular.module('ironic').controller('NodeDetailDriverController',
- function(nodeUuid, IronicNode, IronicDriver) {
- 'use strict';
- var vm = this;
-
- // Set up controller parameters
- vm.errorMessage = null;
- vm.driver = null;
-
- // Generic, shared error handler.
- function errorHandler (error) {
- // Set the error message and clear the port promise.
- vm.errorMessage = error.data.error_message;
- vm.driver = null;
- }
-
- // Load the node.
- IronicNode.read({
- uuid: nodeUuid
- }, function(node) {
- vm.driver = IronicDriver.read({
- uuid: node.driver
- }, angular.noop, errorHandler);
- }, errorHandler);
-
- });
diff --git a/app/js/modules/ironic/controller/node_detail_ports_controller.js b/app/js/modules/ironic/controller/node_detail_ports_controller.js
deleted file mode 100644
index 72182d3..0000000
--- a/app/js/modules/ironic/controller/node_detail_ports_controller.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett Packard Enterprise Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * Node port handling for the Ironic UI.
- */
-angular.module('ironic').controller('NodeDetailPortsController',
- function(nodeUuid, IronicPort) {
- 'use strict';
- var vm = this;
-
- // Set up controller parameters
- vm.errorMessage = null;
- vm.ports = null;
-
- // Load the node.
- vm.ports = IronicPort.query({
- node: nodeUuid
- }, angular.noop, function(error) {
- // Set the error message and clear the node promise.
- vm.errorMessage = error.data.error_message;
- vm.ports = null;
- });
- });
diff --git a/app/js/modules/ironic/controller/node_list_controller.js b/app/js/modules/ironic/controller/node_list_controller.js
deleted file mode 100644
index 01b0546..0000000
--- a/app/js/modules/ironic/controller/node_list_controller.js
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * Node handling for the Ironic UI.
- */
-angular.module('ironic')
- .controller('NodeListController', function($scope, $q, IronicNode, IronicNodeProvisionTransition,
- IronicNodePowerTransition) {
- 'use strict';
- var vm = this;
-
- // Set up controller parameters
- vm.errorMessage = null;
- vm.nodes = [];
- vm.selectedNodes = [];
- vm.selectAll = false;
- vm.provisionTransitions = [];
- vm.powerTransitions = [];
-
- /**
- * Initialize the controller.
- *
- * @returns {void}
- */
- vm.init = function() {
- vm.loadProvisionTransitions();
- vm.loadPowerTransitions();
- vm.loadNodes();
- };
-
- // Load the node list.
- vm.loadNodes = function() {
- vm.errorMessage = null;
- vm.nodes = IronicNode.query({}, function() {
- vm.selectedNodes = [];
- vm.selectAll = false;
- }, function(error) {
- vm.errorMessage = error.data.error_message;
- vm.selectedNodes = [];
- vm.selectAll = false;
- vm.nodes = null;
- });
- };
-
- /**
- * Check the selected nodes anytime we suspect that the selectAll property may no longer be
- * valid.
- */
- // using $watchCollection only works on non-scope items if the property provided is a
- // generator. Otherwise this syntax would have to be $scope.$watchCollection('foo'), and
- // we do not permit polluting the scope.
- var unwatchSelectedNodes = $scope.$watchCollection(function() {
- return vm.selectedNodes;
- }, function(newValue) {
- vm.selectAll = newValue.length === vm.nodes.length;
- });
- $scope.$on('$destroy', unwatchSelectedNodes);
-
- /**
- * Select, or deselect, all nodes based on the value of the checkbox.
- *
- * @param {Boolean} selectAll Whether to select all.
- * @returns {void}
- */
- vm.toggleSelectAll = function(selectAll) {
- if (selectAll) {
- vm.selectedNodes = vm.nodes.map(function(item) {
- return angular.copy(item.uuid);
- });
- } else {
- vm.selectedNodes = [];
- }
- };
-
- /**
- * Load all valid user power transition names into the controller.
- *
- * @returns {void}
- */
- vm.loadPowerTransitions = function() {
- var transitionPromise = IronicNodePowerTransition.query({actor: 'user'}).$promise;
-
- vm.powerTransitions = [];
- vm.powerTransitions.$resolved = false;
- vm.powerTransitions.$promise = transitionPromise
- .then(mapTransitionNames)
- .then(function(names) {
- angular.forEach(names, function(name) {
- vm.powerTransitions.push(name);
- });
- vm.powerTransitions.$resolved = true;
- });
- };
-
- /**
- * Load all valid user provisioning transitions names into the controller.
- *
- * @returns {void}
- */
- vm.loadProvisionTransitions = function() {
- var transitionPromise = IronicNodeProvisionTransition.query({actor: 'user'}).$promise;
-
- vm.provisionTransitions = [];
- vm.provisionTransitions.$resolved = false;
- vm.provisionTransitions.$promise = transitionPromise
- .then(mapTransitionNames)
- .then(function(names) {
- angular.forEach(names, function(name) {
- vm.provisionTransitions.push(name);
- });
- vm.provisionTransitions.$resolved = true;
- });
- };
-
- /**
- * This helper method reduces the transition data format down to the actual action name that
- * can be performed on a node.
- *
- * @param {[{}]} transitions The list of resolved transitions.
- * @returns {Array} The reduced list of available transitions.
- */
- function mapTransitionNames (transitions) {
- var reducedTransitions = [];
- transitions = transitions.map(function(item) {
- return item.event;
- });
- // deduplicate.
-
- angular.forEach(transitions, function(name) {
- if (reducedTransitions.indexOf(name) === -1) {
- reducedTransitions.push(name);
- }
- });
- return reducedTransitions;
- }
-
- vm.init();
- });
diff --git a/app/js/modules/ironic/module.js b/app/js/modules/ironic/module.js
deleted file mode 100644
index 9426538..0000000
--- a/app/js/modules/ironic/module.js
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * The Ironic Root Application.
- *
- * This module defines dependencies and root routes, but no actual
- * functionality.
- */
-angular.module('ironic', ['ui.router', 'ui.bootstrap', 'ironic.util', 'ironic.api',
- 'checklist-model'])
- .config(function($urlRouterProvider, $httpProvider, $stateProvider, $$configurationProvider) {
- 'use strict';
-
- // Default UI route
- $urlRouterProvider.otherwise('/ironic/nodes');
-
- // Enable all of our configuration detection methods
- $$configurationProvider.$enableDefault(true);
- $$configurationProvider.$enableConfigLoad(true);
- $$configurationProvider.$enableLocalStorage(true);
-
- // Ironic's root state, used to resolve global resources before
- // the application fully initializes.
- $stateProvider
- .state('root', {
- abstract: true,
- url: '',
- templateUrl: 'view/ironic/root.html'
- })
- .state('root.ironic', {
- abstract: true,
- url: '/ironic',
- views: {
- header: {
- templateUrl: 'view/ironic/header.html',
- controller: 'HeaderController as headerCtrl'
- },
- root: {
- templateUrl: 'view/ironic/ironic.html'
- }
- },
- resolve: {
- configurations: function($$configuration) {
- return $$configuration.query({}).$promise;
- },
- currentConfiguration: function($$selectedConfiguration, $q) {
- var deferred = $q.defer();
-
- var resource = $$selectedConfiguration.get();
- resource.$promise.then(
- function() {
- deferred.resolve(resource);
- },
- function() {
- deferred.reject('no_config');
- });
- return deferred.promise;
- }
- }
- })
- .state('root.ironic.nodes', {
- url: '/nodes',
- views: {
- 'main@root.ironic': {
- templateUrl: 'view/ironic/node_list.html',
- controller: 'NodeListController as nodeListCtrl'
- }
- }
- })
- .state('root.ironic.nodes.detail', {
- abstract: true,
- url: '/:uuid',
- resolve: {
- nodeUuid: function($stateParams) {
- return $stateParams.uuid;
- }
- },
- views: {
- 'main@root.ironic': {
- templateUrl: 'view/ironic/detail.html',
- controller: 'NodeDetailController as nodeCtrl'
- }
- }
- })
- .state('root.ironic.nodes.detail.node', {
- url: '/node',
- templateUrl: 'view/ironic/detail_node.html'
- })
- .state('root.ironic.nodes.detail.ports', {
- url: '/ports',
- templateUrl: 'view/ironic/detail_ports.html',
- controller: 'NodeDetailPortsController as portCtrl'
- })
- .state('root.ironic.nodes.detail.driver', {
- url: '/driver',
- templateUrl: 'view/ironic/detail_driver.html',
- controller: 'NodeDetailDriverController as driverCtrl'
- })
- .state('root.ironic.drivers', {
- url: '/drivers',
- views: {
- 'main@root.ironic': {
- controller: 'DriverListController as driverListCtrl',
- templateUrl: 'view/ironic/driver_list.html'
- }
- }
- })
- .state('root.config', {
- url: '/config',
- views: {
- header: {
- templateUrl: 'view/ironic/config_header.html'
- },
- root: {
- templateUrl: 'view/ironic/config.html',
- controller: 'ConfigurationController as ctrl'
- }
- }
- });
- })
- .run(function($rootScope, $state) {
- 'use strict';
-
- var listener = $rootScope.$on('$stateChangeError',
- function(evt, toState, toParams, fromState, fromParams, reason) {
- if (reason === 'no_config') {
- $state.go('root.config');
- } else {
- $state.go('root.ironic.nodes');
- }
- });
- $rootScope.$on('$destroy', listener);
- });
diff --git a/app/js/modules/openstack/configuration.js b/app/js/modules/openstack/configuration.js
deleted file mode 100644
index 426676d..0000000
--- a/app/js/modules/openstack/configuration.js
+++ /dev/null
@@ -1,641 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * This resource acts as a resource-like service that provides cloud api configurations
- * from various optional sources. First, you may hardcode a configuration using
- * $$configurationProvider.$addConfig. Secondly, you may use the default configuration
- * as registered by peer libraries using $$configurationProvider.$registerDefault.
- * Thirdly, it can load a configuration from ./config.json. Lastly, it provides
- * a simple CRUD interface by which a user may manipulate configurations that
- * are persisted in a browser's persistent storage.
- *
- * An example configuration file follows:
- *
- * [{
- * "name": "My Little Cloud",
- * "ironic": {
- * "apiRoot": "https://ironic.example.com:6385/"
- * },
- * "glance": {
- * "apiRoot": "https://glance.example.com:9292/"
- * }
- * }]
- */
-angular.module('openstack').provider('$$configuration',
- function() {
- 'use strict';
-
- var merge = angular.merge;
- var forEach = angular.forEach;
-
- /**
- * Promise variables, used to keep certain result sets in state.
- */
- var deferAll, deferConfig, deferStatic, deferDefault, deferLocal;
-
- /**
- * ID key for the persistent storage.
- *
- * @type {string}
- */
- var storageKey = '$$configuration';
-
- /**
- * Internal flag: Is the default configuration enabled?
- *
- * @type {boolean} True if enabled, otherwise false.
- */
- var enableDefault = false;
-
- /**
- * Internal flag: Is configuration loading enabled?
- *
- * @type {boolean} True if enabled, otherwise false.
- */
- var enableConfigLoad = false;
-
- /**
- * Internal flag: Is persisting via localStorage enabled?
- *
- * @type {boolean} True if enabled, otherwise false.
- */
- var enableLocalStorage = false;
-
- /**
- * A list of static configurations, added to the provider.
- *
- * @type {Array}
- */
- var staticConfigs = [];
-
- /**
- * The default configuration instance.
- *
- * @type {{}}
- */
- var defaultConfig = {
- id: 'default',
- name: 'Default Cloud',
- source: 'default'
- };
-
- /**
- * Add a new configuration to the provider. Use this method if you are providing your
- * own configuration loading mechanism during application initialization, such as a
- * hardcoded configuration. For a user-provided configuration, we recommend you use
- * $$configuration.create({}); instead.
- *
- * @param {*} configuration The configuration to add.
- * @returns {void}
- */
- this.$addConfig = function(configuration) {
- configuration = angular.copy(configuration);
- configuration.source = 'static';
- staticConfigs.push(configuration);
-
- // Reset associated promises
- if (deferStatic) {
- deferStatic = null;
- deferAll = null;
- }
- };
-
- /**
- * Register a service's default API URL. This allows peer libraries, such as glance-apilib
- * or ironic-apilib, to set a 'default' location for their API.
- *
- * @param {String} serviceName The name of the service to register. Example: 'ironic'.
- * @param {String} serviceUrl The root url of the API.
- * @returns {void}
- */
- this.$registerDefault = function(serviceName, serviceUrl) {
- defaultConfig[serviceName] = {
- id: serviceName,
- apiRoot: serviceUrl
- };
-
- if (deferDefault) {
- deferDefault = null;
- deferAll = null;
- }
- };
-
- /**
- * Enable, or disable, the default configuration mechanism. This mechanism assumes that peer
- * libraries, such as ironic-jslib or others, register an expected 'default' API root during
- * application initialization. These are provided under the 'default' id.
- *
- * This feature is disabled by default, enable it if you want your UI to permit automatic
- * creation of default configurations.
- *
- * @param {Boolean} enable Whether to enable the default configuration mechanism.
- * @returns {void}
- */
- this.$enableDefault = function(enable) {
- enable = !!enable;
- // Only change things if things have changed
- if (enable !== enableDefault) {
- enableDefault = enable;
-
- // Reset associated promises
- if (deferDefault) {
- deferDefault = null;
- deferAll = null;
- }
- }
- };
-
- /**
- * Enable, or disable, the configuration loading mechanism. This mechanism attempts to load
- * a list of cloud configurations from a ./config.json file that lives adjacent to your user
- * interface. This feature is disabled by default, enable it if you want to configure your
- * cloud with a static config.json file.
- *
- * @param {Boolean} enable Whether to enable configuration loading.
- * @returns {void}
- */
- this.$enableConfigLoad = function(enable) {
- enable = !!enable;
- // Only change things if things have changed
- if (enable !== enableConfigLoad) {
- enableConfigLoad = enable;
-
- // Reset associated promises
- if (deferConfig) {
- deferConfig = null;
- deferAll = null;
- }
- }
- };
-
- /**
- * Enable, or disable, loading cloud configuration from a browser's LocalStorage. This may
- * be used either to drive a user-provided configuration UI, or to read a configuration that
- * is shared between applications on the same domain.
- *
- * @param {Boolean} enable Whether to enable localStorage configurations.
- * @returns {void}
- */
- this.$enableLocalStorage = function(enable) {
- enable = !!enable;
- // Only change things if things have changed
- if (enable !== enableLocalStorage) {
- enableLocalStorage = enable;
-
- // Reset associated promises
- if (deferLocal) {
- deferLocal = null;
- deferAll = null;
- }
- }
- };
-
- /**
- * Create a shallow copy of an object without persisting private methods.
- *
- * @param {*} src The source object.
- * @returns {*|{}} A copy of the object.
- */
- function cleanCopy (src) {
- var dst = {};
-
- for (var key in src) {
- if (src.hasOwnProperty(key) && !(key.charAt(0) === '$')) {
- dst[key] = src[key];
- }
- }
-
- return dst;
- }
-
- this.$get = function($q, $$persistentStorage, $log, $http) {
-
- /**
- * Store a list of data in local persistent storage.
- *
- * @param {*} list An array of config objects.
- * @returns {void}
- */
- function saveLocal (list) {
- $$persistentStorage.set(storageKey, list);
- deferLocal = null;
- deferAll = null;
- }
-
- /**
- * Retrieve all configurations from the browser local storage, if enabled.
- *
- * @returns {promise} A resolving promise for local configuration objects.
- */
- function resolveLocal () {
- if (!deferLocal) {
- deferLocal = $q.defer();
- if (enableLocalStorage) {
- var configs = $$persistentStorage.get(storageKey) || [];
- forEach(configs, function(config) {
- config.source = 'local';
- });
- deferLocal.resolve(configs);
- } else {
- deferLocal.resolve([]);
- }
- }
- return deferLocal.promise;
- }
-
- /**
- * Retrieve all configurations from our various storage mechanisms.
- *
- * @returns {promise} A resolving promise for all configuration objects.
- */
- function resolveAll () {
- // Only trigger this if the promise has been cleared.
- if (!deferAll) {
- deferAll = $q.defer();
-
- $q.all({
- local: resolveLocal(),
- config: resolveConfig(),
- default: resolveDefault(),
- static: resolveStatic()
- }).then(function(results) {
- var list = [];
- forEach(results.local, function(config) {
- list.push(config);
- });
- forEach(results.config, function(config) {
- list.push(config);
- });
- forEach(results.default, function(config) {
- list.push(config);
- });
- forEach(results.static, function(config) {
- list.push(config);
- });
- deferAll.resolve(list);
- });
- }
-
- return deferAll.promise;
- }
-
- /**
- * Resolve configuration files from the ./config.json file.
- *
- * @returns {promise} A resolving promise for configFile configuration objects.
- */
- function resolveConfig () {
- if (!deferConfig) {
- deferConfig = $q.defer();
-
- if (!enableConfigLoad) {
- deferConfig.resolve([]);
- } else {
- $log.info('Attempting to load parameters from ./config.json');
- $http.get('./config.json').then(
- function(response) {
-
- // The result must be an array.
- if (!angular.isArray(response.data)) {
- $log.warn('Content of ./config.json must be a valid JSON array.');
- response.data = [];
- }
-
- forEach(response.data, function(config) {
- config.source = 'host';
- });
-
- deferConfig.resolve(response.data);
- },
- function() {
- $log.warn('Cannot load ./config.json, using defaults.');
- deferConfig.resolve([]);
- }
- );
- }
- }
- return deferConfig.promise;
- }
-
- /**
- * Resolve the default configuration.
- *
- * @returns {promise} A resolving promise for default API calls.
- */
- function resolveDefault () {
- if (!deferDefault) {
- deferDefault = $q.defer();
- if (enableDefault) {
- deferDefault.resolve([defaultConfig]);
- } else {
- deferDefault.resolve([]);
- }
- }
-
- return deferDefault.promise;
- }
-
- /**
- * Resolve a list of configurations added to the services at config time.
- *
- * @returns {promise} A resolving promise of static configuration objects.
- */
- function resolveStatic () {
- if (!deferStatic) {
- deferStatic = $q.defer();
- deferStatic.resolve(staticConfigs);
- }
- return deferStatic.promise;
- }
-
- /**
- * Create a new local configuration. This requires that localStorage is enabled.
- *
- * @param {{}} newConfig The configuration to create.
- * @returns {{}} A resource for this new configuration object.
- */
- function createConfig (newConfig) {
- // Create a result object
- var deferred = $q.defer();
-
- // Decorate the result resource with necessary bits.
- newConfig = resourceify(newConfig, deferred.promise);
-
- // We must have local storage enabled.
- if (!enableLocalStorage) {
- deferred.reject('local_storage_disabled');
- return newConfig;
- }
-
- // The user must provide an id property.
- if (!newConfig.id) {
- deferred.reject('no_id_provided');
- return newConfig;
- }
-
- // Resolve both all and local.
- $q.all({
- all: resolveAll(),
- local: resolveLocal()
- }).then(function(results) {
- // Check for duplicate ID's, reject if one exists.
- for (var i = 0; i < results.all.length; i++) {
- if (newConfig.id === results.all[i].id) {
- deferred.reject('duplicate_id');
- return;
- }
- }
-
- // Add the new config.
- results.local.push(cleanCopy(newConfig));
-
- // Stash the results
- saveLocal(results.local);
-
- // resolve and exit
- deferred.resolve(newConfig);
- });
-
- return newConfig;
- }
-
- /**
- * Update a new locally stored configuration.
- *
- * @param {{}} config The configuration object to update.
- * @returns {{}} The updated configuration.
- */
- function updateConfig (config) {
- var deferred = $q.defer();
- config = resourceify(config, deferred.promise);
-
- // We must have local storage enabled.
- if (!enableLocalStorage) {
- deferred.reject('local_storage_disabled');
- return config;
- }
-
- // Load local configurations
- resolveLocal().then(
- function(results) {
- // Try to find the matching id.
- for (var i = 0; i < results.length; i++) {
- var storedConfig = results[i];
- if (config.id === storedConfig.id) {
- // Merge the new values onto the stored config.
- storedConfig = merge(storedConfig, cleanCopy(config));
-
- // Stash the results
- saveLocal(results);
-
- // Resolve the promise
- deferred.resolve(config);
- return;
- }
- }
- deferred.reject('not_found');
- });
-
- return config;
- }
-
- /**
- * Retrieve a configuration by ID.
- *
- * @param {{}} config The configuration object to resolve.
- * @returns {{}} The configuration resource.
- */
- function readConfig (config) {
- var deferred = $q.defer();
- config = resourceify(config, deferred.promise);
-
- // Force the user to provide an ID.
- if (!config.id) {
- deferred.reject('no_id_provided');
- return config;
- }
-
- // Load everything, then...
- resolveAll().then(
- function(results) {
- // Try to find the matching id.
- for (var i = 0; i < results.length; i++) {
- var storedConfig = results[i];
- if (config.id === storedConfig.id) {
- // Merge values onto the config.
- merge(config, cleanCopy(storedConfig));
- deferred.resolve(config);
- return;
- }
- }
- deferred.reject('not_found');
- });
-
- return config;
- }
-
- /**
- * Remove a locally stored configuration from the cache.
- *
- * @param {{}} config The configuration object to remove.
- * @returns {{}} The configuration object, with appropriate promises.
- */
- function removeConfig (config) {
- var deferred = $q.defer();
- config = resourceify(config, deferred.promise);
-
- // We must have local storage enabled.
- if (!enableLocalStorage) {
- deferred.reject('local_storage_disabled');
- return config;
- }
-
- // Load local configurations
- resolveLocal().then(
- function(results) {
- // Try to find the matching id.
- for (var i = 0; i < results.length; i++) {
- var storedConfig = results[i];
- if (storedConfig.id === config.id) {
-
- // Remove the config from local storage.
- results.splice(i, 1);
-
- // Stash the results
- saveLocal(results);
-
- // Resolve the promise and exit
- deferred.resolve(config);
- return;
- }
- }
- deferred.reject('not_found');
- });
- return config;
- }
-
- /**
- * This method decorates a raw resource with manipulation methods like $delete, $update,
- * etc. These convenience methods permit individual instance manipulation.
- *
- * @param {{}} instance The instance to decorate.
- * @param {Promise} promise The promise to apply.
- *
- * @returns {{}} A clone of the instance, with $ methods added.
- */
- function resourceify (instance, promise) {
- instance.$promise = promise;
-
- // Set the initial resolved, and keep it up to date.
- instance.$resolved = false;
- instance.$promise.then(function() {
- instance.$resolved = true;
- }, function() {
- instance.$resolved = true;
- });
-
- instance.$remove = function() {
- return removeConfig(instance);
- };
- instance.$create = function() {
- return createConfig(instance);
- };
- instance.$update = function() {
- return updateConfig(instance);
- };
- instance.$read = function() {
- return readConfig(instance);
- };
- return instance;
- }
-
- return {
- /**
- * Get a list of all configurations.
- *
- * @returns {{}} A list of configurations.
- */
- query: function() {
- // Start with the promise
- var listDeferred = $q.defer();
-
- // Build a resource
- var list = resourceify([], listDeferred.promise);
-
- // Resolve all the resources, then resolve the list promise.
- resolveAll().then(
- function(results) {
- // Load cloned configs into the result array.
- forEach(results, function(config) {
- var rDeferred = $q.defer();
- var resource = resourceify(cleanCopy(config), rDeferred.promise);
- listDeferred.promise.then(
- function() {
- rDeferred.resolve(resource);
- });
- list.push(resource);
- });
-
- listDeferred.resolve(list);
- });
- return list;
- },
-
- /**
- * Create a new configuration.
- *
- * @param {{}} configuration The configuration to add.
- * @returns {{}} A resource for this new configuration object.
- */
- create: function(configuration) {
- return createConfig(configuration);
- },
-
- /**
- * Retrieve a specific configuration by ID.
- *
- * @param {String} id The configuration ID/Name to load.
- * @returns {{}} The configuration resource.
- */
- read: function(id) {
- return readConfig({id: id});
- },
-
- /**
- * Update a configuration in the loaded cache. This will error if the user attempts to
- * update a configuration from a static provider - say the config file.
- *
- * @param {{}} configuration The configuration object to update.
- * @returns {{}} The updated configuration.
- */
- update: function(configuration) {
- return updateConfig(configuration);
- },
-
- /**
- * Remove a particular configuration from the configuration list.
- *
- * @param {String} id The ID to remove.
- * @returns {{}} The configuration object, with appropriate promises.
- */
- remove: function(id) {
- return removeConfig({id: id});
- }
- };
- };
- }
-);
diff --git a/app/js/modules/openstack/dummy_resource.js b/app/js/modules/openstack/dummy_resource.js
deleted file mode 100644
index a24cb5c..0000000
--- a/app/js/modules/openstack/dummy_resource.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * The $$dummyResource component is a placeholder, which simulates the ngResource API. It does
- * nothing on its own, and should only be used in situations where a more appropriate resource
- * could not be resolved.
- */
-angular.module('openstack').factory('$$dummyResource',
- function($q) {
- 'use strict';
-
- /**
- * Apply common resource-like behavior, and instantly reject the promise.
- *
- * @param {*} resource An object to decorate.
- * @returns {*} The decorated instance.
- */
- function resourceify (resource) {
- var deferred = $q.defer();
- resource.$promise = deferred.promise;
- resource.$resolved = false;
-
- resource.$promise.finally(function() {
- resource.$resolved = true;
- });
- deferred.reject('dummy_resource');
- return resource;
- }
-
- return {
- query: function() {
- return resourceify([]);
- },
- create: function() {
- return resourceify({});
- },
- read: function() {
- return resourceify({});
- },
- update: function() {
- return resourceify({});
- },
- remove: function() {
- return resourceify({});
- }
- };
- });
diff --git a/app/js/modules/openstack/error_code.js b/app/js/modules/openstack/error_code.js
deleted file mode 100644
index dd799f7..0000000
--- a/app/js/modules/openstack/error_code.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * An application-wide static constant that contains error code constants.
- * Different modules and components may dynamically add error codes that serve
- * their own needs.
- */
-angular.module('openstack').constant('$$errorCode', {});
diff --git a/app/js/modules/openstack/module.js b/app/js/modules/openstack/module.js
deleted file mode 100644
index bf68f46..0000000
--- a/app/js/modules/openstack/module.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * OpenStack specific configuration discovery.
- */
-angular.module('openstack', ['ngCookies', 'ngResource']);
diff --git a/app/js/modules/openstack/resource_cache.js b/app/js/modules/openstack/resource_cache.js
deleted file mode 100644
index 2935332..0000000
--- a/app/js/modules/openstack/resource_cache.js
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * The resource cache acts as a centralized location where different services' resource
- * instances may be stored. It plays a central role in multi-cloud environments, as a resource
- * abstraction - say IronicNode - can create and cache the actual ngResource instances for N>1
- * configured ironic endpoints.
- *
- * In order to maintain flexibility, it does not build resources, it only accepts preconstructed
- * instances. It is strongly recommended that you store your resource instances using the root
- * URI of the API to which your instance is talking, so that 'https://somecloud.com:6385/v1/nodes'
- * will be stored separately from 'https://someothercloud.com:6385/v1/nodes'.
- */
-angular.module('openstack').factory('$$resourceCache',
- function() {
- 'use strict';
-
- /**
- * Cache of all the resource instances.
- *
- * @type {{}}
- */
- var resourceCache = {};
-
- return {
-
- /**
- * Store a resource instance in the cache.
- *
- * @param {String} uri The root uri of the resource.
- * @param {*} resource The resource to store.
- * @return {*} The stored resource.
- */
- set: function(uri, resource) {
- resourceCache[uri] = resource;
- return resource;
- },
-
- /**
- * Retrieve a resource instance from the cache.
- *
- * @param {String} uri The uri of the resource to retrieve.
- * @return {*|undefined} The resource, or undefined.
- */
- get: function(uri) {
- if (resourceCache[uri]) {
- return resourceCache[uri];
- }
- },
-
- /**
- * Check whether or not a resource is in the cache.
- *
- * @param {String} uri The uri of the resource to check.
- * @return {true|false} Whether this resource has already been cached.
- */
- has: function(uri) {
- return resourceCache.hasOwnProperty(uri);
- },
-
- /**
- * Remove a specific resource from the cache.
- *
- * @param {String} uri The uri of the resource to remove.
- * @returns {void}
- */
- remove: function(uri) {
- if (resourceCache.hasOwnProperty(uri)) {
- delete resourceCache[uri];
- }
- },
-
- /**
- * Return all the uri keys currently registered.
- *
- * @returns {Array} An array of all registered uri keys.
- */
- keys: function() {
- var keys = [];
- /*eslint-disable guard-for-in*/
- for (var key in resourceCache) {
- keys.push(key);
- }
- /*eslint-enable guard-for-in*/
- return keys;
- },
-
- /**
- * Remove everything from the cache.
- *
- * @returns {void}
- */
- clearAll: function() {
- var keys = this.keys();
- for (var i = 0; i < keys.length; i++) {
- delete resourceCache[keys[i]];
- }
- },
-
- /**
- * Return the number of resources in the cache.
- *
- * @returns {number} The number of resources cached.
- */
- length: function() {
- return this.keys().length;
- }
- };
- });
diff --git a/app/js/modules/openstack/selected_configuration.js b/app/js/modules/openstack/selected_configuration.js
deleted file mode 100644
index e715ffe..0000000
--- a/app/js/modules/openstack/selected_configuration.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * The $$selectedConfiguration service provides a way of easily accessing, and modifying,
- * the current active cloud configuration used in an application. It will resolve configurations
- * from the $$configuration provider, which provides multiple configuration loading mechanisms.
- */
-angular.module('openstack').service('$$selectedConfiguration',
- function($$persistentStorage, $$configuration) {
- 'use strict';
-
- var storageKey = '$$selectedConfiguration';
- var currentConfiguration, selectingConfiguration;
-
- return {
- /**
- * Retrieve the currently active configuration. If there is not configuration selected,
- * this resources' $promise will fail.
- *
- * @returns {*} The configuration.
- */
- get: function() {
- // If we're in the process of selecting one, return that.
- if (selectingConfiguration) {
- return selectingConfiguration;
- }
-
- // If we have a current one, return that.
- if (currentConfiguration) {
- return currentConfiguration;
- }
-
- // Return the 'selected' configuration by setting it.
- return this.set($$persistentStorage.get(storageKey));
- },
-
- /**
- * Set a particular configuration as active. The selection will only be persisted to
- * LocalStorage if the selected configuration is valid and available in the
- * $$configuration list.
- *
- * @param {String} configurationId The configuration to activate.
- * @returns {*} The active configuration.
- */
- set: function(configurationId) {
- // Normalize input
-
- if (angular.isObject(configurationId)) {
- configurationId = configurationId.id || null;
- }
-
- // If we're in a resolved state and the ID's match...
- if (currentConfiguration && currentConfiguration.id === configurationId) {
- return currentConfiguration;
- }
-
- // If we're in a resolving state and the ID's match...
- if (selectingConfiguration && selectingConfiguration.id === configurationId) {
- return selectingConfiguration;
- }
-
- // If we've reached this point, we need to resolve a new configuration.
- selectingConfiguration = $$configuration.read(configurationId);
- selectingConfiguration.$promise.then(
- function() {
- // Only set this if the promise resolves sucessfully.
- $$persistentStorage.set(storageKey, configurationId);
- currentConfiguration = selectingConfiguration;
- },
- function() {
- // if setting fails, clear the existing storage key if it matches. This case occurs
- // if the system initializes with a config ID that has been invalidated since the
- // previous run.
- if ($$persistentStorage.get(storageKey) === configurationId) {
- $$persistentStorage.remove(storageKey);
- }
- }
- ).finally(
- function() {
- // clear the selecting configuration
- selectingConfiguration = null;
- });
-
- return selectingConfiguration;
- }
- };
- });
diff --git a/app/js/modules/openstack/storage/cookie_storage.js b/app/js/modules/openstack/storage/cookie_storage.js
deleted file mode 100644
index 1040123..0000000
--- a/app/js/modules/openstack/storage/cookie_storage.js
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * This file provides an implementation of the storage API, backed by cookies.
- * This particular implementation is not intelligent: It will access the
- * cookie for this domain, as configured by the $cookieProvider, and will
- * grant access to all values stored this way.
- */
-angular.module('openstack').factory('$$cookieStorage',
- function($cookies) {
- 'use strict';
-
- return {
-
- /**
- * Is this storage type supported?
- *
- * @returns {boolean} True if it is supported, otherwise false.
- */
- isSupported: function() {
- return true;
- },
-
- /**
- * Set a value to the provided key in memory storage. If the
- * value already exists it will be overwritten.
- *
- * @param {String} key The key to store the value at.
- * @param {*} value The value to store.
- * @return {*} The stored value.
- */
- set: function(key, value) {
- $cookies.put(key, angular.toJson(value));
- return value;
- },
-
- /**
- * Retrieve a value from this storage provider.
- *
- * @param {String} key The key to retrieve.
- * @return {*|undefined} The value, or undefined if it is not set.
- */
- get: function(key) {
- var result = angular.fromJson($cookies.get(key));
- if (result) {
- return result;
- }
- },
-
- /**
- * Remove a specific value from the storage provider.
- *
- * @param {String} key The key to remove.
- * @returns {void}
- */
- remove: function(key) {
- $cookies.remove(key);
- },
-
- /**
- * Return all the keys currently registered.
- *
- * @returns {Array} An array of all registered keys.
- */
- keys: function() {
- var all = $cookies.getAll();
- var keys = [];
- /*eslint-disable guard-for-in*/
- for (var key in all) {
- keys.push(key);
- }
- /*eslint-enable guard-for-in*/
- return keys;
- },
-
- /**
- * Remove everything from the memory storage mechanism.
- *
- * @returns {void}
- */
- clearAll: function() {
- var all = $cookies.getAll();
- /*eslint-disable guard-for-in*/
- for (var key in all) {
- $cookies.remove(key);
- }
- /*eslint-enable guard-for-in*/
- },
-
- /**
- * Return the size of the current memory storage.
- *
- * @returns {number} The number of keys in storage.
- */
- length: function() {
- return this.keys().length;
- }
- };
- });
diff --git a/app/js/modules/openstack/storage/local_storage.js b/app/js/modules/openstack/storage/local_storage.js
deleted file mode 100644
index e5da3b3..0000000
--- a/app/js/modules/openstack/storage/local_storage.js
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * A $$localStorage service behind a common API. If localStorage is not
- * supported, this will log a warning to the console. If you want a provider
- * that gracefully degrades, use $$persistentStorage.
- */
-angular.module('openstack').factory('$$localStorage',
- function($window, $log) {
- 'use strict';
-
- /**
- * Detect whether localStorage is supported, and make sure we can write
- * to it.
- */
- var isSupported = (function() {
-
- // Does it exist?
- if (!$window.localStorage) {
- return false;
- }
-
- // Can we write to it?
- var testKey = '__' + Math.round(Math.random() * 1e7);
- try {
- $window.localStorage.setItem(testKey, '');
- $window.localStorage.removeItem(testKey);
- return true;
- } catch (e) {
- return false;
- }
- })();
-
- return {
-
- /**
- * Is this storage type supported?
- *
- * @returns {boolean} True if it is supported, otherwise false.
- */
- isSupported: function() {
- return isSupported;
- },
-
- /**
- * Set a value of the provided key. If the
- * value already exists it will be overwritten.
- *
- * @param {String} key The key to store the value at.
- * @param {*} value The value to store.
- * @return {*} The stored value.
- */
- set: function(key, value) {
- if (isSupported) {
- $window.localStorage.setItem(key, angular.toJson(value));
- return value;
- }
- $log.warn('$$localStorage not supported');
- },
-
- /**
- * Retrieve a value from this storage provider.
- *
- * @param {String} key The key to retrieve.
- * @return {*|undefined} The value, or undefined if it is not set.
- */
- get: function(key) {
- if (isSupported) {
- var result = angular.fromJson($window.localStorage.getItem(key));
- if (result) {
- return result;
- }
- } else {
- $log.warn('$$localStorage not supported');
- }
- },
-
- /**
- * Remove a specific value from the storage provider.
- *
- * @param {String} key The key to remove.
- * @returns {void}
- */
- remove: function(key) {
- if (isSupported) {
- return $window.localStorage.removeItem(key);
- }
- $log.warn('$$localStorage not supported');
- },
-
- /**
- * Return all the keys currently registered.
- *
- * @returns {Array} An array of all registered keys.
- */
- keys: function() {
- if (isSupported) {
- var keys = [];
- for (var i = 0; i < $window.localStorage.length; i++) {
- keys.push($window.localStorage.key(i));
- }
- return keys;
- }
- $log.warn('$$localStorage not supported');
- return [];
- },
-
- /**
- * Remove everything from the memory storage mechanism.
- *
- * @returns {void}
- */
- clearAll: function() {
- if (isSupported) {
- var keys = this.keys();
- for (var i = 0; i < keys.length; i++) {
- this.remove(keys[i]);
- }
- }
- $log.warn('$$localStorage not supported');
- },
-
- /**
- * Return the size of the current memory storage.
- *
- * @returns {number} The number of keys in storage.
- */
- length: function() {
- if (isSupported) {
- return $window.localStorage.length;
- }
- $log.warn('$$localStorage not supported');
- return 0;
- }
- };
- });
diff --git a/app/js/modules/openstack/storage/memory_storage.js b/app/js/modules/openstack/storage/memory_storage.js
deleted file mode 100644
index 5927408..0000000
--- a/app/js/modules/openstack/storage/memory_storage.js
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * This provides a memory-based key/value storage mechanism. It's provided as
- * a fallback option for all other storage mechanisms, to prevent unexpected
- * runtime failures.
- */
-angular.module('openstack').factory('$$memoryStorage',
- function() {
- 'use strict';
-
- var memoryStorage = {};
-
- return {
-
- /**
- * Is this storage type supported?
- *
- * @returns {boolean} True if it is supported, otherwise false.
- */
- isSupported: function() {
- return true;
- },
-
- /**
- * Set a value to the provided key in memory storage. If the
- * value already exists it will be overwritten.
- *
- * @param {String} key The key to store the value at.
- * @param {*} value The value to store.
- * @return {*} The stored value.
- */
- set: function(key, value) {
- memoryStorage[key] = value;
-
- return value;
- },
-
- /**
- * Retrieve a value from this storage provider.
- *
- * @param {String} key The key to retrieve.
- * @return {*|undefined} The value, or undefined if it is not set.
- */
- get: function(key) {
- if (memoryStorage.hasOwnProperty(key)) {
- return memoryStorage[key];
- }
- },
-
- /**
- * Remove a specific value from the storage provider.
- *
- * @param {String} key The key to remove.
- * @returns {void}
- */
- remove: function(key) {
- delete memoryStorage[key];
- },
-
- /**
- * Return all the keys currently registered.
- *
- * @returns {Array} An array of all registered keys.
- */
- keys: function() {
- var keys = [];
- /*eslint-disable guard-for-in*/
- for (var key in memoryStorage) {
- keys.push(key);
- }
- /*eslint-enable guard-for-in*/
- return keys;
- },
-
- /**
- * Remove everything from the memory storage mechanism.
- *
- * @returns {void}
- */
- clearAll: function() {
- var keys = [];
- /*eslint-disable guard-for-in*/
- for (var key in memoryStorage) {
- keys.push(key);
- }
- /*eslint-enable guard-for-in*/
-
- for (var i = 0; i < keys.length; i++) {
- delete memoryStorage[keys[i]];
- }
- },
-
- /**
- * Return the size of the current memory storage.
- *
- * @returns {number} The number of keys in storage.
- */
- length: function() {
- return this.keys().length;
- }
- };
- });
diff --git a/app/js/modules/openstack/storage/persistent_storage.js b/app/js/modules/openstack/storage/persistent_storage.js
deleted file mode 100644
index 1603cd1..0000000
--- a/app/js/modules/openstack/storage/persistent_storage.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * A convenience component that automatically selects the most secure, and most
- * persistent, storage mechanism available in the current runtime. This does
- * not include sessionStorage, which must be used independently.
- */
-angular.module('openstack').factory('$$persistentStorage',
- function($log, $$cookieStorage, $$memoryStorage, $$localStorage) {
- 'use strict';
-
- // Check for local storage.
- if ($$localStorage.isSupported()) {
- return $$localStorage;
- }
-
- // Check for cookie storage.
- if ($$cookieStorage.isSupported()) {
- return $$cookieStorage;
- }
-
- $log.warn('Warning: No persistent storage mechanism supported, all storage will be transient.');
- return $$memoryStorage;
- });
diff --git a/app/js/modules/openstack/storage/session_storage.js b/app/js/modules/openstack/storage/session_storage.js
deleted file mode 100644
index 255cedc..0000000
--- a/app/js/modules/openstack/storage/session_storage.js
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * A $$sessionStorage service behind a common API. If sessionStorage is not
- * supported, this will log a warning to the console. If you want a provider
- * that gracefully degrades, use $$persistentStorage.
- */
-angular.module('openstack').factory('$$sessionStorage',
- function($window, $log) {
- 'use strict';
-
- /**
- * Detect whether sessionStorage is supported, and make sure we can
- * write to it.
- */
- var isSupported = (function() {
-
- // Does it exist?
- if (!$window.sessionStorage) {
- return false;
- }
-
- // Can we write to it?
- var testKey = '__' + Math.round(Math.random() * 1e7);
- try {
- $window.sessionStorage.setItem(testKey, '');
- $window.sessionStorage.removeItem(testKey);
- return true;
- } catch (e) {
- return false;
- }
- })();
-
- return {
-
- /**
- * Is this storage type supported?
- *
- * @returns {boolean} True if it is supported, otherwise false.
- */
- isSupported: function() {
- return isSupported;
- },
-
- /**
- * Set a value of the provided key. If the
- * value already exists it will be overwritten.
- *
- * @param {String} key The key to store the value at.
- * @param {*} value The value to store.
- * @return {*} The stored value.
- */
- set: function(key, value) {
- if (isSupported) {
- $window.sessionStorage.setItem(key, angular.toJson(value));
- return value;
- }
- $log.warn('$$sessionStorage not supported');
- },
-
- /**
- * Retrieve a value from this storage provider.
- *
- * @param {String} key The key to retrieve.
- * @return {*|undefined} The value, or undefined if it is not set.
- */
- get: function(key) {
- if (isSupported) {
- var result = angular.fromJson($window.sessionStorage.getItem(key));
- if (result) {
- return result;
- }
- } else {
- $log.warn('$$sessionStorage not supported');
- }
- },
-
- /**
- * Remove a specific value from the storage provider.
- *
- * @param {String} key The key to remove.
- * @returns {void}
- */
- remove: function(key) {
- if (isSupported) {
- return $window.sessionStorage.removeItem(key);
- }
- $log.warn('$$sessionStorage not supported');
- },
-
- /**
- * Return all the keys currently registered.
- *
- * @returns {Array} An array of all registered keys.
- */
- keys: function() {
- if (isSupported) {
- var keys = [];
- for (var i = 0; i < $window.sessionStorage.length; i++) {
- keys.push($window.sessionStorage.key(i));
- }
- return keys;
- }
- $log.warn('$$sessionStorage not supported');
- return [];
- },
-
- /**
- * Remove everything from the memory storage mechanism.
- *
- * @returns {void}
- */
- clearAll: function() {
- if (isSupported) {
- var keys = this.keys();
- for (var i = 0; i < keys.length; i++) {
- this.remove(keys[i]);
- }
- return;
- }
- $log.warn('$$sessionStorage not supported');
- },
-
- /**
- * Return the size of the current memory storage.
- *
- * @returns {number} The number of keys in storage.
- */
- length: function() {
- if (isSupported) {
- return $window.sessionStorage.length;
- }
- $log.warn('$$sessionStorage not supported');
- return 0;
- }
- };
- });
diff --git a/app/js/modules/util/directive/active_path.js b/app/js/modules/util/directive/active_path.js
deleted file mode 100644
index 69bc66c..0000000
--- a/app/js/modules/util/directive/active_path.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * This directive requires ui-router, as it listens for events dispatched as
- * a user navigates through the application, and adds the 'active' class to
- * the bound element if the user's selected path matches the one configured.
- */
-angular.module('ironic.util').directive('activePath',
- function ($location, $rootScope) {
- 'use strict';
-
- return {
- link: function ($scope, element, attrs) {
- var activePath = attrs.activePath;
-
- function setActivePath () {
- var path = $location.path();
- var isMatchedPath = path.match(activePath) !== null;
-
- element.toggleClass('active', isMatchedPath);
- }
-
- // This is angularjs magic, the return method from any $on
- // binding will return a function that will disconnect
- // that binding.
- var disconnectBinding =
- $rootScope.$on('$stateChangeSuccess', setActivePath);
- $scope.$on('$destroy', disconnectBinding);
-
- // INIT
- setActivePath();
- }
- };
- });
diff --git a/app/js/modules/util/filter/capitalize.js b/app/js/modules/util/filter/capitalize.js
deleted file mode 100644
index f3ba9ba..0000000
--- a/app/js/modules/util/filter/capitalize.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2016 Hewlett-Packard Enterprise Development Company, L.P.
- *
- * 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.
- */
-angular.module('ironic.util').filter('capitalize',
- function() {
- 'use strict';
-
- return function(input) {
- input = input || '';
- return input.replace(/([^\W_]+[^\s-]*) */g, function(txt) {
- return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
- });
- };
- });
diff --git a/app/js/modules/util/module.js b/app/js/modules/util/module.js
deleted file mode 100644
index 27d1d7c..0000000
--- a/app/js/modules/util/module.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
- *
- * 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.
- */
-
-/**
- * UI Utilities used by the ironic client.
- */
-angular.module('ironic.util', []);
diff --git a/app/view/ironic/action/provision.html b/app/view/ironic/action/provision.html
deleted file mode 100644
index 7b8a0e5..0000000
--- a/app/view/ironic/action/provision.html
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
{{ctrl.actionName | capitalize }} Node
-
-
-
-
-
- Loading Details...
-
-
-
-
-
-
-
-
Ironic will {{ctrl.actionName}} the following nodes.
- This will remove all knowledge of the nodes from the system. It will not modify the nodes,
- however you will lose the ability to manage them via this application.
-
Below you see a collection of all the Ironic clouds available
- to you. You may add additional ones here, or remove ones that
- you've previously added.
-
-
-
-
-
-
-
-
Name
-
API Endpoint
-
Source
-
-
-
-
-
-
-
-
-
- We were unable to detect a valid ironic service. Would you like
- to add one?
-
-
-