Example #1
0
        public async Task <IActionResult> LoginAsync([FromBody] dynamic parameters)
        {
            ZabbixResponse response = await _zabbixService.GetZabbixResponseAsync("user.login", parameters);

            ZabbixSettings.Token = response?.result;

            return(Ok(response.result));
        }
Example #2
0
        public async Task <IActionResult> CreateHost([FromBody] dynamic parameters)
        {
            //ZabbixResponse templateResponse = await _zabbixService.GetZabbixResponseAsync("template.get", JsonConvert.SerializeObject(new { output = "extend" }));
            //ZabbixResponse response = await _zabbixService.GetZabbixResponseAsync("usermacro.get", JsonConvert.SerializeObject(new { output = "extend" }));

            ZabbixResponse response = await _zabbixService.GetZabbixResponseAsync("host.create", parameters);

            return(Ok(response.result));
        }
Example #3
0
        public async Task <IActionResult> LogoutAsync()
        {
            ZabbixResponse response = await _zabbixService.GetZabbixResponseAsync("user.logout", null);

            if (response.error == null)
            {
                ZabbixSettings.Token = string.Empty;
                ZabbixSettings.Url   = string.Empty;
            }

            return(Ok(response.result));
        }
Example #4
0
        public async Task <IActionResult> GetApplication([FromBody] dynamic parameters)
        {
            ZabbixResponse response = await _zabbixService.GetZabbixResponseAsync("application.get", parameters);

            return(Ok(response.result));
        }
Example #5
0
        public async Task <IActionResult> DeleteItem([FromBody] dynamic parameters)
        {
            ZabbixResponse response = await _zabbixService.GetZabbixResponseAsync("item.delete", parameters);

            return(Ok(response.result));
        }
Example #6
0
        public async Task <IActionResult> UpdateHost([FromBody] dynamic parameters)
        {
            ZabbixResponse response = await _zabbixService.GetZabbixResponseAsync("host.update", parameters);

            return(Ok(response.result));
        }
        public async Task <IActionResult> CreateHostInterface(dynamic parameters)
        {
            ZabbixResponse response = await _zabbixService.GetZabbixResponseAsync("hostinterface.create", parameters);

            return(Ok(response.result));
        }