本文整理汇总了C++中Oam::getProcessStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ Oam::getProcessStatus方法的具体用法?C++ Oam::getProcessStatus怎么用?C++ Oam::getProcessStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oam
的用法示例。
在下文中一共展示了Oam::getProcessStatus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sendUpgradeRequest
/******************************************************************************************
* @brief sendUpgradeRequest
*
* purpose: send Upgrade Request Msg to all ACTIVE UMs
*
*
******************************************************************************************/
int sendUpgradeRequest(int IserverTypeInstall)
{
Oam oam;
while(true)
{
try{
ProcessStatus procstat;
oam.getProcessStatus("WriteEngineServer", "pm1", procstat);
if ( procstat.ProcessOpState == oam::ACTIVE)
break;
}
catch (exception& ex)
{}
}
SystemModuleTypeConfig systemmoduletypeconfig;
try{
oam.getSystemConfig(systemmoduletypeconfig);
}
catch (exception& ex)
{}
ByteStream msg;
ByteStream::byte requestID = RUNUPGRADE;
msg << requestID;
msg << mysqlpw;
int returnStatus = oam::API_SUCCESS;
for( unsigned int i = 0; i < systemmoduletypeconfig.moduletypeconfig.size(); i++)
{
int moduleCount = systemmoduletypeconfig.moduletypeconfig[i].ModuleCount;
if( moduleCount == 0)
continue;
string moduleType = systemmoduletypeconfig.moduletypeconfig[i].ModuleType;
if ( moduleType == "um" ||
( moduleType == "pm" && IserverTypeInstall == oam::INSTALL_COMBINE_DM_UM_PM ) ) {
DeviceNetworkList::iterator pt = systemmoduletypeconfig.moduletypeconfig[i].ModuleNetworkList.begin();
for ( ; pt != systemmoduletypeconfig.moduletypeconfig[i].ModuleNetworkList.end(); pt++)
{
int opState;
bool degraded;
try {
oam.getModuleStatus((*pt).DeviceName, opState, degraded);
if (opState == oam::ACTIVE) {
returnStatus = sendMsgProcMon( (*pt).DeviceName, msg, requestID, 30 );
if ( returnStatus != API_SUCCESS)
return returnStatus;
}
}
catch (exception& ex)
{}
}
}
}
return returnStatus;
}