openstack.api.js
v0.1.1
Published
Implementation of the openstack api in a pure angularJS
Downloads
3
Readme
API.js
Pure angular implementation of the Openstack API clients.
Build
Requirements
In order to develop on this lib you need to have at least NodeJS installed.
Installation
npm install -g gulp bower
- Use
npm install && bower install
inside project's folder to install all the required dependencies
Tasks
Usage: gulp
(calls default task) or gulp [task_name]
Available tasks are:
clean
: deletes thedist
folderjshint
: runs jshint over the js filestest
: runs the unit and e2e teststest:unit
: runs the unit tests oncetest:unit:watch
: runs the unit tests and then watch file changes of source and test them again everytime something changetest:unit:ci
: runs the unit tests for travis ci (integration with coveralls)
e2e tests must have the api.json file set up, see the development section
test:e2e
: runs the e2e tests oncetest:e2e:watch
: runs the e2e tests, watch for file changes, and test them again if something is different.test:e2e:debug
: allow the developer to debug e2e tests, to do that, you need to open a browser onlocalhost:9876/debug.html
(port can vary if it is already used, look at the console output).build
: clean, checks source files with jshint, tests, and then build in the dist folder, the filesopenstack.api.js
andopenstack.api.min.js
(default task)
Options
You can also specify on which module you want to run a task,
by specifing its name with the --module=module1:module2
syntax.
All modules are listed in the modules section and in the config.json file in the modules section
For example to run tests over keystone.base module you just have to run
(it works for all tasks except clean)
gulp test:unit --modules="keystone.base"
Development
Run cp api.json.example api.json
edit the api.json file,
and replace the value of the URLs by the ones of your openstack config.
Then run the gulp e2e debug task: gulp test:e2e:debug
.
For debugging, all the test files are available in your browser
at the following address: http://localhost:9876/debug.html
.
You can now place a debugger statement wherever you want
in order to debug your development.
Modules
Currently, the following modules are supported:
- keystone.base: an implementation of keystone basic functionality, it allows you to ask for a token, and to list the tenants
- heat: a quite finished implementation of the heat client, software configuration is not supported at this point.
Workflows
All modules have tests which can contact a real openstack service. These tests can be used to see a simple workflow on how you can use those services. Checks the documentation on each module test to see a description:
See it in action
For a quick start just to see the lib running you need
git clone https://github.com/OpenstackJS/API.js && cd API.js
follow the requirements and installation sections
be sure to have a devstack or an openstack set up to interact, if not, please look at the local.conf file in the repo, for a default devstack
cp api.json.example api.json
then edit the file in order to provide informations for a devstack or an openstack instancechecks the requirements of each worflows in order to have working tests
IMPORTANT:
gulp test:e2e:debug
go to http://localhost:9876/debug.html and open the debugger (ctrl + alt + j for chrome on windows/linux, cmd + alt +j for macOS) of your browser to see if everything is working fine