Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Pete
@kasim1r
but what actually happens is an error 400
{"type":["This field is required."],"hypervisor":["This field is required."]}
i though i had both in there
i also tried "" around the integers
basic misunderstanding of the concept (at my side)?
✪ vi4m Marcin Kliks
@vi4m
trying.
Pete
@kasim1r
very nice of you :)
✪ vi4m Marcin Kliks
@vi4m
curl -H "Content-Type: application/json" -H "Authorization: Token 9af03a5ed0eabdc665f00c7043c3913f88d0943b" -XPOST http://ralph-demo.allegro.tech/api/virtual-servers/ -d '{"hypervisor": 810, "type": 4}' -vvv
Pete
@kasim1r
that worked?
✪ vi4m Marcin Kliks
@vi4m
it works on our demo site, remember about Content-Type
if not provided, it wont' work
Pete
@kasim1r
oh really.... i only had the "Accept" header in there
✪ vi4m Marcin Kliks
@vi4m
it's required to specify, because we accept other content types
Zrzut ekranu 2016-09-14 o 17.56.07.png
you can play around using this GUI also
Zrzut ekranu 2016-09-14 o 17.56.25.png
to gather some examples and play with it
Pete
@kasim1r
ok, and the "accept" and "content-type" headers cannot be mixed, i just realized
next problem right away:
{"hostname":["This field must be unique."],"sn":["This field must be unique."]}
forget it, he already took the request :)
very nice
i'm doing this in Powershell, so bear with me
✪ vi4m Marcin Kliks
@vi4m
are you adopting Ralph for some back office purposes ?
Pete
@kasim1r
yes, we have a cluster of hypervisors, and I want to automate inventory of VMs
nobody wants to sit in front of a web interface to add VMs by hand :)
albeit the web interface is cool
:P
✪ vi4m Marcin Kliks
@vi4m
yeah, we did it the same, using bunch of scripts
Pete
@kasim1r
oh maybe you want to share these scripts ... for shortening the learning curve?
✪ vi4m Marcin Kliks
@vi4m
so this API for virtualservers should be sufficient to add complete set of properties
it's very simple, you just discovered 30% of it already, by yourself
Pete
@kasim1r
do ihave to add ethernets before the VM so that i can "connect" the ethernet to the VM?
✪ vi4m Marcin Kliks
@vi4m
i'm not sure..
Pete
@kasim1r
thanks for your help anyway.
and a hint for the "installation" howto: change "apt-get install mysql-server" to "mysql-server-5.6" or so
because otherwise installtion fails
✪ vi4m Marcin Kliks
@vi4m
oh, thanks
we are working on the CLI tool, too, http://ralph-cli.readthedocs.io/en/latest/quickstart/
which helps "discovering" in an automatically manner, devices
Pete
@kasim1r
aha
✪ vi4m Marcin Kliks
@vi4m
but we're currently using it only for phiscal hardware, to discover hardware information
so it cannot create new device, rather update components(cpu, memory, ethernets)
Pete
@kasim1r
cool, but dracs are in a saprate physical LAN, not routed to infrstructure
so, hypervisors will still have to be manual :)
✪ vi4m Marcin Kliks
@vi4m
yeah.
Pete
@kasim1r
signing off now, thanks again, will surely come back with more questions :)
cucu
✪ vi4m Marcin Kliks
@vi4m
see you later
Pete
@kasim1r
Good morning!