SetRubMdResult SetRubMd(RubId tRub, SetRubMdArg tArg)
tRub. Opened time series database instance moniker.
tArg. Parameters for changing metadata.
The SetRubMd operation changes metadata of time series database.
To execute the operation, in the tRub field specify moniker of opened time series database instance, and in the tArg field specify changing parameters. The moniker can be obtained on executing the OpenRub operation. In the tArg.pattern field specify the pattern that will be used to make changes, and in the tArg.meta field specify the updated data and metadata. To save changes after executing the SetRubMd operation execute the SaveObject or SaveObjectAs operation.
The SetRubMd operation results in the time series database moniker and the updated metadata that can be requested in the tArg.metaGet pattern.
Below is the example of changing time series database properties. The request contains time series database moniker and new property values. The response contains the updated information about all properties specified for time series database.
{
"SetRubMd" :
{
"tRub" :
{
"id" : "S1!M!S!R1"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"period" : "true",
"properties" : "true"
},
"meta" :
{
"properties" :
{
"@useDeduplication" : "true",
"calendarLevels" :
{
"it" :
[
"Month",
"Quarter",
"Year"
]
}
}
},
"metaGet" :
{
"obInst" : "true",
"period" : "true",
"properties" : "true"
}
}
}
}
{
"SetRubMdResult" :
{
"id" :
{
"id" : "S1!M!S!R1"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "5",
"@hf" : "0",
"i" : "TS_DB",
"n" : "Time series database",
"k" : "5472",
"c" : "2822",
"p" : "5471",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
},
"openArgs" : ""
},
"period" :
{
"startYear" : "1980",
"endYear" : "2020"
},
"properties" :
{
"@lightWeight" : "0",
"@useDeduplication" : "1",
"@valuesOnQuery" : "0",
"@factsOnQuery" : "0",
"@hasMnemonics" : "1",
"@revisionsOnQuery" : "0",
"@treatEmptyStringAsNull" : "0",
"@keepHistory" : "1",
"@autoUpdateStat" : "1",
"@useDistinctSequence" : "0",
"@separateTableForActualData" : "0",
"@unitIsRequired" : "0",
"@compoundFactorKey" : "0",
"@hasEmptyAttribute" : "0",
"objRdsRepo" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "0",
"@hf" : "0",
"i" : "RDS",
"n" : "MDM repository",
"k" : "159",
"c" : "4353",
"p" : "51",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
},
"objUnitsDictionary" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "0",
"@hf" : "0",
"i" : "UNITS_D",
"n" : "Measurement units",
"k" : "174",
"c" : "3076",
"p" : "159",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
},
"objMeasuresDictionary" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "0",
"@hf" : "0",
"i" : "MEASURES",
"n" : "Measures",
"k" : "172",
"c" : "3076",
"p" : "159",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
},
"calendarLevels" :
{
"it" :
[
"Year",
"Quarter",
"Month"
]
},
"firstDayOfWeek" : "Monday"
}
}
}
}
public static SetRubMdResult SetRubMetadata(RubId moniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetRubMd()
{
tArg = new SetRubMdArg()
{
pattern = new RubMdPattern()
{
properties = true
},
meta = new RubMd()
{
properties = new RubProperties()
{
calendarLevels = new DimCalendarLvl[]
{
DimCalendarLvl.Month,
DimCalendarLvl.Quarter,
DimCalendarLvl.Year
},
useDeduplication = true,
useDeduplicationSpecified = true
}
},
metaGet = new RubMdPattern()
{
properties = true
}
},
tRub = moniker
};
//Change time series database metadata
var result = somClient.SetRubMd(tSet);
return result;
}
See also: