wti.remote.cpm_plugconfig 模块 – 获取和设置 WTI OOB 和 PDU 电源设备的插座参数

注意

此模块是 wti.remote 集合 (版本 1.0.10) 的一部分。

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

要安装它,请使用:ansible-galaxy collection install wti.remote

要在剧本中使用它,请指定:wti.remote.cpm_plugconfig

wti.remote 2.8.0 中的新增功能

概要

  • 获取和设置 WTI OOB 和 PDU 设备的插座参数

参数

参数

注释

cpm_action

字符串 / 必填

这是要发送给模块的操作。

选项

  • "getplugconfig"

  • "setplugconfig"

cpm_password

字符串 / 必填

这是要发送给模块的 WTI 设备密码。

cpm_url

字符串 / 必填

这是要发送给模块的 WTI 设备 URL。

cpm_username

字符串 / 必填

这是要发送给模块的 WTI 设备用户名。

plug_bootdelay

整数

在重启命令中,这是插座在关闭电源后开启电源的时间。

0='0.5 秒',1='1 秒',2='2 秒',3='5 秒',4='15 秒',5='30 秒',6='1 分钟',7='2 分钟',8='3 分钟',9='5 分钟'。

选项

  • 0

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

plug_bootpriority

整数

优先安排哪个插座首先更改其状态。数字越小,优先级越高。

有效值范围为 1 到 WTI 设备的最大插座数量。

plug_default

整数

设备启动时插座的默认状态。0 - 关闭,1 - 开启。

选项

  • 0

  • 1

plug_id

字符串 / 必填

这是要操作的插座编号。

对于 getplugconfig 命令,plug_id 'all' 将返回用户有权访问的所有插座的状态。

用户有权访问。

plug_name

字符串

插座的新名称。

use_https

布尔值

指定使用 https 连接还是 http 连接。

选项

  • false

  • true ← (默认)

use_proxy

布尔值

控制查找在存在时是否观察 HTTP 代理环境变量的标志。

选项

  • false ← (默认)

  • true

validate_certs

布尔值

如果为 false,则不会验证 SSL 证书。这仅应在使用自签名证书的个人控制站点上使用。

在使用自签名证书的个人控制站点上使用。

选项

  • false

  • true ← (默认)

示例

# Get Plug parameters for all ports
- name: Get the Plug parameters for ALL ports of a WTI Power device
  cpm_plugconfig:
    cpm_action: "getplugconfig"
    cpm_url: "rest.wti.com"
    cpm_username: "restpower"
    cpm_password: "restfulpowerpass12"
    use_https: true
    validate_certs: true
    plug_id: "all"

# Get Plug parameters for port 2
- name: Get the Plug parameters for the given port of a WTI Power device
  cpm_plugconfig:
    cpm_action: "getplugconfig"
    cpm_url: "rest.wti.com"
    cpm_username: "restpower"
    cpm_password: "restfulpowerpass12"
    use_https: true
    validate_certs: false
    plug_id: "2"

# Configure plug 5
- name: Configure parameters for Plug 5 on a given WTI Power device
  cpm_plugconfig:
    cpm_action: "setplugconfig"
    cpm_url: "rest.wti.com"
    cpm_username: "restpower"
    cpm_password: "restfulpowerpass12"
    use_https: true
    plug_id: "5"
    plug_name: "NewPlugNameFive"
    plug_bootdelay: "3"
    plug_default: "0"
    plug_bootpriority: "1"

返回值

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

描述

data

字符串

从发送的命令返回的输出 JSON

返回值:始终

作者

  • Western Telematic Inc. (@wtinetworkgear)