@argh_named("terminate")
    @arg_full_match
    @argh.arg('target', type=str, help='target systems/nodes (regexp)')
    @expects_obj
    def handle_cloud_terminate(self, arg):
        confman = self.get_confman(arg.root_dir, reset_cache=False)
        count = 0
        # group operations by provider
        clouds = {}
        for node in confman.find(arg.target, full_match=arg.full_match):
            cloud_prop = node.get("cloud", {})
            if cloud_prop.get("instance"):
                provider = self.sky.get_provider(cloud_prop)
                if provider not in clouds:
                    clouds[provider] = []
                clouds[provider].append(cloud_prop)
                self.log.info("terminating: %s", node.name)
        for provider, props in clouds.items():
            provider.terminate_instances(props)
            count += len(props)
        self.log.info("%s instances terminated", count)
Google requires grant_type
dataset/ETHPy150Open ohmu/poni/poni/tool.py/Tool.handle_cloud_terminate--crossover with--dataset/ETHPy150Open flashingpumpkin/django-socialregistration/socialregistration/contrib/google/client.py/Google.get_access_token