zabbixApi4j-Host interface

Host interface

hostinterface.create: 创建新的主机接口
hostinterface.delete: 删除主机接口
hostinterface.exists: 检查主机接口是否存在
hostinterface.get: 检索主机接口
hostinterface.massadd: 向主机添加主机接口
hostinterface.massremove: 从主机移除主机接口
hostinterface.replaceostinterfaces: 主机替换主机接口
hostinterface.update: 更新主机接口

zabbixApi4j-Host interface_第1张图片
image.png


HostInterfaceGetTest
package cn.com.yeexun.testzabbix.zabbix4j.example.hostinterface;

import static org.junit.Assert.assertNotNull;

import java.util.ArrayList;

import org.junit.Test;

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

import com.google.gson.Gson;
import com.zabbix4j.hostinteface.HostInterfaceGetRequest;
import com.zabbix4j.hostinteface.HostInterfaceGetResponse;

/**
 * Created by Suguru Yajima on 2014/05/08.
 */
public class HostInterfaceGetTest extends ZabbixApiTestBase {

    public HostInterfaceGetTest() {
        super();
    }

    @Test
    public void testGet1() throws Exception {

        HostInterfaceGetRequest request = new HostInterfaceGetRequest();
        HostInterfaceGetRequest.Params params = request.getParams();
        ArrayList hostids = new ArrayList();
        hostids.add(10109);
        params.setHostids(hostids);

        HostInterfaceGetResponse response = zabbixApi.hostInterface().get(request);

        assertNotNull(response);

        Gson gson = getGson();
        logger.debug(gson.toJson(response));
    }
}

你可能感兴趣的:(zabbixApi4j-Host interface)