##// END OF EJS Templates
webhook: updated docs/examples.
marcink -
r3375:7adf2b03 default
parent child Browse files
Show More
@@ -118,8 +118,7 b' class WebhookSettingsSchema(colander.Sch'
118 118 method_type = colander.SchemaNode(
119 119 colander.String(),
120 120 title=_('Call Method'),
121 description=_('Select if the Webhook call should be made '
122 'with POST, GET or PUT.'),
121 description=_('Select a HTTP method to use when calling the Webhook.'),
123 122 default='post',
124 123 missing='',
125 124 widget=deform.widget.RadioChoiceWidget(
@@ -187,8 +186,7 b' class WebhookIntegrationType(Integration'
187 186 handler = WebhookDataHandler(template_url, headers)
188 187
189 188 url_calls = handler(event, data)
190 log.debug('webhook: calling following urls: %s',
191 [x[0] for x in url_calls])
189 log.debug('webhook: calling following urls: %s', [x[0] for x in url_calls])
192 190
193 191 run_task(post_to_webhook, url_calls, self.settings)
194 192
@@ -214,7 +212,9 b' def post_to_webhook(url_calls, settings)'
214 212 'parents': [{'raw_id': '431b772a5353dad9974b810dd3707d79e3a7f6e0'}],
215 213 'permalink_url': u'http://rc.local:8080/_7/changeset/a815cc738b9651eb5ffbcfb1ce6ccd7c701a5ddf',
216 214 'raw_id': 'a815cc738b9651eb5ffbcfb1ce6ccd7c701a5ddf',
217 'refs': {'bookmarks': [], 'branches': [u'default'], 'tags': [u'tip']},
215 'refs': {'bookmarks': [],
216 'branches': [u'default'],
217 'tags': [u'tip']},
218 218 'reviewers': [],
219 219 'revision': 9L,
220 220 'short_id': 'a815cc738b96',
@@ -228,11 +228,11 b' def post_to_webhook(url_calls, settings)'
228 228 'url': u'http://rc.local:8080/hg-repo'},
229 229 'server_url': u'http://rc.local:8080',
230 230 'utc_timestamp': datetime.datetime(2017, 11, 30, 13, 0, 1, 569276)
231 }
232 """
231 233
232 """
233 234 call_headers = {
234 'User-Agent': 'RhodeCode-webhook-caller/{}'.format(
235 rhodecode.__version__)
235 'User-Agent': 'RhodeCode-webhook-caller/{}'.format(rhodecode.__version__)
236 236 } # updated below with custom ones, allows override
237 237
238 238 auth = get_auth(settings)
@@ -247,8 +247,7 b' def post_to_webhook(url_calls, settings)'
247 247 headers = headers or {}
248 248 call_headers.update(headers)
249 249
250 log.debug('calling Webhook with method: %s, and auth:%s',
251 call_method, auth)
250 log.debug('calling Webhook with method: %s, and auth:%s', call_method, auth)
252 251 if settings.get('log_data'):
253 252 log.debug('calling webhook with data: %s', data)
254 253 resp = call_method(url, json={
General Comments 0
You need to be logged in to leave comments. Login now