Michael Pasternak has uploaded a new change for review. Change subject: sdk: regenerate against the latest api ......................................................................
sdk: regenerate against the latest api - added StorageDomainStorageConnection.delete(async) signature - added StorageDomainStorageConnections.add(storageconnection, expect, correlationId) signature Change-Id: I58962be14fb9ce2968f4e7732f1567170d41f701 Signed-off-by: Michael pasternak <mpast...@redhat.com> --- M src/ovirtsdk/api.py M src/ovirtsdk/infrastructure/brokers.py M src/ovirtsdk/xml/params.py 3 files changed, 92 insertions(+), 28 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine-sdk refs/changes/36/18836/1 diff --git a/src/ovirtsdk/api.py b/src/ovirtsdk/api.py index 8bf57a6..c1dee98 100644 --- a/src/ovirtsdk/api.py +++ b/src/ovirtsdk/api.py @@ -20,7 +20,7 @@ ############ GENERATED CODE ############ ######################################## -'''Generated at: 2013-08-14 12:10:31.267414''' +'''Generated at: 2013-09-03 17:33:36.499568''' import types @@ -245,6 +245,12 @@ typ=types.IntType ) + def __enter__(self): + return self + + def __exit__(self, type, value, tb): + self.disconnect() + def get_comment(self): entry_point = context.manager[self.id].get('entry_point') if entry_point: @@ -284,9 +290,3 @@ if entry_point: return entry_point.product_info raise DisconnectedError - - def __enter__(self): - return self - - def __exit__(self, type, value, tb): - self.disconnect() diff --git a/src/ovirtsdk/infrastructure/brokers.py b/src/ovirtsdk/infrastructure/brokers.py index 25019a5..47066e1 100644 --- a/src/ovirtsdk/infrastructure/brokers.py +++ b/src/ovirtsdk/infrastructure/brokers.py @@ -20,7 +20,7 @@ ############ GENERATED CODE ############ ######################################## -'''Generated at: 2013-08-26 15:36:10.578423''' +'''Generated at: 2013-09-03 17:33:36.497540''' from ovirtsdk.xml import params @@ -10238,6 +10238,27 @@ #still available at client's code. raise DisconnectedError + def delete(self, async=None): + ''' + [@param async: boolean (true|false)] + + @return None: + ''' + + url = UrlHelper.replace( + '/api/storagedomains/{storagedomain:id}/storageconnections/{storageconnection:id}', + {'{storagedomain:id}' : self.parentclass.get_id(), + '{storageconnection:id}': self.get_id()} + ) + + return self.__getProxy().delete( + url=SearchHelper.appendQuery( + url, + {'async:matrix':async} + ), + headers={"Content-type":None} + ) + class StorageDomainStorageConnections(Base): def __init__(self, storagedomain , context): @@ -10253,6 +10274,35 @@ #still available at client's code. raise DisconnectedError + def add(self, storageconnection, expect=None, correlation_id=None): + + ''' + @type StorageConnection: + + @param storageconnection.id: string + [@param expect: 201-created] + [@param correlation_id: any string] + + @return StorageConnection: + ''' + + url = '/api/storagedomains/{storagedomain:id}/storageconnections' + + result = self.__getProxy().add( + url=UrlHelper.replace( + url, + {'{storagedomain:id}': self.parentclass.get_id()} + ), + body=ParseHelper.toXml(storageconnection), + headers={"Expect":expect, "Correlation-Id":correlation_id} + ) + + return StorageDomainStorageConnection( + self.parentclass, + result, + self.context + ) + def get(self, name=None, id=None): ''' diff --git a/src/ovirtsdk/xml/params.py b/src/ovirtsdk/xml/params.py index 0f6139a..1e4d5b6 100644 --- a/src/ovirtsdk/xml/params.py +++ b/src/ovirtsdk/xml/params.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # -# Generated Mon Aug 26 15:35:54 2013 by generateDS.py version 2.9a. +# Generated Tue Sep 3 17:33:19 2013 by generateDS.py version 2.9a. # import sys @@ -21659,8 +21659,9 @@ class ParametersSet(GeneratedsSuper): subclass = None superclass = None - def __init__(self, deprecated=None, parameter=None): + def __init__(self, deprecated=None, description=None, parameter=None): self.deprecated = deprecated + self.description = description if parameter is None: self.parameter = [] else: @@ -21673,6 +21674,8 @@ factory = staticmethod(factory) def get_deprecated(self): return self.deprecated def set_deprecated(self, deprecated): self.deprecated = deprecated + def get_description(self): return self.description + def set_description(self, description): self.description = description def get_parameter(self): return self.parameter def set_parameter(self, parameter): self.parameter = parameter def add_parameter(self, value): self.parameter.append(value) @@ -21680,6 +21683,7 @@ def hasContent_(self): if ( self.deprecated is not None or + self.description is not None or self.parameter ): return True @@ -21711,6 +21715,9 @@ if self.deprecated is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sdeprecated>%s</%sdeprecated>%s' % (namespace_, self.gds_format_boolean(self.deprecated, input_name='deprecated'), namespace_, eol_)) + if self.description is not None: + showIndent(outfile, level, pretty_print) + outfile.write('<%sdescription>%s</%sdescription>%s' % (namespace_, self.gds_format_string(quote_xml(self.description).encode(ExternalEncoding), input_name='description'), namespace_, eol_)) for parameter_ in self.parameter: parameter_.export(outfile, level, namespace_, name_='parameter', pretty_print=pretty_print) def exportLiteral(self, outfile, level, name_='ParametersSet'): @@ -21725,6 +21732,9 @@ if self.deprecated is not None: showIndent(outfile, level) outfile.write('deprecated=%s,\n' % self.deprecated) + if self.description is not None: + showIndent(outfile, level) + outfile.write('description=%s,\n' % quote_python(self.description).encode(ExternalEncoding)) showIndent(outfile, level) outfile.write('parameter=[\n') level += 1 @@ -21756,6 +21766,10 @@ raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'deprecated') self.deprecated = ival_ + elif nodeName_ == 'description': + description_ = child_.text + description_ = self.gds_validate_string(description_, node, 'description') + self.description = description_ elif nodeName_ == 'parameter': obj_ = Parameter.factory() obj_.build(child_) @@ -27206,8 +27220,9 @@ class DetailedLink(Link): subclass = None superclass = Link - def __init__(self, href=None, rel=None, request=None, response=None, linkCapabilities=None, extensiontype_=None): + def __init__(self, href=None, rel=None, description=None, request=None, response=None, linkCapabilities=None, extensiontype_=None): super(DetailedLink, self).__init__(href, rel, extensiontype_, ) + self.description = description self.request = request self.response = response self.linkCapabilities = linkCapabilities @@ -27218,6 +27233,8 @@ else: return DetailedLink(*args_, **kwargs_) factory = staticmethod(factory) + def get_description(self): return self.description + def set_description(self, description): self.description = description def get_request(self): return self.request def set_request(self, request): self.request = request def get_response(self): return self.response @@ -27228,6 +27245,7 @@ def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_ def hasContent_(self): if ( + self.description is not None or self.request is not None or self.response is not None or self.linkCapabilities is not None or @@ -27264,6 +27282,9 @@ eol_ = '\n' else: eol_ = '' + if self.description is not None: + showIndent(outfile, level, pretty_print) + outfile.write('<%sdescription>%s</%sdescription>%s' % (namespace_, self.gds_format_string(quote_xml(self.description).encode(ExternalEncoding), input_name='description'), namespace_, eol_)) if self.request is not None: self.request.export(outfile, level, namespace_, name_='request', pretty_print=pretty_print) if self.response is not None: @@ -27280,6 +27301,9 @@ super(DetailedLink, self).exportLiteralAttributes(outfile, level, already_processed, name_) def exportLiteralChildren(self, outfile, level, name_): super(DetailedLink, self).exportLiteralChildren(outfile, level, name_) + if self.description is not None: + showIndent(outfile, level) + outfile.write('description=%s,\n' % quote_python(self.description).encode(ExternalEncoding)) if self.request is not None: showIndent(outfile, level) outfile.write('request=model_.request(\n') @@ -27311,7 +27335,11 @@ self.extensiontype_ = value super(DetailedLink, self).buildAttributes(node, attrs, already_processed) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): - if nodeName_ == 'request': + if nodeName_ == 'description': + description_ = child_.text + description_ = self.gds_validate_string(description_, node, 'description') + self.description = description_ + elif nodeName_ == 'request': obj_ = Request.factory() obj_.build(child_) self.set_request(obj_) @@ -27330,10 +27358,9 @@ class GeneralMetadata(DetailedLink): subclass = None superclass = DetailedLink - def __init__(self, href=None, rel=None, request=None, response=None, linkCapabilities=None, name=None, description=None): - super(GeneralMetadata, self).__init__(href, rel, request, response, linkCapabilities, ) + def __init__(self, href=None, rel=None, description=None, request=None, response=None, linkCapabilities=None, name=None): + super(GeneralMetadata, self).__init__(href, rel, description, request, response, linkCapabilities, ) self.name = name - self.description = description def factory(*args_, **kwargs_): if GeneralMetadata.subclass: return GeneralMetadata.subclass(*args_, **kwargs_) @@ -27342,12 +27369,9 @@ factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name - def get_description(self): return self.description - def set_description(self, description): self.description = description def hasContent_(self): if ( self.name is not None or - self.description is not None or super(GeneralMetadata, self).hasContent_() ): return True @@ -27380,9 +27404,6 @@ if self.name is not None: showIndent(outfile, level, pretty_print) outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_)) - if self.description is not None: - showIndent(outfile, level, pretty_print) - outfile.write('<%sdescription>%s</%sdescription>%s' % (namespace_, self.gds_format_string(quote_xml(self.description).encode(ExternalEncoding), input_name='description'), namespace_, eol_)) def exportLiteral(self, outfile, level, name_='GeneralMetadata'): level += 1 already_processed = set() @@ -27396,9 +27417,6 @@ if self.name is not None: showIndent(outfile, level) outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding)) - if self.description is not None: - showIndent(outfile, level) - outfile.write('description=%s,\n' % quote_python(self.description).encode(ExternalEncoding)) def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) @@ -27412,10 +27430,6 @@ name_ = child_.text name_ = self.gds_validate_string(name_, node, 'name') self.name = name_ - elif nodeName_ == 'description': - description_ = child_.text - description_ = self.gds_validate_string(description_, node, 'description') - self.description = description_ super(GeneralMetadata, self).buildChildren(child_, node, nodeName_, True) # end class GeneralMetadata -- To view, visit http://gerrit.ovirt.org/18836 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I58962be14fb9ce2968f4e7732f1567170d41f701 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine-sdk Gerrit-Branch: master Gerrit-Owner: Michael Pasternak <mpast...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches