3 Replies Latest reply on Jun 2, 2015 2:07 PM by tdanner

    Looking for a little help with the CreateCustomProperty verb


      I've not done much with the SDK and don't have very much programming/scripting experience at all, so please excuse the "noob" level of this question.


      I have come across the CreateCustomProperty verb and very much want to use it to create a bunch of custom properties by having a powershell script loop through a csv file, excel file, or whatever kind of input method I end up creating.  The problem I am having with the documentation is that none of the verbs that it does explain and none of the examples that are given address this particular verb and its cousin, CreateCustomPropertyValues.  I see there are a bunch of parameters you can define with this property when you create it but many of the parameter names do not match the custom property entity values.  See here:


      If you look above, some are obvious.  PropertyName is obviously the property's name, which is called "Field" in the Orion.CustomProperty entity table but others are ambiguous or completely cryptic to a non-programmer such as myself.  ValueType for instance, does that correspond to the DataType field which is basically nvarchar/bit/datetime/real/int or does that correspond to the Table field, which is whether it is a Node/Interface/Application/Volumes/Report/Alert type of custom property?  What is ValidRange for example, or Parser, Header, Alignment, Format, Units, or Usages for that matter?  I mean, I think I know what some of those might be, but I don't really know nor do I have any clue on how to find out other than spinning up a lab system and going through a tedious system of trial and error.


      Also, for Custom Properties that will have a list of Restricted values, how are those defined when scripting it in Powershell?


      If someone could either explain these questions or, better yet, tell me an easy way to find out (you know, "teach a man to fish"?) then that would very helpful and much appreciated.


      On a related subject, has SolarWinds released a full listing of its verbs with descriptions of all of their parameters yet?  If not, why not?  Looking in the PDF document that you get when you install the SDK, I see a handful of verbs are explained, why not just finish explaining the rest and then adding to that list whenever new verbs are created?  Like I said, if there is an easy way to see which entity values these parameters map to, then by all means please show me and disregard this request, but if not, please SolarWinds, document the verbs completely.  That would make this much easier for programming beginners to start learning and using the SDK.


      Thank you!


      EDIT:  Ok, so I found this Link: Full documentation of Orion SDK verbs? and I got a little excited, but when I went and looked at the entity tables it talked about they really didn't answer my questions. I don't seen anything in the MetaData Verb entities that tell me which parameters map to which values.  So, questions above still stand.


      Message was edited by: Jordan Hume

          • Re: Looking for a little help with the CreateCustomProperty verb

            This is absolutely perfect tdanner!  You even put some PowerShell examples which helps me a lot.  It would be amazing if every verb was documented this way (I know, big project, but you probably have an intern or two you could get to do the grunt work and just have you edit it at the end to fill in any blanks and fix any incorrect data).  It would be pretty easy to maintain after the initial shock of doing all of them since it would really just be about documenting the new ones.


            Seriously, thank you very very much.  I really appreciate it, this will make my job so much easier.


            P.S. You got any tips for an easy way to pass a large number of custom properties and their values and parameters into a script like this?  So I have a bunch of properties I commonly implement in a new Orion install and I am tired of manually creating them for each and every client.  Some of the properties are Node properties, some are Interfaces properties, some are True/False, most are Text with Restricted Values.  I want an easy way of just running a script and having all of them and their values "imported" into the new installation.  I was thinking a CSV file but I don't know how to format it to handle the different types of properties.  Also, from your example it looks like I would need to have a separate CSV for the restricted values?  I'm thinking maybe it would just be easier to just put it all into a big static powershell script, but then any time I would want to change a property's parameters/names/values I'd have to go through the script and edit it.  I can't decide if a csv file would make that easier or not.  Any tips, ideas, or examples?

              • Re: Looking for a little help with the CreateCustomProperty verb

                CSV is a good input source for a PowerShell script. You can read a CSV file into a list of objects with the "Import-Csv" cmdlet. I would use Excel to build a table with these columns:


                EntityType, PropertyName, PropertyType, PropertySize, PropertyValues


                For node properties, EntityType would be Orion.NodesCustomProperties. For interface custom properties, it would be Orion.NPM.InterfacesCustomProperties (the same verb exists on that entity). PropertyType and PropertySize are straightforward. For PropertyValues, just put all of the values in one cell separated by semi-colons. Then when you need to convert that into a string array for passing to CreateCustomPropertyWithValues, just call .Split(";") on it - you'll get back a string array with one entry for each item.

                1 of 1 people found this helpful