Skip to main content
ONTAP Automation
本繁體中文版使用機器翻譯,譯文僅供參考,若與英文版本牴觸,應以英文版本為準。

列出 EMS 記錄事件

貢獻者

您可以擷取所有事件通知訊息、或只擷取具有特定特性的訊息。

HTTP 方法和端點

此 REST API 呼叫使用下列方法和端點。

HTTP方法 路徑

取得

/api/support/EMS / 事件

處理類型

同步

Curl 範例的其他輸入參數

除了所有REST API呼叫通用的參數之外、此步驟的Curl範例也會使用下列參數。

參數 類型 必要 說明

欄位

查詢

用於要求在回應中包含特定欄位。

Max_Records

查詢

可用於限制單一要求傳回的記錄數。

log_message

查詢

用於搜尋特定的文字值、並僅傳回相符的訊息。

message.severity

查詢

將傳回的訊息限制為具有特定嚴重性的訊息、例如 alert

捲曲範例:傳回最新訊息和名稱值
curl --request GET \
--location "https://$FQDN_IP/api/support/ems/events?fields=message.name&max_records=1" \
--include \
--header "Accept: */*" \
--header "Authorization: Basic $BASIC_AUTH"
捲曲範例:傳回包含特定文字和嚴重性的訊息
curl --request GET \
--location "https://$FQDN_IP/api/support/ems/events?log_message=*disk*&message.severity=alert" \
--include \
--header "Accept: */*" \
--header "Authorization: Basic $BASIC_AUTH"
Json輸出範例
{
  "records": [
    {
      "node": {
        "name": "malha-vsim1",
        "uuid": "da4f9e62-9de3-11ec-976a-005056b369de",
        "_links": {
          "self": {
            "href": "/api/cluster/nodes/da4f9e62-9de3-11ec-976a-005056b369de"
          }
        }
      },
      "index": 4602,
      "time": "2022-03-18T06:37:46-04:00",
      "message": {
        "severity": "alert",
        "name": "raid.autoPart.disabled"
      },
      "log_message": "raid.autoPart.disabled: Disk auto-partitioning is disabled on this system: the system needs a minimum of 4 usable internal hard disks.",
      "_links": {
        "self": {
          "href": "/api/support/ems/events/malha-vsim1/4602"
        }
      }
    }
  ],
  "num_records": 1,
  "_links": {
    "self": {
      "href": "/api/support/ems/events?log_message=*disk*&message.severity=alert&max_records=1"
    },
    "next": {
      "href": "/api/support/ems/events?start.keytime=2022-03-18T06%3A37%3A46-04%3A00&start.node.name=malha-vsim1&start.index=4602&log_message=*disk*&message.severity=alert"
    }
  }
}