Trove/FlavorServiceType

Extending Flavor API to create and delete Flavors from trove

'''== Requirements == '''
 * 1) Management API to add/delete flavors from trove.


 * 1) Categorization for service_type for a flavor created from trove.(This categorization would be used to validate the guest vm creation and resize activities to related flavors, mapped for service.)

'''== Implementation == '''
 * 1) In Troveclient's management.py a new class MgmtFlavors has been added with two methods for creation and deletion of flavors using the API "/mgmt/flavors" in trove.


 * 1) In Trove, new controller MgmtFlavorController has been added in trove.extensions.mgmt.flavors.service.py and is registered in trove.extensions.routes.mgmt.py


 * 1) This controller has two public methods create and delete which could be called under admin context only.


 * 1) Create method in controller also does a json-schema validation using the new schema added in trove.common.apischema.py


 * 1) Controller methods in turn calls their counter-parts from trove.flavor.models.py


 * 1)  New class FlavorManage with 3 methods(create, delete, load_flavor) have been implemented in trove.flavor.models.py.
 * 2) Class FlavorView in trove.flavor.views.py has been edited to show service for the flavors.
 * 3) To keep the service_type classification, table service_flavors is created using trove.db.sqlalchemy.migrate_repo.versions.016_service_flavor.py and mapped in db.sqlalchemy.mappers.py as service_flavor.
 * 4) service_flavors table is created with three columns(id, service_type, flavor_id).
 * 5) New model ServiceFlavor has been created in trove.flavor.models.py to work with table service_flavors and is registered in trove.db.sqlalchemy.session.py
 * 6) Create method in trove.flavor.models.py creates the flavor using nova client and creates a record in service_flavors table. Delete method deletes the flavor from nova and removes entry from trove database. Load_flavor has been written to fetch the flavor details using nova client.
 * 7) Integration tests have been updated in trove.tests.api.flavors.py and unit-tests have been written as tests.unittests.mgmt.flavors.test_flavors_controller.py and tests.unittests.mgmt.flavors. test_flavors_models.py