Chapter 10. Investigative Debugging
As we saw in Chapter 6, there is a lot of useful information in the form of service model object attributes and virtual columns, links to other objects via associations, and service model methods that we can call. The challenge is sometimes knowing which objects are available to us at any particular point in our workflow, and how to access their properties and traverse associations to find the information that we need.
Fortunately there are several ways of exploring the object structure in the Automation Engine, both to investigate what might be available to use, and to debug and troubleshoot our own automation code. This chapter will discuss the various tools that we can use to reveal the service model object structure available during any Automate operation.
InspectMe
InspectMe is an instance/method combination supplied out-of-the-box that we can call to dump some attributes of $evm.root
and its associated objects. As an example, we can call InspectMe from a button on a “VM and Instance” object as we did when running our AddCustomAttribute instance in Chapter 5. As both the instance and method are in the ManageIQ/System/Request namespace, we can call InspectMe directly rather than calling Call_Instance as an intermediary.
We can view the InspectMe output in automation.log:
# vmdb # grep inspectme log/automation.log | awk 'FS="INFO -- :" {print $2}' Root:<$evm.root> Attributes - Begin Attribute - ae_provider_category: infrastructure Attribute ...
Get Mastering CloudForms Automation now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.