Tuning Manager APIリファレンスガイド

[目次][索引][前へ][次へ]


3.2 アラート定義情報の追加

アラート定義情報を新規に追加します。

HTTPリクエスト構文(URI)

POST  <scheme>://<host>:<port>/<application>/<version>/objects/alert-defs

リクエストの構造

リクエストにはアラート定義型オブジェクトを指定してください。

アラート定義型オブジェクトについては,「3.11 アラート定義情報設定時のオブジェクト」および「A.2 アラート定義情報の作成手順」を参照してください。

レスポンスの構造

レスポンスボディの構造を次に示します。なお,Errorオブジェクトおよびcause要素は,エラーが発生している場合に含まれます。

{
    "state": "...",
    "affectedResources": [
        "..."
    ],
    "error": {
        "errorSource": "...",
        "message": "...",
        "messageID": "...",
        "actions": [
            "..."
        ]
    },
    "result": [
        {
            "distributionResult": "...",
            "agent": {
                "agentType": "...",
                "hostName": "...",
                "instanceName": "...",
                "model": "...",
                "serialNumber": "...",
                "smuIp": "...",
                "destIp": "...",
                "detourIp": "..."
            },
            "cause": {
                "errorID": "...",
                "errorDescription": "..."
            }
        }
    ],
    "resultType": "AlertDefDistributionResult"
}

表3-2 アラート定義情報追加時のスキーマ

変数名 説明
state string 処理結果の状態
  • Succeeded:成功
  • Failed:失敗
  • Distribution Failed:失敗(エージェントへのアラート定義配布)
    Distribution Failedの場合,返却されたcause要素の内容を確認して,失敗の要因を取り除いてから,アラート定義情報の同期を実行してください。
affectedResources string 追加したアラート定義情報を参照するためのURI
error※1 エラー時の情報
詳細については,「2.7.2 Errorオブジェクト」を参照してください。
errorSource string APIクライアントが送信したURI
message string エラーメッセージ
messageID string メッセージID
actions string型の配列 APIクライアントが取るべき対処
result 定義追加の結果情報
distributionResult string 追加の状態
  • Succeeded:成功
  • Failed:失敗
agent 監視対象の情報
agentType string エージェントの種別
  • HTM - Agent for RAIDの場合:RAID
  • HTM - Agent for NASの場合:NAS
hostName string エージェントのホスト名
instanceName string エージェントのインスタンス名
model string ストレージシステムの機種名
serialNumber string ストレージシステムのシリアル番号
smuIp string 外部NAS Managerを特定するための情報
外部NAS Managerで管理されるNAS Platformのインスタンスを作成するときに指定したSMU/NAS Manager IP Addressが返却されます。
destIp string Hitachi Virtual File Platform※2を特定するための情報
Hitachi Virtual File Platform※2のインスタンスを作成するときに指定したdestination_addressが返却されます。
detourIp string Hitachi Virtual File Platform※2を特定するための情報
Hitachi Virtual File Platform※2のインスタンスを作成するときに指定したdetour_addressが返却されます。
cause※1 エラー時の情報
errorID string メッセージID
errorDescription string エラーメッセージ
resultType string 次の値が返却されます。
AlertDefDistributionResult

注※1
Succeededの場合は返却されません。

注※2
次のファイルサーバを総称して,「Hitachi Virtual File Platform」と呼びます。
  • Hitachi Virtual File Platform
  • Hitachi Capacity Optimization
  • Hitachi Essential NAS Platform

実行例(アラート定義情報の追加)

curlコマンドを使用したリクエストメッセージ:

curl -v -H "Content-Type: application/json" -u system:manager -d @AlertVSPG1000_01.json -X POST http://server_1:22015/DeviceManagerWebService/analytics/v1/objects/alert-defs

リクエストに対する実行結果/

リクエストヘッダー:

POST /DeviceManagerWebService/analytics/v1/objects/alert-defs HTTP/1.1
Authorization: Basic c3lzdGVtOm1hbmFnZXI=
User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
Host: server_1:22015
Accept: */*
Content-Type: application/json
Content-Length: 1024

レスポンスヘッダー:

HTTP/1.1 201 Created
Date: Tue, 20 Oct 2015 07:07:40 GMT
Server: Cosminexus HTTP Server
Location: http://server_1:22015/DeviceManagerWebService/analytics/v1/objects/alert-defs/AlertVSPG1000_01
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8

レスポンスボディ:

{
    "state": "Succeeded",
    "affectedResources": [
        "http://server_1:22015/DeviceManagerWebService/analytics/v1/objects/alert-defs/AlertVSPG1000_01"
    ],
    "result": [
        {
            "distributionResult": "Succeeded",
            "agent": {
                "agentType": "RAID",
                "hostName": "agent_1",
                "instanceName": "VSPG1000_instance",
                "model": "VSP G1000",
                "serialNumber": "10182"
            }
        }
    ],
    "resultType": "AlertDefDistributionResult"
}

リクエスト時に読み込ませたファイルの内容:(AlertVSPG1000_01.json

{
  "alertDefName": "AlertVSPG1000_01",
  "targets": [
    {
      "targetID": "target1",
      "targetDef": [
        {
          "type": "model",
          "key": {
            "model": "VSP G1000"
          }
        }
      ]
    }
  ],
  "notices": [
    {
      "noticeID": "notice1",
      "emailNotification": [
        "warning", "caution", "normal"
      ],
      "emails": [
        {
          "addresses": [
            "alert@example.com"
          ],
          "subject": "HTnM Alert Mail",
          "body": "Alert Mail"
        }
      ]
    }
  ],
  "triggers": [
    {
      "triggerID": "trigger1",
      "isActive": "Y",
      "monitorAlways": "Y",
      "alertEveryTime": "Y",
      "evaluateAllData": "Y",
      "condition": {
        "warning": "%PI_LDS.READ_IO_COUNT% > '3000'",
        "caution": "%PI_LDS.READ_IO_COUNT% > '2000'"
      }
    }
  ],
  "definitions": [
    {
      "targetIDs": [
        "target1"
      ],
      "noticeIDs": [
        "notice1"
      ],
      "triggerIDs": [
        "trigger1"
      ]
    }
  ],
  "formatVersion": "1.0"
}

[目次] [前へ] [次へ]


[マニュアル発行元]

All Rights Reserved. Copyright© 2014, 2020, Hitachi, Ltd.