MCPcopy Create free account
hub / github.com/StackStorm/st2 / WebhookDB

Class WebhookDB

st2common/st2common/models/db/webhook.py:23–46  ·  view source on GitHub ↗

Note: Right now webhook is a meta model which is not persisted in the database. Attribute: name: Webhook name - maps to the URL path (e.g. st2/ or my/webhook/one).

Source from the content-addressed store, hash-verified

21
22
23class WebhookDB(stormbase.StormFoundationDB, stormbase.UIDFieldMixin):
24 """
25 Note: Right now webhook is a meta model which is not persisted in the database.
26
27 Attribute:
28 name: Webhook name - maps to the URL path (e.g. st2/ or my/webhook/one).
29 """
30
31 RESOURCE_TYPE = ResourceType.WEBHOOK
32 UID_FIELDS = ["name"]
33
34 name = me.StringField(required=True)
35
36 def __init__(self, *args, **values):
37 super(WebhookDB, self).__init__(*args, **values)
38 self.name = self._normalize_name(name=self.name)
39 self.uid = self.get_uid()
40
41 def _normalize_name(self, name):
42 # Remove trailing slash if present
43 if name.endswith("/"):
44 name = name[:-1]
45
46 return name

Callers 2

get_oneMethod · 0.90
postMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected