SetHieMdResult SetHieMd(HieId tHie, SetHieMdArg tArg)
tHie. Moniker of opened indicators hierarchy instance.
tArg. Operation execution parameters.
The SetHieMd operation changes metadata of the time series database indicators hierarchy.
To execute the operation, in the tHie parameter specify moniker of the indicators hierarchy instance, and in the tArg parameter specify data change parameters. The moniker can be obtained on executing the OpenHie operation. The operation results in the updated metadata if the tArg.metaGet field was defined on operation execution.
Below is the example of setting the list of levels that are used on creating indicator names. The request contains the list of levels. The response contains updated information about levels and properties of indicators hierarchy.
{
"SetHieMd" :
{
"tHie" :
{
"id" : "S1!M!S!H2"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"levs" : "true"
},
"meta" :
{
"levs" :
{
"its" :
{
"it" :
[
{
"k" : "2",
"id" : "LEVEL1",
"n" : "Country",
"vis" : "true",
"atts" :
{
"its" :
{
"it" :
[
{
"k" : "9",
"id" : "COUNTRY",
"n" : "Country",
"vis" : "true",
"dim" :
{
"k" : "208",
"id" : "COUNTRIES",
"n" : "Countries",
"vis" : "true"
},
"includeSelectedOnly" : "false",
"namingFormat" : "",
"isLeaf" : "true",
"levKey" : "2",
"orderBy" :
{
"isActive" : "false"
},
"orderInDefaultHie" : "-1"
}
]
}
},
"isLeaf" : "true"
},
{
"k" : "1",
"id" : "LEVEL",
"n" : "Period",
"vis" : "true",
"atts" :
{
"its" :
{
"it" :
[
{
"k" : "4",
"id" : "DL",
"n" : "Period",
"vis" : "true",
"dim" :
{
"k" : "5482",
"id" : "CALENDAR_LEVELS",
"n" : "Frequencies",
"vis" : "true"
},
"includeSelectedOnly" : "false",
"namingFormat" : "",
"isLeaf" : "false",
"levKey" : "1",
"orderBy" :
{
"isActive" : "false"
},
"orderInDefaultHie" : "-1"
}
]
}
},
"isLeaf" : "false"
}
]
}
}
},
"metaGet" :
{
"obInst" : "true",
"levs" : "true",
"props" : "true"
}
}
}
}
{
"SetHieMdResult" :
{
"id" :
{
"id" : "S1!M!S!H2"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "1",
"@hf" : "0",
"i" : "TS_DB",
"n" : "Time series database",
"k" : "2147483646",
"c" : "2829",
"p" : "5472",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "0",
"isTemp" : "1"
}
},
"dirty" : "0",
"levs" :
{
"its" :
{
"it" :
[
{
"k" : "1",
"id" : "LEVEL",
"n" : "Period",
"vis" : "1",
"atts" :
{
"its" :
{
"it" :
[
{
"k" : "4",
"id" : "DL",
"n" : "Period",
"vis" : "1",
"dim" :
{
"k" : "5482",
"id" : "CALENDAR_LEVELS",
"n" : "Frequencies",
"vis" : "1"
},
"includeSelectedOnly" : "0",
"namingFormat" : "",
"isLeaf" : "0",
"levKey" : "1",
"orderBy" :
{
"isActive" : "0"
},
"orderInDefaultHie" : "-1"
}
]
}
},
"isLeaf" : "0"
},
{
"k" : "2",
"id" : "LEVEL1",
"n" : "Country",
"vis" : "1",
"atts" :
{
"its" :
{
"it" :
[
{
"k" : "9",
"id" : "COUNTRY",
"n" : "Country",
"vis" : "1",
"dim" :
{
"k" : "208",
"id" : "COUNTRIES",
"n" : "Countries",
"vis" : "1"
},
"includeSelectedOnly" : "0",
"namingFormat" : "",
"isLeaf" : "1",
"levKey" : "2",
"orderBy" :
{
"isActive" : "0"
},
"orderInDefaultHie" : "-1"
}
]
}
},
"isLeaf" : "1"
}
]
}
},
"props" :
{
"whereIsEmpty" : "0",
"leafLoadExtent" : "0",
"filterMode" : "All"
}
}
}
}
public static SetHieMdResult SetHieMetadata(HieId moniker, HieLevs levels)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tGet = new SetHieMd()
{
tArg = new SetHieMdArg()
{
//Pattern that will be used to change metadata
pattern = new HieMdPattern()
{
levs = true
},
//Updated metadata
meta = new HieMd()
{
levs = levels
},
metaGet = new HieMdPattern()
{
levs = true,
props = true
}
},
tHie = moniker
};
//Make changes
var result = somClient.SetHieMd(tGet);
return result;
}
See also: