
# 创建虚拟接口 - CreateVirtualInterface
#### 功能介绍
虚拟接口配置物理专线上与客户互联的IP和路由等相关信息。
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-dc/zh-cn_topic_0055025302.html)。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-dc/dc_08_3000.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项              | 访问级别  | 资源类型（\*为必须）    | 条件键                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | 别名 | 依赖的授权项 |
  |:---|:---|:---|:---|:---|:---|
  | dcaas:vif:create | Write | vif \*         | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | -  | -      |
  | dcaas:vif:create | Write | directConnect  | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | -  | -      |
  | dcaas:vif:create | Write | lag            | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | -  | -      |
  | dcaas:vif:create | Write | vgw            | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | -  | -      |
  | dcaas:vif:create | Write | gdgw           | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | -  | -      |
  | dcaas:vif:create | Write | connectGateway | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | -  | -      |
  | dcaas:vif:create | Write | lgw            | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | -  | -      |
  | dcaas:vif:create | Write | -              | - g:EnterpriseProjectId   - g:RequestTag/\<tag-key\>   - g:TagKeys    | -  | -      |
     
  
 
#### URI
POST /v3/{project_id}/dcaas/virtual-interfaces
表1路径参数 
| 参数         | 是否必选 | 参数类型   | 描述                                                                                                                                                                          |
|:---|:---|:---|:---|
| project_id | 是    | String | 租户项目ID 最小长度：**0** 最大长度：**36** |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                      |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。 获取Token，请参考《统一身份认证服务API参考》的"获取用户Token"章节。请求响应成功后在响应消息头中包含的"X-Subject-Token"的值即为Token值。 最小长度：**0** 最大长度：**10240** |
   
表3请求Body参数 
| 参数                | 是否必选 | 参数类型                                                                                                                  | 描述         |
|:---|:---|:---|:---|
| virtual_interface | 是    | [CreateVirtualInterface] object | 创建虚拟接口对象参数 |
   
 表4CreateVirtualInterface 
| 参数                    | 是否必选 | 参数类型                                                                                      | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|:---|:---|:---|:---|
| name                  | 否    | String                                                                                    | 虚拟接口名称 最小长度：**0** 最大长度：**64**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| description           | 否    | String                                                                                    | 虚拟接口描述信息 最小长度：**0** 最大长度：**2048**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| direct_connect_id     | 否    | String                                                                                    | 虚拟接口关联的物理专线ID。在创建虚拟接口时，需要关联direct_connect_id或lag_id，当LAG功能在当前局点不支持时，该参数为必选。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| type                  | 是    | String                                                                                    | 虚拟接口的类型。默认取值：private                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| service_type          | 否    | String                                                                                    | 接入网关的类型。 **取值范围：** - VGW：虚拟网关   - GDGW：全域接入网关   - LGW：本地网关    **约束限制：** VGW场景不能配置该参数。 |
| vlan                  | 是    | Integer                                                                                   | 对接客户侧vlan。当关联物理连接选择托管专线时，vlan需要和托管专线保持一致。 最小值：**0** 最大值：**3999**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| bandwidth             | 是    | Integer                                                                                   | 虚拟接口接入带宽 最小值：**2** 最大值：**2147483647**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| priority              | 否    | String                                                                                    | 虚拟接口的优先级，支持两种优先级状态normal和low。 接口优先级相同时表示负载关系，接口优先级不同时表示主备关系，出云流量优先转到优先级更高的normal接口。 目前仅BGP模式接口支持。 缺省值：**normal**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| local_gateway_v4_ip   | 否    | String                                                                                    | 云侧网关IPv4接口地址,如果address_family是IPv4，是必选参数                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| remote_gateway_v4_ip  | 否    | String                                                                                    | 客户侧网关IPv4接口地址,如果address_family是IPv4，是必选参数                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| address_family        | 否    | String                                                                                    | 接口的地址簇类型，ipv4，ipv6 缺省值：**ipv4**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| local_gateway_v6_ip   | 否    | String                                                                                    | 云侧网关IPv6接口地址,如果address_family是IPv6，是必选参数                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| remote_gateway_v6_ip  | 否    | String                                                                                    | 客户侧网关IPv6接口地址,如果address_family是IPv6，是必选参数                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| vgw_id                | 否    | String                                                                                    | 虚拟接口连接的虚拟网关的ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| gateway_id            | 否    | String                                                                                    | 虚拟接口关联的网关的ID。 当虚拟接口接入网关类型为全域接入网关时该参数必填，gateway_id值为全域接入网关的id                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| route_mode            | 是    | String                                                                                    | 路由模式：static/bgp 缺省值：**static**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| bgp_asn               | 否    | Integer                                                                                   | 客户侧BGP邻居的AS号 最小值：**1** 最大值：**4294967295**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| bgp_md5               | 否    | String                                                                                    | BGP邻居的MD5密码                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| remote_ep_group       | 否    | Array of strings                                                                          | 远端子网列表，记录租户侧的cidrs                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| service_ep_group      | 否    | Array of strings                                                                          | 访问公网服务的子网列表                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| enable_bfd            | 否    | Boolean                                                                                   | 是否使能bfd功能：true或false。 缺省值：**false**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| enable_nqa            | 否    | Boolean                                                                                   | 是否使能nqa功能：true或false。 缺省值：**false**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| lag_id                | 否    | String                                                                                    | 虚拟接口关联的链路聚合组ID 最小长度：**36** 最大长度：**36**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| resource_tenant_id    | 否    | String                                                                                    | 目标的租户的ID,用于跨租户创建虚拟接口场景                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| enterprise_project_id | 否    | String                                                                                    | **参数解释：** 实例所属企业项目ID。 **取值范围：** 最大长度36字节，带"-"连字符的UUID格式，或者是字符串"0"，"0"表示默认企业项目。 最小长度：**36** 最大长度：**36**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| tags                  | 否    | Array of [Tag] objects | 标签信息 数组长度：**0 - 10**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
   
 表5Tag 
| 参数    | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                               |
|:---|:---|:---|:---|
| key   | 是    | String | 标签键，取值可以包含任意语种字母、数字、空格，以及_.:=+-@特殊字符，但首尾不能含有空格，不能以_sys_开头。 最小长度：**1** 最大长度：**128** |
| value | 否    | String | 标签值，格式为取值可以包含任意语种字母、数字、空格，以及_.:/=+-@特殊字符。 最小长度：**0** 最大长度：**255**                  |
   
#### 响应参数
**状态码：201**
表6响应Body参数 
| 参数                | 参数类型                                                                                                       | 描述     |
|:---|:---|:---|
| request_id        | String                                                                                                     | 操作请求ID |
| virtual_interface | [VirtualInterface] object | 虚拟接口对象 |
   
 表7VirtualInterface 
| 参数                    | 参数类型                                                                                                           | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
|:---|:---|:---|
| id                    | String                                                                                                         | 虚拟接口的ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| name                  | String                                                                                                         | 虚拟接口的名称                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| admin_state_up        | Boolean                                                                                                        | 管理状态：true或false                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| bandwidth             | Integer                                                                                                        | 虚拟接口接入带宽                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| create_time           | String                                                                                                         | 虚拟接口创建时间。采用UTC时间格式，格式为：yyyy-MM-ddTHH:mm:ss.SSSZ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| update_time           | String                                                                                                         | 虚拟接口修改时间。采用UTC时间格式，格式为：yyyy-MM-ddTHH:mm:ss.SSSZ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| description           | String                                                                                                         | 虚拟接口的描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| direct_connect_id     | String                                                                                                         | 物理专线的ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| service_type          | String                                                                                                         | 接入网关的类型。 **取值范围：** - VGW：虚拟网关   - GDGW：全域接入网关   - LGW：本地网关                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| status                | String                                                                                                         | 操作状态。取值范围： - ACTIVE：正常   - DOWN：不可用   - BUILD：开通中   - ERROR：异常   - PENDING_CREATE：创建中   - PENDING_UPDATE：修改中   - PENDING_DELETE：删除中   - AUTHORIZATION：认证中   - REJECTED：拒绝    |
| tenant_id             | String                                                                                                         | 租户ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| type                  | String                                                                                                         | 表示接口类型：private                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| vgw_id                | String                                                                                                         | 虚拟网关的ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| vlan                  | Integer                                                                                                        | 同用户网关对接的vlan, 配置范围0-3999                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| route_limit           | Integer                                                                                                        | VIF远端子网路由配置规格                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| enable_nqa            | Boolean                                                                                                        | 是否使能nqa功能：true或false                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| enable_bfd            | Boolean                                                                                                        | 是否使能bfd功能：true或false                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| lag_id                | String                                                                                                         | VIF关联的链路聚合组ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| device_id             | String                                                                                                         | 归属的设备ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| enterprise_project_id | String                                                                                                         | **参数解释：** 实例所属企业项目ID。 **取值范围：** 最大长度36字节，带"-"连字符的UUID格式，或者是字符串"0"，"0"表示默认企业项目。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| tags                  | Array of [Tag] objects                     | 标签信息                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| local_gateway_v4_ip   | String                                                                                                         | 云侧网关IPv4接口地址，该字段现已经移到vifpeer参数列表中，未来将会废弃。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| remote_gateway_v4_ip  | String                                                                                                         | 客户侧网关IPv4接口地址，该字段现已经移到vifpeer参数列表中，未来将会废弃。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ies_id                | String                                                                                                         | 归属的CloudPond站点的ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| reason                | String                                                                                                         | 如果资源的状态是Error的情况下，该参数会显示相关错误信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| rate_limit            | Boolean                                                                                                        | 标识虚拟接口是否开启限速                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| address_family        | String                                                                                                         | 接口的地址簇类型，ipv4，ipv6。该字段现已迁移到vifpeer参数列表中，未来将会废弃。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| local_gateway_v6_ip   | String                                                                                                         | 云侧网关IPv6接口地址，该字段现已迁移到vifpeer参数列表中，未来将会废弃。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| remote_gateway_v6_ip  | String                                                                                                         | 客户侧网关IPv6接口地址，该字段现已迁移到vifpeer参数列表中，未来将会废弃。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| lgw_id                | String                                                                                                         | 本地网关的ID，用于CloudPond场景。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| gateway_id            | String                                                                                                         | 虚拟接口关联的网关的ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| remote_ep_group       | Array of strings                                                                                               | 远端子网列表，记录租户侧的cidrs。该字段现已迁移到vifpeer参数列表中，未来将会废弃。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| service_ep_group      | Array of strings                                                                                               | 该字段用于公网专线接口，表示租户可以访问云上公网服务地址列表。该字段现已迁移到vifpeer参数列表中，未来将会废弃。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| bgp_route_limit       | Integer                                                                                                        | BGP的路由配置规格                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| priority              | String                                                                                                         | 虚拟接口的优先级，支持两种优先级状态normal和low。 接口优先级相同时表示负载关系，接口优先级不同时表示主备关系，出云流量优先转到优先级更高的normal接口。 目前仅BGP模式接口支持。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| vif_peers             | Array of [VifPeer] objects             | vif的Peer的相关信息                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| extend_attribute      | [VifExtendAttribute] object | 虚拟接口BFD/NQA等可靠性检测的扩展信息                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
   
 表8Tag 
| 参数    | 参数类型   | 描述                                                         |
|:---|:---|:---|
| key   | String | 标签键，取值可以包含任意语种字母、数字、空格，以及_.:=+-@特殊字符，但首尾不能含有空格，不能以_sys_开头。 |
| value | String | 标签值，格式为取值可以包含任意语种字母、数字、空格，以及_.:/=+-@特殊字符。                  |
   
 表9VifPeer 
| 参数                | 参数类型             | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
|:---|:---|:---|
| id                | String           | 资源ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| tenant_id         | String           | 归属租户ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| name              | String           | 虚拟接口对等体名称                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| description       | String           | 虚拟接口对等体描述信息                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| address_family    | String           | 接口的地址簇类型，ipv4，ipv6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| local_gateway_ip  | String           | 虚拟接口对等体云侧接口地址                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| remote_gateway_ip | String           | 虚拟接口对等体客户侧接口地址                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| route_mode        | String           | 路由模式：static/bgp                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| bgp_asn           | Integer          | BGP邻居的AS号                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| bgp_md5           | String           | BGP邻居的MD5密码                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| remote_ep_group   | Array of strings | 远端子网列表，记录租户侧的cidrs                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| service_ep_group  | Array of strings | 该字段用于公网专线接口,表示租户可以访问云上公网服务地址列表                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| device_id         | String           | 归属的设备ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| bgp_route_limit   | Integer          | BGP的路由配置规格                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| bgp_status        | String           | 接口BGP协议状态,如果是静态路由接口则状态为 null                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| status            | String           | 虚拟接口对等体状态。取值范围： - ACTIVE：正常   - ERROR：异常    |
| vif_id            | String           | 虚拟接口对等体对应的虚拟接口ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| receive_route_num | Integer          | 路由模式为bgp时，receive_route_num值为接收搭配BGP的路由数目；路由模式为static时，该字段无意义，值为-1。 早期接入云的部分用户可能无法获取该字段信息，如有需要请联系客服迁移专线端口。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| enable_nqa        | Boolean          | 是否使能nqa功能：true或false                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| enable_bfd        | Boolean          | 是否使能bfd功能：true或false                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
   
 表10VifExtendAttribute 
| 参数                   | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
|:---|:---|:---|
| ha_type              | String  | 虚拟接口的可用性检测类型。取值范围： - nqa：网络质量分析   - bfd：双向转发检测                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ha_mode              | String  | 虚拟接口可用性检测的配置模式。取值范围： - auto_single：自动单跳bfd   - auto_multi：自动多跳bfd   - static_single：静态单跳bfd   - static_multi：静态多跳bfd   - enhance_nqa：增强型nqa    |
| detect_multiplier    | Integer | 检测的重试次数                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| min_rx_interval      | Integer | 检测的接收时长间隔，单位为毫秒。 - 当ha_type为nqa时，实际生效的时间间隔为按秒为单位将输入的数值向上取整，例如输入1500毫秒，实际时间间隔为2秒；   - 当ha_type为bfd时，实际生效的时间间隔为按毫秒为单位的输入数值。最小值为200毫秒，最大值为1000毫秒。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| min_tx_interval      | Integer | 检测的发送时长间隔，单位为毫秒。 - 当ha_type为nqa时，实际生效的时间间隔为按秒为单位将输入的数值向上取整，例如输入1500毫秒，实际时间间隔为2秒；   - 当ha_type为bfd时，实际生效的时间间隔为按毫秒为单位的输入数值。最小值为200毫秒，最大值为1000毫秒。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| remote_disclaim      | Integer | 检测的远端的标识，用于静态BFD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| local_disclaim       | Integer | 检测的本端的标识，用于静态BFD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ipv6_remote_disclaim | Integer | 检测的远端的标识，用于静态ipv6 BFD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ipv6_local_disclaim  | Integer | 检测的本端的标识，用于静态ipv6 BFD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
   
#### 请求示例
创建一个private类型的虚拟接口，设置带宽为2，VLAN为332，云侧网关IPv4接口地址为1.1.1.1/30，客户侧网关IPv4接口地址为1.1.1.2/30，使用静态路由模式。
```
POST https://{dc_endpoint}/v3/0605768a3300d5762f82c01180692873/dcaas/virtual-interfaces
{
  "virtual_interface" : {
    "name" : "vif-0819",
    "description" : "mytest",
    "direct_connect_id" : "4673e339-8412-4ee1-b73e-2ba9cdfa54c1",
    "vgw_id" : "8a47064a-f34c-4f94-b7fe-cac456c9b37b",
    "vlan" : 332,
    "bandwidth" : 2,
    "local_gateway_v4_ip" : "1.1.1.1/30",
    "remote_gateway_v4_ip" : "1.1.1.2/30",
    "type" : "private",
    "route_mode" : "static",
    "remote_ep_group" : [ "1.1.2.0/30" ]
  }
}
```
#### 响应示例
**状态码：201**
Created
```
{
  "virtual_interface" : {
    "id" : "0d0fdf63-f2c4-491c-8866-d504796189be",
    "name" : "vif-0819",
    "description" : "mytest",
    "tenant_id" : "0605768a3300d5762f82c01180692873",
    "direct_connect_id" : "4673e339-8412-4ee1-b73e-2ba9cdfa54c1",
    "vgw_id" : "8a47064a-f34c-4f94-b7fe-cac456c9b37b",
    "type" : "private",
    "service_type" : "VGW",
    "vlan" : 332,
    "bandwidth" : 2,
    "device_id" : "18.9.215.131",
    "status" : "ACTIVE",
    "create_time" : "2022-08-19T11:28:06.000Z",
    "update_time" : "2022-08-19T11:28:06.000Z",
    "admin_state_up" : true,
    "enable_bfd" : false,
    "route_limit" : 50,
    "enable_nqa" : false,
    "local_gateway_v4_ip" : "1.1.1.1/30",
    "remote_gateway_v4_ip" : "1.1.1.2/30",
    "ies_id" : null,
    "reason" : null,
    "rate_limit" : false,
    "local_gateway_v6_ip" : null,
    "remote_gateway_v6_ip" : null,
    "lgw_id" : null,
    "lag_id" : null,
    "priority" : "normal",
    "vif_peers" : [ {
      "id" : "c768eb52-12a8-4859-9b43-81194643040c",
      "tenant_id" : "0605768a3300d5762f82c01180692873",
      "name" : "vif-0819",
      "description" : "",
      "address_family" : "ipv4",
      "local_gateway_ip" : "1.1.1.1/30",
      "remote_gateway_ip" : "1.1.1.2/30",
      "route_mode" : "static",
      "bgp_asn" : null,
      "bgp_md5" : null,
      "device_id" : "18.9.215.131",
      "bgp_route_limit" : 100,
      "bgp_status" : null,
      "status" : "ACTIVE",
      "vif_id" : "0d0fdf63-f2c4-491c-8866-d504796189be",
      "receive_route_num" : -1,
      "remote_ep_group" : [ "1.1.2.0/30" ],
      "enable_bfd" : false,
      "enable_nqa" : false,
      "service_ep_group" : null
    } ],
    "enterprise_project_id" : "0"
  },
  "request_id" : "5633df7af874576d819a481c76673236"
}
```
#### SDK代码示例
SDK代码示例如下。
- [Java]
  创建一个private类型的虚拟接口，设置带宽为2，VLAN为332，云侧网关IPv4接口地址为1.1.1.1/30，客户侧网关IPv4接口地址为1.1.1.2/30，使用静态路由模式。
  ```
  package com.huaweicloud.sdk.test;
  import com.huaweicloud.sdk.core.auth.ICredential;
  import com.huaweicloud.sdk.core.auth.BasicCredentials;
  import com.huaweicloud.sdk.core.exception.ConnectionException;
  import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
  import com.huaweicloud.sdk.core.exception.ServiceResponseException;
  import com.huaweicloud.sdk.dc.v3.region.DcRegion;
  import com.huaweicloud.sdk.dc.v3.*;
  import com.huaweicloud.sdk.dc.v3.model.*;
  import java.util.List;
  import java.util.ArrayList;
  public class CreateVirtualInterfaceSolution {
      public static void main(String[] args) {
          // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
          // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
          String ak = System.getenv("CLOUD_SDK_AK");
          String sk = System.getenv("CLOUD_SDK_SK");
          String projectId = "{project_id}";
          ICredential auth = new BasicCredentials()
                  .withProjectId(projectId)
                  .withAk(ak)
                  .withSk(sk);
          DcClient client = DcClient.newBuilder()
                  .withCredential(auth)
                  .withRegion(DcRegion.valueOf("<YOUR REGION>"))
                  .build();
          CreateVirtualInterfaceRequest request = new CreateVirtualInterfaceRequest();
          CreateVirtualInterfaceRequestBody body = new CreateVirtualInterfaceRequestBody();
          List<String> listVirtualInterfaceRemoteEpGroup = new ArrayList<>();
          listVirtualInterfaceRemoteEpGroup.add("1.1.2.0/30");
          CreateVirtualInterface virtualInterfacebody = new CreateVirtualInterface();
          virtualInterfacebody.withName("vif-0819")
              .withDescription("mytest")
              .withDirectConnectId("4673e339-8412-4ee1-b73e-2ba9cdfa54c1")
              .withType(CreateVirtualInterface.TypeEnum.fromValue("private"))
              .withVlan(332)
              .withBandwidth(2)
              .withLocalGatewayV4Ip("1.1.1.1/30")
              .withRemoteGatewayV4Ip("1.1.1.2/30")
              .withVgwId("8a47064a-f34c-4f94-b7fe-cac456c9b37b")
              .withRouteMode(CreateVirtualInterface.RouteModeEnum.fromValue("static"))
              .withRemoteEpGroup(listVirtualInterfaceRemoteEpGroup);
          body.withVirtualInterface(virtualInterfacebody);
          request.withBody(body);
          try {
              CreateVirtualInterfaceResponse response = client.createVirtualInterface(request);
              System.out.println(response.toString());
          } catch (ConnectionException e) {
              e.printStackTrace();
          } catch (RequestTimeoutException e) {
              e.printStackTrace();
          } catch (ServiceResponseException e) {
              e.printStackTrace();
              System.out.println(e.getHttpStatusCode());
              System.out.println(e.getRequestId());
              System.out.println(e.getErrorCode());
              System.out.println(e.getErrorMsg());
          }
      }
  }
  ```
- [Python]
  创建一个private类型的虚拟接口，设置带宽为2，VLAN为332，云侧网关IPv4接口地址为1.1.1.1/30，客户侧网关IPv4接口地址为1.1.1.2/30，使用静态路由模式。
  ```
  # coding: utf-8
  import os
  from huaweicloudsdkcore.auth.credentials import BasicCredentials
  from huaweicloudsdkdc.v3.region.dc_region import DcRegion
  from huaweicloudsdkcore.exceptions import exceptions
  from huaweicloudsdkdc.v3 import *
  if __name__ == "__main__":
      # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak = os.environ["CLOUD_SDK_AK"]
      sk = os.environ["CLOUD_SDK_SK"]
      projectId = "{project_id}"
      credentials = BasicCredentials(ak, sk, projectId)
      client = DcClient.new_builder() \
          .with_credentials(credentials) \
          .with_region(DcRegion.value_of("<YOUR REGION>")) \
          .build()
      try:
          request = CreateVirtualInterfaceRequest()
          listRemoteEpGroupVirtualInterface = [
              "1.1.2.0/30"
          ]
          virtualInterfacebody = CreateVirtualInterface(
              name="vif-0819",
              description="mytest",
              direct_connect_id="4673e339-8412-4ee1-b73e-2ba9cdfa54c1",
              type="private",
              vlan=332,
              bandwidth=2,
              local_gateway_v4_ip="1.1.1.1/30",
              remote_gateway_v4_ip="1.1.1.2/30",
              vgw_id="8a47064a-f34c-4f94-b7fe-cac456c9b37b",
              route_mode="static",
              remote_ep_group=listRemoteEpGroupVirtualInterface
          )
          request.body = CreateVirtualInterfaceRequestBody(
              virtual_interface=virtualInterfacebody
          )
          response = client.create_virtual_interface(request)
          print(response)
      except exceptions.ClientRequestException as e:
          print(e.status_code)
          print(e.request_id)
          print(e.error_code)
          print(e.error_msg)
  ```
- [Go]
  创建一个private类型的虚拟接口，设置带宽为2，VLAN为332，云侧网关IPv4接口地址为1.1.1.1/30，客户侧网关IPv4接口地址为1.1.1.2/30，使用静态路由模式。
  ```
  package main
  import (
  "fmt"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
      dc "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dc/v3"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dc/v3/model"
      region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dc/v3/region"
  )
  func main() {
      // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak := os.Getenv("CLOUD_SDK_AK")
      sk := os.Getenv("CLOUD_SDK_SK")
      projectId := "{project_id}"
      auth, err := basic.NewCredentialsBuilder().
          WithAk(ak).
          WithSk(sk).
          WithProjectId(projectId).
          SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      hcClient, err := dc.DcClientBuilder().
           WithRegion(region.ValueOf("<YOUR REGION>")).
           WithCredential(auth).
           SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      client := dc.NewDcClient(hcClient)
      request := &model.CreateVirtualInterfaceRequest{}
  var listRemoteEpGroupVirtualInterface = []string{
          "1.1.2.0/30",
      }
  nameVirtualInterface:= "vif-0819"
  descriptionVirtualInterface:= "mytest"
  directConnectIdVirtualInterface:= "4673e339-8412-4ee1-b73e-2ba9cdfa54c1"
  localGatewayV4IpVirtualInterface:= "1.1.1.1/30"
  remoteGatewayV4IpVirtualInterface:= "1.1.1.2/30"
  vgwIdVirtualInterface:= "8a47064a-f34c-4f94-b7fe-cac456c9b37b"
  virtualInterfacebody := &model.CreateVirtualInterface{
  Name: &nameVirtualInterface,
  Description: &descriptionVirtualInterface,
  DirectConnectId: &directConnectIdVirtualInterface,
  Type: model.GetCreateVirtualInterfaceTypeEnum().PRIVATE,
  Vlan: int32(332),
  Bandwidth: int32(2),
  LocalGatewayV4Ip: &localGatewayV4IpVirtualInterface,
  RemoteGatewayV4Ip: &remoteGatewayV4IpVirtualInterface,
  VgwId: &vgwIdVirtualInterface,
  RouteMode: model.GetCreateVirtualInterfaceRouteModeEnum().STATIC,
  RemoteEpGroup: &listRemoteEpGroupVirtualInterface,
  }
  request.Body = &model.CreateVirtualInterfaceRequestBody{
  VirtualInterface: virtualInterfacebody,
  }
  response, err := client.CreateVirtualInterface(request)
  if err == nil {
          fmt.Printf("%+v\n", response)
      } else {
          fmt.Println(err)
      }
  }
  ```
- [更多]
  更多编程语言的SDK代码示例，请参见[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/DC/sdk?api=CreateVirtualInterface)的代码示例页签，可生成自动对应的SDK代码示例。
#### 状态码
| 状态码 | 描述      |
|:---|:---|
| 201 | Created |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-dc/ErrorCode.html)。
