# update()

Canonical URL: https://developers.iagenify.com/zh/sdk/ref/host/update/
Language: zh

`host.update({ label }) → Promise<Host>`

重命名主机。仅标签——子弹是地址,它不会改变。

Status: PATCH · label only · the slug is the URL

```javascript
await site.update({ label: "Portfolio (2026)" });
```

## 为何打球的子弹是固定的, {#why}

> **改变它会同时打破三件事**
>
> 链接已经共享,客户域名已经连接,主机名证书已经签发,三个链接都已经停止工作,三个链接都无法大声使用,它们只是停止工作。

## 另一地址, 另一个主机主机 {#another}

```javascript
const next = await api.hosts.create({ kind: "site", slug: "portfolio-2026", label: "Portfolio" });
await next.deploy({ files: "./out" });
// Then move the domain, and remove the old host when nothing points at it.
```

## 标签是用来做什么的 {#label}

显示在列表中。 没有什么取决于它, 所以改变它是安全的—— 正因为如此,它才能改变。

## 更新对象 {#object}

`host.label` 被回来的东西取代

- [create()](/zh/sdk/ref/hosts/create): 选一个子弹
- [domains.attach()](/zh/sdk/ref/host/domains/attach): 自己的地址 自己写个地址

```python
site.update(label="Portfolio (2026)")
```

```python
nxt = api.hosts.create(runtime="static", slug="portfolio-2026", label="Portfolio")
nxt.deploy(files="./out")
# Then move the domain, and remove the old host when nothing points at it.
```
