This is a charge service for the OpenStack. It can do the followings:
- Generate the order if any required resources are created and close the order when the resource is deleted.
- Calculate the price according to the order.
- Charge the user.
There are 3 parts to deployment.
- The WSGI middleware for the OpenStack. It should be installed in every API node in the OpenStack.
- The charge system implementation. It can be installed everywhere. But better under a Ngix or HA Proxy.
- Before you start, make sure you put your configuration under folder config. The config/config.default.js is the basic configuration for the app to start. You need to put the other configurations like db/memcached in your env configuration. Please follow this step:
- Name your env by the command:
export EGG_SERVER_ENV="local"
- Create your configuration file according to the env. Here the name should be config/config.local.js
Please make sure those components are installed in your enviroment. Both in API node and the server you installed the source code.
- Node: 7.6.5 and above.
curl --silent --location https://rpm.nodesource.com/setup_7.x | bash -
yum install -y nodejs
The middleware is a python code that will capture the OpenStack API's request and response. To install the middleware. Please follow the step:
- Copy the middleware code to your API node.
- Install the middleware code:
pip install .
- Configure to add the middleware in the OpenStack module:
node script/setup.js
Note: You must use the properly user to run this command.
The checker is used to check the resource and generate/delete order if does not match. To use it please run as follows:
yarn run schedule checker