Skip to content

Commit

Permalink
feat: change webhook response
Browse files Browse the repository at this point in the history
Signed-off-by: Jongmin Kim <[email protected]>
  • Loading branch information
whdalsrnt committed Jul 25, 2024
1 parent 68cf100 commit 71cdcd4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/spaceone/monitoring/info/webhook_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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),
}
Expand Down

0 comments on commit 71cdcd4

Please sign in to comment.