Media:本类旨在与媒体合作。
usermedia.get: 检索媒体
user.addmedia: 创建新媒体
user.updatemedia: 更新媒体
user.deletemedia: 删除媒体
MediaGetTest
package cn.com.yeexun.testzabbix.zabbix4j.example.media;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;
import cn.com.yeexun.testzabbix.zabbix4j.common.ZabbixApiTestBase;
import com.zabbix4j.media.MediaGetRequest;
import com.zabbix4j.media.MediaGetResponse;
/**
* @author Suguru Yajima
*/
public class MediaGetTest extends ZabbixApiTestBase {
public MediaGetTest() {
super();
}
@Test
public void testGet() throws Exception {
MediaGetRequest request = new MediaGetRequest();
MediaGetRequest.Params params = request.getParams();
params.addUserId(1);
MediaGetResponse response = zabbixApi.media().get(request);
assertNotNull(response);
logger.debug(getGson().toJson(response));
}
}