Start a Conversation

Unsolved

This post is more than 5 years old

832

March 14th, 2017 07:00

list() and table() inspection

Does anyone know if it is possible to check what the size or contents of a list() or a table() declared in ASL scripts is using dmctl connected to an IPAM domain?

53 Posts

March 15th, 2017 09:00

David,

Thanks your post.  To answer your question, its not possible to get the size of the list or table declared in the ASL script using dmctl.  The reason being that dmctl has only has access to Smarts repository objects.  The list and tables are not repository objects.  Only the asl file has access to the list and table.

5 Practitioner

 • 

274.2K Posts

April 2nd, 2017 23:00

There are other options available that would allow you to do this.  Depending on the use case you could use a GA_StringDictionary (all domains) or AD_DataSet object.  These live in the domain manager as objects and can be queried using dmctl.

dictObj = create("GA_StringDictionary", "myDict");

dictObj->insert("key", "value");

dictObj->contains("key"); <== boolean

dictObj->find("key"); <== returns the value associated with the key

dictObj->dump();  <== dumps the values to the domain managers log file.

dictObj->get(); <== list to iterate through.

getting the size is a bit tougher since there is no size operation.  You could:

dmctl -s invoke dictObj::myDict get | grep "{" | wc -l

dmctl -s invoke dictObj::myDict get | find /i "{" /c

Each will return a count that is 1 higher than actual count (assumes you do not use { in the key or value.)

If you use AD_DataSet you get the option of having up to 5 values associated with the key and you gain a size operation.  You also need to use getEntry to get the entire 5 values.  Other operations are the same.

One important note, if you are using nested tables this will likely not work.

No Events found!

Top