Monitoring - Retrieve Widget

检索小组件属性和配置。

GET http://<Servername>/OperationsManager/monitoring/widget/{widgetId}

URI 参数

名称 必需 类型 说明
widgetId
path True

string

指定小组件 ID

响应

名称 类型 说明
200 OK

ComponentResponse

还行。已成功检索小组件属性和配置。

Media Types: "application/json", "text/json", "application/xml", "text/xml"

示例

Monitoring_RetrieveWidget

示例请求

GET http://<Servername>/OperationsManager/monitoring/widget/8c9a13a6-0547-facb-bf43-e4af529a3468

示例响应

{
  "id": "8c9a13a6-0547-facb-bf43-e4af529a3468",
  "name": "Data from shell",
  "description": null,
  "mpId": "da187e72-b9d7-9e16-d098-3b0a624dc38c",
  "componentType": "HtmlPowershellWidget",
  "config": "{\"widgetDisplay\":{\"col\":1,\"row\":2,\"sizex\":6,\"sizey\":4},\"widgetParameters\":{\"script\":\"$class = Get-SCOMClass -Name Microsoft.Windows.Computer  \\n$computers = Get-SCOMClassInstance -Class $class  \\n$i=1  \\nforeach ($computer in $computers)  \\n{  \\n    $results=$ScriptContext.CreateFromObject($computer,\\\"Id=Id,HealthState=HealthState,DisplayName=DisplayName\\\",$null)   \\n    $results[\\\"CustomColumn\\\"]=$i   \\n    $ScriptContext.ReturnCollection.Add($results)   \\n    $i++   \\n}\"},\"widgetRefreshInterval\":5}"
}

定义

ComponentResponse

名称 类型 说明
componentType

string

组件类型

config

string

配置

description

string

组件描述

id

string

身份证件

mpId

string

组件 MP ID

name

string

组件名称