aboutsummaryrefslogtreecommitdiffstats
path: root/src/api
AgeCommit message (Collapse)AuthorFilesLines
2020-01-28Comments and DocumentationParker Berberian5-28/+86
This change adds a ton of comments and documentation across all the code. Change-Id: Ifee0a2f534e8584f14b0f13af4dda8dc70eb7553 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2020-01-28Begin Resource RefactorParker Berberian3-112/+83
Begins the Resource Refactor by creating new interfaces to the resources through a Resource super class and using that new interface in the api Change-Id: I15a8179bfe915d2cde6d658d056e11cbd2c70e43 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-10-08Rename pharos to laasAric Gardner1-1/+1
related to change: https://gerrit.opnfv.org/gerrit/c/releng/+/68161 Signed-off-by: Aric Gardner <agardner@linuxfoundation.org> Change-Id: I4985eb116fd2c214f3639eb991f27b5d75b5ab7c Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-08-13Adds Downtime AwarenessParker Berberian4-0/+88
This adds a Downtime model and relevant operations so that the dashboard knows when a lab is down for maintenance and can act accordingly. This change doesn't modify the front end at all, but it does pass relevant downtime info to the templates so that they can be updated in a future change. Change-Id: Idb88b15838b949f352f11a31a1fce9749d283d28 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-07-08Update DependenciesParker Berberian1-9/+1
Removes or upgrades the dependencies in requirements.txt Change-Id: I4e66348fc80259b4a2f64ca912556f7d847f0645 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-06-05Adds TestsParker Berberian2-12/+54
Adds more complete tests and fixes some bugs found in those tests Change-Id: Icc0433215df511bc0b2bfa264bacf8796d6de86f Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-05-24Add and Fix testsParker Berberian1-153/+102
Makes the existing code less terrible and adds more unit tests Change-Id: Ia3662323eb22ed238829418869ff0363f00337ef Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-05-08Adds pdf and idf into apiParker Berberian6-6/+171
The Pod Descriptor File (pdf) and Installer descriptor file (idf) are now hosted in the api. The url endpoint where the lab can retrieve them are now part of a software task. An OPNFV task also contains a new dictionary that describes how bridges should be configured on the jumphost. This information is not contained in the pdf/idf but is needed by the lab. Change-Id: I6971279979ba180725926035bd9db481aafb1073 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-05-03Merge "Implement OPNFV workflow"Parker Berberian2-27/+47
2019-05-03Implement OPNFV workflowSawyer Bergeron2-27/+47
This is a counterpart to an update to network models, and allows for configuring baremetal OPNFV and Openstack deploys Change-Id: I0185dbfa6c9105d7e63a7e7d7dd1f5cf228a8877 Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu> Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-04-29Fix change/reset image with multiple collaboratorsSawyer Bergeron1-5/+3
When a host on a booking with multiple collaborators has its image reset/changed, a 500 error is no longer returned Change-Id: Icafdf53059f35c838e0de675da6a8b8bffffe58a Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
2019-04-17Fixes the idf and pdf templates so that we can deploy opnfvParker Berberian1-0/+9
Change-Id: I0091629f8f0af423210b2e81210d65239e9662b4 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-03-14Respects lab_token from labParker Berberian1-0/+2
Change-Id: I322f876a21d25dc185a6f4930d2f2a5f463e2d24 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-03-14Add API testsSawyer Bergeron1-0/+278
Change-Id: Ic26d0b6de63405d239a9260b862158962c3140ac Signed-off-by: Sawyer Bergeron <sawyerbergeron@gmail.com>
2019-03-13Fix mismatched charfield max_lengthsSawyer Bergeron2-2/+25
Change-Id: I960710d800b614f93d06f5b0aff81d8b9508d5dd Signed-off-by: Sawyer Bergeron <sawyerbergeron@gmail.com>
2019-03-12Allow labs to retirieve and update some host information in the apiParker Berberian3-0/+30
Change-Id: Ib0682141351f7789c50d98a992ab166c2f033f4b Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-03-01Merge "Add test utils and tests for quick booking"Parker Berberian1-229/+0
2019-03-01Add test utils and tests for quick bookingSawyer Bergeron1-229/+0
Change-Id: Ie76c6fe26622ca8363055b8ebbe0dc6deaed5824 Signed-off-by: Sawyer Bergeron <sawyerbergeron@gmail.com> Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-02-27Update IPMI handlingParker Berberian3-1/+42
provides a way for the lab to report IPMI info to the dashboard. Necessary to allow the dashboard to fully generate a PDF for OPNFV deploy Change-Id: Ieef7a93e28b155ee90f3ffd3cfeedace332a6641 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-02-12Fixed all Flake8 errorsParker Berberian1-6/+6
Change-Id: I1186429df8989461e2384f1f3e533c55cebfb1b4 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-01-23Fix Reimaging HostsParker Berberian1-1/+28
When a User wants to reimage a host, the dashboard needs to also refresh the network and ssh configurations. Otherwise a host is reimaged and becomes unreachable. Change-Id: I534f200498c9217bda81190861021c482e052a81 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-01-18OverHaul the Snapshot WorkflowParker Berberian3-1/+162
Makes the Snapshot workflow much prettier and more functional. Change-Id: Icdd66f64e6d336ad49ed3cf638a301d0ca92fda9 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-01-04Fix API serializationParker Berberian1-1/+4
Under special circumstances, the 'context' field may be empty and serialization will fail, but that field is optional so we will ignore errors. Change-Id: I2e1e47a2f7d507e45b171f80aa241c8026cfc1a5 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2019-01-02Added missing migration fileParker Berberian1-0/+18
Change-Id: I7582360e3e5522cf06798200f80e5585864e945e Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-12-21Fixes creation of ssh access jobParker Berberian1-3/+3
Minor changes that allows the ssh job to be created. Django model creation can become very complex when you go beyond the model.object.create() method, and this just fixes the order of operations. Change-Id: I811f26149365067bdd15f2466f8ba9211c3ef901 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-12-03BUG FIX: Properly decodes ssh public keyfileParker Berberian2-1/+3
Because of how Python3 changed how it handled strings, the byte string read from the user's keyfile was not directly serializable. This decodes the bytes into a unicode string, assuming UTF-8 encoding. Change-Id: I5f723a61fb577fa6d4e76e701ef529521ab389ba Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-11-26Fix all flake8 errorsParker Berberian8-99/+169
The flake8 command in test.sh finds no longer finds any errors. This may form a basis of a jenkins verify job as a sort of 'weak compile-time checks' The flake8 command will not complain about line length, and will not complain about django's manage.py file Change-Id: Ic47cb4fc7ada55e64485661ab6881aef475018ff Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-11-07Merge "Rewrite Notification subsystem"Trevor Bramwell4-15/+15
2018-11-07Rewrite Notification subsystemParker Berberian4-15/+15
In this commit: - delete a lot of really bad and / or unused code - redesign a much simpler Notification model - create and send notifications to the user's inbox on booking start & end - migrations - emails user when booking is ready and when it ends Not in this commit: - Creating notifications from lab messages - warning messages when a booking is about to end - creating "summary" notifications when e.g. a booking has been fulfilled by a lab Change-Id: I69b4dc36c3f2bce76d810106baadeef5a562cc7d Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-24Fixes for access creation and removalParker Berberian1-14/+23
Fixes include: - creating ssh access jobs for users with ssh keys - ensuring vpn access is revoked after booking ends Creates ssh access jobs with the user's ssh keys, if they exist Change-Id: Ia2e9f0c5a2f90b45732a5767a62b87a5a5492b94 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-23Merge "Fixed serialization"Parker Berberian1-2/+1
2018-10-23Merge "Fix clear_delta() function"Parker Berberian1-1/+2
2018-10-22Fixed serializationParker Berberian1-2/+1
There was no need to serialize he dict ourselves. JsonResponse wants to recieve a dict. Change-Id: I2af1d9d8f0ccec4644e64ffce0de6005773be786 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-17Fix clear_delta() functionParker Berberian1-1/+2
NetworkConfig.clear_delta() appeared to be a noop, but can set the delta to a nonempty string if delta is None. This reverts a change I made here: https://gerrit.opnfv.org/gerrit/#/c/63385/6..7/dashboard/src/api/models.py Change-Id: I72661ca9d889801fb6183943c8ae0e5e38cc960a Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-17Adds migrationsParker Berberian1-0/+17
In reviewing the LaaS 2.0 code, models were changed without the accompanying migrations. Change-Id: Ibdba456d9650c7d7d8750328852f27866a899328 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-10-15Lab as a Service 2.0Parker Berberian12-77/+1433
See changes here: https://wiki.opnfv.org/display/INF/Pharos+Laas Change-Id: I59ada5f98e70a28d7f8c14eab3239597e236ca26 Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu> Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
2018-02-16Expose Limited User Info Through APISawyer Bergeron3-0/+13
Jira: PHAROS-362 Exposes info such as username and user email throught the API to facilitate better backend integration Change-Id: I8948f399000ffe41d5b75941f4a4195caaea91f4 Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
2018-01-31Merge "Add User-ID Field in Booking API Serializer"Parker Berberian1-1/+1
2018-01-18Add User-ID Field in Booking API SerializerSawyer Bergeron1-1/+1
Jira: None Change-Id: I217cf26b078461fa2300ee666bd4c2775c62316b Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
2018-01-17Add Nullable Lab Field to ResourcesSawyer Bergeron1-1/+1
Jira: PHAROS-347 Resources are now possible to associate with lab instances upon creation Change-Id: Id8abbcc448a6d840d55e4bf5130dbec22c8bc58f
2018-01-09Implement Booking Modification InterfaceSawyer Bergeron1-1/+1
Jira: PHAROS-330 Users can change start date if it has not already occurred, and can change end date, purpose, and both installer and scenario. Standard checks apply similar to when initially creating a booking. Change-Id: Ibae7fe91a58bd6e0741db065265c05c3823bdc27 Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
2018-01-08Merge "Implement Notification Framework with Initial Email Support"Jack Morgan3-2/+12
2018-01-08Merge "Add Dashboard OS Selection Menu on Booking"Jack Morgan1-1/+2
2018-01-02Implement Notification Framework with Initial Email SupportSawyer Bergeron3-2/+12
JIRA: None Notification/notifier objects are now created with title, content, sender, associated resource, and recipient and there is now support for emails at the very least to be sent as notifications. Change-Id: I456cf0e901d9a1e2a1e7d187dcc03d28fca003fb Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
2017-12-13Add Dashboard OS Selection Menu on BookingSawyer Bergeron1-1/+2
JIRA: PHAROS-326 Implement dropdown menu on pod booking page for user to select base OS, as well as associated support in API and pod status/booking status views This patch includes the migration file mentioned by Parker Berbarian Change-Id: I46a7b0e5e7020a89bc8fa0fe53c10bbda14a2e2d Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
2017-12-12Add Boolean Option for Dev Pod in APISawyer Bergeron1-1/+1
Change-Id: I4f0a0fc0ac5d81ae9454e6cece060032f9b806f7 JIRA: None
2017-09-22Rename pharos-dashboard and pharos-validatorTrevor Bramwell5-0/+152
As subdirectories of the pharos-tools repo, there is little need to keep the pharos prefix. Change-Id: Ica3d79411f409df638647300036c0664183c2725 Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>