internal override async Task <int> RunAsync(CancellationToken cancellationToken)
        {
            var context = await Context
                          .WithAzureLogon()
                          .BuildAsync(cancellationToken);

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

            if (Disable || Enable)
            {
                ok = await rules.EnableAsync(instance, Name, Disable, cancellationToken);
            }
            return(ok ? 0 : 1);
        }
예제 #2
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 ok       = false;

            if (Disable || Enable)
            {
                ok = await rules.EnableAsync(instance, Name, Disable);
            }
            if (!string.IsNullOrEmpty(Update))
            {
                ok = await rules.UpdateAsync(instance, Name, Update);
            }
            return(ok ? 0 : 1);
        }