Skip to content

Latest commit

 

History

History
64 lines (41 loc) · 1.98 KB

creating_the_class.md

File metadata and controls

64 lines (41 loc) · 1.98 KB

##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:

Screenshot


We'll give the Domain the name _ACME_, and ensure the **Enabled** checkbox is ticked:

Screenshot


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**:

Screenshot


Give the Namespace the name _General_:

Screenshot


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:

Screenshot


Give the Class the name _Methods_:

Screenshot


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:

Screenshot


Click **New Field**, and add a single field with name _execute_, **Type** _Method_ and **Data Type** _String_:

Screenshot


Click the **tick** in the left hand column to save the field entry, and click the **Save** button to save the Schema.

Screenshot


We now have our generic Class defininition called `Methods` setup, with a simple Schema that executes a single Method.