Commit Graph

13 Commits

Author SHA1 Message Date
David Moreau Simard 1abe276bae
Refactor ara-server into namespaced python modules
This is a structure that will allow us to install everything under
"ara" as separate packages but inside the same module.

For example, installing ara-server will provide ara.server and
ara.api.
Installing ara-clients will provide ara.clients, ara-plugins will
supply ara.plugins, etc.

Change-Id: I27ee431c4e5d946f558befc12937ba2f3c0d020b
2018-06-20 08:38:49 -04:00
David Moreau Simard 44d108cbbd
Add completed attribute to plays and tasks, remove files from tasks
It's relevant to track whether or not plays and tasks have completed
like playbooks so let's do that.

For tasks, they are only associated to a single file so drop the
'files' attribute, we already have a 'file' field.

Change-Id: I15e37a9f913fca51dad5143ff88bd3f1c1cf0d28
2018-06-19 17:28:22 -04:00
Guillaume Vincent bacd61bade
Fix POST /playbooks/:id/files
The Playbook is kind of special in the sense that it has it's own
(playbook) file but it's also very convenient to store references for
all the files relevant to a playbook execution in a single place.

This makes it so we are able to append files individually as they come
up in the various stages of the execution of a playbook.

Change-Id: I7bf8dcb8286adb702d0a884cdcfeea6ac419b417
2018-03-29 12:36:38 -04:00
Guillaume Vincent 61bd81226f
Add file foreign key to Task and Playbook
And add some tests, too.

Change-Id: Ie44dd60dd7fdee546b3d3a2a5424f8f551f08b4e
2018-03-29 12:36:37 -04:00
Guillaume Vincent 17f6c9eca5
Refactor django models
- Turns out that some datetime fields should actually use timezone.now
- Move file/filecontent out of a relationship with playbooks
- Add many/many relationships for files/filecontents
- Add some tests

Change-Id: I2e83c0a584b49069e423a9ec8c2c9025a52ea7ef
2018-03-29 12:36:35 -04:00
Guillaume Vincent 69cc8dcac1
Fix compression, date fields and add some tests
- Issue with compression due to lack of json.dumps
- Use "auto_now_add=True" instead of "django.utils.timezone.now"
- More tests

Change-Id: I7447750b843d1622db5489e1045592945be1d090
2018-03-29 12:36:33 -04:00
David Moreau Simard 167fc26311
Squashed general improvements
This is a squash of several general improvements like:

- Add and fix docstrings
- Add new task/files endpoints
- Set up file and content compression/decompression
- Try to get serializers work the way we want them to

Change-Id: I52ba5b31e9d225704ed271ede843f3d4a6b468b4
2018-03-29 12:36:32 -04:00
Guillaume Vincent a1ed3a3291
Fix HyperLinkedRelatedFields serializers and fields
This makes the HyperLinkedRelatedFields work as they are intended to.

Change-Id: I6c9556a4ad6127471dc7cb2139c32c1d74a36704
2018-03-29 12:36:30 -04:00
David Moreau Simard 23fbf95672
Add a script to create mock data
It's convenient to have a script to easily add mock data to test the
API and model with. Let's do that.

Change-Id: I0f108b19d35280faa472850bdeb9ac83f3faa505
2018-03-29 12:36:29 -04:00
David Moreau Simard e6a39c9663
Update model and serializers to 1.0 schema
The proof of concept/prototype was built using a database schema that
was closer to what the stable release of ARA used instead of the one
that had been worked on already for 1.0.

This updates the models and API serializers to reflect that and be more
accurate.

Change-Id: I963823e84e2d2ef9f6262cd04de8fd31ffc7d5b4
2018-03-29 12:36:27 -04:00
David Moreau Simard 4e6df8ba44
Add missing views and URLs to cover the entire model
Change-Id: I96ba3d8174ef9f81d80a560105fdd1f11a34817d
2018-03-29 12:36:25 -04:00
Guillaume Vincent 3d42296683
Remove DRF nested router and make api flat
Change-Id: Ib71519b9fab19d58b23467b811bc7aa482c1455b
2018-03-29 12:36:20 -04:00
Guillaume Vincent a889a71bcd
💥 first commit
Change-Id: I42df36220dce581a929c604a13bba0ccb3d580e6
2018-03-29 12:36:14 -04:00