
-- drop class if exists /cache/alerts_status
-- ;

-- drop class if exists /cache
-- ;

create class if not exists /cache (
	status			enum{
		}	"状态"
)
with namespace='m3cache' ;
;

create class if not exists /cache/alerts_status ( 
		acknowledged		int	"acknowledged",
		admin				varchar	"admin",
		adminphone		varchar	"adminphone",
		agent				varchar	"agent",
		alarmkey		varchar	"alarmkey",
		alarmtype		varchar	"alarmtype",
		alertgroup		varchar	"alertgroup",
		alertkey		varchar	"alertkey",
		alertsubtype		varchar	"alertsubtype",
		alerttype		varchar	"alerttype",
		area				varchar	"area",
		bname				varchar	"bname",
		bsm_classname		varchar	"bsm_classname",
		bsm_identity		varchar	"bsm_identity",
		bsm_subidentity		varchar	"bsm_subidentity",
		businessimpact		int	"businessimpact",
		bussinesscategory		varchar	"bussinesscategory",
		causetype		int	"causetype",
		ccpc				int	"ccpc",
		ccpcbank		varchar	"ccpcbank",
		chineseflag		int	"chineseflag",
		ciid				varchar	"ciid",
		cmdbenrichstatus		int	"cmdbenrichstatus",
		cname				varchar	"cname",
		cnsummary		varchar	"cnsummary",
		contact			varchar	"contact",
		contactman		varchar	"contactman",
		contactphone		varchar	"contactphone",
		corrscore		int	"corrscore",
		customer		varchar	"customer",
		deviceios		varchar	"deviceios",
		devicelocation		varchar	"devicelocation",
		devicemodel		varchar	"devicemodel",
		devicepurpose		varchar	"devicepurpose",
		devicetype		varchar	"devicetype",
		domaingroup		varchar	"domaingroup",
		domainsubgroup		varchar	"domainsubgroup",
		duration		int	"duration",
		emailstatus		int	"emailstatus",
		entity			varchar	"entity",
		eventclass		varchar	"eventclass",
		eventid			varchar	"eventid",
		eventstatus		int	"eventstatus",
		eventtime		varchar	"eventtime",
		eventtype		enum {
			"11":["数据库告警"],
			"12":["中间件类告警"],
			"13":["应用类告警"],
			"14":["硬件类告警"],
			"99":["其他类告警"],
			"10":["主机告警"]}	"eventtype",
		evtproccode		varchar	"evtproccode",
		expiretime		int	"expiretime",
		explain			varchar	"explain",
		extendedattr		varchar	"extendedattr",
		firstoccurrence		timestamp	"firstoccurrence",
		flag				int	"flag",
		flash				int	"flash",
		grade				int	"grade",
		identifier		varchar	"identifier",
		idname			varchar	"idname",
		impactflag		int	"impactflag",
		instance		varchar	"instance",
		internallast		timestamp	"internallast",
		itmdisplayitem		varchar	"itmdisplayitem",
		lastoccurrence		timestamp	"lastoccurrence",
		localnodealias		varchar	"localnodealias",
		localobjrelate		int	"localobjrelate",
		localpriobj		varchar	"localpriobj",
		localrootobj		varchar	"localrootobj",
		localsecobj		varchar	"localsecobj",
		localtertobj		varchar	"localtertobj",
		location		varchar	"location",
		logticket		int	"logticket",
		lpar				varchar	"lpar",
		machineid		varchar	"machineid",
		maintainstatus		int	"maintainstatus",
		maintenance		enum {
			"0":["Unknown", "未知"],
			"1":["true", "维护期内"],
			"2":["false", "维护期外"]}	"maintenance",
		manager			varchar	"manager",
		market			varchar	"market",
		msg_id			varchar	"msg_id",
		n_maintenance_status		int	"n_maintenance_status",
		netype			varchar	"netype",
		nmoscausetype		int	"nmoscausetype",
		nmosdomainname		varchar	"nmosdomainname",
		nmosentityid		int	"nmosentityid",
		nmoseventmap		varchar	"nmoseventmap",
		nmosmanagedstatus		int	"nmosmanagedstatus",
		nmosobjinst		int	"nmosobjinst",
		nmosserial		varchar	"nmosserial",
		node				varchar	"node",
		nodealias		varchar	"nodealias",
		nodename		varchar	"nodename",
		nodetype		varchar	"nodetype",
		objectfullname		varchar	"objectfullname",
		oldrow			int	"oldrow",
		omni_class		varchar	"omni_class",
		omni_serial		int	"omni_serial",
		orgcode			varchar	"orgcode",
		originalseverity		int	"originalseverity",
		ownergid		int	"ownergid",
		owneruid		int	"owneruid",
		phone				varchar	"phone",
		physicalcabinet		varchar	"physicalcabinet",
		physicalcard		varchar	"physicalcard",
		physicallocation		varchar	"physicallocation",
		physicalport		int	"physicalport",
		physicalslot		int	"physicalslot",
		plateng			varchar	"plateng",
		platform		varchar	"platform",
		policylevel		varchar	"policylevel",
		policyname		varchar	"policyname",
		poll				int	"poll",
		probesubsecondid		int	"probesubsecondid",
		processreq		int	"processreq",
		recordtime		int	"recordtime",
		region			varchar	"region",
		remotenodealias		varchar	"remotenodealias",
		remoteobjrelate		int	"remoteobjrelate",
		remotepriobj		varchar	"remotepriobj",
		remoterootobj		varchar	"remoterootobj",
		remotesecobj		varchar	"remotesecobj",
		remotetertobj		varchar	"remotetertobj",
		resolve			varchar	"resolve",
		rowserial		int	"rowserial",
		servername		varchar	"servername",
		serverserial		int	"serverserial",
		service			varchar	"service",
		servicenowerrorcode		int	"servicenowerrorcode",
		servicenowstate		int	"servicenowstate",
		servicenowsysid		varchar	"servicenowsysid",
		severity		enum {
			"3":["Info", "消息"],
			"4":["Warn", "警告"],
			"5":["Error", "错误"],
			"6":["Fatal", "致命错误"],
			"0":["Unknown", "未知"],
			"1":["Trace", "追踪"],
			"2":["Debug", "调试"]}	"severity",
		siteid			varchar	"siteid",
		situationfullname		varchar	"situationfullname",
		smsflag			int	"smsflag",
		statechange		timestamp	"statechange",
		submodel		varchar	"submodel",
		subsystem		varchar	"subsystem",
		summary			varchar	"summary",
		suppressescl		int	"suppressescl",
		syscode			varchar	"syscode",
		sysplex			varchar	"sysplex",
		tally				int	"tally",
		tasklist		int	"tasklist",
		ticketstatus		varchar	"ticketstatus",
		tiggerflag		int	"tiggerflag",
		tsrmflag		int	"tsrmflag",
		ttnumber		varchar	"ttnumber",
		ttstate			int	"ttstate",
		ttuser			varchar	"ttuser",
		type				enum {
			"1":["problem", "问题"],
			"2":["resolution", "恢复"],
			"7":["ISM new alarm", "问题"],
			"8":["ISM old alarm", "恢复"],
			"0":["Type not set"]}	"type",
		upgradeflag		int	"upgradeflag",
		url					varchar	"url",
		x733corrnotif		varchar	"x733corrnotif",
		x733eventtype		int	"x733eventtype",
		x733probablecause		int	"x733probablecause",
		x733specificprob		varchar	"x733specificprob",
		
		keys( identifier,serverserial,type) 


		)with ttl=366 day , autosearch=true , notify=10s, version=true , history=true , key=manu, onconflict=(tally incr, firstoccurrence keep, maintenance keep, smsflag keep), partition=node , namespace='m3cache' ;

alter class /cache/alerts_status with core=CassandraOnly
;