-
Notifications
You must be signed in to change notification settings - Fork 50
How To: Author a ForgeTree
Travis Jensen edited this page May 28, 2020
·
29 revisions
How-To: Author a ForgeTree
This page provides a detailed guide how to author a ForgeTree and utilize the various features of Forge.
Overview of ForgeTree Properties
How Forge TreeWalker Walks the ForgeTree
{
"Tree": {
"Root": {
"Type": "Selection",
"ChildSelector": [
{
"Label": "Container",
"ShouldSelect": "C#|UserContext.ResourceType == \"Container\"",
"Child": "Container"
},
{
"Label": "Node",
"ShouldSelect": "C#|UserContext.ResourceType == \"Node\"",
"Child": "Node"
}
]
},
"Container": {
"Type": "Action",
"Actions": {
"Container_CollectDiagnosticsAction": {
"Action": "CollectDiagnosticsAction"
}
},
"ChildSelector": [
{
"Label": "Tardigrade",
"ShouldSelect": "C#|Session.GetLastActionResponse().Status == \"Success\"",
"Child": "Tardigrade"
}
]
},
"Tardigrade": {
"Type": "Action",
"Actions": {
"Tardigrade_TardigradeAction": {
"Action": "TardigradeAction",
"Input": {
"Context": "ContainerFault",
"EnableV2": true,
"DiagnosticData": "C#|Session.GetLastActionResponse().Output"
}
}
},
"ChildSelector": [
{
"Label": "Tardigrade_Success",
"ShouldSelect": "C#|(await Session.GetOutputAsync(\"Tardigrade_TardigradeAction\")).Status == \"Success\"",
"Child": "Tardigrade_Success"
},
{
"Label": "Tardigrade_Failure",
"Child": "Tardigrade_Failure"
}
]
},
"Tardigrade_Success": {
"Type": "Leaf"
},
"Tardigrade_Failure": {
"Type": "Leaf",
"Actions": {
"Tardigrade_Failure_LeafNodeSummaryAction": {
"Action": "LeafNodeSummaryAction",
"Input": {
"Status": "TestStatusValue",
"Output": "C#|TreeInput as string ?? \"NA\""
}
}
}
},
"Node": {
"Type": "Selection",
"ChildSelector": [
{
"Label": "Reboot",
"ShouldSelect": "C#|UserContext.ShouldReboot()",
"Child": "Reboot"
},
{
"Label": "Evacuate",
"Child": "Evacuate"
}
]
},
"Reboot": {
"Type": "Action",
"Actions": {
"Reboot_RebootAction": {
"Action": "RebootAction",
"RetryPolicy": {
"Type": "FixedCount",
"MaxRetryCount": 3,
"MinBackoffMs": 1000
},
"ContinuationOnRetryExhaustion": true
}
}
},
"Evacuate": {
"Type": "Action",
"Actions": {
"Evacuate_EvacuateAction": {
"Action": "EvacuateAction",
"Timeout": 60000,
"ContinuationOnTimeout": true
}
}
}
}
}