16.20 - ALERT - Teradata Ecosystem Manager

Teradata® Ecosystem Manager API Reference

prodname
Teradata Ecosystem Manager
vrm_release
16.20
created_date
December 2020
category
Programming Reference
featnum
B035-3204-107K
#include <tmsmapi.h>
//initialize Api
pCtx = TM_Init();
//Create MSM_UofW placeholder.
pUOW=MSM_CreateUOW(pCtx);
//Create Event placeholder.
pAlertEventOnProcess= MSM_CreateWEvent(pCtx,pUOW);
pAlertEventOnProcess->szResourceId=L”FLOAD”;//set resource-id
pAlertEventOnProcess->eventType=ALERTEVENT;//set event type
pAlertEventOnProcess->szTDPID=L”sampleTDPID”;//set TDPID
pAlertEventOnProcess->iAlertCode=50;//set alert code
pAlertEventOnProcess->iSeverityLevel=TMSM_SEVERITY_CRITICAL;//set severity level
MSM_AddWResourceType(pCtx, pAlertEventOnProcess,L”FLOAD”);//Add multi-argument resourceType
pAlertEventOnProcess->szJobStep = L”sampleJobStep”;//set job step
status=MSM_SendWEvent(pCtx, pAlertEventOnProcess);//send event
MSM_FreeAndClearWEventMembers(pCtx, pAlertEventOnProcess);
MSM_ClearUofWMembers(pCtx,pUOW);
//Free event. Do not forget to call this
MSM_FreeWEvent(pCtx, pAlertEventOnProcess);
//Free UnitOfWork. Do not forget to call this.
MSM_FreeUOW(pCtx,pUOW);
//Free Context.do not forget to call this.
TM_Free(pCtx);