Add simple unit tests to the Trove specs repo which ensure that specifications submitted follow the template correctly and address all the needed sections. Update tox to run these unit tests automatically. At the beginning of each release, test_titles.py will need to be updated and 'current_release' modified to reflect the new release directory. At the same time, the new release directory will be created, the index.rst file in doc/source ammended to include this directory, and any unmerged specs moved there. In this way, changes to the template will only affect specs going forward and avoids having to modify any specs that have merged in previous releases. (It will also have the side effect of signalling the 'opening' of the release to new specs.) Change-Id: I8f1175bceed63d36d96b6c6c6b4188ef27d3102e
3.5 KiB
MongoDB database management
https://blueprints.launchpad.net/trove/+spec/mongodb-database
Enable MongoDB database management functionality.
Problem Description
The MongoDB datastore does not support database management features. Allowing the user to create, list, and delete databases through the API is essential.
Proposed Change
Three standard Trove commands will be enabled for MongoDB:
- database-create
- database-list
- database-delete
The changes will be confined to the guestagent code. The taskmanager, API, and conductor do not require any code changes. The code changes will be to implement a new class service.MongoDBAdmin and the corresponding methods as members of the class. The methods of manager.Manager will be updated to call the admin functions.
Calls to MongoDB will be done in Python via the PyMongo library, which is required to be pre-installed on the guest.
Configuration
No changes will be made to any configuration files.
Database
No new items will be added here.
Public API
No API changes.
Public API Security
No API Security changes.
Python API
None (empty section added after merging)
CLI (python-troveclient)
None (empty section added after merging)
Internal API
No Internal API changes.
Guest Agent
Modified files:
trove/guestagent/db/models.py - add a MongoDBSchema class.
trove/guestagent/datastore/experimental/mongodb/manager.py - enable functions.
trove/guestagent/datastore/experimental/mongodb/service.py - add functions.
The Guest Agent will be changed to support the following manager functions:
- create_database - MongoDB does not have a method to explicitly create a database. The database to use is specified via 'use <dbname>', but this does not create the database. Databases are created when a 'document' is first inserted into them. To ensure a database is created, a dummy document will be inserted but then deleted.
- list_databases - Run 'pymongo.MongoClient.database_names()' and return the resulting list.
- delete_database - Drop the database with 'pymongo.MongoClient.drop_database("<dbname>")'. Users associated with the database will have to be removed manually.
Alternatives
create_database could not create a dummy object in the database.
Implementation
Assignee(s)
Matthew Van Dijk
Milestones
liberty-1
Work Items
The changes will be implemented in a single commit. The scope is small and the functionality is linked.
Upgrade Implications
There will be no upgrade implications.
Dependencies
There are no dependencies on other work in progress.
Testing
Unit tests will be added to validate non-trivial code paths. Integration tests may be added as needed.
Documentation Impact
The MongoDB datastore documentation can be updated to reflect the enabled features.
References
There are no external references in this document.