> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/cn/zec/public-ipv6/deleteipv6addresses.md).

# DeleteIpv6Addresses

## 1. 接口描述

本接口(DeleteIpv6Addresses)用于批量删除公网IPv6。逐个独立处理，部分失败不影响其余项，失败项通过failedIpv6Addresses返回其错误码与错误信息。

{% hint style="info" %}
**注意事项**

* 网卡上的公网IPv6被删除后，网卡的堆栈类型会从 `IPv4_IPv6` 降级为 `IPv4`。仅有IPv6地址的网卡不允许删除其公网IPv6。
* 负载均衡上的公网IPv6可以单独删除；负载均衡本身被删除时，其上的公网IPv6会一并回收，无需单独调用本接口。
* 传入的公网IPv6逐个独立处理，部分失败不影响其余项的删除。失败项通过 `failedIpv6Addresses` 返回各自的错误码与错误信息，接口本身仍返回成功。
  {% endhint %}

## 2. 请求参数

以下请求参数列表仅列出了接口中需要的请求参数

| 参数名称    | 必选 | 类型              | 描述                                                                                                                                     |
| ------- | -- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| ipv6Ids | 是  | Array of String | <p>要删除的公网IPv6的ID列表。</p><p>可通过调用 <a href="/api-reference/cn/zec/public-ipv6/describeipv6addresses.md">DescribeIpv6Addresses</a> 获取。</p> |

## 3. 响应结果

| 参数名称                | 类型                                                                                                             | 描述                                                       |
| ------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| requestId           | String                                                                                                         | <p>唯一请求 ID。</p><p>每次请求都会返回。定位问题时需要提供该次请求的 requestId。</p> |
| failedIpv6Addresses | Array of [DeleteIpv6AddressesFailedItem](/api-reference/cn/zec/datastructure.md#deleteipv6addressesfaileditem) | <p>删除失败的公网IPv6详情列表。</p><p>若全量成功则为空。</p>                  |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}
**1. 批量删除公网IPv6，全部成功。**

```json
POST /api/v2/zec HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DeleteIpv6Addresses
<Common Request Params>

Request：
{
  "ipv6Ids": [
    "<ipv6Id1>",
    "<ipv6Id2>"
  ]
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "failedIpv6Addresses": []
  }
}
```

**2. 部分失败：成功项已删除，失败项在failedIpv6Addresses中返回原因。**

```json
POST /api/v2/zec HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DeleteIpv6Addresses
<Common Request Params>

Request：
{
  "ipv6Ids": [
    "<ipv6Id1>",
    "<ipv6Id2>"
  ]
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "failedIpv6Addresses": [
      {
        "ipv6Id": "<ipv6Id2>",
        "errorCode": "INVALID_NIC_STACK_TYPE_NOT_SUPPORT",
        "errorMsg": "The specified nic `<nicId>` stack type does not support this operation"
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. 开发者工具

Zenlayer Cloud API 2.0 提供了配套的[开发工具集（SDK）](/api-reference/cn/api-introduction/toolkit.md)，未来会陆续支持更多开发语言，方便快速接入和使用Zenlayer的产品和服务。

## 6. 错误码

下面包含业务逻辑中遇到的错误码，其他错误码见[公共错误码](/api-reference/cn/api-introduction/instruction/commonerrorcode.md)

| HTTP状态码 | 错误码 | 说明 |
| ------- | --- | -- |
