<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 01/23/2014 09:01 PM, Aline Manera
      wrote:<br>
    </div>
    <blockquote cite="mid:52E11295.30807@linux.vnet.ibm.com" type="cite">On
      01/22/2014 02:13 PM, <a class="moz-txt-link-abbreviated" href="mailto:lvroyce@linux.vnet.ibm.com">lvroyce@linux.vnet.ibm.com</a> wrote:
      <br>
      <blockquote type="cite">From: Royce Lv
        <a class="moz-txt-link-rfc2396E" href="mailto:lvroyce@linux.vnet.ibm.com">&lt;lvroyce@linux.vnet.ibm.com&gt;</a>
        <br>
        <br>
        Add storage server collection and resource to report
        <br>
        used storage server.
        <br>
        <br>
        Signed-off-by: Royce Lv <a class="moz-txt-link-rfc2396E" href="mailto:lvroyce@linux.vnet.ibm.com">&lt;lvroyce@linux.vnet.ibm.com&gt;</a>
        <br>
        ---
        <br>
        &nbsp; src/kimchi/API.json&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 11 ++++++++++
        <br>
        &nbsp; src/kimchi/control/storageservers.py | 41
        ++++++++++++++++++++++++++++++++++++
        <br>
        &nbsp; src/kimchi/root.py&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; 2 ++
        <br>
        &nbsp; 3 files changed, 54 insertions(+)
        <br>
        &nbsp; create mode 100644 src/kimchi/control/storageservers.py
        <br>
        <br>
        diff --git a/src/kimchi/API.json b/src/kimchi/API.json
        <br>
        index 46818d4..9b86164 100644
        <br>
        --- a/src/kimchi/API.json
        <br>
        +++ b/src/kimchi/API.json
        <br>
        @@ -237,6 +237,17 @@
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "additionalProperties": false
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "storageservers_get_list": {
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "type": "object",
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "properties": {
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "_target_type": {
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "description": "List storage servers of
        given type",
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "type": "string",
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "pattern": "^netfs$"
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "additionalProperties": false
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "template_update": {
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "type": "object",
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "properties": {
        <br>
        diff --git a/src/kimchi/control/storageservers.py
        b/src/kimchi/control/storageservers.py
        <br>
        new file mode 100644
        <br>
        index 0000000..c692fae
        <br>
        --- /dev/null
        <br>
        +++ b/src/kimchi/control/storageservers.py
        <br>
        @@ -0,0 +1,41 @@
        <br>
        +#
        <br>
        +# Project Kimchi
        <br>
        +#
        <br>
        +# Copyright IBM, Corp. 2014
        <br>
        +#
        <br>
        +# Authors:
        <br>
        +#&nbsp; Royce Lv <a class="moz-txt-link-rfc2396E" href="mailto:lvroyce@linux.vnet.ibm.com">&lt;lvroyce@linux.vnet.ibm.com&gt;</a>
        <br>
        +#
        <br>
        +# This library is free software; you can redistribute it and/or
        <br>
        +# modify it under the terms of the GNU Lesser General Public
        <br>
        +# License as published by the Free Software Foundation; either
        <br>
        +# version 2.1 of the License, or (at your option) any later
        version.
        <br>
        +#
        <br>
        +# This library is distributed in the hope that it will be
        useful,
        <br>
        +# but WITHOUT ANY WARRANTY; without even the implied warranty
        of
        <br>
        +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&nbsp; See the
        GNU
        <br>
        +# Lesser General Public License for more details.
        <br>
        +#
        <br>
        +# You should have received a copy of the GNU Lesser General
        Public
        <br>
        +# License along with this library; if not, write to the Free
        Software
        <br>
        +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
        MA&nbsp; 02110-1301 USA
        <br>
        +
        <br>
        +from kimchi.control.base import Collection, Resource
        <br>
        +from kimchi.control.utils import get_class_name, model_fn
        <br>
        +import kimchi.template
        <br>
        +
        <br>
        +
        <br>
        +class StorageServers(Collection):
        <br>
        +&nbsp;&nbsp;&nbsp; def __init__(self, model):
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super(StorageServers, self).__init__(model)
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.resource = StorageServer
        <br>
        +
        <br>
        +
        <br>
        +class StorageServer(Resource):
        <br>
        +&nbsp;&nbsp;&nbsp; def __init__(self, model, ident):
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super(StorageServer, self).__init__(model, ident)
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.storagetargets = StorageTargets(self.model,
        self.ident.decode("utf-8"))
        <br>
        +
        <br>
        +&nbsp;&nbsp;&nbsp; @property
        <br>
        +&nbsp;&nbsp;&nbsp; def data(self):
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return self.info
        <br>
        diff --git a/src/kimchi/root.py b/src/kimchi/root.py
        <br>
        index 3cc6321..ec531c0 100644
        <br>
        --- a/src/kimchi/root.py
        <br>
        +++ b/src/kimchi/root.py
        <br>
        @@ -36,6 +36,7 @@ from kimchi.control.interfaces import
        Interfaces
        <br>
        &nbsp; from kimchi.control.networks import Networks
        <br>
        &nbsp; from kimchi.control.plugins import Plugins
        <br>
        &nbsp; from kimchi.control.storagepools import StoragePools
        <br>
        +from kimchi.control.storageserver import StorageServers
        <br>
      </blockquote>
      <br>
      It should be:
      <br>
      <br>
      from kimchi.control.storageservers import StorageServers
      <br>
    </blockquote>
    after my patch,&nbsp; <font color="#909090"><font size="3"> "[PATCH]
        improve controller" </font></font><br>
    you do not need to touch root.py any more.<br>
    <blockquote cite="mid:52E11295.30807@linux.vnet.ibm.com" type="cite">
      <br>
      I will fix it before applying the patch =)
      <br>
      So you don't need to send again the patch set
      <br>
      <br>
      <blockquote type="cite">&nbsp; from kimchi.control.tasks import Tasks
        <br>
        &nbsp; from kimchi.control.templates import Templates
        <br>
        &nbsp; from kimchi.control.utils import parse_request
        <br>
        @@ -60,6 +61,7 @@ class Root(Resource):
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.vms = VMs(model)
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.templates = Templates(model)
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.storagepools = StoragePools(model)
        <br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.storageservers = StorageServers(model)
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.interfaces = Interfaces(model)
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.networks = Networks(model)
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.tasks = Tasks(model)
        <br>
      </blockquote>
      <br>
      _______________________________________________
      <br>
      Kimchi-devel mailing list
      <br>
      <a class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
      <br>
      <a class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
      <br>
      <br>
      <br>
      <br>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Thanks and best regards!

Sheldon Feng(&#20911;&#23569;&#21512;)<a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com">&lt;shaohef@linux.vnet.ibm.com&gt;</a>
IBM Linux Technology Center</pre>
  </body>
</html>