Michael Pasternak has uploaded a new change for review. Change subject: sdk: regenerate against the latest api ......................................................................
sdk: regenerate against the latest api - to DiskStatistics.list() added 'max' argument - to ClusterGlusterVolumeBrick added 'replace' action - Host can be added to cluster now either by id or name Change-Id: I8ae59ecef269bf0ac5c69283a60b20ad984ed602 Signed-off-by: Michael Pasternak <[email protected]> --- M src/ovirtsdk/infrastructure/brokers.py M src/ovirtsdk/xml/params.py 2 files changed, 54 insertions(+), 7 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine-sdk refs/changes/04/12204/1 diff --git a/src/ovirtsdk/infrastructure/brokers.py b/src/ovirtsdk/infrastructure/brokers.py index 94a8b6b..e01d7a5 100644 --- a/src/ovirtsdk/infrastructure/brokers.py +++ b/src/ovirtsdk/infrastructure/brokers.py @@ -19,7 +19,7 @@ ############ GENERATED CODE ############ ######################################## -'''Generated at: 2013-01-13 19:52:39.094040''' +'''Generated at: 2013-02-19 14:54:43.225049''' from ovirtsdk.xml import params from ovirtsdk.utils.urlhelper import UrlHelper @@ -341,6 +341,34 @@ '{glustervolume:id}': self.parentclass.get_id(), '{brick:id}': self.get_id()}), headers={'Content-type':None}) + + def replace(self, action=params.Action(), correlation_id=None): + ''' + @type Action: + + @param action.brick.server_id: string + @param action.brick.brick_dir: string + [@param action.force: boolean] + [@param correlation_id: any string] + + @return Action: + ''' + + url = '/api/clusters/{cluster:id}/glustervolumes/{glustervolume:id}/bricks/{brick:id}/replace' + + result = self.__getProxy().request( + method='POST', + url=UrlHelper.replace( + url, + {'{cluster:id}' : self.parentclass.parentclass.get_id(), + '{glustervolume:id}': self.parentclass.get_id(), + '{brick:id}': self.get_id()} + ), + body=ParseHelper.toXml(action), + headers={"Correlation-Id":correlation_id} + ) + + return result class ClusterGlusterVolumeBricks(Base): @@ -1658,17 +1686,20 @@ else: raise MissingParametersError(['id', 'name']) - def list(self, **kwargs): + def list(self, max=None, **kwargs): ''' [@param **kwargs: dict (property based filtering)"] + [@param max: int (max results)] @return Statistics: ''' url = '/api/disks/{disk:id}/statistics' - result = self.__getProxy().get(url=UrlHelper.replace(url, {'{disk:id}': self.parentclass.get_id()})).get_statistic() - + result = self.__getProxy().get(url=SearchHelper.appendQuery(url=UrlHelper.replace(url=url, + args={'{disk:id}': self.parentclass.get_id()}), + qargs={'max:matrix':max}), + headers={}).get_statistic() return ParseHelper.toSubCollection(DiskStatistic, self.parentclass, FilterHelper.filter(result, kwargs), @@ -2839,7 +2870,7 @@ [@param host.name: string] [@param host.address: string] [@param host.root_password: string] - [@param host.cluster.id: string] + [@param host.cluster.id|name: string] [@param host.port: int] [@param host.storage_manager.priority: int] [@param host.power_management.type: string] diff --git a/src/ovirtsdk/xml/params.py b/src/ovirtsdk/xml/params.py index a49fab3..1160032 100644 --- a/src/ovirtsdk/xml/params.py +++ b/src/ovirtsdk/xml/params.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # -# Generated Sun Jan 13 19:52:44 2013 by generateDS.py version 2.7b. +# Generated Tue Feb 19 14:54:44 2013 by generateDS.py version 2.7b. # import sys @@ -9046,10 +9046,11 @@ class Hook(BaseResource): subclass = None superclass = BaseResource - def __init__(self, actions=None, href=None, id=None, name=None, description=None, creation_status=None, link=None, event_name=None, md5=None): + def __init__(self, actions=None, href=None, id=None, name=None, description=None, creation_status=None, link=None, event_name=None, md5=None, host=None): super(Hook, self).__init__(actions, href, id, name, description, creation_status, link, ) self.event_name = event_name self.md5 = md5 + self.host = host def factory(*args_, **kwargs_): if Hook.subclass: return Hook.subclass(*args_, **kwargs_) @@ -9060,6 +9061,8 @@ def set_event_name(self, event_name): self.event_name = event_name def get_md5(self): return self.md5 def set_md5(self, md5): self.md5 = md5 + def get_host(self): return self.host + def set_host(self, host): self.host = host def export(self, outfile, level, namespace_='', name_='Hook', namespacedef_=''): showIndent(outfile, level) outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) @@ -9082,10 +9085,13 @@ if self.md5 is not None: showIndent(outfile, level) outfile.write('<%smd5>%s</%smd5>\n' % (namespace_, self.gds_format_string(quote_xml(self.md5).encode(ExternalEncoding), input_name='md5'), namespace_)) + if self.host is not None: + self.host.export(outfile, level, namespace_, name_='host') def hasContent_(self): if ( self.event_name is not None or self.md5 is not None or + self.host is not None or super(Hook, self).hasContent_() ): return True @@ -9106,6 +9112,12 @@ if self.md5 is not None: showIndent(outfile, level) outfile.write('md5=%s,\n' % quote_python(self.md5).encode(ExternalEncoding)) + if self.host is not None: + showIndent(outfile, level) + outfile.write('host=model_.host(\n') + self.host.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') def build(self, node): self.buildAttributes(node, node.attrib, []) for child in node: @@ -9122,6 +9134,10 @@ md5_ = child_.text md5_ = self.gds_validate_string(md5_, node, 'md5') self.md5 = md5_ + elif nodeName_ == 'host': + obj_ = Host.factory() + obj_.build(child_) + self.set_host(obj_) super(Hook, self).buildChildren(child_, node, nodeName_, True) # end class Hook -- To view, visit http://gerrit.ovirt.org/12204 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8ae59ecef269bf0ac5c69283a60b20ad984ed602 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine-sdk Gerrit-Branch: sdk_3.2 Gerrit-Owner: Michael Pasternak <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
