Supply two names: Existing instance name or ID, and new name to assign to the instance.
548564
def rename(args):
    """"""
    old_name, new_name = args.names
    add_tags(resources.ec2.Instance(resolve_instance_id(old_name)), Name=new_name, dry_run=args.dry_run)
1292256
def rename(self, new_name):
    
    update = copy.copy(self)
    update.name = new_name
    return self._do_update(update)
689960
def set_instances(name, instances, test=False, region=None, key=None, keyid=None,
                         profile=None):
    '''
    
    '''
    ret = True
    current = set([i['instance_id'] for i in get_instance_health(name, region, key, keyid, profile)])
    desired = set(instances)
    add = desired - current
    remove = current - desired
    if test:
        return bool(add or remove)
    if remove:
        if deregister_instances(name, list(remove), region, key, keyid, profile) is False:
            ret = False
    if add:
        if register_instances(name, list(add), region, key, keyid, profile) is False:
            ret = False
    return ret
865760
def extend_initials(with_first, for_last)
      rename_if :first => with_first do |name|
        if name.last == for_last
          mine = name.initials.split(/\.[^[:alpha:]]*/)
          other = initials(with_first).split(/\.[^[:alpha:]]*/)

          mine == other || mine.length < other.length && mine == other[0, mine.length]
        end
      end
    end
516959
def set_name(self, new_name):
        

        # change the hostname in the startup-config
        if os.path.isfile(self.startup_config_path):
            try:
                with open(self.startup_config_path, "r+", encoding="utf-8", errors="replace") as f:
                    old_config = f.read()
                    new_config = re.sub(r"^hostname .+$", "hostname " + new_name, old_config, flags=re.MULTILINE)
                    f.seek(0)
                    f.write(new_config)
            except OSError as e:
                raise DynamipsError("Could not amend the configuration {}: {}".format(self.startup_config_path, e))

        # change the hostname in the private-config
        if os.path.isfile(self.private_config_path):
            try:
                with open(self.private_config_path, "r+", encoding="utf-8", errors="replace") as f:
                    old_config = f.read()
                    new_config = old_config.replace(self.name, new_name)
                    f.seek(0)
                    f.write(new_config)
            except OSError as e:
                raise DynamipsError("Could not amend the configuration {}: {}".format(self.private_config_path, e))

        yield from self._hypervisor.send('vm rename "{name}" "{new_name}"'.format(name=self._name, new_name=new_name))
        log.info('Router "{name}" [{id}]: renamed to "{new_name}"'.format(name=self._name, id=self._id, new_name=new_name))
        self._name = new_name
479785
def set_name(self, new_name):
        

        yield from self._hypervisor.send('ethsw rename "{name}" "{new_name}"'.format(name=self._name, new_name=new_name))
        log.info('Ethernet switch "{name}" [{id}]: renamed to "{new_name}"'.format(name=self._name,
                                                                                   id=self._id,
                                                                                   new_name=new_name))
        self._name = new_name
926848
def newNodeEatName(self, name):
        
        ret = libxml2mod.xmlNewNodeEatName(self._o, name)
        if ret is None:raise treeError('xmlNewNodeEatName() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
244538
def rename(self, name):
        """"""

        r = self._h._http_resource(
            method='PUT',
            resource=('apps', self.name),
            data={'app[name]': name}
        )
        return r.ok
330513
def add_name(self, name_attr, space_attr, new_schema):
        # type: (Text, Optional[Text], NamedSchema) -> Name
        
        to_add = Name(name_attr, space_attr, self.default_namespace)

        if to_add.fullname in VALID_TYPES:
            fail_msg = '%s is a reserved type name.' % to_add.fullname
            raise SchemaParseException(fail_msg)
        elif to_add.fullname in self.names:
            fail_msg = 'The name "%s" is already in use.' % to_add.fullname
            raise SchemaParseException(fail_msg)

        self.names[to_add.fullname] = new_schema
        return to_add
196752
def add_previous_name(self, name):
        
        self._ensure_field('name', {})
        self.obj['name'].setdefault('previous_names', []).append(name)
707589
def rename(id, name)
      wf_proxy_id?(id)
      wf_string?(name)
      update(id, name: name)
    end
936862
public void addInstance(InstanceInfo i) {
        instancesMap.put(i.getId(), i);
        synchronized (instances) {
            instances.remove(i);
            instances.add(i);
            isDirty = true;
        }
    }
930359
def name(self, new_name):
        

        log.info("{module}: {name} [{id}] renamed to {new_name}".format(module=self.manager.module_name,
                                                                        name=self.name,
                                                                        id=self.id,
                                                                        new_name=new_name))
        self._name = new_name
823993
private void finalizeNameAssignment(Assignment a, String newName) {
    a.setNewName(newName);

    // Keep track of the mapping
    renameMap.put(a.oldName, newName);
  }
811990
def change_name(self, new_name):
        """"""
        if not new_name:
            name = self.hostname
        else:
            name = new_name.decode()
        self.display_name = display_names.change(
            self.display_name, name)
894879
public static String getInstanceName(String instanceName, Config config) {
        String name = instanceName;

        if (name == null || name.trim().length() == 0) {
            name = createInstanceName(config);
        }

        return name;
    }
259425
private Property newProperty(String propertyName, String instanceName, String entity) {
        return new Property(toAlias(propertyName), instanceName, entity);
    }