Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1854303

Summary: [RFE] Please add Json stdout to example scripts
Product: [oVirt] ovirt-engine-sdk-python Reporter: Ilan Zuckerman <izuckerm>
Component: RFEsAssignee: Ori Liel <oliel>
Status: CLOSED WONTFIX QA Contact: Avihai <aefrat>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.3.0CC: bugs, eshenitz, juan.hernandez, nsoffer, tnisan
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-29 18:02:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ilan Zuckerman 2020-07-07 07:05:40 UTC
Description of problem:

Currently, the example scripts found in   /usr/share/doc/python3-ovirt-engine-sdk4/   do not have an option of returning Json formatted std out.
They only return text stdout when they are done.
It would be very helpful, and relatively easy to add an option for returning Json type data as a result of script execution.
That way, it would be easier to parse the results.

The following scripts are in particular interest for me:
backup_vm.py
upload_disk.py 
download_disk.py


Version-Release number of selected component (if applicable):
python3-ovirt-engine-sdk4-4.4.4-1.el8ev.x86_64

Comment 1 Nir Soffer 2020-07-07 09:36:41 UTC
I think we can change the examples to use stderr for messages
instead of stdout, and add --json option to write json object
to stdout with the details of the operation.

For example for upload_disk.py we we an have:

{
    "storage-domain": "storage-name",
    "disk": "disk-id",
    "transfer": "transfer-id",
    "transfer-host": "host1",
    "image": "/path/to/file",
    "image-format": "qcow2",
    "disk-name": "file.raw",
    "disk-format": "raw",
    ...
}