Le 04/01/2017 à 15:41, Juan Hernández a écrit :
On 01/04/2017 12:30 PM, Yaniv Kaul wrote:
>
> On Wed, Jan 4, 2017 at 1:04 PM, Nicolas Ecarnot <nicolas(a)ecarnot.net
> <mailto:nicolas@ecarnot.net>> wrote:
>
> Hello,
>
> Le 04/01/2017 à 11:49, Nathanaël Blanchet a écrit :
>
>
>
> Le 04/01/2017 à 10:09, Andrea Ghelardi a écrit :
>
>
> Personally I don’t think ansible and ovirt-shell are
> mutually exclusive.
>
> Those who are in ansible and devops realms are not really
> scared by
> making python/ansible work with ovirt.
>
> From what I gather, playbooks are quite a de-facto
> pre-requisite to
> build up a real SaaC “Software as a Code” environment.
>
>
>
> On the other hand, ovirt-shell can and is a fast/easy way to
> perform
> “normal daily tasks”.
>
> totally agree but ovirt-shell is deprecated in 4.1 et will be
> removed in
> 4.2. Ansible or sdk4 are proposed as an alternative.
>
>
> Could someone point me to an URL where sdk4 is fully documented, as
> I have to get ready for ovirt-shell deprecation?
>
>
> The Rest API is partially documented under https://<engine>/api/model .
> It's not complete yet. All new features in 4.0 are documented and we are
> working on the 'older' features now.
> (contributions are welcome!)
>
>
> I'm sure no one at Redhat thought about deprecating a tool in favor
> of a new one before providing a complete user doc!
>
>
> In addition, the SDK RPM itself contains many examples. See [1].
> (contributions are welcome!)
>
> Y.
>
> [1]
https://github.com/oVirt/ovirt-engine-sdk/tree/master/sdk/examples
>
Although these examples, I can successfully create a snapshot, but I
didn't find the way to delete it...
Regarding many example, it should be possible to locate any service by :
name_service = connection.system_service().name.service()
So logically it should be doable with snapshot like
snapshots_service = connection.system_service().snapshots.service()
but : AttributeError: 'SystemService' object has no attribute 'snapshots
I saw an example into the ansible [ working ] way to do the same thing
and I found this :
snapshot =
snapshots_service.snapshot_service(module.params['snapshot_id']).get()
How can I get this working with sdk, I mean giving snapshot_id as a
parameter?
--
Nathanaël Blanchet
Supervision réseau
Pôle Infrastrutures Informatiques
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5
Tél. 33 (0)4 67 54 84 55
Fax 33 (0)4 67 54 84 14
blanchet(a)abes.fr