'Schedules a group action to recreate the specified instances in the
managed instance group. The instances are deleted and recreated using
the current instance template for the managed instance group. This
operation is marked as DONE when the action is scheduled even if the
instances have not yet been recreated. You must separately verify
the status of the recreating action with the listmanagedinstances
method or querying the managed instance group directly.
Scopes needed - one of the following:
* https://www.googleapis.com/auth/cloud-platform
* https://www.googleapis.com/auth/compute
:param  manager:  Required. The name of the managed instance group. The
name must be 1-63 characters long, and comply with
RFC1035.
:type   manager: ``str`` or :class: `GCEInstanceGroupManager`
:keyword  instances:  list of Node objects to be recreated. If equal
to None, all instances in the managed instance
group are recreated.
:type   instances: ``list`` of :class: `Node`, ``list`` of instance
names (only), ``list`` of instance URIs, or None.
:return:  Dictionary containing instance URI and currentAction.
See ex_instancegroupmanager_list_managed_instances for
more details.
:rtype: ``dict``'

def ex_instancegroupmanager_recreate_instances(self, manager, instances=None):

    instance_uris = []
    if ((not isinstance(manager, GCEInstanceGroupManager)) and (not isinstance(manager, str))):
        raise ValueError(("InstanceGroupManager    must    be    of    type    str    or    GCEInstanceGroupManager.    Type    '%s'    provided" % type(manager)))
    if isinstance(manager, str):
        manager = self.ex_get_instancegroupmanager(manager)
    if (instances is None):
        il = self.ex_instancegroupmanager_list_managed_instances(manager)
        instance_uris = [x['instance'] for x in il]
    elif isinstance(instances, list):
        for i in instances:
            if i.startswith('https://'):
                instance_uris.append(i)
            else:
                instance_uris.append(self.ex_get_node(i, manager.zone)['selfLink'])
    else:
        raise ValueError("instances    must    be    'None    or    a    list    of    instance    URIs,    instance    names,    orNode    objects")
    request = ('/zones/%s/instanceGroupManagers/%s/recreateInstances' % (manager.zone.name, manager.name))
    request_data = {'instances': instance_uris}
    self.connection.request(request, method='POST', data=request_data).object
    return self.ex_instancegroupmanager_list_managed_instances(manager)
