예제 #1
0
    def _create_elb_sections(names, tags):
        region = "region"
        config = AWSConfig("hostname", [], (None, None))
        config.add_single_service_config("elb_names", names)
        config.add_service_tags("elb_tags", tags)

        fake_elb_client = FakeELBClient()
        fake_cloudwatch_client = FakeCloudwatchClient()

        elb_limits_distributor = ResultDistributor()
        elb_summary_distributor = ResultDistributor()

        elb_limits = ELBLimits(fake_elb_client, region, config, elb_limits_distributor)
        elb_summary = ELBSummaryGeneric(
            fake_elb_client, region, config, elb_summary_distributor, resource="elb"
        )
        elb_labels = ELBLabelsGeneric(fake_elb_client, region, config, resource="elb")
        elb_health = ELBHealth(fake_elb_client, region, config)
        elb = ELB(fake_cloudwatch_client, region, config)

        elb_limits_distributor.add(elb_summary)
        elb_summary_distributor.add(elb_labels)
        elb_summary_distributor.add(elb_health)
        elb_summary_distributor.add(elb)
        return elb_limits, elb_summary, elb_labels, elb_health, elb
예제 #2
0
    def _create_elbv2_sections(names, tags):
        region = 'region'
        config = AWSConfig('hostname', [], (None, None))
        config.add_single_service_config('elbv2_names', names)
        config.add_service_tags('elbv2_tags', tags)

        fake_elbv2_client = FakeELBv2Client()
        fake_cloudwatch_client = FakeCloudwatchClient()

        elbv2_limits_distributor = ResultDistributor()
        elbv2_summary_distributor = ResultDistributor()

        elbv2_limits = ELBv2Limits(fake_elbv2_client, region, config, elbv2_limits_distributor)
        elbv2_summary = ELBSummaryGeneric(fake_elbv2_client,
                                          region,
                                          config,
                                          elbv2_summary_distributor,
                                          resource='elbv2')
        elbv2_labels = ELBLabelsGeneric(fake_elbv2_client, region, config, resource='elbv2')
        elbv2_target_groups = ELBv2TargetGroups(fake_elbv2_client, region, config)
        elbv2_application = ELBv2Application(fake_cloudwatch_client, region, config)
        elbv2_network = ELBv2Network(fake_cloudwatch_client, region, config)

        elbv2_limits_distributor.add(elbv2_summary)
        elbv2_summary_distributor.add(elbv2_labels)
        elbv2_summary_distributor.add(elbv2_target_groups)
        elbv2_summary_distributor.add(elbv2_application)
        elbv2_summary_distributor.add(elbv2_network)
        return elbv2_limits, elbv2_summary, elbv2_labels, elbv2_target_groups, elbv2_application, elbv2_network
예제 #3
0
    def _create_elbv2_sections(names, tags):
        region = "region"
        config = AWSConfig("hostname", [], (None, None))
        config.add_single_service_config("elbv2_names", names)
        config.add_service_tags("elbv2_tags", tags)

        fake_elbv2_client = FakeELBv2Client()
        fake_cloudwatch_client = FakeCloudwatchClient()

        elbv2_limits_distributor = ResultDistributor()
        elbv2_summary_distributor = ResultDistributor()

        elbv2_limits = ELBv2Limits(fake_elbv2_client, region, config,
                                   elbv2_limits_distributor)
        elbv2_summary = ELBSummaryGeneric(fake_elbv2_client,
                                          region,
                                          config,
                                          elbv2_summary_distributor,
                                          resource="elbv2")
        elbv2_labels = ELBLabelsGeneric(fake_elbv2_client,
                                        region,
                                        config,
                                        resource="elbv2")
        elbv2_target_groups = ELBv2TargetGroups(fake_elbv2_client, region,
                                                config)
        elbv2_application = ELBv2Application(fake_cloudwatch_client, region,
                                             config)
        elbv2_application_target_groups_http = ELBv2ApplicationTargetGroupsHTTP(
            fake_cloudwatch_client, region, config)
        elbv2_application_target_groups_lambda = ELBv2ApplicationTargetGroupsLambda(
            fake_cloudwatch_client, region, config)
        elbv2_network = ELBv2Network(fake_cloudwatch_client, region, config)

        elbv2_limits_distributor.add(elbv2_summary)
        elbv2_summary_distributor.add(elbv2_labels)
        elbv2_summary_distributor.add(elbv2_target_groups)
        elbv2_summary_distributor.add(elbv2_application)
        elbv2_summary_distributor.add(elbv2_application_target_groups_http)
        elbv2_summary_distributor.add(elbv2_application_target_groups_lambda)
        elbv2_summary_distributor.add(elbv2_network)
        return {
            "elbv2_limits":
            elbv2_limits,
            "elbv2_summary":
            elbv2_summary,
            "elbv2_labels":
            elbv2_labels,
            "elbv2_target_groups":
            elbv2_target_groups,
            "elbv2_application": (
                elbv2_application,
                elbv2_application_target_groups_http,
                elbv2_application_target_groups_lambda,
            ),
            "elbv2_network":
            elbv2_network,
        }