community.general.circonus_annotation 模块 – 在 circonus 中创建注释

注意

此模块是 community.general 集合(版本 10.1.0)的一部分。

如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install community.general。您需要进一步的要求才能使用此模块,请参阅 要求 了解详细信息。

要在 playbook 中使用它,请指定:community.general.circonus_annotation

概要

  • 使用给定的类别、标题和描述创建注释事件。可以选择提供开始、结束或持续时间

要求

在执行此模块的主机上需要以下要求。

  • requests (Python 3 为 >= 2.0.0,或 Python 2 为 >= 1.0.0)

参数

参数

注释

api_key

字符串 / 必需

Circonus API 密钥

category

字符串 / 必需

注释类别

description

字符串 / 必需

注释描述

duration

整数

注释的持续时间(以秒为单位)

默认值: 0

start

整数

事件开始的 Unix 时间戳

如果未指定,则默认为“现在”。

stop

整数

事件结束的 Unix 时间戳

如果未指定,则默认为“现在”+ duration

title

字符串 / 必需

注释标题

属性

属性

支持

描述

check_mode

支持:

可以在 check_mode 中运行,并在不修改目标的情况下返回更改状态预测。

diff_mode

支持:

在 diff 模式下,将返回有关已更改的内容(或可能需要在 check_mode 中更改的内容)的详细信息。

注意

注意

  • 不支持检查模式。

示例

- name: Create a simple annotation event with a source, defaults to start and end time of now
  community.general.circonus_annotation:
    api_key: XXXXXXXXXXXXXXXXX
    title: App Config Change
    description: This is a detailed description of the config change
    category: This category groups like annotations

- name: Create an annotation with a duration of 5 minutes and a default start time of now
  community.general.circonus_annotation:
    api_key: XXXXXXXXXXXXXXXXX
    title: App Config Change
    description: This is a detailed description of the config change
    category: This category groups like annotations
    duration: 300

- name: Create an annotation with a start_time and end_time
  community.general.circonus_annotation:
    api_key: XXXXXXXXXXXXXXXXX
    title: App Config Change
    description: This is a detailed description of the config change
    category: This category groups like annotations
    start_time: 1395940006
    end_time: 1395954407

返回值

常见返回值记录在 此处,以下是此模块独有的字段

描述

annotation

复杂

有关创建的注释的详细信息

已返回: 成功

_cid

字符串

注释标识符

已返回: 成功

示例: "/annotation/100000"

_created

整数

创建时间戳

已返回: 成功

示例: 1502236928

_last_modified

整数

上次修改时间戳

已返回: 成功

示例: 1502236928

_last_modified_by

字符串

上次修改者

已返回: 成功

示例: "/user/1000"

category

字符串

创建的注释的类别

已返回: 成功

示例: "alerts"

description

字符串

创建的注释的描述

已返回: 成功

示例: "Host is down."

rel_metrics

列表 / elements=string

与此注释相关的指标数组,每个指标都是一个字符串。

已返回: 成功

示例: ["54321_kbps"]

start

整数

时间戳,自注释应用以来

已返回: 成功

示例: "Host is down."

stop

字符串

时间戳,自注释结束以来

已返回: 成功

示例: "Host is down."

title

字符串

创建的注释的标题

已返回: 成功

示例: "WARNING"

作者

  • Nick Harring (@NickatEpic)