SDL Web 8 Idea – TTML – Tridion Topology Markup Language

A few weeks ago I attended the SDL Web 8.5 Bootcamp in Amsterdam. You can read more about it on the Building Blocks blog.

One of the exercises was a Topology Manager refresher. I had some fun learning Topology Manager when it was introduced in SDL Web 8 and over the past year have had a chance to get some real world experience with it on a few projects. It’s an interesting idea but can be fiddly to set up if you haven’t seen it before.

SDL Web 8.5 brings a great new UI to help you check things have been set up correctly which is a huge help. But I still have a lot of fun with the Powershell commands during initial set up.

The new Topology Manager UI

While working together on the exercise in Powershell, Ginika from SDL professional services showed me a script that his team had written which generated Publication Mapping commands. It achieved this by connecting to SDL Web itself using Peter Kjaer’s Tridion-CoreService Powershell module (which is fantastic by the way).

The script uses simple pattern matching to figure out what the website Publications are and generate the required Powershell scripts to create the Mappings between the CdEnvironments, the Web applications and the Publications – which is critical to getting publishing working.

The exercise got me thinking about whether there was a better way to describe a Topology in a manner which could be easily understood and stored in Source Control. Powershell scripts are fine but anyone who has had hands on experience with Topology Manager knows it can be a little fiddly the first few times particularly if you need to change something like a URL for example.

I’ve been using Swagger / Open API specification at work recently to describe an API I’m working on and that uses YAML which is sort of like JSON with no curly brackets and I thought it might be interesting to try to describe a Topology in YAML.

This is what I came up with:

YAML

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

# Prototype Topology Manager YAML

#

# Date: 08/02/2017

# Robert Stevenson-Leggett

TopologyType:

Id: "StagingAndLiveType"

Name: "Staging & Live"

Purposes: "Staging,Live"

Environments:

-

Id: "Staging"

Purpose: "Staging"

Name: "Staging"

Discovery: "http://staging:8082/discovery.svc"

Auth:

ClientId: "cmuser"

ClientSecret: "CMUserP@ssw0rd"

-

Id: "LiveEU"

Purpose: "Live"

Name: "Live EU"

Discovery: "http://live-eu:8082/discovery.svc"

Auth:

ClientId: cmuser

ClientSecret: CMUserP@ssw0rd

Topology:

Id: "BestFlightTopology"

Name: "Best Flight Topology"

TopologyTypeId: "StagingAndLiveType"

Environments: "Staging,LiveUS"

Websites:

-

Id: LiveSite

CdEnvironmentId: LiveEU

BaseUrls:

- https://www.building-blocks.com

- https://www1.building-blocks.com

- https://www2.building-blocks.com

-

Id: StagingSite

CdEnvironmentId: Staging

BaseUrls:

- https://staging.building-blocks.com

Mappings:

-

Id: LiveSiteMapping

PublicationID: 'tcm:13-0-1'

WebApplicationId: LiveSite_RootWebApp

-

Id: StagingSiteMapping

PublicationID: 'tcm:13-0-1'

WebApplicationId: StagingSite_RootWebApp

Then I just needed a script to generate the necessary Powershell commands based on my format. I played around for a while and got as far as this using the PowerYaml module.

This was just an idea but I think it could be really interesting to play with as a way of storing your Topology and sketching it out.

I guess the advantage of using the YAML format vs saving the PowerShell Script directly is that there is less duplication and it is a bit easier to read.

Ideas for further extension of the format:

Generate a diagram of Topology from the YAML

Link it up to Tridion-Powershell module like the script that Ginika showed me to work out the Mapping from WebApps to Publications based on some rules and generate the appropriate Powershell without needing that part defined in the YAML.