HTTP Value Sets in UrbanCode Deploy

Remember that old,old post of mine: HTTP Filtered Value Set Providers and dependent enumerations ? Probably not. It goes into a little feature of Rational Team Concert that makes it easy to avoid having to duplicate data from external systems that RTC might need to integrate with. UrbanCode Deploy can do something similar for value sets for process properties.

Take a closer look at UrbanCode Deploy with vSphere andĀ Chef, specifically at how the Generic Process to kick of the whole thing is invoked.

parampromptIt may not be entirely obvious but the value sets for theĀ applicationName, jkedbVersion, jkewebVersion, and infrastructureVersion properties all come from existing sets in UCD: the names of all UCD Applications and names of versions of the jke-db, jke-web and jke-infrastructure components respectively.

Now to provide these lists to the user I would normally have to create each property as a “Select” type and manually maintain the values. For example:

valueselectIf there are only three applications and not many more added over time maintaining this list isn’t a big deal. Same applies to the component versions. However as the numbers grow, this will quickly become a real pain.

Enter HTTP value sets.

Since I can get the list of Applications via the UCD REST API, I simply make the property a “HTTP Select” sucking in the values for the applicationName property directly from UCD at selection time.

httpappselectHitting the URL returns JSON from which I pick out the “Name” via the “Value Path” parameter. Now I don’t need to worry about the values for this property each time I add a new application. The same applies to the component versions.

httpdbselectNotice the slight difference here. I use the “id” for the “Value Path” which is a value like “ca71cee3-ad1e-42da-bae3-1e223b2cf7e1” and doesn’t make much sense. I then use “name” for the “Label Path” parameter which is (usually) a more human readable value like “1.2“. So the Value Path picks the value used for the property while the label path picks the label displayed for the property.

This feature applies to properties for Component, Application and Generic processes. See the Retrieving property values from external files topic in the UCD 6.1 documentation for more details with examples of how to use this with JSON or XML.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s