Jump to: navigation, search

Difference between revisions of "Trove/trove-capabilities"

(List Capabilities (GET))
(List Capabilities (GET))
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
=Overview=
 
=Overview=
This proposal includes the ability to setup different capabilities for different datastore types.
+
This proposal includes the ability to setup different capabilities for different datastore versions.  This
 +
is a management only feature, useful for globally enabling/disabling capabilities. The only exception
 +
to that is the List Capabilities for Datastore Version. That method would be available to all users, so that
 +
end users could determine the behavior of a particular datastore version.
  
An example capability would be "ephemeral_volume". As a result of a datastore having
+
An example capability would be "volume_support". As a result of a datastore version having
this capability,an ephemeral volume would be created on server create. A datastore without
+
this capability,an block storage volume would be created on server create. A datastore version without
 
this capability (such as redis) would not create a volume.
 
this capability (such as redis) would not create a volume.
  
Line 19: Line 22:
  
 
= API Resources =  
 
= API Resources =  
 
+
== Summary ==
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! Verb !! Resource !! Description
 
! Verb !! Resource !! Description
 
|-
 
|-
| GET || /capabilities || Supplies a list of capabilities that can be associated to a datastore
+
| GET || /capabilities || Supplies a list of capabilities that can be associated to a datastore version
 
|-
 
|-
| GET || /datastores/{datastore}/capabilities || Get a list of capabilities configured for this datastore
+
| GET || /datastore_versions/{datastore}/capabilities || Get a list of capabilities configured for this datastore version
 
|-
 
|-
| GET || /datastores/{datastore}/capabilities/{capability_id} || Determine if a capability is supported by the datastore (potentially not useful?)
+
| POST || /datastore_versions/{datastore}/capabilities || Associate a capability with the datastore version
 
|-
 
|-
| POST || /datastores/{datastore}/capabilities || Associate a capability with the datastore
+
| DELETE || /datastore_versions/{datastore}/capabilities/{capability_id} || Remove a capability from the datastore version
|-
 
| DELETE || /datastores/{datastore}/capabilities/{capability_id} || Remove a capability from the datastore
 
 
|}
 
|}
  
== List Capabilities (GET) ==
+
== Example Calls ==
 +
=== List Capabilities (GET) ===
  
 
This call lists all capabilities  
 
This call lists all capabilities  
 +
 +
GET /capabilities
 +
 +
'''Response'''
 +
{
 +
    "capabilities": {
 +
        [
 +
            {
 +
                "id": "550e8400-e29b-41d4-a716-446655440000",
 +
                "name": "Volume Support",
 +
                "description": "If enabled, a cinder volume will be created and attached to the database server"
 +
                "enabled": true
 +
            }
 +
        ]
 +
    }
 +
}
 +
 +
=== List capabilities for a datastore version ===
 +
 +
This call lists all capabilities that are associated with a particular datastore version
 +
 +
GET datastore_versions/e60153d4-8ac4-414a-ad58-fe2e0035704a/capabilities
  
 
'''Response'''
 
'''Response'''
Line 45: Line 69:
 
             {
 
             {
 
                 "id": "550e8400-e29b-41d4-a716-446655440000",
 
                 "id": "550e8400-e29b-41d4-a716-446655440000",
                 "name": "Ephemeral Volume Support",
+
                 "name": "Volume Support",
 
                 "description": "If enabled, a cinder volume will be created and attached to the database server"
 
                 "description": "If enabled, a cinder volume will be created and attached to the database server"
 
             }
 
             }
Line 51: Line 75:
 
     }
 
     }
 
  }
 
  }
 +
 +
=== Add a capability to a datastore version ===
 +
 +
This call allows a user to associate a capability to a datastore version
 +
 +
POST datastore_versions/e60153d4-8ac4-414a-ad58-fe2e0035704a/capabilities
 +
 +
'''Request Body'''
 +
{
 +
    "capability_id": "550e8400-e29b-41d4-a716-446655440000"
 +
}
 +
 +
 +
'''Response"""
 +
{
 +
    "capabilities": {
 +
        [
 +
            {
 +
                "id": "550e8400-e29b-41d4-a716-446655440000",
 +
                "name": "Volume Support",
 +
                "description": "If enabled, a cinder volume will be created and attached to the database server"
 +
            }
 +
        ]
 +
    }
 +
}
 +
 +
=== Delete Capabilities (DELETE) ===
 +
 +
This call deletes a capability
 +
 +
DELETE /capabilities/{capability_id}
 +
 +
'''Response'''
 +
 +
200 OK
 +
 +
No body
  
 
=Database Schema=
 
=Database Schema=
Two new entities will be created in the trove database: capabilities and datastore_capabilities.  These entities will store the capabilities and the association between those capabilities and the datastore  
+
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  
  
 
'''Capabilities (capabilities)'''
 
'''Capabilities (capabilities)'''
Line 67: Line 128:
 
|-
 
|-
 
| description || VARCHAR || 256 || True || -
 
| description || VARCHAR || 256 || True || -
 +
|-
 +
| enabled || Boolean ||  || False || -
 
|}
 
|}
  
'''Datastore Capabilities (datastore_capabilities)'''
+
'''Datastore Version Capabilities (capability_overrides)'''
  
 
This table maintains a many-to-many relationship of datastores to capabilities via the foreign key references to capability_id and datastore_id
 
This table maintains a many-to-many relationship of datastores to capabilities via the foreign key references to capability_id and datastore_id
Line 79: Line 142:
 
| capability_id || VARCHAR || 36 || False || Foreign Key reference to capabilities.id
 
| capability_id || VARCHAR || 36 || False || Foreign Key reference to capabilities.id
 
|-
 
|-
| datastore_id || VARCHAR || 32 || False || Foreign Key reference to datastore.id
+
| datastore_version_id || VARCHAR || 32 || False || Foreign Key reference to datastore.id
 
|-
 
|-
| datastore_version_id || VARCHAR || 32 || False || Foreign Key reference to datastore_version.id
+
| enabled || BOOLEAN || || False ||  
 
|}
 
|}

Latest revision as of 14:31, 27 June 2014

Overview

This proposal includes the ability to setup different capabilities for different datastore versions. This is a management only feature, useful for globally enabling/disabling capabilities. The only exception to that is the List Capabilities for Datastore Version. That method would be available to all users, so that end users could determine the behavior of a particular datastore version.

An example capability would be "volume_support". As a result of a datastore version having this capability,an block storage volume would be created on server create. A datastore version without this capability (such as redis) would not create a volume.

Capabilities

Supported with the first iteration:

  • volume_support - When creating an instance, a cinder volume will be provisioned with the server
  • enable_root_user - When creating an instance, the root user password is returned to the user

Eventually we want to add support for the following capabilities:

  • multiple_users - If not enabled, return an appropriate error code for any user related routes
  • databases - If not enabled, return an appropriate error code for any database related routes (ie, redis does not support database, but mysql should)
  • security_groups

API Resources

Summary

Verb Resource Description
GET /capabilities Supplies a list of capabilities that can be associated to a datastore version
GET /datastore_versions/{datastore}/capabilities Get a list of capabilities configured for this datastore version
POST /datastore_versions/{datastore}/capabilities Associate a capability with the datastore version
DELETE /datastore_versions/{datastore}/capabilities/{capability_id} Remove a capability from the datastore version

Example Calls

List Capabilities (GET)

This call lists all capabilities

GET /capabilities

Response

{
   "capabilities": {
       [
           {
               "id": "550e8400-e29b-41d4-a716-446655440000",
               "name": "Volume Support",
               "description": "If enabled, a cinder volume will be created and attached to the database server"
               "enabled": true
           }
       ]
   }
}

List capabilities for a datastore version

This call lists all capabilities that are associated with a particular datastore version

GET datastore_versions/e60153d4-8ac4-414a-ad58-fe2e0035704a/capabilities

Response

{
   "capabilities": {
       [
           {
               "id": "550e8400-e29b-41d4-a716-446655440000",
               "name": "Volume Support",
               "description": "If enabled, a cinder volume will be created and attached to the database server"
           }
       ]
   }
}

Add a capability to a datastore version

This call allows a user to associate a capability to a datastore version

POST datastore_versions/e60153d4-8ac4-414a-ad58-fe2e0035704a/capabilities

Request Body

{
    "capability_id": "550e8400-e29b-41d4-a716-446655440000"
}


Response"""

{
   "capabilities": {
       [
           {
               "id": "550e8400-e29b-41d4-a716-446655440000",
               "name": "Volume Support",
               "description": "If enabled, a cinder volume will be created and attached to the database server"
           }
       ]
   }
}

Delete Capabilities (DELETE)

This call deletes a capability

DELETE /capabilities/{capability_id}

Response

200 OK

No body

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

Capabilities (capabilities)

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
name VARCHAR 64 False -
description VARCHAR 256 True -
enabled Boolean False -

Datastore Version Capabilities (capability_overrides)

This table maintains a many-to-many relationship of datastores to capabilities via the foreign key references to capability_id and datastore_id

Name Data Type Length Nullable Details
capability_id VARCHAR 36 False Foreign Key reference to capabilities.id
datastore_version_id VARCHAR 32 False Foreign Key reference to datastore.id
enabled BOOLEAN False