# -*- coding: utf-8 -*-
# 接口测试
# 作者: 陈磊
# 时间: 2019-10-21

from WorkApi.HostGroup.hostGroup_get import Get
from WorkApi.HostGroup.hostGroup_create import Create
from WorkApi.HostGroup.hostGroup_delete import Delete
from WorkApi.HostGroup.hostGroup_update import Update

from WorkUtils.UtilsResponse import UtilsResponse

import time


# 域名
host = "http://10.0.0.12:8080"

# 查询主机
# api = Get(host=host)
# api.searchWildcardsEnabled = "true"
# api.searchByAny = "true"
# api.monitoredHosts = "true"
# api.withItems = "true"
#
# api.output_add("extend")
# api.filter_name_add("Zabbix servers")
# api.filter_name_add("Linux servers")
# api.search_name_add("*emp*")

# 创建主机
# api = Create(host=host)
# api.name = "三石测试主机2"
# api.groupid = 1
# api.flags = 0
# api.internal = 1

# 删除主机
# api = Delete(host=host)
# api.groupids_add(groupids=34)

# 更新主机
api = Update(host=host)
api.groupid = 33
api.name = "三石测试主机1-1"

api.get_response()
