Jump to: navigation, search

Difference between revisions of "Trove/list-datastore-type-and-versions"

(Justification/Benefits)
(New API call: List All Datastore Types & Versions)
Line 17: Line 17:
  
 
=== ReST API ===
 
=== ReST API ===
==== New API call: List All Datastore Types & Versions ====
+
==== Augment existing API call: List All Datastore Types & Versions ====
 
'''Request'''
 
'''Request'''
  
GET/{tenant_id}/datastoreandversions
+
GET/{tenant_id}/datastores
  
 
'''Response'''  
 
'''Response'''  
 
<pre>
 
<pre>
 
{
 
{
"datastores": [
+
    "datastores": [
{
+
        {
"id": "10000000-0000-0000-0000-000000000001",  
+
            "default_version": “1”,
"links": [
+
"id": “1”,  
……
+
            "links": [
],  
+
                {
"name": "MySQL"
+
                    "href": "https://API/v1.0/1234/datastores/1”,
"version": "5.1"
+
                    "rel": "self"
"manager": "mysql"
+
                },
"default": "False"
+
                {
},  
+
                    "href": "https://API/datastores/1”,
{
+
                    "rel": "bookmark"
"id": "e00000e0-00e0-0e00-00e0-000e000000ee",  
+
                }
"links": [
+
            ],  
……..
+
            "name": “mysql”
],  
+
"versions": [
"name": "MySQL"
+
        {
"version": "5.5"
+
              "id": “1”,
"manager": "mysql"
+
              "links": [
"default": "True"
+
                  {
}
+
                      "href": "https://API/v1.0/1234/datastores/versions/1”,
{
+
                      "rel": "self"
"id": "100000e0-00e0-0e00-00e0-000e000000ff",  
+
                  },
"links": [
+
                  {
……..
+
                      "href": "https://API/datastores/versions/1”,
],  
+
                      "rel": "bookmark"
"name": "Redis"
+
                  }
"version": "2.8"
+
              ],
"manager": "redis"
+
              "name": "mysql-5.5"
"default": "True"
+
        },
}
+
            {
]
+
              "id": “2”,  
 +
              "links": [
 +
                  {
 +
                      "href": "https://API/v1.0/1234/datastores/versions/2”,
 +
                      "rel": "self"
 +
                  },
 +
                  {
 +
                      "href": "https://API/datastores/versions/2”,  
 +
                      "rel": "bookmark"
 +
                  }
 +
              ],
 +
              "name": "mysql-5.6”
 +
        }
 +
    ]
 +
  },
 +
        {
 +
            "default_version": “1”,
 +
            "id": “2”,
 +
            "links": [
 +
                {
 +
                    "href": "https://API/v1.0/1234/datastores/2”,
 +
                    "rel": "self"
 +
                },
 +
                {
 +
                    "href": "https://API/datastores/2”,
 +
                    "rel": "bookmark"
 +
                }
 +
            ],
 +
            "name": “redis”
 +
            "versions": [
 +
        {
 +
              "id": “1”,  
 +
              "links": [
 +
                  {
 +
                      "href": "https://API/v1.0/1234/datastores/versions/1”,
 +
                      "rel": "self"
 +
                  },
 +
                  {
 +
                      "href": "https://API/datastores/versions/1”,
 +
                      "rel": "bookmark"
 +
                  }
 +
              ],  
 +
              "name": “redis-2.6”
 +
        },
 +
            {
 +
              "id": “2”,
 +
              "links": [
 +
                  {
 +
                      "href": "https://API/v1.0/1234/datastores/versions/2”,
 +
                      "rel": "self"
 +
                  },
 +
                  {
 +
                      "href": "https://API/datastores/versions/2”,
 +
                      "rel": "bookmark"
 +
                  }
 +
              ],
 +
              "name": “redis-2.8”
 +
        }
 +
    ]
 +
  }
 +
    ]
 
}
 
}
 
</pre>
 
</pre>
  
 
== Comments/Questions From Community ==
 
== Comments/Questions From Community ==

Revision as of 21:58, 28 April 2014

Description

This blueprint will add an API call for retrieving datastore type and version in a single call.

Blueprint:

Justification/Benefits

  • Instead of making n+1 calls where n is the number of datastore types, this single API call will fetch all datastore types and version, and the manager in a single call. It will also show if the version is the default for that datastore.
  • This call can vastly improve the user experience for retrieving all the supported datastore types and versions

Impacts

Configuration

None

Database

No impact

ReST API

Augment existing API call: List All Datastore Types & Versions

Request

GET/{tenant_id}/datastores

Response

{
    "datastores": [
        {
            "default_version": “1”,
		 "id": “1”, 
            "links": [
                {
                    "href": "https://API/v1.0/1234/datastores/1”, 
                    "rel": "self"
                }, 
                {
                    "href": "https://API/datastores/1”, 
                    "rel": "bookmark"
                }
            ], 
            "name": “mysql”
		 "versions": [
        	 {
              "id": “1”, 
              "links": [
                  {
                      "href": "https://API/v1.0/1234/datastores/versions/1”, 
                      "rel": "self"
                  }, 
                  {
                      "href": "https://API/datastores/versions/1”, 
                      "rel": "bookmark"
                	  }
              ], 
              "name": "mysql-5.5"
        	 },
            {
              "id": “2”, 
              "links": [
                  {
                      "href": "https://API/v1.0/1234/datastores/versions/2”, 
                      "rel": "self"
                  }, 
                  {
                      "href": "https://API/datastores/versions/2”, 
                      "rel": "bookmark"
                	  }
              ], 
              "name": "mysql-5.6”
        	 }
    		]
	   }, 
        {
            "default_version": “1”, 
            "id": “2”, 
            "links": [
                {
                    "href": "https://API/v1.0/1234/datastores/2”, 
                    "rel": "self"
                }, 
                {
                    "href": "https://API/datastores/2”, 
                    "rel": "bookmark"
                }
            ], 
            "name": “redis”
            "versions": [
        	 {
              "id": “1”, 
              "links": [
                  {
                      "href": "https://API/v1.0/1234/datastores/versions/1”, 
                      "rel": "self"
                  }, 
                  {
                      "href": "https://API/datastores/versions/1”, 
                      "rel": "bookmark"
                	  }
              ], 
              "name": “redis-2.6”
        	 },
            {
              "id": “2”, 
              "links": [
                  {
                      "href": "https://API/v1.0/1234/datastores/versions/2”, 
                      "rel": "self"
                  }, 
                  {
                      "href": "https://API/datastores/versions/2”, 
                      "rel": "bookmark"
                	  }
              ], 
              "name": “redis-2.8”
        	 }
    		]
	   }
    ]
}

Comments/Questions From Community