[comment]: # ({c71a2e54-c71a2e54})
# correlation.update

[comment]: # ({/c71a2e54-c71a2e54})

[comment]: # ({b9562236-b9562236})
### 説明

`object correlation.update(object/array correlations)`

このメソッドは、既存の相関関係を更新することができます。

::: noteclassic
このメソッドは、*Super admin*タイプのユーザーのみ利用可能です。メソッドを呼び出す権限は、ユーザーの役割の設定で取り消すことができます。詳細は[ユーザーの役割](/manual/web_interface/frontend_sections/administration/user_roles)を参照してください。
:::

[comment]: # ({/b9562236-b9562236})

[comment]: # ({ce355bf6-326bc80e})
### パラメーター

`(object/array)` 更新する相関関係プロパティ。

`correlationid` プロパティは相関ごとに定義する必要があり、他のすべてのプロパティはオプションです。渡されたプロパティのみが更新され、他のプロパティは変更されません。

[標準相関プロパティ](object#correlation)に加えて、このメソッドは次のパラメーターを受け入れます。

|パラメーター|[タイプ](/manual/api/reference_commentary#data_types)|説明|
|--|--|------|
|filter|object|現在のフィルターを置き換える相関関係[フィルター](/manual/api/reference/correlation/object#correlation_filter)オブジェクト。|
|operations|array|既存の操作を置き換える相関関係[操作](/manual/api/reference/correlation/object#correlation_operation)。|

[comment]: # ({/ce355bf6-326bc80e})

[comment]: # ({13e1dc13-13e1dc13})
### 戻り値

`(object)` correlationids`プロパティの下で更新された相関関係IDを含むオブジェクトを返します。

[comment]: # ({/13e1dc13-13e1dc13})

[comment]: # ({b41637d2-b41637d2})
### 例

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({84b38e7f-67bb2dfb})
#### 相関関係の無効化

リクエスト:

```json
{
    "jsonrpc": "2.0",
    "method": "correlation.update",
    "params": {
        "correlationid": "1",
        "status": "1"
    },
    "auth": "343baad4f88b4106b9b5961e77437688",
    "id": 1
}
```

レスポンス:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "correlationids": [
            "1"
        ]
    },
    "id": 1
}
```

[comment]: # ({/84b38e7f-67bb2dfb})

[comment]: # ({8611676c-d6ef1778})
#### 評価方法を維持したままで条件の置き換え

リクエスト:

```json
{
    "jsonrpc": "2.0",
    "method": "correlation.update",
    "params": {
        "correlationid": "1",
        "filter": {
            "conditions": [
                {
                    "type": 3,
                    "oldtag": "error",
                    "newtag": "ok"
                }
            ]
        }
    },
    "auth": "343baad4f88b4106b9b5961e77437688",
    "id": 1
}
```

レスポンス:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "correlationids": [
            "1"
        ]
    },
    "id": 1
}
```

[comment]: # ({/8611676c-d6ef1778})

[comment]: # ({e7d15410-e7d15410})
### 参照

-   [Correlation filter](object#correlation_filter)
-   [Correlation operation](object#correlation_operation)

[comment]: # ({/e7d15410-e7d15410})

[comment]: # ({40fa665f-40fa665f})
### ソース

CCorrelation::update() in
*ui/include/classes/api/services/CCorrelation.php*.

[comment]: # ({/40fa665f-40fa665f})
