Below is the example of using the SetMbUpdate operation to start the update installation. The update moniker and installation execution parameters are sent in the query. The information about installation results is sent in the response.
{
"SetMbUpdate" :
{
"tMbUpdate" :
{
"id" : "S1!M!S!MbUpd1"
},
"tArg" :
{
"pattern" :
{
"execute" : "true"
},
"meta" :
{
"execute" :
{
"command" : "Apply",
"async" : "false"
}
},
"metaGet" :
{
"execute" : "true"
}
}
}
}
{
"SetMbUpdateResult" :
{
"id" :
{
"id" : "S1!M!S!MbUpd1"
},
"meta" :
{
"execute" :
{
"resolveTimeout" : "600000",
"state" : "Waiting",
"callback" :
{
"onProgress" :
{
"stage" : "Start",
"total" : "1",
"current" : "1"
}
}
}
}
}
}
public static SetMbUpdateResult ApplyUpdate(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()
{
command = MbUpdateExecuteCommand.Apply,
async = false
},
},
metaGet = new MbUpdateMdPattern()
{
execute = true
}
},
tMbUpdate = new MbUpdateId() { id = moniker }
};
//Install update
var result = somClient.SetMbUpdate(tSet);
return result;
}
See also: