[ovirt-users] Re: Python to retrive the VM-Config from the snapshot

2019-09-10 Thread Ondra Machacek

Hi,

this example is the close to what you want to achieve:


https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/vm_backup.py#L137

but instead of line 137, you would have to do something like this:

snap_data = data_vm_service.snapshots_service().list(all_content=True)[0]
ovf_data = snap_data.vm.initialization.configuration.data

On 10/09/2019 15:12, Sven Achtelik wrote:

Hi All,

I’m trying to build a custom solution for Backups using the python. 
Everything works and I can get my disk copies. The last thing is getting 
the VM config and I can’t find any hint on how to get this done with 
python. Is there a way to actually get this information out easily ? 
Somehting like


  * Grab the wanted vm configuration from the needed snapshot - it’ll be
under initialization/configuration/data

URL = SERVER:PORT/api/vms/VM_ID/snapshots/IDMethod = GET  (with 
All-Content:true header)

I also have to mention that I’m not a profession programmer and work 
with what I can find as documentation or code examples.


http://ovirt.github.io/ovirt-engine-sdk/4.1/

https://github.com/oVirt/ovirt-engine-sdk/tree/master/sdk/examples

If some experienced python programmer could give a hint where to look at 
that would be great.


Thank you,

Sven


___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/G5ZAPBGVZ7EKYWPXDPIZIKMSBUQBOPWN/


___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/53WGTDTIVIGX7FRSQHL5GT5REQ4Z2IQS/


[ovirt-users] Re: Python to retrive the VM-Config from the snapshot

2019-09-10 Thread Strahil
If the system is running you can use virsh dumpxml.

Best Regards,
Strahil NikolovOn Sep 10, 2019 16:12, Sven Achtelik  
wrote:
>
> Hi All,
>
>  
>
> I’m trying to build a custom solution for Backups using the python. 
> Everything works and I can get my disk copies. The last thing is getting the 
> VM config and I can’t find any hint on how to get this done with python. Is 
> there a way to actually get this information out easily ? Somehting like
>
> Grab the wanted vm configuration from the needed snapshot - it’ll be under 
> initialization/configuration/data
>
> URL = SERVER:PORT/api/vms/VM_ID/snapshots/ID Method = GET  (with 
> All-Content:true header)
>
> I also have to mention that I’m not a profession programmer and work with 
> what I can find as documentation or code examples.
>
> http://ovirt.github.io/ovirt-engine-sdk/4.1/
>
> https://github.com/oVirt/ovirt-engine-sdk/tree/master/sdk/examples
>
> If some experienced python programmer could give a hint where to look at that 
> would be great.
>
> Thank you,
>
> Sven___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/SUWJ46M343QUTNNPLBUZIOERCIHQ4GJR/