Change in ovirt-engine-sdk[master]: sdk: Add support for matrix parameters to "add" methods

juan.hernandez at redhat.com juan.hernandez at redhat.com
Mon Nov 23 09:17:23 UTC 2015


Juan Hernandez has submitted this change and it was merged.

Change subject: sdk: Add support for matrix parameters to "add" methods
......................................................................


sdk: Add support for matrix parameters to "add" methods

Currently the "add" methods don't support the matrix or query parameters
declared in the RSDL. For example, the method that adds a disk to a
storage domain supports an "unregistered" matrix parameter, but in the
current Python SDK the method is declared as follows:

  def add(self, disk, correlation_id=None, expect=None)

This patch adds support for the matrix parameters, so that this method,
for example, will instead be declared like this:

  def add(self, disk, correlation_id=None, expect=None, unregistered=None)

The user will then be able to use this "unregistered" parameter. For
example, to resgister an unregistered disk:

  sd = api.storagedomains.get(name="mysd")
  sd.disks.add(
    disk=params.Disk(id="51bd5eee-6dab-4ba2-8851-ca91729aeed5"),
    unregistered=True
  )

This support for matrix parameters will also be available in the CLI, so
users could, for example, use the following command to register a disk:

  $ add disk \
  --parent-storagedomain-name mydata \
  --unregistered true \
  --id 51bd5eee-6dab-4ba2-8851-ca91729aeed5

Change-Id: I7a4f5fa36c96f59d79d1d6458936107a6ab02d89
Bug-Url: https://bugzilla.redhat.com/1282770
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
---
M generator/src/main/java/org/ovirt/engine/sdk/generator/python/Collection.java
M generator/src/main/java/org/ovirt/engine/sdk/generator/python/SubCollection.java
M generator/src/main/java/org/ovirt/engine/sdk/generator/python/templates/CollectionAddTemplate
M generator/src/main/java/org/ovirt/engine/sdk/generator/python/templates/CollectionGetDisksTemplate
M generator/src/main/java/org/ovirt/engine/sdk/generator/python/templates/CollectionGetSearchableTemplate
M generator/src/main/java/org/ovirt/engine/sdk/generator/python/templates/CollectionListSearchableTemplate
M generator/src/main/java/org/ovirt/engine/sdk/generator/python/templates/ParamsImportsTemplate
M generator/src/main/java/org/ovirt/engine/sdk/generator/python/templates/ResourceDeleteWithBodyTemplate
M generator/src/main/java/org/ovirt/engine/sdk/generator/python/templates/ResourceDeleteWithParamsTemplate
M generator/src/main/java/org/ovirt/engine/sdk/generator/python/templates/SubCollectionAddTemplate
M generator/src/main/java/org/ovirt/engine/sdk/generator/python/templates/SubCollectionListWithParamsTemplate
M generator/src/main/java/org/ovirt/engine/sdk/generator/python/templates/SubResourceDeleteWithUrlParamsAndBodyTemplate
M generator/src/main/java/org/ovirt/engine/sdk/generator/python/templates/SubResourceDeleteWithUrlParamsTemplate
M generator/src/main/java/org/ovirt/engine/sdk/generator/python/templates/SubResourceUpdateTemplate
M generator/src/main/java/org/ovirt/engine/sdk/generator/python/utils/ParamUtils.java
M src/ovirtsdk/api.py
M src/ovirtsdk/infrastructure/brokers.py
M src/ovirtsdk/utils/searchhelper.py
M src/ovirtsdk/utils/urlhelper.py
M src/ovirtsdk/xml/params.py
20 files changed, 1,454 insertions(+), 1,055 deletions(-)

Approvals:
  Juan Hernandez: Looks good to me; Passed CI tests; Ready for merge
  Jenkins CI: Passed CI tests
  Maor Lipchuk: Verified; Looks good to me



-- 
To view, visit https://gerrit.ovirt.org/48677
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7a4f5fa36c96f59d79d1d6458936107a6ab02d89
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipchuk at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>



More information about the Engine-commits mailing list