67 Commits

Author SHA1 Message Date
Frédéric Guillot
3a8c877081 Add link to the documentation
Change-Id: I97bfe72cbf0460547681f5a2afefe268044fcbe0
2016-11-29 12:41:52 -05:00
Paul Millette
5ff08a68c9 Add json outputs to documentation
- use literal includes to show input and output
- add input payloads folder to docs
- add output payloads folder to docs

Change-Id: Ifaa782422edc2d0fee70fcc2f8909fd928e363cc
2016-11-28 11:12:46 -05:00
Frédéric Guillot
7c14e2e868 Migrate to oslo_messaging and oslo_service
This modification introduce a breaking change about AMQP
queue handling.

Now, Almanach use the same terminology as other OpenStack
projects.

- By default, Almanach listen on the "almanach" topic
- The "info" priority is used to receive notifications
- The "error" level is used as retry queue
- The "critical" level for the dead queue

To be compatible with olso_messaging drivers, transport_url
must start by "rabbit://" to use the driver kombu.

Change-Id: Ia331d68e94c8ce4196b2d5f3b974a8dbdd6016ef
2016-11-17 10:13:56 -05:00
Frédéric Guillot
f4c176ff96 Fix 500 error when using bad date format or invalid payload
- Simplify exception handling in API handler.
- The API code absolutely need to be refactored to use
the same date format everywhere and to use the same way
of handling JSON parsing/serialization, basically
validation of incoming data must consistent across the
application.

Change-Id: Ie490fac8867086e7f3e719a04993f9803e48b350
3.3.2
2016-11-03 11:18:27 -04:00
Frédéric Guillot
f1cb73cab3 Use URL to define RabbitMQ connection
* kombu have been updated to be compatible with global
requirements
* Unit test have been modified due to breaking changes
introduced by kombu library
* kombu will be replaced later by oslo.messaging
* Add new config option to define multiple connection
URL separated by a semi-colon
* Use secret parameter to avoid any password leaks in log
files
* Add option for connection heartbeat

Change-Id: Ia1db99f5804a0b3cdd496485f6a9410758d567fe
3.3.1
2016-11-01 13:48:56 -04:00
Frédéric Guillot
07cb2a0441 Make abstract class compatible with Python 2 and 3
Change-Id: I71eb914588213c667842d86426170fffa3d5d818
3.3.0
2016-10-13 16:32:55 -04:00
Frédéric Guillot
743eaf78cc Add support for multiple storage backends
* New storage drivers can be implemented in addition
  to MongoDB, for example: MySQL or Postgres, etc.
* The default database driver still MongoDB
* New storage drivers must implement the interface
  defined by the class BaseDriver
* Flexmock and hamcrest are deprected for new unit tests

Change-Id: I1cf73f28d469d2f22ecbaf345e53b9596cc0c2f6
2016-10-13 13:30:27 -04:00
Frédéric Guillot
e0561271cf Migrate code base to oslo.config and oslo.log
In order to migrate the code base to the "OpenStack way":

* Replace ConfigParser by oslo.config
* Replace logging by oslo.log
* Use testtools as base class for unit tests
* Add tox -e genconfig to generate config file
* Start to organize the file structure like other projects
* Define 2 cli entry points almanach-collector and almanach-api
* The docker-compose.yml is now used to run integration-tests
* Integration tests will be moved to tempest in the future
* Docker configs should be deprecated and moved to Kolla

Change-Id: I89a89a92c7bdb3125cc568323db0f9488e1380db
2016-10-13 11:28:09 -04:00
Frédéric Guillot
13d383a50c Rename exception class to be consistent with the code base
Change-Id: Iffcfad802a1e588ed3886f9573ddaec675b82d55
2016-10-12 08:59:24 -04:00
Jenkins
592702b4df Merge "Generate api documentation using sphinx and autoflask" 2016-10-11 12:28:51 +00:00
Frédéric Guillot
a180ee30f8 Move all exception objects in the same place
- Follow what other OpenStack projects are doing
- Respect the OpenStack guidelines about import
- Remove common packages

Change-Id: I4a3f598537ed5f54edab79471d074a46fa99ab52
2016-10-07 14:49:08 -04:00
Paul Millette
3262ba7b82 Generate api documentation using sphinx and autoflask
- add autoflask to index.rst
- add pydocs for all methods
- move app out of AlmanachApi so autoflask can see it

Change-Id: I83e1af74507091774d1eff86fa1d07a237d69729
2016-10-07 14:25:43 -04:00
gecong1973
22c6251c2a Add __ne__ built-in function
In Python 3 __ne__ by default delegates to __eq__ and inverts the
result, but in Python 2 they urge you to define __ne__ when you
define __eq__ for it to work properly [1].There are no implied
relationships among the comparison operators. The truth of x==y
does not imply that x!=y is false. Accordingly, when defining __eq__(),
one should also define __ne__() so that the operators will behave
as expected.
[1]https://docs.python.org/2/reference/datamodel.html#object.__ne__

Change-Id: I2eecd9d90a3a6ba09917f27f2f8568a42beb58d1
2016-09-22 14:14:56 +00:00
Frédéric Guillot
6a3812cf1b Fix gate docs-ubuntu-xenial
Change-Id: I429724d76b46dfc318b8a4212a5658cdf9de9865
2016-09-21 18:01:15 -04:00
Marc Aubry
51d6364b07 Add devstack plugin
Change-Id: I47be86218a744f3b7937380b7adbe5268c04abf0
2016-09-09 16:48:08 -04:00
gecong1973
371bf1bdff Add __ne__ built-in function
In Python 3 __ne__ by default delegates to __eq__ and inverts the
result, but in Python 2 they urge you to define __ne__ when you
define __eq__ for it to work properly [1].There are no implied
relationships among the comparison operators. The truth of x==y
does not imply that x!=y is false. Accordingly, when defining __eq__(),
one should also define __ne__() so that the operators will behave
as expected.
[1]https://docs.python.org/2/reference/datamodel.html#object.__ne__

Change-Id: Ib9db2166313f49f3b40df7ce0aba8b01c6a2869a
2016-09-05 16:40:44 +08:00
Nguyen Hung Phuong
90bb67ffb6 Clean imports in code
In some part in the code we import objects.
In the Openstack style guidelines they recommend to import only
modules.

http://docs.openstack.org/developer/hacking/#imports

Change-Id: I58b2dab1a46128893648630edba615e2592040ac
2016-08-25 17:14:29 -04:00
Marc Aubry
451191f843 Add py35 for unit test
Change-Id: I102b3e1e55d8d2195525354d744a38afdf75be13
2016-08-23 15:08:35 -04:00
Marc Aubry
7f33dcc7df Add compatibility to python3
Change-Id: I20251e3dbe495c60a2a17751d84a395d10d38817
2016-08-22 17:47:19 -04:00
Frédéric Guillot
4f9fe41f51 Convert Markdown to reStructuredText format
Change-Id: I8094a23cc6d32c6fc280b89a2633dd80b001398a
2016-08-17 17:11:52 -04:00
Frédéric Guillot
3ace712f06 Remove useless travis.yml file
Change-Id: I3b2cb3ef163cc0fdd5cf55d606f8ee505c6db40d
2016-08-16 15:47:06 -04:00
Frédéric Guillot
caa78a0cd1 Make project compatible with OpenStack CI
* Add gitreview
* Update tox configuration
* Add skeleton for documentation
* Change requirements to be compatible with OpenStack global requirements

Change-Id: Ic137410083bebfe58a653d6ffc0565d6a61f393d
3.2.1
2016-08-15 10:17:51 -04:00
Frédéric Guillot
9986845af9 Add links to bug tracker (#27) 2016-07-22 11:57:19 -04:00
Marx314
1728025721 Authentication allow now token and keystone together (#26) 3.2.0 2016-07-14 13:05:23 -04:00
Frédéric Guillot
3a458da2cb Add API endpoint to fetch an entity (#25)
* Add API endpoint to fetch an entity

* Move logic to outside of the API
2016-07-13 14:13:55 -04:00
Frédéric Guillot
077daf622f Split bus adapter into volume and instance bus adapter (#23) 2016-06-10 15:05:43 -04:00
Frédéric Guillot
40554b98e3 Added Keystone autentication (#22)
* Added Keystone autentication

* Added license header

* Minor PEP8 fixes
2016-06-09 11:28:31 -04:00
Marx314
cbb2d69371 Merge pull request #21 from fguillot/collector-tests
Added collector tests for volume entities
2016-05-31 15:51:23 -04:00
Frederic Guillot
3a970d7d65 Added collector tests for volume entities 2016-05-31 14:41:05 -04:00
Frédéric Guillot
4cb6c8c535 Split and add new integration tests (#20)
* Split and add new integration tests

* Fix some PEP8
2016-05-31 12:09:35 -04:00
Marx314
87de8d1f0d HEAD method to obtain whatever an entity exist or not (#19) 2016-05-30 17:13:05 -04:00
Marx314
5c16300397 Origin/integration test (#18)
Added integration tests with Docker
2016-05-26 11:41:40 -04:00
Frédéric Guillot
6b6d25124f Added integration tests with Docker (#17)
* Added integration tests with Docker
* Cleanup more data
2016-05-19 16:06:02 -04:00
Marx314
a81c0554b5 Modify api to support edition of closed entity 3.1.0 2016-05-18 12:05:09 -04:00
Frédéric Guillot
47ab4568ce Added Docker configuration (#12) 3.0.0-dev 3.0.0 2016-05-03 15:56:34 -04:00
Olivier C
6df2aa2a9d Merge pull request #13 from fguillot/doc
Added configuration instructions to the documentation
2016-05-03 15:30:25 -04:00
Paul Millette
00f5d6994b Handle API response errors (#14)
Assert that exception message is not empty
Added voluptuous
2016-05-03 15:15:49 -04:00
Frederic Guillot
466b786226 Added configuration instructions to the documentation 2016-04-29 16:12:18 -04:00
Marx314
c621ede3ca Merge pull request #11 from fguillot/fix-logging
Fix logging regression
2.0.0
2016-04-26 16:24:40 -04:00
Marx314
aea1c8d69c Merge pull request #10 from fguillot/retry-unordered-events
Do not ignore silently instance.delete.end events when the entity is not created
2016-04-26 16:23:40 -04:00
Frederic Guillot
9d6c746f5a Fix logging regression
- The Python logger have to be configured before to start the daemon
- If no custom logger configuration is provided, the default behavior is to log to stdout now (useful for Docker images)
2016-04-26 10:51:18 -04:00
Frederic Guillot
173ba69d79 Do not ignore silently compute.instance.delete.end events when the entity is not created
- When events are received in the wrong order, instance delete are not taken into consideration
- There is already a mechanism that send messages to the retry queue
- This fix check the existence of the entity before doing the database update
- This fix send to the retry queue messages with entity not found
2016-04-26 10:00:19 -04:00
Sebastien Delisle
ad65784568 Merge pull request #9 from fguillot/port-config
Make API port configurable
2016-04-25 15:39:48 -04:00
Frederic Guillot
a3b2b2ff0e Make API port configurable 2016-04-25 11:24:19 -04:00
Marx314
3784db8475 Merge pull request #8 from fguillot/fix-gunicorn
Do not use Gunicorn inside the app (override command line arguments)
2016-04-25 11:15:30 -04:00
Marx314
7992d03364 Merge pull request #7 from fguillot/env
Added environment variable overrides
2016-04-22 09:45:56 -04:00
Frederic Guillot
2598020577 Do not use gunicorn inside the app (override command line arguments) 2016-04-21 17:52:11 -04:00
Frederic Guillot
d8632a8de6 Added environment variable overrides 2016-04-21 16:35:47 -04:00
Frédéric Guillot
0280cf911e Use standard Python command line parser (#6) 1.0.5 2016-04-21 14:20:34 -04:00
Marx314
b013e96aff flake8 now automated (#5)
* flake8 now automated
* 120 chars max, auto-reformat intellij
2016-04-15 07:49:15 -04:00