https://github.com/lishisangzi/charge
Billing System for OpenStack
https://github.com/lishisangzi/charge
billing openstack
Last synced: 11 months ago
JSON representation
Billing System for OpenStack
- Host: GitHub
- URL: https://github.com/lishisangzi/charge
- Owner: LiShiSangZi
- Created: 2017-05-15T00:07:10.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-01T02:22:41.000Z (over 8 years ago)
- Last Synced: 2025-04-10T06:54:19.488Z (about 1 year ago)
- Topics: billing, openstack
- Language: JavaScript
- Size: 204 KB
- Stars: 1
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Charge Service for the OpenStack
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.
# Deployment
There are 3 parts to deployment.
1. The WSGI middleware for the OpenStack. It should be installed in every API node in the OpenStack.
2. The charge system implementation. It can be installed everywhere. But better under a Ngix or HA Proxy.
3. 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:
1. Name your env by the command:
```
export EGG_SERVER_ENV="local"
```
2. Create your configuration file according to the env. Here the name should be config/config.local.js
## Enviroment
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
```
## Middleware
The middleware is a python code that will capture the OpenStack API's request and response.
To install the middleware. Please follow the step:
1. Copy the middleware code to your API node.
2. Install the middleware code:
```
pip install .
```
3. Configure to add the middleware in the OpenStack module:
```
node script/setup.js
```
Note: You must use the properly user to run this command.
## Run schedule by manual.
The checker is used to check the resource and generate/delete order if does not match.
To use it please run as follows:
```bash
yarn run schedule checker
```