wti.remote.cpm_plugcontrol 模块 – 获取和设置 WTI OOB 和 PDU 电源设备的插头操作

注意

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

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

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

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

wti.remote 2.8.0 中的新增功能

概要

  • 获取和设置 WTI OOB 和 PDU 设备的插头操作

参数

参数

注释

cpm_action

字符串 / 必需

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

选项

  • "getplugcontrol"

  • "setplugcontrol"

cpm_password

字符串 / 必需

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

cpm_url

字符串 / 必需

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

cpm_username

字符串 / 必需

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

plug_id

字符串 / 必需

这是要操作的插头编号或插头名称。

对于 plugget 命令,plug_id ‘all’ 将返回用户有权访问的所有插头的状态。

用户有权访问。

plug_state

字符串

这是对插头采取的操作。

选项

  • "on"

  • "off"

  • "boot"

  • "default"

use_https

布尔值

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

选项

  • false

  • true ← (默认)

use_proxy

布尔值

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

选项

  • false ← (默认)

  • true

validate_certs

布尔值

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

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

选项

  • false

  • true ← (默认)

示例

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

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

# Reboot plug 5
- name: Reboot Plug 5 on a given WTI device
  cpm_plugcontrol:
    cpm_action: "setplugcontrol"
    cpm_url: "rest.wti.com"
    cpm_username: "restpower"
    cpm_password: "restfulpowerpass12"
    use_https: true
    plug_id: "5"
    plug_state: "boot"

返回值

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

描述

data

字符串

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

返回:始终

作者

  • Western Telematic Inc. (@wtinetworkgear)