[comment]: # ({7416ad19-7416ad19})
# correlation.get 

[comment]: # ({/7416ad19-7416ad19})

[comment]: # ({6e13bc51-858936aa})
### 説明

`integer/array correlation.get(object parameters)`

このメソッドは、指定したパラメーターに応じた相関関係を取得できます。

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

[comment]: # ({/6e13bc51-858936aa})

[comment]: # ({7c68a8c3-06a650a0})
### パラメータ

`(object)` 目的の出力を定義するパラメータです。

このメソッドは以下のパラメータをサポートしています。

|パラメータ|[型](/manual/api/reference_commentary#data-types)|説明|
|--|--|------|
|correlationids|ID/array|指定したIDを持つ相関関係のみを返します。|
|selectFilter|query|相関条件を含む [`filter`](/manual/api/reference/correlation/object#correlation-filter) プロパティを返します。|
|selectOperations|query|相関操作を含む [`operations`](/manual/api/reference/correlation/object#correlation-operation) プロパティを返します。|
|sortfield|string/array|指定したプロパティで結果をソートします。<br><br>指定可能な値: `correlationid`, `name`, `status`。|
|countOutput|boolean|これらのパラメータについては、[リファレンス解説](/manual/api/reference_commentary#common-get-method-parameters) を参照してください。|
|editable|boolean|^|
|excludeSearch|boolean|^|
|filter|object|^|
|limit|integer|^|
|output|query|^|
|preservekeys|boolean|^|
|search|object|^|
|searchByAny|boolean|^|
|searchWildcardsEnabled|boolean|^|
|sortorder|string/array|^|
|startSearch|boolean|^|

[comment]: # ({/7c68a8c3-06a650a0})

[comment]: # ({7223bab1-7223bab1})
### 戻り値

`(integer/array)` 次のいずれかを返します:

-   オブジェクトの配列
-   `countOutput`パラメーターが使用されている場合、取得したオブジェクトの数

[comment]: # ({/7223bab1-7223bab1})

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

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

[comment]: # ({ef8be6d3-d14c4f20})
#### 相関関係の取得

設定されたすべての相関を、相関条件および操作とともに取得します。
フィルターは"and/or"評価タイプを使用するため、`formula`プロパティは空で、`eval_formula`が自動的に生成されます。

[リクエスト](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "correlation.get",
    "params": {
        "output": "extend",
        "selectOperations": "extend",
        "selectFilter": "extend"
    },
    "id": 1
}
```

レスポンス:

```json
{
    "jsonrpc": "2.0",
    "result": [
        {
            "correlationid": "1",
            "name": "Correlation 1",
            "description": "",
            "status": "0",
            "filter": {
                "evaltype": "0",
                "formula": "",
                "conditions": [
                    {
                        "type": "3",
                        "oldtag": "error",
                        "newtag": "ok",
                        "formulaid": "A"
                    }
                ],
                "eval_formula": "A"
            },
            "operations": [
                {
                    "type": "0"
                }
            ]
        }
    ],
    "id": 1
}
```

[comment]: # ({/ef8be6d3-d14c4f20})

[comment]: # ({1341f8b4-e7d15410})
### 関連項目

-   [相関フィルター](object#correlation-filter)
-   [相関操作](object#correlation-operation)

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

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

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

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