Click here to Skip to main content
15,890,557 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have tried getting domain name from the code but i couldn't

What I have tried:

C++
ECFErr SqlhaCMAPI_Corosync::SqlhaCMAPI_Corosync_CorosyncCertificate
(
   const std::string & DomainName, 
   const std::string & DeviceName, 
   const std::vector<std::string> & nodeList
)
{
   ECFErr rc = ECF_OK ;
   PCMK_RC vRC = PCMK_SUCCESS ;
   PCMKCorosyncCertificateParam certificateParam ;
   Uint probe = 0 ;

   certificateParam.DomainName = strDomainName ;
   certificateParam.DeviceName = strDeviceName ;
   for (const auto& node : m_Nodes) {
      certificateParam.nodeList.insert(node.name);
   } 

   pdTraceEntry(SQLT_SqlhaCMAPI_Corosync_CorosyncCertificate);
   vRC = g_pcmkAPITable[SQLHA_CM_API_PCMK_COROSYNC_CERTIFICATE].pcmkFunctionp( &certificateParam ) ;
   if ( PCMK_SUCCESS != vRC )
   {
      rc = ECF_SQLHA_FAILED ;
   
      pdLog( PD_DEV, SQLT_SqlhaCMAPI_Corosync_CorosyncCertificate,
             rc, __LINE__, PD_LEVEL_ERR,
             PD_3TUPLES_BEGIN,
             PD_MESSAGE( "Failed to add quorum certificate." ),
             PD_UINT( vRC ),
             PD_3TUPLES_END ) ;
   }

EXIT:
   pdTraceExit( SQLT_SqlhaCMAPI_Corosync_CorosyncCertificate, rc ) ;
   return rc ;

ERROR_param_uninitialized:
   rc = ECF_INVALID_PARAMETER ;
   pdLog( PD_DEV, SQLT_SqlhaCMAPI_Corosync_CorosyncCertificate,
          rc, probe, PD_LEVEL_ERR,
          PD_3TUPLES_BEGIN,
          PD_MESSAGE( "The input parameter is NULL." ),
          //PD_UINT( m_quorumType ),
          //PD_STRING( strDomainName.c_str() ),
         // PD_STRING( strDeviceName.c_str() ),
          PD_3TUPLES_END ) ;
   goto EXIT ; 
}
Posted
Updated 7-Apr-23 21:14pm
v2

1 solution

We cant help you on your specific problem, but when using such special API you need to read the documentation to understand how it works.
Normally the best starting point is the first error which occurs. Check that all preconditions are meet. Like access rights, data in the store and everything properly installe.

Contact the vendor support if you can.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900