Commit Graph

28 Commits

Author SHA1 Message Date
David Moreau Simard 33e4c1d841
Update README to explain ara-server was migrated back into ara
The ara-server standalone repository is being discontinued.
The clear and logical separation of components was nice but the overhead
in complexity was not worth it.

Change-Id: I9d5e3096db4972405932ae2af46ee63bfeef43b5
2019-03-02 08:47:26 -05:00
Guillaume Vincent d3de8af4c8
Allow get results with multiple statuses
Change-Id: Id649fa95e908ba69d3e95502a47e203496e5b79e
2019-01-30 16:30:00 -05:00
Florian Apolloner 39339053ec Added endpoint exposing ara and python version.
Change-Id: Ic0fead79c0b87d87b990cc6c6526a44414a4546e
2018-12-21 11:39:30 +01:00
David Moreau Simard 2bd8c3f654
Refactor and standardize how files are added to playbooks
Files are now (once again) related to playbooks.
We expect the playbook to be created first and then it's files are
created and associated to it.

- the /api/v1/playbook/<id>/files endpoint was removed
- the playbook id is now required when doing a POST on /api/v1/files
- playbook.file referenced a file object and no longer exists.
- playbook.file was replaced by "path" which is the path for the playbook
  file.
- playbook.files still exists but, from an API standpoint, this means
  that to find the files associated to a playbook, we can now do
  something like:

    "/api/v1/files?playbook=%s" % playbook.id

To find the playbook file itself, we can do something like:

    "/api/v1/files?playbook=%s&path=%s" % (playbook.id, playbook.path)

Change-Id: Id51129757e1626313caee4005b081027e5694aba
2018-12-20 17:49:01 -05:00
David Moreau Simard c5890ea0cc
Add playbook filtering by status
This allows to search playbook by status (running, failed, completed,
etc.)

Change-Id: I05bba5611bb1f18e48791d570575b6f57c5862d9
2018-12-06 18:03:43 -05:00
David Moreau Simard 1e2a936a18 Add record filtering by key
Change-Id: Iea6cae697a64b75ffda070f909d2fc5382ad9a82
2018-11-20 14:53:26 +00:00
David Moreau Simard cd66991bd1 Add record filtering by playbook id
Change-Id: Iadb7840e09f35f8e6bfd5c360edd4b3be7f7f5e4
2018-11-20 14:53:19 +00:00
David Moreau Simard 7265ac64ee
Add DjangoFilterBackend to default DRF filter backends
This makes it so it's not required to add to every viewset.

Change-Id: Ibd1a9bde4750424c34986ada97d15550e2ba5e85
2018-10-16 14:51:17 -04:00
David Moreau Simard 299883fd35
Add stats filtering by host
Change-Id: Ib716398e45a9cd4ce9aef1308339c347aab95449
2018-10-16 13:27:29 -04:00
David Moreau Simard 63878f733e
Add result filtering by status
Change-Id: I8c4e8e4bbb6f0957b8c42a0328e00b12129d717a
2018-10-16 13:25:15 -04:00
David Moreau Simard 075e790eba
Add result filtering by playbook id
Change-Id: Ia155c2d20df9133b9cf9bf1671b70d698aa06c7f
2018-10-16 13:25:15 -04:00
David Moreau Simard 3d2ed79cd9
Add stats filtering by playbook id
Change-Id: I37a83ee40f1756ba5b35b93de1fc4a738f68790d
2018-10-16 13:25:12 -04:00
David Moreau Simard 2e863887eb
Add host filtering by playbook id
Change-Id: I04c32d60bb87f1323dc187956c1a06301df2615c
2018-10-16 13:18:56 -04:00
David Moreau Simard 85e76d68db
Add task filtering by playbook id
Change-Id: Ibcafe4ad574a7a55c48b99a38f23702f10f2c8a1
2018-10-16 13:18:56 -04:00
David Moreau Simard 864e0b481b
Add play filtering by uuid
Change-Id: I8ec1fdd6d79838dc64e519e0c8ae9b5c5fb22524
2018-10-16 13:18:52 -04:00
David Moreau Simard 70f248c24f
Add play filtering by playbook id
Change-Id: Ic863b9bd9323dc13b31b8a700be9fe429a69774d
2018-10-16 10:16:17 -04:00
Guillaume Vincent fef942b62f
Add search by name on playbook endpoint
Change-Id: I1ffb958aff4aa466cb15e3e2c2e9f0bb28207224
2018-10-16 09:48:33 -04:00
David Moreau Simard 41db775584
Implement API for ARA records
This adds the API support for implementing records in ARA that are meant
to be used by the ara_record and ara_read modules.

Change-Id: I162de3859ec05fb51d190753fe073c48ed6f8823
2018-10-02 14:44:07 -05:00
Florian Apolloner d7b57c9bc3 Run black & isort over the codebase.
Change-Id: I084279e15560a1178376d8ef1ed91ea84c060982
2018-10-01 18:24:47 +02:00
Florian Apolloner 640b51c606 Ensure that add files to a playbook succeeds completly or not at all.
Change-Id: Icda65cc73326df44d1a34543ef03827118e9b2f2
2018-09-28 17:44:20 +02:00
Florian Apolloner 509bbb8486 Small cleanups for django best practices.
Changes include:

 * Custom admin app config instead of monkey patching attributes.
 * DRF Routers & Viewsets instead of manual view configuration.
 * nested viewsets from drf-extensions (for now) to scope files to playbooks.
 * Removed media serving since runserver does this alreay in dev;
    deployment will need another option anyways.

Change-Id: I409bd3f7faa5f133fcb204613baebf2512d34c1a
2018-09-28 08:51:36 +02:00
David Moreau Simard 24bf9ab055
Add Stats model and API
- Reset database migrations back to initial (database schema is not
  stable or supported yet, let's not burden ourselves with migrations
  needlessly)
- Move host stats to a Stats model
- Tie the hosts back to the playbook instead of the play
  While hosts are in fact "children" of plays, Ansible doesn't provide
  stats per-play. From ARA's perspective, it's simpler to keep hosts at
  the same level as the stats.

Depends-On: https://review.openstack.org/600058
Change-Id: I127efd79a5077488ffa084d2784d5a3c6f2da2da
2018-09-05 12:04:45 -04:00
David Moreau Simard fa2ebaf911
Model: rename reports to labels
labels will be a better word for representing how playbooks will be
grouped together.

Change-Id: Ibe78d65947061a3a3d43509ee8151a73b300fc82
2018-09-05 10:08:01 -04:00
David Moreau Simard 50f322932c
Add the concept of reports to the API
A report is a generic container meant to group or correlate different
playbooks.
It could contain a single playbook run or a group of playbook runs.
It can also be used to represent phases or dynamic tagging of playbook
runs.
For example, you could have a report named "failures" and make it so
failed playbooks are added to this report, for example.

The main purpose of this is to make reports generic and dynamic from
an API standpoint so we can build on top of this later.

Change-Id: I398f0337987abe31fa1e886f66ec9c3e644a32d6
2018-06-20 23:40:00 -04:00
David Moreau Simard f34c6ccb85
Add API endpoints for results
This makes the API endpoints for results available for consumption.

Change-Id: Icc7938d0081bb71404fb02ead9b95295abcae914
2018-06-20 22:14:25 -04:00
David Moreau Simard ccffd48287
Add API endpoints for hosts
This makes the API endpoints for hosts available for consumption.

Change-Id: Ifab3b27e81b27808aa33f484e228b90356e2406c
2018-06-20 19:08:14 -04:00
Guillaume Vincent a14228c902 Fix flake8 and bandit tests
* enable voting job on pep8 tox env
 * fix pep8 tox job
 * add db.sqlite3 in ignore file

Change-Id: If11fb74553a6f1cb986cbed17e0fc8386d08c032
2018-06-20 12:39:48 +00:00
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