美文网首页
zabbixApi4j-Host interface

zabbixApi4j-Host interface

作者: 差不多先生_tl | 来源:发表于2018-01-11 14:01 被阅读38次

Host interface

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

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<Integer> hostids = new ArrayList<Integer>();
        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

    Host interface hostinterface.create: 创建新的主机接口hostinterfac...

  • zabbixApi4j-Host

    Host: 这个类的设计目的是与主机一起工作。 host.create: 创建新主机host.delete: 删除...

  • interface{} 与 []interface{}

    简介 基于可以对interface{}赋值任何类型的变量,很多人会尝试如下的代码: 很不幸会导致错误: 于是问题来...

  • zabbixApi4j-Host prototype

    Host prototype hostprototype.create: 创建新主机原型hostprototype...

  • zabbixApi4j-Host group

    Host group hostgroup.create: 创建新的主机组hostgroup.delete: 删除主...

  • Interface

    Interface is a group of method signatures, continuin with...

  • Interface

    为什么interface中的变量都是static public final? 首先接口是一种高度抽象的"模版",,...

  • interface

    接口用于定义对象的 '轮廓' 但是如果我们直接传入一个对象字面量进去,ts就会报错, 因为ts对对象字面量检测更加...

  • interface

    http://blog.csdn.net/justaipanda/article/details/43155949...

  • @interface

    深入理解Java:注解(Annotation)自定义注解入门http://www.cnblogs.com/peid...

网友评论

      本文标题:zabbixApi4j-Host interface

      本文链接:https://www.haomeiwen.com/subject/upgznxtx.html