Jump to: navigation, search

Trove/associate-flavors-datastores

< Trove
Revision as of 20:26, 23 May 2014 by Iccha-sethi (talk | contribs) (Created page with "=Overview= This proposal includes the ability to associate flavor types with datastore versions. The management api will provide the ability to add this information. An examp...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Overview

This proposal includes the ability to associate flavor types with datastore versions. The management api will provide the ability to add this information. An example use case of this feature is say we have an enterprise version datastore which requires minimum 2GB flavor associated with it. There is no way to currently to enforce that.

API Resources

Summary

Verb Resource Description
GET /{tenant_id}/flavors/{datastore_version_id} Gets list of flavors for a given datastore version
POST /{tenant_id}/mgmt/datastores/versions/{datastore_version_id}/flavors Adds flavors for a given datastore version id
DELETE /{tenant_id}/mgmt/datastores/versions/{datastore_version_id}/flavors/{flavor_id} Deletes a flavor's association with a given datastore

Example Calls

List Flavors (GET)

This call lists all flavors for a given datastore version

/{tenant_id}/flavors/{datastore_version_id}

Response

{ "flavors": [

   {
       "id": 1,
       "links": [
                      {
                      "href": "https://ord.databases.api.rackspacecloud.com/v1.0/1234/flavors/1",
                      "rel": "self"
                      },
                     {
                      "href": "https://ord.databases.api.rackspacecloud.com/flavors/1",
                      "rel": "bookmark"
                     }
                  ],
       "name": "512MB Instance",
       "ram": 512
   },

] }

Add flavors datastore version

This call adds flavors to a given datastore version

POST /{tenant_id}/mgmt/datastores/versions/{datastore_version_id}/flavors 

Request

{
   "flavors": {
       [
           {
               "id": "550e8400-e29b-41d4-a716-446655440000",
           },
           {
               "id": "220e8400-e29b-41d4-a716-446655449934",
           },
       ]
   }
}

Response: 204

Delete a flavor association with datastore version

This call allows a user to disassociate a flavor to a datastore version

/{tenant_id}/mgmt/datastores/versions/{datastore_version_id}/flavors/{flavor_id}


Database Schema

Two new entities will be created in the trove database: capabilities and datastore_version_capabilities. These entities will store the capabilities and the association between those capabilities and the datastore

Datastore Version Metadata

This table will contain the id, name and description of the capabilities

Name Data Type Length Nullable Details
id VARCHAR 36 False Primary Key, Generated UUID
datastore_version_id VARCHAR 36 False -
key VARCHAR 256 False -
value VARCHAR 256 True -