feat(notify): add local template

This commit is contained in:
rainzm
2021-01-15 18:09:52 +08:00
parent 3719b8b7f1
commit a6b24e373d
28 changed files with 207 additions and 0 deletions
@@ -0,0 +1,6 @@
{{- $d := .resource_details -}}
您在{{ $d.project }}项目的
{{- if $d.brand -}}
{{ $d.brand }}平台
{{- end -}}
{{ .resource_type_display }}{{ $d.name }}已经成功{{ .action_display }}
@@ -0,0 +1,64 @@
{{- $d := .resource_details }}
{{- $consoleServiceType := list "loadbalancer" "dbinstance" "elasticcache" -}}
您在{{ $d.project }}项目的
{{- if $d.brand -}}
{{ $d.brand }}平台
{{- end -}}
{{ .resource_type_display }}{{ $d.name }}已经创建成功
{{- if $d.private_dns -}}
,内网地址为{{ $d.private_dns }}:{{ $d.private_connect_port }}
{{- end -}}
{{- if $d.public_dns -}}
,外网地址为{{ $d.public_dns }}:{{ $d.public_connect_port }}
{{- end -}}
{{- if and $d.address_type $d.address -}}
,服务地址为{{ $d.address_type }}{{ $d.address }}
{{- end -}}
{{- if $d.ips -}}
IP地址为{{ $d.ips }}
{{- end -}}
{{- if and $d.guest_ip_start $d.guest_ip_end -}}
IP范围为{{ $d.guest_ip_start }}-{{ $d.guest_ip_end }}
{{- end -}}
{{- if $d.ip_addr -}}
IP地址为{{ $d.ip_addr }}
{{- end -}}
{{- if $d.account -}}
,初始帐号为{{ $d.account }}
{{- end -}}
{{- if $d.password -}}
,初始密码为{{ $d.password }}
{{- end -}}
{{- if $d.keypair -}}
,访问ssh密钥为{{ $d.keypair }}
{{- end -}}
{{- if $d.common_name -}}
,证书域名为{{ $d.common_name }}
{{- end -}}
{{- if $d.not_after -}}
,过期时间为{{ $d.not_after }}
{{- end -}}
{{- if eq .resource_type "server" -}}
,请使用
{{- if $d.windows -}}
远程桌面连接器(RDC)
{{- else -}}
SSH
{{- end -}}
或控制面板控制台访问虚拟机。
{{- end -}}
{{- if has .resource_type $consoleServiceType -}}
,更多信息请前往控制台查看。
{{- end -}}
@@ -0,0 +1,6 @@
{{- $d := .resource_details -}}
您在{{ $d.project }}项目的
{{- if $d.brand -}}
{{ $d.brand }}平台
{{- end -}}
{{ .resource_type_display }}{{ $d.name }}还有{{ .advance_days }}天就要到期释放,如需续期使用,请尽快前往控制台处理
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
您在{{ $d.project }}项目的弹性伸缩组{{ $d.scaling_group }}中的{{ $d.trigger_type_display }}类型伸缩策略{{ $d.name }}满足触发条件,成功{{ $d.action_display }}{{ $d.number }}{{ $d.unit_display }}实例
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
您在{{ $d.project }}项目的定时任务执行成功
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
您在{{ $d.project }}项目的自动快照策略{{ $d.name }}为硬盘{{ $d.disk }}创建快照成功
@@ -0,0 +1,14 @@
{{- $d := .resource_details -}}
您在{{ $d.project }}项目的
{{- if $d.brand -}}
{{ $d.brand }}平台
{{- end -}}
{{ .resource_type_display }}{{ $d.name }}已经{{ .action_display }}成功
{{- if $d.account -}}
,帐号为{{ $d.account }}
{{- end -}}
{{- if $d.password -}}
,密码为{{ $d.password }}
{{- end -}}
,更多信息请前往控制台进行查看
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
Your {{ if $d.brand -}} {{ $d.brand }} {{ end -}} {{ .resource_type_display }} {{ $d.name }} {{ if $d.project -}} in project {{ $d.project }} {{ end -}} has been {{ .action_display }} successfully
@@ -0,0 +1,54 @@
{{- $d := .resource_details }}
{{- $consoleServiceType := list "loadbalancer" "dbinstance" "elasticcache" -}}
Your {{ if $d.brand -}} {{ $d.brand }} {{ end -}} {{ .resource_type_display }} {{ $d.name }} {{ if $d.project -}} in project {{ $d.project }} {{ end -}} has been created successfully
{{- if $d.private_dns -}}
, the intranet address is {{ $d.private_dns }}:{{ $d.private_connect_port }}
{{- end -}}
{{- if $d.public_dns -}}
, the internet address is {{ $d.public_dns }}:{{ $d.public_connect_port }}
{{- end -}}
{{- if and $d.address_type $d.address -}}
, the service address is {{ $d.address_type }}{{ $d.address }}
{{- end -}}
{{- if $d.ips -}}
, the IP address is {{ $d.ips }}
{{- end -}}
{{- if and $d.guest_ip_start $d.guest_ip_end -}}
, the IP range is {{ $d.guest_ip_start }}-{{ $d.guest_ip_end }}
{{- end -}}
{{- if $d.ip_addr -}}
, the IP address is {{ $d.ip_addr }}
{{- end -}}
{{- if $d.account -}}
, the initial account is {{ $d.account }}
{{- end -}}
{{- if $d.password -}}
, the initial password is {{ $d.password }}
{{- end -}}
{{- if $d.keypair -}}
, the access ssh key is {{ $d.keypair }}
{{- end -}}
{{- if $d.common_name -}}
, the certificate domain name is {{ $d.common_name }}
{{- end -}}
{{- if $d.not_after -}}
, the expiration is {{ $d.not_after }}
{{- end -}}
{{- if eq .resource_type "server" -}}
, and please use {{ if $d.windows -}} Remote Desktop Connector (RDC) {{ else -}} SSH {{ end -}} or the control panel console to access the VM.
{{- end -}}
{{- if has .resource_type $consoleServiceType -}}
. For more information, please go to the console to view
{{- end -}}
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
Your {{ if $d.brand -}} {{ $d.brand }} {{ end -}} {{ .resource_type }} {{ $d.name }} {{ if $d.project -}} in project {{ $d.project }} {{ end -}} will expire and be released in {{ .advance_days }} days. If you need to renew, please go to the console as soon as possible
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
The {{ $d.trigger_type_display }} type scaling policy {{ $d.name }} in the scaling group {{ $d.scaling_group }} of the {{ $d.project }} project satisfies the trigger conditions, and {{ $d.action_display }} {{ $d.number }}{{ $d.unit_display }} instances successfully
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
The scheduled task in {{ $d.project }} successfully {{ $d.operation_display }} the {{ $d.resource_type_display }} {{ $d.resource_name }}
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
The snapshot policy {{ $d.name }} in the {{ $d.project }} project successfully creates a snapshot for the disk {{ $d.disk }}
@@ -0,0 +1,10 @@
{{- $d := .resource_details -}}
Your {{ if $d.brand -}} {{ $d.brand }} {{ end -}} {{ .resource_type }} {{ $d.name }} {{ if $d.project -}} in project {{ $d.project }} {{ end -}} has been {{ .action_display }} successfully
{{- if $d.account -}}
, the acount is {{ $d.account }}
{{- end -}}
{{- if $d.password -}}
, the password is {{ $d.password }}
{{- end -}}
, and please go to the console to view more information
@@ -0,0 +1,5 @@
{{- $d := .resource_details -}}
{{- if $d.project -}}
{{ $d.project }}项目的
{{- end -}}
{{ .resource_type_display }}{{ $d.name }}{{ .action_display }}成功
@@ -0,0 +1,5 @@
{{- $d := .resource_details -}}
{{- if $d.project -}}
{{ $d.project }}项目的
{{- end -}}
{{ .resource_type_display }}{{ $d.name }}创建成功
@@ -0,0 +1,3 @@
{{- $d := .resource_details -}}
{{ $d.project }}项目的
{{ .resource_type_display }}{{ $d.name }}到期前{{ .advance_days }}天通知
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
{{ $d.project }}项目的弹性伸缩组{{ $d.scaling_group }}中的伸缩策略{{ $d.name }}满足触发
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
The scheduled task in {{ $d.project }} successfully {{ $d.operation_display }} the {{ $d.resource_type_display }} {{ $d.resource_name }}
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
{{ $d.project }}项目的自动快照策略{{ $d.name }}生效
@@ -0,0 +1,3 @@
{{- $d := .resource_details -}}
{{ $d.project }}项目的
{{ .resource_type_display }}{{ $d.name }}{{ .action_display }}成功
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
The {{ .resource_type_display }} {{ .Name }} {{ if $d.project }} in poject {{ $d.project }} {{ end -}} {{ .action_display }} successfully
@@ -0,0 +1,3 @@
{{- $d := .resource_details -}}
The {{ .resource_type_display }} {{ $d.name }} {{ if $d.project }} in poject {{ $d.project }} {{ end -}} created successfully
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
{{ .advance_days }} days notice before {{ .resource_type }} {{ $d.name }} {{ if $d.project -}} in project {{ $d.project }} {{ end -}} expiration
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
The scaling policy {{ $d.name }} in the scaling group {{ $d.scaling_group }} triggered
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
The scheduled task in {{ $d.project }} execute successfully
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
The snapshot policy {{ $d.name }} in the {{ $d.project }} project executed
@@ -0,0 +1,2 @@
{{- $d := .resource_details -}}
The {{ .resource_type }} {{ $d.name }} {{ if $d.project -}} in project {{ $d.project }} {{ end -}} {{ .action_display }} successfully