Dela via


Data - Retrieve PowerShell Output

Hämtar data efter att ha kört det angivna PowerShell-skriptet för widgetID och instrumentpanelstyp

GET http://<Servername>/OperationsManager/data/powershell?widgetId={widgetId}&dashboardType={dashboardType}

URI-parametrar

Name I Obligatorisk Typ Description
dashboardType
query True

string

Ange instrumentpanelstyp

widgetId
query True

string

Ange widget-ID:t

Svar

Name Typ Description
200 OK

TableDataResponse

Okej. Data har hämtats efter att det angivna PowerShell-skriptet har körts.

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

Exempel

RetrievePowerShellOutput

Sample Request

GET http://<Servername>/OperationsManager/data/powershell?widgetId=8c9a13a6-0547-facb-bf43-e4af529a3468&dashboardType=MONITORING

Sample Response

{
  "tableColumns": [
    {
      "field": "healthstate",
      "header": "HealthState",
      "type": "HealthStateType",
      "hidden": false
    },
    {
      "field": "displayname",
      "header": "DisplayName",
      "type": null,
      "hidden": false
    },
    {
      "field": "customcolumn",
      "header": "CustomColumn",
      "type": null,
      "hidden": false
    },
    {
      "field": "id",
      "header": "Id",
      "type": null,
      "hidden": true
    },
    {
      "field": "path",
      "header": "Path",
      "type": null,
      "hidden": false
    }
  ],
  "rows": [
    {
      "healthstate": "unknown",
      "displayname": "LlhmpKkOvfnZ2tR7VF1yIcgo02c1S7q9FPLsa9h7hl5kEHVHViIKu9vtE3wxst5xyoTmhigWi3Qgg5ktgUftzgOGecn.NuPypIvaxtkxBvm0sONJTCQYNM7SZNIF48Jxoc1YKJ5wtssD3XYPOeO",
      "customcolumn": "1",
      "id": "aeee35a8-c9bc-916d-a86a-ab4fd0e4f8e8",
      "path": ""
    },
    {
      "healthstate": "unknown",
      "displayname": "scomdevserver.contoso.net",
      "customcolumn": "2",
      "id": "9f2ef630-9784-9e27-bbd0-af9900d8264f",
      "path": ""
    }
  ]
}

Definitioner

Name Description
TableColumn
TableDataResponse

TableColumn

Name Typ Description
field

string

Namnet på kolumnen

header

string

Kolumnrubrik

hidden

boolean

Är kolumnen dold

type

string

Typ av kolumn

TableDataResponse

Name Typ Description
rows

object[]

Tabellrader med data

tableColumns

TableColumn[]

Tabellkolumner med data