[gsoc-dev] Fwd: [GWM] Need a bit of Sys Admin help - Sample data
Chance Zibolski
chance at osuosl.org
Mon Jul 1 22:00:58 UTC 2013
Sorry didn't send this to the entire list.
Also, Pranjal, if you set up vagrant-ganeti with ganeti web manager, you
should be able to get all of this data from ganeti web manager using the
stuff I mentioned in the previous email.
---------- Forwarded message ----------
From: Chance Zibolski <chance at osuosl.org>
Date: Mon, Jul 1, 2013 at 11:57 AM
Subject: Re: [gsoc-dev] [GWM] Need a bit of Sys Admin help - Sample data
To: pranjal mittal <mittal.pranjal at gmail.com>
https://docs.djangoproject.com/en/1.4/topics/serialization/
Take a look at that for serializing the models.
I tested this and it seems to work pretty well.
>>> from django.core import serializers
>>> data = serializers.serialize("json",
models.VirtualMachine.objects.all())
On Mon, Jul 1, 2013 at 10:22 AM, pranjal mittal <mittal.pranjal at gmail.com>wrote:
> Interesting, I didn't know there was a santize tool for the configuration
> files.
> I was wondering before, as to why the nodes and instances in the JSON file
> you gave me have so mainstream names.
>
> Having a look at sanitize-config. Will have to try using it first, to see
> what it does exactly.
>
>
> On Mon, Jul 1, 2013 at 9:02 PM, Lance Albertson <lance at osuosl.org> wrote:
>
>> I'm cool with doing this but I want to make sure the data is sanitized
>> (i.e. no real hostnames or ips). The data I originally gave you came from a
>> script from ganeti itself which had an sanitized feature. Perhaps we (or
>> you!) can write a similar tool for RAPI and contribute it upstream. For a
>> reference its under tools/sanitize-config in the ganeti git repo. I would
>> create one called sanitize-rapi.
>>
>>
>> On Sun, Jun 30, 2013 at 5:43 AM, pranjal mittal <mittal.pranjal at gmail.com
>> > wrote:
>>
>>> Hello Lance / Ken,
>>>
>>> I need some sample data -
>>> JSON dumps for all nodes, virtualmachine objects on any one sample
>>> cluster at the OSL, *obtained almost exactly this GWM way shown below-*
>>>
>>> $ cd ganeti_webmgr
>>> $ python manage.py shell
>>>
>>> >>> from ganeti_web.models import *
>>>
>>> *>>> vms = VirtualMachine.objects.all(cluster=...)*
>>> *>>> nodes = Node.objects.all(cluster=...)*
>>> *
>>> *
>>> *>>> serialized_data_vms = json.dump(vms, "vms.json")*
>>> *>>> serialized_data_nodes = json.dump(nodes, "nodes.json")*
>>>
>>> vms.json, & nodes.json is what I would need.
>>>
>>>
>>> *Why?*
>>> The front-end "graph.js" needs to be format-aware of these JSON objects
>>> to use them well. (Technically, that would be me :))
>>> Though, I am almost sure I would not be passing the same JSON as above
>>> to the client-side ie. I might want to do some sanitizing,formatting before
>>> serializing to JSON, in Python itself.
>>>
>>> But, I would need this format atleast now, to experiment.
>>>
>>>
>>> Thanks,
>>> - Pranjal
>>>
>>> IRC: pmittal
>>> GITHUB: pramttl
>>>
>>> --
>>> Best Regards,
>>> Pranjal Mittal
>>> B.Tech. 2014
>>> Indian Institute of Technology,BHU
>>> Varanasi, U.P,
>>> India
>>>
>>
>>
>>
>> --
>> Lance Albertson
>> Director
>> Oregon State University | Open Source Lab
>>
>
>
>
> --
> Best Regards,
> Pranjal Mittal
> B.Tech. 2014
> Indian Institute of Technology,BHU
> Varanasi, U.P,
> India
>
> _______________________________________________
> gsoc-dev mailing list
> gsoc-dev at lists.osuosl.org
> http://lists.osuosl.org/mailman/listinfo/gsoc-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/gsoc-dev/attachments/20130701/5fae65c4/attachment-0001.html>
More information about the gsoc-dev
mailing list