github.com/argoproj/argo-cd/v2@v2.10.9/docs/operator-manual/notifications/catalog.md (about) 1 # Triggers and Templates Catalog 2 ## Triggers 3 | NAME | DESCRIPTION | TEMPLATE | 4 |------------------------|---------------------------------------------------------------|-----------------------------------------------------| 5 | on-created | Application is created. | [app-created](#app-created) | 6 | on-deleted | Application is deleted. | [app-deleted](#app-deleted) | 7 | on-deployed | Application is synced and healthy. Triggered once per commit. | [app-deployed](#app-deployed) | 8 | on-health-degraded | Application has degraded | [app-health-degraded](#app-health-degraded) | 9 | on-sync-failed | Application syncing has failed | [app-sync-failed](#app-sync-failed) | 10 | on-sync-running | Application is being synced | [app-sync-running](#app-sync-running) | 11 | on-sync-status-unknown | Application status is 'Unknown' | [app-sync-status-unknown](#app-sync-status-unknown) | 12 | on-sync-succeeded | Application syncing has succeeded | [app-sync-succeeded](#app-sync-succeeded) | 13 14 ## Templates 15 ### app-created 16 **definition**: 17 ```yaml 18 email: 19 subject: Application {{.app.metadata.name}} has been created. 20 message: Application {{.app.metadata.name}} has been created. 21 teams: 22 title: Application {{.app.metadata.name}} has been created. 23 24 ``` 25 ### app-deleted 26 **definition**: 27 ```yaml 28 email: 29 subject: Application {{.app.metadata.name}} has been deleted. 30 message: Application {{.app.metadata.name}} has been deleted. 31 teams: 32 title: Application {{.app.metadata.name}} has been deleted. 33 34 ``` 35 ### app-deployed 36 **definition**: 37 ```yaml 38 email: 39 subject: New version of an application {{.app.metadata.name}} is up and running. 40 message: | 41 {{if eq .serviceType "slack"}}:white_check_mark:{{end}} Application {{.app.metadata.name}} is now running new version of deployments manifests. 42 slack: 43 attachments: | 44 [{ 45 "title": "{{ .app.metadata.name}}", 46 "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}", 47 "color": "#18be52", 48 "fields": [ 49 { 50 "title": "Sync Status", 51 "value": "{{.app.status.sync.status}}", 52 "short": true 53 }, 54 { 55 "title": "Repository", 56 "value": "{{.app.spec.source.repoURL}}", 57 "short": true 58 }, 59 { 60 "title": "Revision", 61 "value": "{{.app.status.sync.revision}}", 62 "short": true 63 } 64 {{range $index, $c := .app.status.conditions}} 65 {{if not $index}},{{end}} 66 {{if $index}},{{end}} 67 { 68 "title": "{{$c.type}}", 69 "value": "{{$c.message}}", 70 "short": true 71 } 72 {{end}} 73 ] 74 }] 75 deliveryPolicy: Post 76 groupingKey: "" 77 notifyBroadcast: false 78 teams: 79 facts: | 80 [{ 81 "name": "Sync Status", 82 "value": "{{.app.status.sync.status}}" 83 }, 84 { 85 "name": "Repository", 86 "value": "{{.app.spec.source.repoURL}}" 87 }, 88 { 89 "name": "Revision", 90 "value": "{{.app.status.sync.revision}}" 91 } 92 {{range $index, $c := .app.status.conditions}} 93 {{if not $index}},{{end}} 94 {{if $index}},{{end}} 95 { 96 "name": "{{$c.type}}", 97 "value": "{{$c.message}}" 98 } 99 {{end}} 100 ] 101 potentialAction: |- 102 [{ 103 "@type":"OpenUri", 104 "name":"Operation Application", 105 "targets":[{ 106 "os":"default", 107 "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}" 108 }] 109 }, 110 { 111 "@type":"OpenUri", 112 "name":"Open Repository", 113 "targets":[{ 114 "os":"default", 115 "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}" 116 }] 117 }] 118 themeColor: '#000080' 119 title: New version of an application {{.app.metadata.name}} is up and running. 120 121 ``` 122 ### app-health-degraded 123 **definition**: 124 ```yaml 125 email: 126 subject: Application {{.app.metadata.name}} has degraded. 127 message: | 128 {{if eq .serviceType "slack"}}:exclamation:{{end}} Application {{.app.metadata.name}} has degraded. 129 Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}. 130 slack: 131 attachments: | 132 [{ 133 "title": "{{ .app.metadata.name}}", 134 "title_link": "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}", 135 "color": "#f4c030", 136 "fields": [ 137 { 138 "title": "Health Status", 139 "value": "{{.app.status.health.status}}", 140 "short": true 141 }, 142 { 143 "title": "Repository", 144 "value": "{{.app.spec.source.repoURL}}", 145 "short": true 146 } 147 {{range $index, $c := .app.status.conditions}} 148 {{if not $index}},{{end}} 149 {{if $index}},{{end}} 150 { 151 "title": "{{$c.type}}", 152 "value": "{{$c.message}}", 153 "short": true 154 } 155 {{end}} 156 ] 157 }] 158 deliveryPolicy: Post 159 groupingKey: "" 160 notifyBroadcast: false 161 teams: 162 facts: | 163 [{ 164 "name": "Health Status", 165 "value": "{{.app.status.health.status}}" 166 }, 167 { 168 "name": "Repository", 169 "value": "{{.app.spec.source.repoURL}}" 170 } 171 {{range $index, $c := .app.status.conditions}} 172 {{if not $index}},{{end}} 173 {{if $index}},{{end}} 174 { 175 "name": "{{$c.type}}", 176 "value": "{{$c.message}}" 177 } 178 {{end}} 179 ] 180 potentialAction: | 181 [{ 182 "@type":"OpenUri", 183 "name":"Open Application", 184 "targets":[{ 185 "os":"default", 186 "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}" 187 }] 188 }, 189 { 190 "@type":"OpenUri", 191 "name":"Open Repository", 192 "targets":[{ 193 "os":"default", 194 "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}" 195 }] 196 }] 197 themeColor: '#FF0000' 198 title: Application {{.app.metadata.name}} has degraded. 199 200 ``` 201 ### app-sync-failed 202 **definition**: 203 ```yaml 204 email: 205 subject: Failed to sync application {{.app.metadata.name}}. 206 message: | 207 {{if eq .serviceType "slack"}}:exclamation:{{end}} The sync operation of application {{.app.metadata.name}} has failed at {{.app.status.operationState.finishedAt}} with the following error: {{.app.status.operationState.message}} 208 Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true . 209 slack: 210 attachments: | 211 [{ 212 "title": "{{ .app.metadata.name}}", 213 "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}", 214 "color": "#E96D76", 215 "fields": [ 216 { 217 "title": "Sync Status", 218 "value": "{{.app.status.sync.status}}", 219 "short": true 220 }, 221 { 222 "title": "Repository", 223 "value": "{{.app.spec.source.repoURL}}", 224 "short": true 225 } 226 {{range $index, $c := .app.status.conditions}} 227 {{if not $index}},{{end}} 228 {{if $index}},{{end}} 229 { 230 "title": "{{$c.type}}", 231 "value": "{{$c.message}}", 232 "short": true 233 } 234 {{end}} 235 ] 236 }] 237 deliveryPolicy: Post 238 groupingKey: "" 239 notifyBroadcast: false 240 teams: 241 facts: | 242 [{ 243 "name": "Sync Status", 244 "value": "{{.app.status.sync.status}}" 245 }, 246 { 247 "name": "Failed at", 248 "value": "{{.app.status.operationState.finishedAt}}" 249 }, 250 { 251 "name": "Repository", 252 "value": "{{.app.spec.source.repoURL}}" 253 } 254 {{range $index, $c := .app.status.conditions}} 255 {{if not $index}},{{end}} 256 {{if $index}},{{end}} 257 { 258 "name": "{{$c.type}}", 259 "value": "{{$c.message}}" 260 } 261 {{end}} 262 ] 263 potentialAction: |- 264 [{ 265 "@type":"OpenUri", 266 "name":"Open Operation", 267 "targets":[{ 268 "os":"default", 269 "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true" 270 }] 271 }, 272 { 273 "@type":"OpenUri", 274 "name":"Open Repository", 275 "targets":[{ 276 "os":"default", 277 "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}" 278 }] 279 }] 280 themeColor: '#FF0000' 281 title: Failed to sync application {{.app.metadata.name}}. 282 283 ``` 284 ### app-sync-running 285 **definition**: 286 ```yaml 287 email: 288 subject: Start syncing application {{.app.metadata.name}}. 289 message: | 290 The sync operation of application {{.app.metadata.name}} has started at {{.app.status.operationState.startedAt}}. 291 Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true . 292 slack: 293 attachments: | 294 [{ 295 "title": "{{ .app.metadata.name}}", 296 "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}", 297 "color": "#0DADEA", 298 "fields": [ 299 { 300 "title": "Sync Status", 301 "value": "{{.app.status.sync.status}}", 302 "short": true 303 }, 304 { 305 "title": "Repository", 306 "value": "{{.app.spec.source.repoURL}}", 307 "short": true 308 } 309 {{range $index, $c := .app.status.conditions}} 310 {{if not $index}},{{end}} 311 {{if $index}},{{end}} 312 { 313 "title": "{{$c.type}}", 314 "value": "{{$c.message}}", 315 "short": true 316 } 317 {{end}} 318 ] 319 }] 320 deliveryPolicy: Post 321 groupingKey: "" 322 notifyBroadcast: false 323 teams: 324 facts: | 325 [{ 326 "name": "Sync Status", 327 "value": "{{.app.status.sync.status}}" 328 }, 329 { 330 "name": "Started at", 331 "value": "{{.app.status.operationState.startedAt}}" 332 }, 333 { 334 "name": "Repository", 335 "value": "{{.app.spec.source.repoURL}}" 336 } 337 {{range $index, $c := .app.status.conditions}} 338 {{if not $index}},{{end}} 339 {{if $index}},{{end}} 340 { 341 "name": "{{$c.type}}", 342 "value": "{{$c.message}}" 343 } 344 {{end}} 345 ] 346 potentialAction: |- 347 [{ 348 "@type":"OpenUri", 349 "name":"Open Operation", 350 "targets":[{ 351 "os":"default", 352 "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true" 353 }] 354 }, 355 { 356 "@type":"OpenUri", 357 "name":"Open Repository", 358 "targets":[{ 359 "os":"default", 360 "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}" 361 }] 362 }] 363 title: Start syncing application {{.app.metadata.name}}. 364 365 ``` 366 ### app-sync-status-unknown 367 **definition**: 368 ```yaml 369 email: 370 subject: Application {{.app.metadata.name}} sync status is 'Unknown' 371 message: | 372 {{if eq .serviceType "slack"}}:exclamation:{{end}} Application {{.app.metadata.name}} sync is 'Unknown'. 373 Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}. 374 {{if ne .serviceType "slack"}} 375 {{range $c := .app.status.conditions}} 376 * {{$c.message}} 377 {{end}} 378 {{end}} 379 slack: 380 attachments: | 381 [{ 382 "title": "{{ .app.metadata.name}}", 383 "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}", 384 "color": "#E96D76", 385 "fields": [ 386 { 387 "title": "Sync Status", 388 "value": "{{.app.status.sync.status}}", 389 "short": true 390 }, 391 { 392 "title": "Repository", 393 "value": "{{.app.spec.source.repoURL}}", 394 "short": true 395 } 396 {{range $index, $c := .app.status.conditions}} 397 {{if not $index}},{{end}} 398 {{if $index}},{{end}} 399 { 400 "title": "{{$c.type}}", 401 "value": "{{$c.message}}", 402 "short": true 403 } 404 {{end}} 405 ] 406 }] 407 deliveryPolicy: Post 408 groupingKey: "" 409 notifyBroadcast: false 410 teams: 411 facts: | 412 [{ 413 "name": "Sync Status", 414 "value": "{{.app.status.sync.status}}" 415 }, 416 { 417 "name": "Repository", 418 "value": "{{.app.spec.source.repoURL}}" 419 } 420 {{range $index, $c := .app.status.conditions}} 421 {{if not $index}},{{end}} 422 {{if $index}},{{end}} 423 { 424 "name": "{{$c.type}}", 425 "value": "{{$c.message}}" 426 } 427 {{end}} 428 ] 429 potentialAction: |- 430 [{ 431 "@type":"OpenUri", 432 "name":"Open Application", 433 "targets":[{ 434 "os":"default", 435 "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}" 436 }] 437 }, 438 { 439 "@type":"OpenUri", 440 "name":"Open Repository", 441 "targets":[{ 442 "os":"default", 443 "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}" 444 }] 445 }] 446 title: Application {{.app.metadata.name}} sync status is 'Unknown' 447 448 ``` 449 ### app-sync-succeeded 450 **definition**: 451 ```yaml 452 email: 453 subject: Application {{.app.metadata.name}} has been successfully synced. 454 message: | 455 {{if eq .serviceType "slack"}}:white_check_mark:{{end}} Application {{.app.metadata.name}} has been successfully synced at {{.app.status.operationState.finishedAt}}. 456 Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true . 457 slack: 458 attachments: | 459 [{ 460 "title": "{{ .app.metadata.name}}", 461 "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}", 462 "color": "#18be52", 463 "fields": [ 464 { 465 "title": "Sync Status", 466 "value": "{{.app.status.sync.status}}", 467 "short": true 468 }, 469 { 470 "title": "Repository", 471 "value": "{{.app.spec.source.repoURL}}", 472 "short": true 473 } 474 {{range $index, $c := .app.status.conditions}} 475 {{if not $index}},{{end}} 476 {{if $index}},{{end}} 477 { 478 "title": "{{$c.type}}", 479 "value": "{{$c.message}}", 480 "short": true 481 } 482 {{end}} 483 ] 484 }] 485 deliveryPolicy: Post 486 groupingKey: "" 487 notifyBroadcast: false 488 teams: 489 facts: | 490 [{ 491 "name": "Sync Status", 492 "value": "{{.app.status.sync.status}}" 493 }, 494 { 495 "name": "Synced at", 496 "value": "{{.app.status.operationState.finishedAt}}" 497 }, 498 { 499 "name": "Repository", 500 "value": "{{.app.spec.source.repoURL}}" 501 } 502 {{range $index, $c := .app.status.conditions}} 503 {{if not $index}},{{end}} 504 {{if $index}},{{end}} 505 { 506 "name": "{{$c.type}}", 507 "value": "{{$c.message}}" 508 } 509 {{end}} 510 ] 511 potentialAction: |- 512 [{ 513 "@type":"OpenUri", 514 "name":"Operation Details", 515 "targets":[{ 516 "os":"default", 517 "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true" 518 }] 519 }, 520 { 521 "@type":"OpenUri", 522 "name":"Open Repository", 523 "targets":[{ 524 "os":"default", 525 "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}" 526 }] 527 }] 528 themeColor: '#000080' 529 title: Application {{.app.metadata.name}} has been successfully synced 530 531 ```