community.general.alerta_customer 模块 – 在 Alerta 中管理客户
注意
此模块是 community.general 集合 (版本 10.1.0) 的一部分。
如果您正在使用 ansible 包,则您可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install community.general。
要在 playbook 中使用它,请指定:community.general.alerta_customer。
community.general 4.8.0 中的新增功能
概要
- 使用 REST API 创建或删除 Alerta 中的客户。 
参数
| 参数 | 注释 | 
|---|---|
| Alerta API 端点。 | |
| API 的访问令牌。 | |
| 使用基本身份验证的 API 密码。 | |
| 使用基本身份验证的 API 用户名。 | |
| 客户的名称。 | |
| 与客户匹配的登录用户。 | |
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持:完全支持 | 可以在  | |
| 支持:不支持 | 在 diff 模式下,将返回有关已更改内容(或可能需要在  | 
另请参阅
另请参阅
- API 文档
- Alerta API 文档 
示例
- name: Create customer
  community.general.alerta_customer:
    alerta_url: https://alerta.example.com
    api_username: [email protected]
    api_password: password
    customer: Developer
    match: [email protected]
- name: Delete customer
  community.general.alerta_customer:
    alerta_url: https://alerta.example.com
    api_username: [email protected]
    api_password: password
    customer: Developer
    match: [email protected]
    state: absent
返回值
常见的返回值已在 此处 记录,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 成功或失败消息。 返回:始终返回 示例: | |
| API 的响应。 返回:始终返回 | 
