HTMLリクエストまたは電子メールテンプレートの変数の使用例
エンティティ属性にアクセスするため
${latestEvent.modernEntity.attributes}
${latestEvent.modernEntity.attributes.get("k8s.cluster.name")}
影響を受けるエンティティから最新のエンティティと旧来のエンティティを出力するため
#foreach($entity in $latestEvent.affectedEntities)
#if($entity.isLegacyEntity)
* Legacy Entity:
Affected Entity Name: ${entity.name}
Affected Entity Type: ${entity.entityType}
Affected Entity Tags: ${entity.tagValues}
#else
* Modern Entity:
Affected Entity Name: ${entity.name}
Affected Entity Type Display Name: ${entity.entityTypeDisplayName}
Affected Entity Attributes: ${entity.attributes}
#end
#end
Pod のクラスターおよび名前空間を出力するため
#foreach($entity in $latestEvent.affectedEntities)
#if($entity.attributes)
#set($attrs = $entity.attributes)
#if($attrs.get("k8s.cluster.name"))
- Cluster: ${attrs.get("k8s.cluster.name")}
#if($attrs.get("k8s.namespace.name"))
- Namespace: ${attrs.get("k8s.namespace.name")}
#end
#end
#end