zabbixApi4j-Graph item

Graph item

graphitem.get: 检索图项目

image.png
GraphItemGetTest
package cn.com.yeexun.testzabbix.zabbix4j.example.graphitem;

import static org.junit.Assert.assertNotNull;

import org.junit.Test;

import cn.com.yeexun.testzabbix.zabbix4j.common.ZabbixApiTestBase;

import com.zabbix4j.graphitem.GraphItemGetRequest;
import com.zabbix4j.graphitem.GraphItemGetResponse;
import com.zabbix4j.graphitem.GraphItemObject;


/**
 * Created by Suguru Yajima on 2014/06/01.
 */
public class GraphItemGetTest extends ZabbixApiTestBase {


    public GraphItemGetTest() {
        super();
    }

    @Test
    public void testGet1() throws Exception {
        GraphItemGetRequest request = new GraphItemGetRequest();
        GraphItemGetRequest.Params params = request.getParams();

        GraphItemGetResponse response = zabbixApi.graphItem().get(request);
        assertNotNull(response);

        logger.debug(getGson().toJson(response));

        GraphItemObject item = response.getResult().get(0);
        assertNotNull(item);

        assertNotNull(item.getCalc_fnc());
        assertNotNull(item.getColor());
        assertNotNull(item.getDrawtype());
        assertNotNull(item.getGitemid());
        assertNotNull(item.getGraphid());
        assertNotNull(item.getItemid());
        assertNotNull(item.getSortorder());
        assertNotNull(item.getType());
        assertNotNull(item.getYaxisside());
    }
}

你可能感兴趣的:(zabbixApi4j-Graph item)