Handle add alias command

@param Client $client
@param string $index
@param string $alias
@param bool   $replace
165610
public function handle(Client $client, $index, $alias, $replace = false)
    {
        $client
            ->getIndex($index)
            ->addAlias($alias, $replace)
        ;
    }
502408
public function addOrReplace($index, $stringSql)
    {
        if (!$stringSql) {
            return;
        }
        $sql = null;
        if ($this->offsetExists($index)) {
            $sql = $this->offsetGet($index);
            $sql->setSql($stringSql);
        } else {
            $sql = new Sql($stringSql);
            $this->add($sql);
        }

        return $sql;
    }
1121034
public function updateClient(ClientInterface $client)
    {
        if (isset($this->clients[$client->getAccessToken()])) {
            $this->clients[$client->getAccessToken()] = $client;
        }
    }
28998
public function add_field($field, $table, $alias = null) {
        $field = self::resolve_field($field, $table);
        if (!empty($alias)) {
            $field .= ' AS ' . $alias;
        }
        $this->fields[] = $field;
    }
854358
public function createCommand($indexName, $clientName = null)
    {
        if (!in_array($indexName, $this->indexInformer->getAllIndexNames())) {
            $this->outputFormatted("The index <b>%s</b> is not configured in the current application", [$indexName]);
            $this->quit(1);
        }

        $client = $this->clientFactory->create($clientName);
        try {
            $index = new Index($indexName, $client);
            if ($index->exists()) {
                $this->outputFormatted("The index <b>%s</b> exists", [$indexName]);
                $this->quit(1);
            }
            $index->create();
            $this->outputFormatted("Index <b>%s</b> created with success", [$indexName]);
        } catch (Exception $exception) {
            $this->outputFormatted("Unable to create an index named: <b>%s</b>", [$indexName]);
            $this->quit(1);
        }
    }
43354
protected function addNewPath($path, $alias, $mode)
    {
        if ($cleanPath = $this->cleanPathInternal($path)) {
            if ($mode === self::MOD_PREPEND) {
                array_unshift($this->paths[$alias], $cleanPath);
            }

            if ($mode === self::MOD_APPEND) {
                $this->paths[$alias][] = $cleanPath;
            }
        }
    }
1303197
public function injectIndex(Index $index)
    {
        foreach ($this->_indexes as $_index) {
            if ($_index->getId() === $index->getId()) {
                return;
            }
        }
        $this->_indexes[] = $index;
    }
1206299
def update_alias(self, addressid, data):
        """"""
        return self.api_call(
            ENDPOINTS['aliases']['update'],
            dict(addressid=addressid),
            body=data)
1193068
private function add_index($test, &$out, &$exts)
    {
        if (!empty($test['index'])) {
            array_push($exts, 'index');
            $out .= ' :index ' . intval($test['index']) . ($test['last'] ? ' :last' : '');
        }
    }
814572
def set_alias(index_name, delete=True):
    '''
    
    '''
    log.info('Creating alias "{0}" on index "{1}"'.format(
        es.index_name, index_name))
    if es.indices.exists_alias(name=es.index_name):
        alias = es.indices.get_alias(name=es.index_name)
        previous_indices = alias.keys()
        if index_name not in previous_indices:
            es.indices.put_alias(index=index_name, name=es.index_name)
        for index in previous_indices:
            if index != index_name:
                es.indices.delete_alias(index=index, name=es.index_name)
                if delete:
                    es.indices.delete(index=index)
    else:
        es.indices.put_alias(index=index_name, name=es.index_name)
1079995
public static function add($content, $option = array() , $alias = null)
	{
		$object = self::getInstance($alias);
		if($object)
		{
			$object->add($content, $option);
			if(IS_CLI && Config::get('@.LOG_CLI_AUTOSAVE'))
			{
				$object->save();
				$object->data = array();
			}
		}
	}
705517
private function addServiceAlias($alias, Alias $id, \DOMElement $parent)
    {
        $service = $this->document->createElement('service');
        $service->setAttribute('id', $alias);
        $service->setAttribute('alias', $id);
        if (!$id->isPrivate()) {
            $service->setAttribute('public', $id->isPublic() ? 'true' : 'false');
        }

        if ($id->isDeprecated()) {
            $deprecated = $this->document->createElement('deprecated');
            $deprecated->appendChild($this->document->createTextNode($id->getDeprecationMessage('%alias_id%')));

            $service->appendChild($deprecated);
        }

        $parent->appendChild($service);
    }
26427
public function addColumn(string $alias, Expr $column)
    {
        $this->aliasColumnMap[$alias] = $column;

        return $this;
    }
150139
public function add(Command $command, string $alias = '', bool $default = false): self
    {
        $name = $command->name();

        if ($this->commands[$name] ?? $this->aliases[$name] ?? $this->commands[$alias] ?? $this->aliases[$alias] ?? null) {
            throw new InvalidArgumentException(\sprintf('Command "%s" already added', $name));
        }

        if ($alias) {
            $command->alias($alias);
            $this->aliases[$alias] = $name;
        }

        if ($default) {
            $this->default = $name;
        }

        $this->commands[$name] = $command->version($this->version)->onExit($this->onExit)->bind($this);

        return $this;
    }
729509
public function addClient(\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Client\Client $client)
    {
        $this->clients[] = $client;

        return $this;
    }
69713
protected function deleteInClient($index)
    {
        $namespace      = $this->client->indices();
        $indexRealname  = $this->getIndexRealname($index);

        if ($namespace->exists(['index' => $indexRealname])) {
            $namespace->delete(['index' => $indexRealname]);
        }
    }
1114151
public function addFrom($table, $alias = null)
    {
        if ($alias) {
            $this->_tables[$alias] = $table;
        } else {
            $this->_tables[] = $table;
        }

        return $this;
    }