Hi,
Working with the latest VCAC plugin for VCO release (5.2 and 5.5 respectively), I was intending to put a simple set of script element wrappers in front of the "Provision a virtual machine from a blueprint" workflow, such that (for starters) the provisioning group and blueprint inputs could be sent in as simple name strings, rather than expecting complex objects (as provided), to allow for simpler REST API consumption (not through the presentation layer btw, which was using the inventory tree to lookup and provide said input objects interactively). I found no provided actions letting me do simple object retrievals by name, and decided to start by grabbing a full array of the objects and do string matching against it...
That turned out to be quite simple for provisioning groups and is working well - namely because of the provided method "host.findAllChildProvisioningGroups()", whether using it directly or through the "getAvailableProvisioningGroups" action.
Blueprints are turning out to be a different story. I did find the "getBlueprints" action, which appears to be leveraged by the presentation layer when the workflow is run interactively, taking a provisioningGroup object as input (which I had already retrieved above). It wasn't working when used in a script element, though. Upon reviewing the backing action, I found it was relying on a property of the provisioning group object, rather than a method (there isn't a useful method available). Adding some debugging confirmed the expected array was never populating when referenced (group.virtualMachineTemplates). I'm not sure if it's broken, or if I should only expect it would work via presentation, or if I was just using it incorrectly - but I started looking for alternatives.
I looked around in the API browser and other samples, including the extensibility package and reviewed all the provided actions, but they always seem to expect the VCAC:Blueprint input type. I did find getBlueprintsForProperty and it's close to what I need, though it runs far too slowly when pulling a large blueprint list (almost a second per object). I know linqpad can dump all blueprints in VCAC (via ODATA) much faster.
In the end, I'm just looking for a way to easily get all blueprints for a provisioning group (or, even a host if it's fast enough), returned in an array of type VCAC:Blueprint I can iterate through - or even more simply, to retrieve blueprint objects directly based on a known displayName and get my object. I'm aware of the full VCAC entity mechanism added in the latest plugin, but concerned that what I get back won't match the input type..it appears some properties don't match the VCO type and others aren't part of a blueprint entity at all. Frankly I was hoping to not get that familiar with the innards of the existing VCAC API, and would rather not have to recreate a blueprint object from its requisite entity parts.
If you're still with me, thanks! - and, any ideas? I'd love to hear I'm missing something painfully simple here...
-Milson