[racktables-users] Re: Mass object creation

  • From: Jonathan Thurman <jonathan@xxxxxxxxxxxxxxx>
  • To: racktables-users@xxxxxxxxxxxxx
  • Date: Thu, 1 Sep 2011 20:13:10 -0700

On Thu, Sep 1, 2011 at 6:20 AM, Robert Parten <rparten@xxxxxxxxxxxx> wrote:
> I have about 200 objects of the same type to create so I am wondering if
> there is any way to do this as a "one liner" script that creates objects
> "server" with names server{001-150}

There is currently no one-liner but you could create a script to
generate the 150 server names and use the "Same type, same tags" form
on the Add Objects page.  Something like:

perl -e 'for ($i=1; $i<=150; $i++) { printf("server%03d\n", $i); }'

server001
server002
...
server150

Then paste that in and click Go!

I did test this on the code in trunk with 150 server objects, and it
took a minute or two but completed.

-Jonathan

Other related posts: