Example #1
0
        internal override async Task <int> RunAsync()
        {
            var context = await Context
                          .WithAzureLogon()
                          .Build();

            var  instance = new InstanceName(Instance);
            var  rules    = new AggregatorRules(context.Azure, context.Logger);
            bool any      = false;

            foreach (var item in await rules.List(instance))
            {
                context.Logger.WriteOutput(
                    item,
                    (data) => $"Rule {item.Name} {(item.Config.Disabled ? "(disabled)" : string.Empty)}");
                any = true;
            }
            if (!any)
            {
                context.Logger.WriteInfo($"No rules found in aggregator instance {instance.PlainName}.");
            }
            return(0);
        }