I am attempting to build a workflow that creates a volume, its mirror and it snapvaut destination, using the values users enter for the source, to then calculate values for the rest via custom expressions.
We have a naming convension which is to be adhered too and also pre defined relationships between different CDOT clusters. Im controlling text input fieds with RegEx.
I am trying to do the following...
If I define the source volumes aggregate as "aggr_dc1_0001", then the mirror volume should be placed in "aggr_dc2_0001". We have a similar pattern with vservers, and volumes. I've got my source volume fields populating via SQL queries, and that side of things is working lovely.
I have written a function that does a replace and returns the correct value for the mirrors aggregate, I know the function works I've tested it, and I get what I expect out of it.
While other fields can clearly call a function since the autocomplete box pops up, the Aggr field doesnt, and only allows me to do a search with the keys. When I pass the function to the to the key fields, in the form like AggrTranslate($SourceVol), I get invalid expression errors. I dont want it to "search" for an aggregate, I know the one I want it to go to, and have a way to return that value, just cant seem to pass it in a way WFA is happy with...what am I missing?
def AggrTranslate(aggr){
if (aggr[6] == "1") {
return aggr.replace("dc1","dc2")
}
else if (aggr[6] == "2") {
return aggr.replace("dc2","dc1")
}
}
Thanks in advance
-Kev