Below is the example of using the SetMbUpdate operation to resume the update installation. The example must be executed cyclically after update installation was started. Installation can be continued until the SetMbUpdateResult.meta.execute.state field returns Finished or FinishedWithError after executing the operation.
{
"SetMbUpdate" :
{
"tMbUpdate" :
{
"id" : "HIDMDIEFBHCHGOAEGIHPHLGMDNKCMEDEBIGGMJJBPLDGFEOG!M!S!MbUpdOJFBNIEFBHCHGOAEJCKDBGBGODBNBCBEIIDAJOFDEKCIONGC"
},
"tArg" :
{
"pattern" :
{
"execute" : "true"
},
"meta" :
{
"execute" :
{
"async" : "false",
"callback" :
{
"onProgress" : ""
}
}
},
"metaGet" :
{
"execute" : "true"
}
}
}
}
{
"SetMbUpdateResult" :
{
"id" :
{
"id" : "HIDMDIEFBHCHGOAEGIHPHLGMDNKCMEDEBIGGMJJBPLDGFEOG!M!S!MbUpdOJFBNIEFBHCHGOAEJCKDBGBGODBNBCBEIIDAJOFDEKCIONGC"
},
"meta" :
{
"execute" :
{
"resolveTimeout" : "600000",
"state" : "Finished"
}
}
}
}
public static SetMbUpdateResult UpdateExecuteState(string moniker)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetMbUpdate()
{
tArg = new SetMbUpdateArg()
{
pattern = new MbUpdateMdPattern()
{
execute = true
},
meta = new MbUpdateMd()
{
execute = new MbUpdateExecute()
{
callback = new MbUpdateExecuteCallback()
{
onProgress = new MbUpdateProgressData() //To allow execution callback
},
async = false
},
},
metaGet = new MbUpdateMdPattern()
{
execute = true
}
},
tMbUpdate = new MbUpdateId() { id = moniker }
};
var result = somClient.SetMbUpdate(tSet);
// Cyclic execution of SetMbUpdate until the update is completely installed
do
{
// Resume update
result = somClient.SetMbUpdate(tSet);
} while ((result.meta.execute.state != MbUpdateExecuteState.Finished) && (result.meta.execute.state != MbUpdateExecuteState.FinishedWithError));
return result;
}
See also: