SetSegContResult SetSegCont(SegContId tSegCont, SetSegContArg tArg)
tSegCont. Segment container instance moniker.
tArg. Operation execution parameters.
The SetSegCont operation changes segment container metadata.
To execute the operation,, in the tAlg field specify moniker of segment container instance, and in the tArg.pattern field specify the pattern that will be used to change metadata, and in the tArg.meta field specify metadata to be set. One can also determine the tArg.metaGet pattern to get metadata after it was changed. The moniker can be obtained after executing the OpenSegCont operation.
To save changes, use the SaveObject operation.
The operation results in the updated metadata if the tArg.metaGet field was defined.
Below is the example of changing database for segment container. The request contains moniker of opened instance of segment container and database key. The response contains updated information about the database used by the segment container.
{
"SetSegCont" :
{
"tSegCont" :
{
"id" : "FLEDMHBOCLDPFOAEDMFBLHBLOEJDMKEEKKHHKBBDHHIFPONM!M!S!CNIKPLJBOCLDPFOAEJGOHDKFEFEEPOCLEFIAOPAACCEOBKNOG"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"database" : "true"
},
"meta" :
{
"data" :
{
"database" :
{
"k" : "144693"
}
}
},
"metaGet" :
{
"obInst" : "true",
"database" : "true"
}
}
}
}
{
"SetSegContResult" :
{
"id" :
{
"id" : "FLEDMHBOCLDPFOAEDMFBLHBLOEJDMKEEKKHHKBBDHHIFPONM!M!S!CNIKPLJBOCLDPFOAEJGOHDKFEFEEPOCLEFIAOPAACCEOBKNOG"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "27",
"@hf" : "0",
"i" : "SEG_CONTAINER",
"n" : "Cube segment container",
"k" : "317162",
"c" : "1296",
"p" : "317056",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "1",
"data" :
{
"database" :
{
"id" : "BD_1",
"k" : "144693",
"n" : "Database",
"classId" : "513"
}
}
}
}
}
public static SetSegContResult SetSegCont(string moniker, uint bdKey)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetSegCont()
{
tArg = new SetSegContArg()
{
pattern = new SegContMdPattern()
{
database = true,
},
meta = new SegContMd()
{
data = new SegContData()
{
database = new SimpleMbObject() { k = bdKey }
}
},
metaGet = new SegContMdPattern()
{
database = true
}
},
tSegCont = new SegContId() { id = moniker }
};
// Change segment container settings
var result = somClient.SetSegCont(tSet);
return result;
}
See also: