Skip to content

OpsGenie

URL 格式

opsgenie://[host:port/]apikey

URL 字段

  • Host - OpsGenie API 主机。欧盟实例使用 'api.eu.opsgenie.com'
    默认值: api.opsgenie.com
    URL 部分: opsgenie://host:port/apikey

  • Port - OpsGenie API 端口
    默认值: 443
    URL 部分: opsgenie://host:port/apikey

  • APIKey - OpsGenie API 密钥(必填)
    URL 部分: opsgenie://host:port/apikey

查询/参数属性

属性可以通过 URL 查询参数提供: ?key=value&key=value 等。

  • Actions - 警报可用的自定义操作
    默认值: empty

  • Alias - 客户端定义的警报标识符
    默认值: empty

  • Description - 警报的描述字段
    默认值: empty

  • Entity - 警报的实体字段,通常用于指定警报的源字段的域
    默认值: empty

  • Note - 创建警报时将添加的附加说明
    默认值: empty

  • Priority - 警报的优先级。可能的值为 P1, P2, P3, P4 和 P5
    默认值: empty

  • Responders - 警报将路由发送通知的团队、用户、升级和计划
    默认值: empty

  • Source - 警报的源字段
    默认值: empty

  • Tags - 警报的标签
    默认值: empty

  • User - 请求所有者的显示名称
    默认值: empty

  • VisibleTo - 警报将对其可见但不发送任何通知的团队和用户
    默认值: empty

在 OpsGenie 中创建 REST API 端点

  1. 通过点击菜单中的 Settings => Integration List 打开集成列表页面
截图 1: 打开集成列表页面
  1. 点击 API => Add

  2. 确保勾选 Create and Update AccessEnabled,然后点击 Save Integration

截图 2: 点击 API => Add
  1. 复制 API Key

  2. 格式化服务 URL

主机可以是 api.opsgenie.com 或 api.eu.opsgenie.com,取决于您实例的位置。详情请参阅 OpsGenie 文档

opsgenie://api.opsgenie.com/eb243592-faa2-4ba2-a551q-1afdf565c889
                            └───────────────────────────────────┘
                                           token

示例

opsgenie://api.opsgenie.com/eb243592-faa2-4ba2-a551q-1afdf565c889?alias=Life+is+too+short+for+no+alias&description=Every+alert+needs+a+description&actions=An+action&tags=["tag1","tag2"]&entity=An+example+entity&source=The+source&priority=P1&user=Dracula¬e=Here+is+a+note

基于 MIT 许可发布