Creating the Class
Before we create our first Automation script, we need to put some things in place. We'll begin by creating a new Domain called ACME.
In the Automation Explorer, highlight the Datastore icon in the side bar, and click Configuration -> Add a New Domain:
We'll give the Domain the name ACME, and ensure the Enabled checkbox is ticked:
Now we'll add a Namespace into this domain, called General. Highlight the ACME Domain icon in the side bar, and click Configuration -> Add a New Namespace:
Give the Namespace the name General:
Now we'll create a new Class, called Methods. (it may seem that naming a class Methods is somewhat confusing, however many of the generic Classes in the ManageIQ
and RedHat
Domains in the automation datastore are called Methods
to signify their general-purpose nature).
Highlight the General Domain icon in the side bar, and click *Configuration -> Add a New Class:
Give the Class the name Methods:
We'll leave the Display Name blank for this example.
We'll create a simple Schema. Click the Schema tab for the Methods class, and click Configuration -> Edit selected Schema:
Click New Field, and add a single field with name execute, Type Method and Data Type String:
Click the tick in the left hand column to save the field entry, and click the Save button to save the Schema.
We now have our generic Class defininition called Methods
setup, with a simple Schema that executes a single Method.