Reboot the specified instances.

        :type instance_ids: list
        :param instance_ids: The instances to terminate and reboot
433407
def reboot_instances(self, instance_ids=None):
        
        params = {}
        if instance_ids:
            self.build_list_params(params, instance_ids, 'InstanceId')
        return self.get_status('RebootInstances', params)
597831
def terminate(self, instances, count=0):
        
        if not instances:
            return
        if count > 0:
            instances = self._scale_down(instances, count)
        self.ec2.terminate_instances([i.id for i in instances])
773469
def get_ips(self, instance_id):
        
        instance = self._load_instance(instance_id)
        IPs = sum(instance.networks.values(), [])
        return IPs
1203336
func (s *Command) SetInstanceIds(v []*string) *Command {
	s.InstanceIds = v
	return s
}
57080
def stop_instance(self, instance_id):
        
        self._init_az_api()

        cluster_name, node_name = instance_id
        self._init_inventory(cluster_name)

        for name, api_version in [
                # we must delete resources in a specific order: e.g.,
                # a public IP address cannot be deleted if it's still
                # in use by a NIC...
                (node_name,                '2018-06-01'),
                (node_name + '-nic',       '2018-10-01'),
                (node_name + '-public-ip', '2018-10-01'),
                (node_name + '-disk',      '2018-09-30'),
            (self._make_storage_account_name(
                    cluster_name, node_name),
                                           '2018-07-01'),
        ]:
            rsc_id = self._inventory[name]
            log.debug("Deleting resource %s (`%s`) ...", name, rsc_id)
            oper = self._resource_client.resources.delete_by_id(rsc_id, api_version)
            oper.wait()
            del self._inventory[name]

        self._vm_details.pop(node_name, None)

        # if this was the last VM to be deleted, clean up leftover resource group
        with self.__lock:
            if len(self._inventory) == 2:
                log.debug("Cleaning up leftover resource group ...")
                oper = self._resource_client.resource_groups.delete(cluster_name)
                oper.wait()
                self._inventory = {}
1371697
def reboot(self, nodes=None):
        
        if not self.is_connected():
            return None

        nodes = nodes or self.nodes
        result = []

        for node in nodes:
            if node.state == 'stopped':
                logging.warning('Node %s is "stopped" and can not be rebooted.', node.name)
                continue
            try:
                status = self.gce.reboot_node(node)
                if status:
                    result.append(node)
            except InvalidRequestError as err:
                raise ComputeEngineManagerException(err)

        return result
222202
def lock(self, instance_id):
        '''
        
        '''
        nt_ks = self.compute_conn
        response = nt_ks.servers.lock(instance_id)
        return True
860935
def reboot(self, subid, params=None):
        ''' 
        '''
        params = update_params(params, {'SUBID': subid})
        return self.request('/v1/server/reboot', params, 'POST')
1036378
def restart_instance(self, instance):
        
        params = {'state': 'restarted'}
        url = '/instances/{}'.format(instance)
        self.patch_proto(url, params=params)
1071983
def restore_replicas(self) -> None:
        '''
        
        '''
        self.backup_instances_faulty.clear()
        for inst_id in range(self.node.requiredNumberOfInstances):
            if inst_id not in self.node.replicas.keys():
                self.node.replicas.add_replica(inst_id)
1256884
public List<InstanceStateChangeType> stopInstances(final Set<String> instanceIDs) {

        List<InstanceStateChangeType> ret = new ArrayList<InstanceStateChangeType>();

        Collection<AbstractMockEc2Instance> instances = getInstances(instanceIDs);
        for (AbstractMockEc2Instance instance : instances) {
            if (null != instance) {
                InstanceStateChangeType stateChange = new InstanceStateChangeType();
                stateChange.setInstanceId(instance.getInstanceID());

                InstanceStateType previousState = new InstanceStateType();
                previousState.setCode(instance.getInstanceState().getCode());
                previousState.setName(instance.getInstanceState().getName());
                stateChange.setPreviousState(previousState);

                instance.stop();

                InstanceStateType newState = new InstanceStateType();
                newState.setCode(instance.getInstanceState().getCode());
                newState.setName(instance.getInstanceState().getName());
                stateChange.setCurrentState(newState);

                ret.add(stateChange);
            }
        }

        return ret;

    }
1176298
func (s *DescribeTimeBasedAutoScalingInput) SetInstanceIds(v []*string) *DescribeTimeBasedAutoScalingInput {
	s.InstanceIds = v
	return s
}
402200
def get_multi_instances_by_id(self, instance_ids):
        
        result = []

        for reservation in self.all_reservations():
            for instance in reservation.instances:
                if instance.id in instance_ids:
                    result.append(instance)

        # TODO: Trim error message down to specific invalid id.
        if instance_ids and len(instance_ids) > len(result):
            raise InvalidInstanceIdError(instance_ids)

        return result
1017960
def get_ips(self, instance_id):
        
        self._init_os_api()
        instance = self._load_instance(instance_id)
        try:
            ip_addrs = set([self.floating_ip])
        except AttributeError:
            ip_addrs = set([])
        for ip_addr in sum(instance.networks.values(), []):
            ip_addrs.add(ip_addr)
        log.debug("VM `%s` has IP addresses %r", instance_id, ip_addrs)
        return list(ip_addrs)
442045
def delete_instance(self, instance_id):

        '''
            
        '''

        title = '%s.delete_instance' % self.__class__.__name__

    # validate inputs
        input_fields = {
            'instance_id': instance_id
        }
        for key, value in input_fields.items():
            object_title = '%s(%s=%s)' % (title, key, str(value))
            self.fields.validate(value, '.%s' % key, object_title)

    # report query
        self.iam.printer('Removing instance %s from AWS region %s.' % (instance_id, self.iam.region_name))

    # retrieve state
        old_state = self.check_instance_state(instance_id)

    # discover tags associated with instance id
        tag_list = []
        try:
            response = self.connection.describe_tags(
                Filters=[ { 'Name': 'resource-id', 'Values': [ instance_id ] } ]
            )
            import re
            aws_tag_pattern = re.compile('aws:')
            for i in range(0, len(response['Tags'])):
                if not aws_tag_pattern.findall(response['Tags'][i]['Key']):
                    tag = {}
                    tag['Key'] = response['Tags'][i]['Key']
                    tag['Value'] = response['Tags'][i]['Value']
                    tag_list.append(tag)
        except:
            raise AWSConnectionError(title)

    # remove tags from instance
        try:
            self.connection.delete_tags(
                Resources=[ instance_id ],
                Tags=tag_list
            )
            self.iam.printer('Tags have been deleted from %s.' % instance_id)
        except:
            raise AWSConnectionError(title)

    # stop instance
        try:
            self.connection.stop_instances(
                InstanceIds=[ instance_id ]
            )
        except:
            raise AWSConnectionError(title)

    # terminate instance
        try:
            response = self.connection.terminate_instances(
                InstanceIds=[ instance_id ]
            )
            new_state = response['TerminatingInstances'][0]['CurrentState']['Name']
        except:
            raise AWSConnectionError(title)

    # report outcome and return true
        self.iam.printer('Instance %s was %s.' % (instance_id, old_state))
        self.iam.printer('Instance %s is %s.' % (instance_id, new_state))
        return new_state
977916
def unmonitor_instances(self, instance_ids):
        
        params = {}
        self.build_list_params(params, instance_ids, 'InstanceId')
        return self.get_list('UnmonitorInstances', params,
                             [('item', InstanceInfo)], verb='POST')
610326
def ids(cls, values, itype=None):
        '''
        

        '''
        instance = cls(ids={'values': values})
        if itype is not None:
            instance['ids']['type'] = itype

        return instance