Пример #1
0
    def list_all():
        ascale_conn = Cluster._autoscale()

        pgrps = [x for x in Cluster.get_placement_groups() if x.name.startswith(UserCluster.NAME_PFX)]
        UserCluster.log_info("%d placement groups", len(pgrps))
        for grp in pgrps:
            UserCluster.log_info("\t%s, %s, %s", grp.name, grp.strategy, repr(grp.state))

        configs = [x for x in ascale_conn.get_all_launch_configurations() if x.name.startswith(UserCluster.NAME_PFX)]
        UserCluster.log_info("%d launch configurations", len(configs))
        for config in configs:
            UserCluster.log_info("\t%s", config.name)

        agrps = [x for x in ascale_conn.get_all_groups() if x.name.startswith(UserCluster.NAME_PFX)]
        UserCluster.log_info("%d autoscale groups", len(agrps))
        for grp in agrps:
            UserCluster.log_info("\t%s", grp.name)

        return pgrps, configs, agrps
Пример #2
0
 def set_capacity(self, ninst):
     conn = Cluster._autoscale()
     conn.set_desired_capacity(self.gname, ninst, False)