Object Model is a definition of environment that Murano Conductor was asked to deploy.

Lets take the following Object Model that describes Active Directory service with single controller for our further examples:

    {
        "name": "MyDataCenter",
        "id": "adc6d143f9584d10808c7ef4d07e4802",
        "services": [ {
            "name": "TestAD",
                "type": "activeDirectory",
                "osImage": {"name": "ws-2012-std", "type": "ws-2012-std"},
                "availabilityZone": "nova",
                "flavor": "m1.medium",
                "id": "9571747991184642B95F430A014616F9",
            "domain": "acme.loc",
            "adminPassword": "SuperP@ssw0rd",
        "units": [ {
                "id": "273c9183b6e74c9c9db7fdd532c5eb25",
                "name": "dc01",
                "isMaster": true,
                "recoveryPassword": "SuperP@ssw0rd!2"
            } ]
         } ]
    }

There are several functions to select values from Object Model and function to modify it so that the Workflow can persist the changes made during deployment.

All reads and writes to Object Model are relative to some cursor position which is managed by workflow rule. Lets call it current cursor position.

The simplest method of accessing Object Model is a select function. Suppose current cursor position points to a single unit of our single service. Then <select path="name"/> is "dc01" and <select path="isMaster"/> is True.

Path parameter may start with colon to indicate navigation to one level up or slash to go to Model root:

 <select path=":"/> 

is

[
    {
        "id": "273c9183b6e74c9c9db7fdd532c5eb25",
        "name": "dc01",
        "isMaster": true,
        "recoveryPassword": "SuperP@ssw0rd!2"
   }
]

<select path="::domain"> is "acme.loc" and <select path="/name" /> is "MyDataCenter"

The path also supports drill-down notation: <select path="::osImage.name"> is "ws-2012-std" <select path="::units.0.name"> equals to <select path="/services.0.units.0.name"> that is "dc01"

If the path does not exist then result of a select would be None: <select path="::noSuchProperty"/> = None

<select/> without path results in object pointed by current cursor position.

It also possible to select multiple values using JSONPath selection language (http://goessner.net/articles/JsonPath/):

 <select-all path="/$.services[?(@.type == 'activeDirectory')].units[*]"/>  

- returns array of all units of all services of type 'activeDirectory'

JSONPath expressions by default select data relative to current cursor position and has no way for navigating up the Model tree. But Conductor has several improvements to JSONPath language:

  • JSONPath expression may start with one or more colon characters to perform query relative to current cursor parent (grandparent etc.)
  • JSONPath expression may also start with slash as in example above to query the whole Model from the tree root
  • Expressions may reference nonexistent Model attributes in the same way as <select/> function does. Such attributes considered to have None values

<select-single path="JSONPath expression"/> is similar to <select-all/> , but returns only the first value matched by a JSONPath query or None.

Object Model can also be modified using <set/> function. <set/> is very similar to <select/> with the only difference in that <select/> writes values while <select/> reads them: <set path="name">dc02</set> changes unit name (eg. the object pointed by current cursor position) to "dc02". <set> can also introduce new attributes, event nested ones: <set path="newProperty">value</set> creates new attribute "newProperty" with given value, <set path="state.property">value</set> makes current unit have property "state": { "property": "value" }

In this case "state" is just a convention - a reserved property that would never be used for service our units input properties. There is a also a special property called "temp". The contents of this property (on all services and units and environment itself) if wiped after each deployment.

loading table of contents...