當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


Python ArcGIS WebhookManager.create用法及代碼示例


本文簡要介紹 python 語言中 arcgis.gis.admin.WebhookManager.create 的用法。

用法:

create(name, url, events='ALL', number_of_failures=5, days_in_past=5, secret=None, properties=None)

創建 WebHook 來監控 REST 端點和報告活動

Parameter

Description

name

必需的字符串。 Webhook 的名稱。

url

必需的字符串。這是 webhook 將向其傳遞有效負載的 URL。

events

可選列表或字符串。事件接受列表或可以監視所有事件。這是通過將“ALL” 作為事件傳遞來完成的。如果提供列表,則可以監視特定端點。

Item Trigger Events

Trigger event

URI example

All trigger events for all items

/items

Add item to the portal

/items/add

All trigger events for a specific item

/items/<itemID>

Delete a specific item

/items/<itemID>/delete

Update a specific item’s properties

/items/<itemID>/update

Move an item or changing ownership of the item

/items/<itemID>/move

Publish a specific item

/items/<itemID>/publish

Share a specific item

/items/<itemID>/share

Unshare a specific item

/items/<itemID>/unshare

Group Trigger Events

Trigger event

URI example

All trigger events for all groups

/groups

Add group

/groups/add

All trigger events for a specific group

/groups/<groupID>

Update a specific group

/groups/<groupID>/update

Delete a specific group

/groups/<groupID>/delete

Enable Delete Protection for a specific group

/groups/<groupID>/protect

Disable Delete Protection for a specific group

/groups/<groupID>/unprotect

Invite a user to a specific group

/groups/<groupID>/invite

Add a user to a specific group

/groups/<groupID>/addUsers

Remove a user from a specific group

/groups/<groupID>/removeUsers

Update a user’s role in a specific group

/groups/<groupID>/updateUsers

User Trigger Events

Trigger event

URI example

All trigger events for all users in the portal

/users

All trigger events associated with a specific user

/users/<username>

Delete a specific user

/users/<username>/delete

Update a specific user’s profile

/users/<username>/update

Disable a specific user’s account

/users/<username>/disable

Enable a specific user’s account

/users/<username>/enable

示例語法:['/users', '/groups/abcd1234….']

number_of_failures

可選整數。服務前允許的失敗次數

days_in_past

選項整數。重新報告的天數。

secret

可選字符串。向您的有效負載添加一個秘密,可用於在您的接收器上驗證消息。

properties

可選字典。在 10.9.1+ 版本中,用戶可以提供額外的配置屬性。

:返回一個WebHook實例

# Example using Zapier as the payload URL

from arcgis.gis import GIS

gis = GIS(profile="your_profile", verify_cert=False)

wh_mgr = gis.admin.webhooks
wh = wh_mgr.create(name="Webhook_from_API",
                   url="https://hooks.zapier.com/hooks/catch/6694048/odqj9o3/",
                   events=["/items/981e98b949d9432ebf26433f40948cec/move",
                           "/items/981e98b949d9432ebf26433f40948cec/update"]

有關詳細說明,請參閱Webhook Blog Post

相關用法


注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 arcgis.gis.admin.WebhookManager.create。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。