You are viewing documentation for the development version, it may be incomplete.
Join our translation project and help translate Zabbix documentation into your native language.

graphitem.get

説明

integer/array graphitem.get(object parameters)

このメソッドは、指定したパラメーターに応じたグラフアイテムを取得できます。

このメソッドは、すべてのタイプのユーザーが利用できます。メソッドを呼び出す権限は、ユーザーの役割の設定で取り消すことができます。詳細はユーザーの役割を参照してください。

パラメーター

(object) 望ましい出力を定義するパラメーター。

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

パラメーター 説明
graphids ID/array 指定したグラフに属するグラフアイテムのみを返します。
itemids ID/array 指定したアイテムIDのグラフアイテムのみを返します。
type integer 指定したタイプのグラフアイテムのみを返します。

サポートされているグラフアイテムタイプの一覧はグラフアイテムオブジェクトページを参照してください。
selectGraphs query アイテムが属するグラフの配列を持つgraphsプロパティを返します。
sortfield string/array 指定したプロパティで結果をソートします。

指定可能な値: gitemid
countOutput boolean これらのパラメーターはリファレンス解説で説明されています。
editable boolean
limit integer
output query
preservekeys boolean
sortorder string/array

戻り値

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

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

グラフからグラフアイテムの取得

グラフで使用されているすべてのグラフアイテムを、アイテムとホストに関する追加情報とともに取得します。

リクエスト:

{
           "jsonrpc": "2.0",
           "method": "graphitem.get",
           "params": {
               "output": "extend",
               "graphids": "387"
           },
           "id": 1
       }

レスポンス:

{
           "jsonrpc": "2.0",
           "result": [
               {
                   "gitemid": "1242",
                   "graphid": "387",
                   "itemid": "22665",
                   "drawtype": "1",
                   "sortorder": "1",
                   "color": "FF5555",
                   "yaxisside": "0",
                   "calc_fnc": "2",
                   "type": "0"
               },
               {
                   "gitemid": "1243",
                   "graphid": "387",
                   "itemid": "22668",
                   "drawtype": "1",
                   "sortorder": "2",
                   "color": "55FF55",
                   "yaxisside": "0",
                   "calc_fnc": "2",
                   "type": "0"
               },
               {
                   "gitemid": "1244",
                   "graphid": "387",
                   "itemid": "22671",
                   "drawtype": "1",
                   "sortorder": "3",
                   "color": "009999",
                   "yaxisside": "0",
                   "calc_fnc": "2",
                   "type": "0"
               }
           ],
           "id": 1
       }

参照

ソース

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