Commit Graph

26 Commits

Author SHA1 Message Date
Fei Long Wang 7a606bbb87 Add API ref
To get a better API spec, this patch is following the OpenStack
community way to describe API ref. Only /products endpoint is
included, costs and usage endpoint will be added in following
patches.

Implement blueprint: api-ref

Change-Id: Icaa121c4257fcc27df93e63ec8c2bb095ac41c43
2017-09-15 14:37:13 +12:00
Feilong Wang f8be0c0710 Support odoo in health check
Co-Authored-By: Amelia Cordwell <ameliacordwell@catalyst.net.nz>
Change-Id: I010bdb444a22bbd7a30ed42054b819a9f520666a
2017-06-28 17:06:03 +12:00
Lingxian Kong 0ab71bae06 Rename get_usage to get_measurements
The costs.py was removed erroneously in previous patch, but it broke
/measurements API.

This patch adds it back but with a different file name to keep
consistency with other APIs.

Add unit tests as well.

Change-Id: Ib34b01d4dca4fb8faf559ba08ba18de7372ecf04
2017-05-31 15:12:42 +12:00
Lingxian Kong dac4cb1fcf distil-collector concurrency support
As the number of our cloud customers and used resources increasing,
it will take a longer time(more than 1 hour) for distil usage
collection, which will lead to database problem, because there will
be more than 1 process operating on the same table for the same
project at the same time, which will also cause performance
degradation.

This change will add a table for locking purpose, it's very easy
to add extra collector without any code or configuration modification.

Change-Id: I25ebd19e8eae9dcc7ee3c2d2389d5ad2658f5e46
2017-02-22 13:11:11 +13:00
Fei Long Wang 3e49f15a1d Add the support for cache
This is a new feature to improve the performance for API request,
since most of the API endpoints of Distil can be cached by parameters.

Change-Id: I2155137a0e9965215f359a20067c4b2065e4de11
2017-01-11 13:31:46 +13:00
Fei Long Wang 09b03931eb Add policy support
Using oslo.policy to support access control for Distil API
access, which will follow the community way.

Change-Id: I670d9fde4f5c368e82c26b512b7c1e46c2e380ec
2016-10-06 14:21:06 +13:00
Fei Long Wang 9024534306 Implement /costs on new service
Change-Id: I12469ec39fcaa79d6588d396367f14107cf4299f
2016-06-03 15:07:52 +12:00
Lingxian Kong c85bda79e6 Add keystone util functions
Change-Id: Ide5756565268aa934e305d2ecb76e49449bd85e5
2016-05-30 13:58:04 +12:00
Lingxian Kong 44837c9943 Implement get_meter function in CeilometerCollector
Change-Id: I10b2c694ccbf8857f864a373fbebcc1b75997d56
2016-05-28 22:54:46 +12:00
Fei Long Wang ed6f9b2c27 Refactor Database layer
Misc changes which include below improvements:

1. Using oslo.db to get a clean db API layer
2. Using alembic to support db migration
3. Fix all the PEP 8 issues for new code
4. A new API /health which is also used to verify the new DB API

NOTE: Given we're using MySQL, so the triggers fro PostgreSQL will
be dropped until there is a requirement for that. And the trigger
creation code will be in a separate patch.

Change-Id: I4edd64cb511d16f1e5243968693ad7e73db43f06
2016-05-10 13:53:08 +12:00
Fei Long Wang 0d20c80a6e Refactor Distil API to support new endpoints
Change-Id: I4d456f9228e879234898177d1f2d791d2ffbbf46
2016-05-05 15:20:17 +12:00
Fei Long Wang 3efcfcdf6a Support Windows image billing
Windows image support is a new feature to for both distil and
odoo glue script.

1. Distil Change: Distil needs to know if the instance is a
Windows instance and save it to be persistent in case the
instance or the original Windows image is deleted.

2. Odoo-glue Change: Odoo glue needs to insert new order line
for charing Windows image if we know the instance is a Windows
instance.

Change-Id: I6ee4222a492d612b83371de656e11e756f7ee84d
2016-04-01 10:53:11 +13:00
Jenkins 4984d16195 Merge "Remove wsgiref from requirements" 2016-02-24 00:15:57 +00:00
Andreas Jaeger ee3d9cbed0 Remove wsgiref from requirements
wsgiref is now in stdlib, so no need to install it explicitely from
pypi, remove this.

Change-Id: I96aaab0a4056f16ed342fb3b231e410ea4d1d486
2016-02-23 23:09:20 +00:00
Andreas Jaeger a90fc02ee0 Remove argparse from requirements
argparse was external in python 2.6 but not anymore, remove it from
requirements.

This should help with pip 8.0 that gets confused in this situation.
Installation of the external argparse is not needed.

Change-Id: Ib7e74912b36c1b5ccb514e31fac35efeff57378d
2016-02-23 23:09:06 +00:00
Lingxian Kong 7dff9372b4 Fix jenkins failure
- Use sqlite in-memory database.
- Skip rest api tests(they always fail, need to figure out in future).
- Combine setup() and teardown() methods for TestModels and TestAPI
  class.

Change-Id: I229c850784218e1ff903503d031245a502d040b3
2016-02-23 11:35:46 +13:00
Lingxian Kong 3149d560c1 Sync distil project structure with internal one
We will lose commits history for some reason, so dump the commits history
as the following:

db927106e7362f25384b1e7113d92538ba100f38 Remove residual oerplib
dependency
42d8a04a8c66299c4c4c58643c89f043ee3b3f13 Fix import error
202937f0d8b4f3dd5f18e989a6e2dfb3a633fa8c Switch oerplib to odoorpc
2e307f84e5f8e93da67fd4c32683c246237c864d Add update-quote function
0c9d8c29ae112f9758347eba153e1fb5fed8b482 Set the correct sales team
df26990838c0d7b0c6721825989706d07747e92a Support traffic billing for
odoo script
2c75433a29fd5c42a2a29b41617b5fa4e42103b4 Add retry support and audit
97aadd2179496255c06f5c1c2a9368500ea74588 packaging: python-distil
depends on client
021ebf0e21a6e42ed853b507fb4f16daaad14b49 Bump changelog to 0.5.10
604b906afac25c9c64862799a0d12565db2064a5 Fix network service tranform
issue
956c8368435bd9ff3bba45bdde18fb72102a9d5c Skip traffic data
a404539dd7d0fa2e19fd2f5536bbd0c18b3bc468 Prep for Odoo migration
f10743440375cdc5512d0c4fff8b239cbdf42e0d Fix changes for Debian
packaging
b76536576e63848aeaa29326a0bac2cf8092e935 Bump version number and add
myself to uploaders
7af68dcc4b521e5851a5f18cc647f4312bfd7fa4 fixing an error if counter
volume is None
f7ec36305e174cd3b1c77cf96fd9025e7774c420 Fix the multithread issue of
strptime
1b16e9bfb4d5e97bd071569d3bca864d6b236cca add debian packaging
9149898015c8d4f859b316a85608bea905a3ca62 Support dynamic source
4dd95ba8be2d8d8a58bb0d6a0ba80cadfb54dd75 dropping near zero entries
766bee76234ffcf71cd0cdd13e1e3f677389390e Merge multi region in odoo-glue
eddc940dbe9cdbcdf9109e3553ffe65ad80c1496 Make it free for one network
and one router
2bb70fe2ecddde3b5db1fa64fc1416bc8835ee93 Don't read rates file everytime
accf74e36519a116acf909cab85cd070dba998a0 version bump
7035605a9ff1e42a1120ee438dfe6de413bf2b76 fetch resource metadata in bulk
when handling get_usage/get_rated.
5c6f7c0831b9560d85ce33e690c6d299470b7de8 version bump to 0.5.2
5a6233e18aa0e79bf6504f8fbe9bd04d7b4afa39 update rates
6f985422ea42f7ac545ed66e62a18760f14e3913 update odoo glue scripts for
distilclient-0.5.1 api break
33c54fe6fc892d4b5621170f5e31ee9df63ed287 Tweak distilclient packaging to
not require custom PYTHONPATH
dc22431354ff96b02fb4def6b010575cc1f1be72 get rid of
product-name-in-line-description kludge
10925492548183749cac77202d71e38291bb5440 setting up memcache
1e106cf1e012102a3cd49af543401826e67eb6a9 version bump to 0.5.0
ac29b39c629b466dcf2e04655b0491d5eb00040b Second uptime transformer for
instance metric
10e37ad6b4c222efbfe0f88261ecd4fb89df93e4 adding another state to
billable states
0e647ead7f6a990d279211caf2993f963372032d client: Rename some functions
for clarity
7280ed585b0524c4376ef89116210f7c68ae94e4 Enable the tox for Distil
6daafca0a9f0b2a8688b9906fbea320eb4d40b2f Removing sales-order
functionality from the api
c12a41d5b67eb8b95abcfbc2d9eeb96cc56e8b2c version bump to 0.4.3
af86e1af31efb14ff6dac39f0c3b642fd4a4e0c4 distil: Region awareness for
nova and cinder lookups
bd71c7106093d2a178417f042201e8ee68ac9929 odoo: Add glue script to set
current prices in distil
5a8b1596f4f08c2ea060d0da9dac844d6ae8039d odoo: Make region-aware
540eb5234f139bf9c51eb60571a81bda25cd9dd7 Import odoo-glue tree into
odoo/
8ed7c74f91d2ffd6c0b1ac50274e238f9e020502 Minor fix to tenant_validation
fed3c8d4d86e09750ac3fa324bded977abe698f5 Require admin or owner
bffebdf974f7e1aad210ff99040424a8f2da19f2 adding missing package depends
for cinderclient
6198f1ec1fdbe0390a43571320159317e7dffa27 add toplevel

Change-Id: I81581ca2aaee006daad2c1071068c651865ebb32
2016-02-10 14:56:13 +13:00
Fei Long Wang 3038043a2b Remove dup novaclient in requirements.txt
Change-Id: I35f0c3e35551363c29272f0f10caab034e28e4a6
2014-07-15 11:41:05 +12:00
Chris Forbes a2ac8a6816 interface: Drop ceilometerclient dependency
We weren't using this since the usage collection rewrite.

Change-Id: I456ceedb70eaeca9da05d7bf892014f33a3c509d
2014-04-28 16:51:56 +12:00
Aurynn Shaw bf671c0210 Moves the artifice web API into the artifice package. Updates the build
system to create a working .deb, based on the makefile.
Adds a new script to start up the web daemon.
Adds a new script to test if the database is provisioned
Adds a new script used by Puppet to provision the database
Adds puppet manifests (mirrored in main puppet)
Moves api/ to artifice/api
Alters some of the relative imports
Moves artifice.py to why_is_this_called_artifice.py, as it was causing
import issues.

Change-Id: Id8a909f7ffcc64a5c4e3281c6b5ba83cef73b596
2014-04-01 16:08:49 +13:00
Chris Forbes 4c9105fc9d be less fussy about python-novaclient version
2.17.0.5 is what you currently get with devstack, but it's not available on the
python package index -- 2.17.0 is the latest there.
2014-03-20 12:13:37 +13:00
adriant 99c52c1cd7 moved the novaclient helper function to a helpers module.
added mocking to avoid it being used in tests.
2014-03-19 17:15:50 +13:00
Chris Forbes ea47c1cdd6 add missing packages to requirements 2014-02-27 11:18:27 +13:00
Aurynn Shaw 0ec26b2933 Tweaks and bugfixes moving towards a stable-ish release 2013-09-02 17:00:12 +12:00
Aurynn Shaw f905dcfd8e Packaging-related stuff 2013-08-28 14:20:18 +12:00
Aurynn Shaw 4c07898182 Adding gitignore. Fixing the SQLAlchemy models to load, interconnect as expected. 2013-08-06 14:19:43 +12:00