当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。