public async Task <IEnumerable <ILogDataObject> > ListAllAsync(CancellationToken cancellationToken)
        {
            var runtime = new FunctionRuntimePackage(logger);
            var rgs     = await azure.ResourceGroups.ListAsync(cancellationToken : cancellationToken);

            if (rgs is null)
            {
                throw new InvalidOperationException("Azure API ResourceGroups.ListAsync failed");
            }
            var filter = rgs
                         .Where(rg => naming.ResourceGroupMatches(rg));
            var result = new List <InstanceOutputData>();

            foreach (var rg in filter)
            {
                var name           = naming.FromResourceGroupName(rg.Name);
                var runtimeVersion = await runtime.GetDeployedRuntimeVersion(name, azure, cancellationToken);

                if (runtimeVersion is null)
                {
                    throw new InvalidOperationException("Could not retrieve deployed Runtime version");
                }
                result.Add(new InstanceOutputData(
                               name.PlainName,
                               rg.RegionName,
                               runtimeVersion)
                           );
            }
            return(result);
        }
Ejemplo n.º 2
0
        public async Task <IEnumerable <ILogDataObject> > ListAllAsync(CancellationToken cancellationToken)
        {
            var runtime = new FunctionRuntimePackage(logger);
            var rgs     = await azure.ResourceGroups.ListAsync(cancellationToken : cancellationToken);

            var filter = rgs
                         .Where(rg => naming.ResourceGroupMatches(rg));
            var result = new List <InstanceOutputData>();

            foreach (var rg in filter)
            {
                var name = naming.FromResourceGroupName(rg.Name);
                result.Add(new InstanceOutputData(
                               name.PlainName,
                               rg.RegionName,
                               await runtime.GetDeployedRuntimeVersion(name, azure, cancellationToken))
                           );
            }
            return(result);
        }