On 12/30/2013 12:17 AM, lvroyce@linux.vnet.ibm.com wrote:
From: Royce Lv <lvroyce@linux.vnet.ibm.com>

v3>v4, fix inconsistency between doc and json schema
v1>v3, fix racing problem, fix style.

Add parameters to GET request so that we will query storage server as:
    /storageservers?type=netfs

Royce Lv (5):
  Support params for GET method
  Add testcase for GET param
  Storage server: Update API.md
  storage server: update controller.py
  storage server: Update model and mockmodel

 docs/API.md              | 13 +++++++++++++
 src/kimchi/API.json      | 11 +++++++++++
 src/kimchi/controller.py | 26 ++++++++++++++++++++++++--
 src/kimchi/mockmodel.py  | 13 +++++++++++++
 src/kimchi/model.py      | 14 +++++++++++++-
 src/kimchi/root.py       |  1 +
 tests/test_rest.py       | 37 +++++++++++++++++++++++++++++++++++++
 7 files changed, 112 insertions(+), 3 deletions(-)


Let me explain what I expect with this patch set:

GET /storageservers will return all storage servers
Example:

[
{'host': 'localhost',
 'target_type': 'netfs',
 'sources': ['/srv', '/mnt/isos'],
}

{'host': '123.234.123.12',
 'target_type': 'iscsi',
 'sources': ['
iqn.2013-06.com.example:iscsi-pool'],
}
]


GET /storageservers?target_type=<server-type> will return only the storage servers with type <server-type>
Example: GET /storageservers?target_type=netfs

[
{'host': 'localhost',
 'target_type': 'netfs',
 'sources': ['/srv', '/mnt/isos'],
}
]

GET /storageservers/<id> will return data related to this specific server
Example: GET /storageservers/localhost

{'host': 'localhost',
 'target_type': 'netfs',
 'sources': ['/srv', '/mnt/isos'],
}

The 'sources' for netfs, for example, will be the parsed output from "showmount -e <host>" command.

So when the user want to create NFS pool with a new server (never used before)

POST /storageservers/new-nfs-server

{'host': 'new-nfs-server',
 'target_type': 'netfs',
 'sources': ['/srv', '/mnt'],
}

Then the user know which paths are available to create the NFS pool

Does that make sense for you?