Esempio n. 1
0
        public async Task <List <SA_LoadBalancer> > GetLoadBalancerList()
        {
            var request  = new DescribeLoadBalancersRequest();
            var response = await client.DescribeLoadBalancersAsync(request);

            var lstLoadBalancers = ModelTransformer <LoadBalancer, SA_LoadBalancer> .
                                   TransformAwsModelListToSafeArrivalModelList(response.LoadBalancers);

            lstLoadBalancers = lstLoadBalancers.FindAll(o => o.LoadBalancerName.Contains($"{environment}-"));
            return(lstLoadBalancers);
        }
Esempio n. 2
0
        //public async Task<PipelineDeclaration> Get()
        public async Task <List <SA_PipelineSummary> > GetCodePipelineList()
        {
            var response = await client.ListPipelinesAsync();

            var lst = ModelTransformer <PipelineSummary, SA_PipelineSummary> .
                      TransformAwsModelListToSafeArrivalModelList(response.Pipelines).FindAll(o =>
                                                                                              (o.Name.IndexOf($"{environment.ToString()}-") == 0 &&
                                                                                               (o.Name.Contains(color) || (!o.Name.Contains("green") && (!o.Name.Contains("blue"))))));

            lst.Sort((a, b) => b.Created.CompareTo(a.Created));
            //foreach (var codePipeline in lst)
            //{
            //    var request = new ListPipelineExecutionsRequest() { PipelineName = codePipeline.Name };
            //    var x = client.ListPipelineExecutions(request);
            //}
            return(lst.ToList());
        }
Esempio n. 3
0
        public async Task <List <SA_TargetGroup> > GetTargetGroupList(bool ignorColor = false)
        {
            var request  = new DescribeTargetGroupsRequest();
            var response = await client.DescribeTargetGroupsAsync(request);

            var lstTargetGroups = ModelTransformer <TargetGroup, SA_TargetGroup> .
                                  TransformAwsModelListToSafeArrivalModelList(response.TargetGroups);

            if (ignorColor)
            {
                lstTargetGroups = lstTargetGroups.FindAll(o => o.TargetGroupName.Contains($"{environment}-"));
            }
            else
            {
                lstTargetGroups = lstTargetGroups.FindAll(o => o.TargetGroupName.Contains($"{environment}-{color}-"));
            }
            return(lstTargetGroups);
        }