コード例 #1
0
        protected override Dictionary <string, object> BuildParams(object filter = null, IEnumerable <DiscoveredServiceInclude> include = null, Dictionary <string, object> @params = null)
        {
            var includeHelper = new IncludeHelper(include == null ? 1 : include.Sum(x => (int)x));

            if (@params == null)
            {
                @params = new Dictionary <string, object>();
            }

            @params.AddIfNotExist("output", "extend");
            @params.AddOrReplace("selectDRules", includeHelper.WhatShouldInclude(DiscoveredServiceInclude.DiscoveryRules));
            @params.AddOrReplace("selectDServices", includeHelper.WhatShouldInclude(DiscoveredServiceInclude.DiscoveredServices));
            @params.AddOrReplace("selectHosts", includeHelper.WhatShouldInclude(DiscoveredServiceInclude.Hosts));

            @params.AddOrReplace("filter", filter);

            return(@params);
        }
コード例 #2
0
ファイル: IITServiceService.cs プロジェクト: tatkob/ZabbixApi
        protected override Dictionary<string, object> BuildParams(object filter = null, IEnumerable<ITServiceInclude> include = null, Dictionary<string, object> @params = null)
        {
            var includeHelper = new IncludeHelper(include == null ? 1 : include.Sum(x => (int)x));
            if (@params == null)
                @params = new Dictionary<string, object>();

            @params.AddIfNotExist("output", "extend");
            @params.AddOrReplace("selectParent", includeHelper.WhatShouldInclude(ITServiceInclude.Parent));
            @params.AddOrReplace("selectDependencies", includeHelper.WhatShouldInclude(ITServiceInclude.Dependencies));
            @params.AddOrReplace("selectParentDependencies", includeHelper.WhatShouldInclude(ITServiceInclude.ParentDependencies));
            @params.AddOrReplace("selectTimes", includeHelper.WhatShouldInclude(ITServiceInclude.Times));
            @params.AddOrReplace("selectAlarms", includeHelper.WhatShouldInclude(ITServiceInclude.Alarms));
            @params.AddOrReplace("selectTrigger", includeHelper.WhatShouldInclude(ITServiceInclude.Trigger));

            @params.AddOrReplace("filter", filter);

            return @params;
        }
コード例 #3
0
        protected override Dictionary <string, object> BuildParams(object filter = null, IEnumerable <MaintenanceInclude> include = null, Dictionary <string, object> @params = null)
        {
            var includeHelper = new IncludeHelper(include == null ? 1 : include.Sum(x => (int)x));

            if (@params == null)
            {
                @params = new Dictionary <string, object>();
            }

            @params.AddIfNotExist("output", "extend");
            @params.AddOrReplace("selectGroups", includeHelper.WhatShouldInclude(MaintenanceInclude.Groups));
            @params.AddOrReplace("selectHosts", includeHelper.WhatShouldInclude(MaintenanceInclude.Hosts));
            @params.AddOrReplace("selectTimeperiods", includeHelper.WhatShouldInclude(MaintenanceInclude.TimePeriods));

            @params.AddOrReplace("filter", filter);

            return(@params);
        }
コード例 #4
0
        protected override Dictionary <string, object> BuildParams(object filter = null, IEnumerable <AlertInclude> include = null, Dictionary <string, object> @params = null)
        {
            var includeHelper = new IncludeHelper(include == null ? 1 : include.Sum(x => (int)x));

            if (@params == null)
            {
                @params = new Dictionary <string, object>();
            }

            @params.AddIfNotExist("output", "extend");
            @params.AddOrReplace("selectHosts", includeHelper.WhatShouldInclude(AlertInclude.Hosts));
            @params.AddOrReplace("selectMediatypes", includeHelper.WhatShouldInclude(AlertInclude.MediaTypes));
            @params.AddOrReplace("selectUsers", includeHelper.WhatShouldInclude(AlertInclude.Users));

            @params.AddOrReplace("filter", filter);

            return(@params);
        }
コード例 #5
0
        protected override Dictionary <string, object> BuildParams(object filter = null, IEnumerable <ActionInclude> include = null, Dictionary <string, object> @params = null)
        {
            var includeHelper = new IncludeHelper(include == null ? 1 : include.Sum(x => (int)x));

            if (@params == null)
            {
                @params = new Dictionary <string, object>();
            }

            @params.AddIfNotExist("output", "extend");
            @params.AddOrReplace("selectFilter", includeHelper.WhatShouldInclude(ActionInclude.Filters));
            @params.AddOrReplace("selectOperations", includeHelper.WhatShouldInclude(ActionInclude.Operations));
            @params.AddOrReplace("selectRecoveryOperations", includeHelper.WhatShouldInclude(ActionInclude.RecoveryOperations));
            @params.AddOrReplace("selectAcknowledgeOperations", includeHelper.WhatShouldInclude(ActionInclude.AcknowledgeOperations));

            @params.AddOrReplace("filter", filter);

            return(@params);
        }
コード例 #6
0
        public override IEnumerable <User> Get(object filter = null, IEnumerable <UserInclude> include = null, Dictionary <string, object> @params = null)
        {
            var includeHelper = new IncludeHelper(include == null ? 1 : include.Sum(x => (int)x));

            if (@params == null)
            {
                @params = new Dictionary <string, object>();
            }

            @params.AddIfNotExist("output", "extend");
            @params.AddOrReplace("getAccess", includeHelper.WhatShouldInclude(UserInclude.Access) != null);
            @params.AddOrReplace("selectMedias", includeHelper.WhatShouldInclude(UserInclude.Medias));
            @params.AddOrReplace("selectMediatypes", includeHelper.WhatShouldInclude(UserInclude.MediaTypes));
            @params.AddOrReplace("selectUsrgrps", includeHelper.WhatShouldInclude(UserInclude.UserGroups));

            @params.AddOrReplace("filter", filter);

            return(BaseGet(@params));
        }
コード例 #7
0
        public override IEnumerable <HostGroup> Get(object filter = null, IEnumerable <HostGroupInclude> include = null, Dictionary <string, object> @params = null)
        {
            var includeHelper = new IncludeHelper(include == null ? 1 : include.Sum(x => (int)x));

            if (@params == null)
            {
                @params = new Dictionary <string, object>();
            }

            @params.AddIfNotExist("output", "extend");
            @params.AddOrReplace("selectDiscoveryRule", includeHelper.WhatShouldInclude(HostGroupInclude.DiscoveryRule));
            @params.AddOrReplace("selectGroupDiscovery", includeHelper.WhatShouldInclude(HostGroupInclude.GroupDiscovery));
            @params.AddOrReplace("selectHosts", includeHelper.WhatShouldInclude(HostGroupInclude.Hosts));
            @params.AddOrReplace("selectTemplates", includeHelper.WhatShouldInclude(HostGroupInclude.Templates));

            @params.AddOrReplace("filter", filter);

            return(BaseGet(@params));
        }
コード例 #8
0
        protected override Dictionary <string, object> BuildParams(object filter = null, IEnumerable <EventInclude> include = null, Dictionary <string, object> @params = null)
        {
            var includeHelper = new IncludeHelper(include == null ? 1 : include.Sum(x => (int)x));

            if (@params == null)
            {
                @params = new Dictionary <string, object>();
            }

            @params.AddIfNotExist("output", "extend");
            @params.AddOrReplace("selectHosts", includeHelper.WhatShouldInclude(EventInclude.Hosts));
            @params.AddOrReplace("selectRelatedObject", includeHelper.WhatShouldInclude(EventInclude.RelatedObject));
            @params.AddOrReplace("select_alerts", includeHelper.WhatShouldInclude(EventInclude.Alerts));
            @params.AddOrReplace("select_acknowledges", includeHelper.WhatShouldInclude(EventInclude.Acknowledges));

            @params.AddOrReplace("filter", filter);

            return(@params);
        }
コード例 #9
0
        protected override Dictionary <string, object> BuildParams(object filter = null, IEnumerable <ItemPrototypeInclude> include = null, Dictionary <string, object> @params = null)
        {
            var includeHelper = new IncludeHelper(include == null ? 1 : include.Sum(x => (int)x));

            if (@params == null)
            {
                @params = new Dictionary <string, object>();
            }

            @params.AddIfNotExist("output", "extend");
            @params.AddOrReplace("selectApplications", includeHelper.WhatShouldInclude(ItemPrototypeInclude.Applications));
            @params.AddOrReplace("selectDiscoveryRule", includeHelper.WhatShouldInclude(ItemPrototypeInclude.DiscoveryRule));
            @params.AddOrReplace("selectGraphs", includeHelper.WhatShouldInclude(ItemPrototypeInclude.Graphs));
            @params.AddOrReplace("selectHosts", includeHelper.WhatShouldInclude(ItemPrototypeInclude.Hosts));
            @params.AddOrReplace("selectTriggers", includeHelper.WhatShouldInclude(ItemPrototypeInclude.Triggers));

            @params.AddOrReplace("filter", filter);

            return(@params);
        }
コード例 #10
0
ファイル: MapService.cs プロジェクト: zhonyong0126/ZabbixApi
        protected override Dictionary <string, object> BuildParams(object filter = null, IEnumerable <MapInclude> include = null, Dictionary <string, object> @params = null)
        {
            var includeHelper = new IncludeHelper(include == null ? 1 : include.Sum(x => (int)x));

            if (@params == null)
            {
                @params = new Dictionary <string, object>();
            }

            @params.AddIfNotExist("output", "extend");
            @params.AddOrReplace("expandUrls", includeHelper.WhatShouldInclude(MapInclude.ExpandUrls) != null);
            @params.AddOrReplace("selectIconMap", includeHelper.WhatShouldInclude(MapInclude.IconMap));
            @params.AddOrReplace("selectLinks", includeHelper.WhatShouldInclude(MapInclude.Links));
            @params.AddOrReplace("selectSelements", includeHelper.WhatShouldInclude(MapInclude.Selements));
            @params.AddOrReplace("selectUrls", includeHelper.WhatShouldInclude(MapInclude.Urls));

            @params.AddOrReplace("filter", filter);

            return(@params);
        }
コード例 #11
0
ファイル: LLDRuleService.cs プロジェクト: vfabregat/ZabbixApi
        public override IEnumerable <LLDRule> Get(object filter = null, IEnumerable <LLDRuleInclude> include = null, Dictionary <string, object> @params = null)
        {
            var includeHelper = new IncludeHelper(include == null ? 1 : include.Sum(x => (int)x));

            if (@params == null)
            {
                @params = new Dictionary <string, object>();
            }

            @params.AddIfNotExist("output", "extend");
            @params.AddOrReplace("selectHosts", includeHelper.WhatShouldInclude(LLDRuleInclude.Hosts));
            @params.AddOrReplace("selectGraphs", includeHelper.WhatShouldInclude(LLDRuleInclude.Graphs));
            @params.AddOrReplace("selectHostPrototypes", includeHelper.WhatShouldInclude(LLDRuleInclude.HostPrototypes));
            @params.AddOrReplace("selectItems", includeHelper.WhatShouldInclude(LLDRuleInclude.Items));
            @params.AddOrReplace("selectTriggers", includeHelper.WhatShouldInclude(LLDRuleInclude.Triggers));

            @params.AddOrReplace("filter", filter);

            return(BaseGet(@params));
        }
コード例 #12
0
        protected override Dictionary <string, object> BuildParams(object filter = null, IEnumerable <TriggerPrototypeInclude> include = null, Dictionary <string, object> @params = null)
        {
            var includeHelper = new IncludeHelper(include == null ? 1 : include.Sum(x => (int)x));

            if (@params == null)
            {
                @params = new Dictionary <string, object>();
            }

            @params.AddIfNotExist("output", "extend");
            @params.AddOrReplace("expandExpression", includeHelper.WhatShouldInclude(TriggerPrototypeInclude.expandExpression) != null);
            @params.AddOrReplace("selectGroups", includeHelper.WhatShouldInclude(TriggerPrototypeInclude.Groups));
            @params.AddOrReplace("selectDiscoveryRule", includeHelper.WhatShouldInclude(TriggerPrototypeInclude.DiscoveryRule));
            @params.AddOrReplace("selectFunctions", includeHelper.WhatShouldInclude(TriggerPrototypeInclude.Functions));
            @params.AddOrReplace("selectHosts", includeHelper.WhatShouldInclude(TriggerPrototypeInclude.Hosts));
            @params.AddOrReplace("selectItems", includeHelper.WhatShouldInclude(TriggerPrototypeInclude.Items));

            @params.AddOrReplace("filter", filter);

            return(@params);
        }
コード例 #13
0
        protected override Dictionary <string, object> BuildParams(object filter = null, IEnumerable <HostPrototypeInclude> include = null, Dictionary <string, object> @params = null)
        {
            var includeHelper = new IncludeHelper(include == null ? 1 : include.Sum(x => (int)x));

            if (@params == null)
            {
                @params = new Dictionary <string, object>();
            }

            @params.AddIfNotExist("output", "extend");
            @params.AddOrReplace("selectDiscoveryRule", includeHelper.WhatShouldInclude(HostPrototypeInclude.DiscoveryRule));
            @params.AddOrReplace("selectGroupLinks", includeHelper.WhatShouldInclude(HostPrototypeInclude.GroupLinks));
            @params.AddOrReplace("selectGroupPrototypes", includeHelper.WhatShouldInclude(HostPrototypeInclude.GroupPrototypes));
            @params.AddOrReplace("selectInventory", includeHelper.WhatShouldInclude(HostPrototypeInclude.Inventory) != null);
            @params.AddOrReplace("selectParentHost", includeHelper.WhatShouldInclude(HostPrototypeInclude.ParentHost));
            @params.AddOrReplace("selectTemplates", includeHelper.WhatShouldInclude(HostPrototypeInclude.Templates));

            @params.AddOrReplace("filter", filter);

            return(@params);
        }
コード例 #14
0
ファイル: ItemService.cs プロジェクト: vfabregat/ZabbixApi
        public override IEnumerable <Item> Get(object filter = null, IEnumerable <ItemInclude> include = null, Dictionary <string, object> @params = null)
        {
            var includeHelper = new IncludeHelper(include == null ? 1 : include.Sum(x => (int)x));

            if (@params == null)
            {
                @params = new Dictionary <string, object>();
            }

            @params.AddIfNotExist("output", "extend");
            @params.AddOrReplace("selectHosts", includeHelper.WhatShouldInclude(ItemInclude.Hosts));
            @params.AddOrReplace("selectInterfaces", includeHelper.WhatShouldInclude(ItemInclude.Interfaces));
            @params.AddOrReplace("selectTriggers", includeHelper.WhatShouldInclude(ItemInclude.Triggers));
            @params.AddOrReplace("selectGraphs", includeHelper.WhatShouldInclude(ItemInclude.Graphs));
            @params.AddOrReplace("selectApplications", includeHelper.WhatShouldInclude(ItemInclude.Applications));
            @params.AddOrReplace("selectDiscoveryRule", includeHelper.WhatShouldInclude(ItemInclude.DiscoveryRule));
            @params.AddOrReplace("selectItemDiscovery", includeHelper.WhatShouldInclude(ItemInclude.ItemDiscovery));

            @params.AddOrReplace("filter", filter);

            return(BaseGet(@params));
        }