diff --git a/src/spaceone/monitoring/info/webhook_info.py b/src/spaceone/monitoring/info/webhook_info.py index 6126918..0f29fb2 100644 --- a/src/spaceone/monitoring/info/webhook_info.py +++ b/src/spaceone/monitoring/info/webhook_info.py @@ -10,6 +10,17 @@ __all__ = ["WebhookInfo", "WebhooksInfo"] +def WebhookRequests(vo): + if vo: + info = { + "total": vo.total, + "error": vo.error, + } + return webhook_pb2.WebhookRequests(**info) + else: + return None + + def PluginInfo(vo): if vo: info = { @@ -46,6 +57,8 @@ def WebhookInfo(webhook_vo: Webhook, minimal=False): "access_key": webhook_vo.access_key, "capability": change_struct_type(webhook_vo.capability), "plugin_info": PluginInfo(webhook_vo.plugin_info), + "tags": change_struct_type(webhook_vo.tags), + "requests": WebhookRequests(webhook_vo.requests), "domain_id": webhook_vo.domain_id, "created_at": utils.datetime_to_iso8601(webhook_vo.created_at), } diff --git a/src/spaceone/monitoring/service/job_service.py b/src/spaceone/monitoring/service/job_service.py index 7cc93e8..a71e54d 100644 --- a/src/spaceone/monitoring/service/job_service.py +++ b/src/spaceone/monitoring/service/job_service.py @@ -251,7 +251,6 @@ def create_alert_notification(self, params): "ERROR", notification_level=notification_level, has_callback=True, - has_short_description=True, ) notification_mgr.create_notification(message, domain_id) @@ -455,7 +454,6 @@ def _create_message( notification_type: str, notification_level="ALL", has_callback=False, - has_short_description=False, user_id=None, ): domain_id = alert_vo.domain_id @@ -533,12 +531,6 @@ def _create_message( if alert_vo.image_url: message["image_url"] = alert_vo.image_url - if has_short_description: - # TODO: Need to change multiple language - message[ - "short_description" - ] = f'경고! 장애 발생! {project_name.replace(" >", "의")} 프로젝트에 장애가 발생했습니다.' - return { "resource_type": resource_type, "resource_id": resource_id,