[Users] Fwd: ovirt cli commands / script wont exit the shell

Rami Vaknin rvaknin at redhat.com
Wed Oct 10 09:41:05 UTC 2012


On 10/09/2012 11:48 PM, Alex Leonhardt wrote:
>
> On 10/09/2012 08:19 PM, Alex Leonhardt wrote:
>>
>>
>> On 10/09/2012 07:21 AM, Yaniv Kaul wrote:
>>> On 10/09/2012 12:15 AM, Alex Leonhardt wrote:
>>>>
>>>>
>>>> On 10/08/2012 10:26 PM, Yaniv Kaul wrote:
>>>>> On 10/08/2012 11:17 PM, Alex Leonhardt wrote:
>>>>>> Aha - cool - thanks! :)
>>>>>>
>>>>>> Now, I was also looking at the REST API - is there a simple shell 
>>>>>> based way to read / query the resulting XML ? Or would you 
>>>>>> suggest to write python scripts to e.g. start/stop instance, get 
>>>>>> a list of VMs / their IDs, etc. ?
>>>>>
>>>>> If you are already planning on Python, why not use the SDK instead 
>>>>> of doing REST?
>>>>> some examples @ http://wiki.ovirt.org/wiki/Testing/PythonApi
>>>>> Y.
>>>>>
>>>> Hi Yaniv,
>>>>
>>>> thanks - had a quick look - is the PyAPI able to get the current 
>>>> usage of the VMs (e.g. Memory/CPU/etc. usage) - it's the main 
>>>> reason (for monitoring & trending) that I need this ..
>>>>
>>>> Thanks!
>>>> Alex
>>>>
>>>
>>> It does. The SDK is auto-generated from the REST interface so you 
>>> can get the statistics sub-collection and use it.
>>> Y.
>>
>> Awesome - thanks! :)
>>
>> Alex
>>
>
> Hi Yaniv,
>
> Is there a document / wiki article that has examples to get those 
> metrics for e.g. ram usage, cpu usage, etc. ?

Take a look at the restapi structure of api/vms/{vm-id}/statistics for 
pointers, but basically here is a simple example:

for stat in api.vms.get('my_vm').statistics.list():
     print 'Name:', stat.name
     print 'Description:',stat.description
     for value in stat.values.value:
         print '  Value:', value.datum
>
> Thanks!
> Alex
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users


-- 

Thanks,

Rami Vaknin, QE @ Red Hat, TLV, IL.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20121010/3451c530/attachment-0001.html>


More information about the Users mailing list