# Batch attach network instances - AttachUGNNetworks

## Overview

Batch attach network instances






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `AttachUGNNetworks`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.netlake.cn/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **ProjectId** | string | Project ID. If left blank, the default project will be used. Sub-accounts must fill in this field. Please refer to the [GetProjectList](/docs/api/summary/get_project_list) |**Yes**|
| **UGNID** | string | UGN ID |**Yes**|
| **Networks.N.NetworkID** | string | representing the network instance ID, such as uvnet-xxxx |**Yes**|
| **Networks.N.Type** | string | indicating the network instance type, with enumerated values like VPC/UCVR/… |**Yes**|
| **Networks.N.Region** | string | denoting the region where the network instance belongs, for example, cn-sh2 |**Yes**|
| **Networks.N.OrgName** | string | specifying the project name to which the network instance belongs, such as org-xxx. |**Yes**|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **Networks** | array[[*Network*](#network)] | Array, with each element containing the following fields: NetworkID: string, network instance ID, such as uvnet-xxxx; Type: string, network instance type, enumeration values: VPC/UCVR/...; Region: string, region where the network instance is located, such as cn-sh2; OrgName: string, project name to which the network instance belongs, such as org-xxx |**Yes**|
| **UGNID** | string | UGN ID |No|

#### Data Model


#### Network

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Region** | string | Region of the Network Instance |**Yes**|
| **NetworkID** | string | ID of the network instance, such as vnet-xxxxx |**Yes**|
| **Name** | string | Network Instance Name |**Yes**|
| **Type** | string | Network Instance Type: VPC/UCVR/... |**Yes**|
| **OrgName** | string | Project name where the network instance is located |**Yes**|
| **CompanyID** | int | The company ID of the network instance |**Yes**|
| **RegionID** | int | Region ID of the network instance |No|
| **OrgID** | int | ID of the project where the network instance is located |No|
| **VNI** | int | The unique identifier of the network instance, such as the tunnel_id of vpc |No|
| **InsertTime** | int | Creation Time |No|

## Example

### Request Example
    
```
https://api.netlake.cn/?Action=AttachUGNNetworks
&ProjectId=org-1jzytw
&UGNID=ugn-1nnk7s9fw238
&Networks.N.NetworkID=uvnet-1ohmq6nnapc2
&Networks.N.Type=VPC
&Networks.N.Region=cn-bj2
&Networks.N.OrgName=org-1jzytw
```

### Response Example
    
```json
{
  "Action": "AttachUGNNetworksResponse",
  "Message": "ok",
  "Networks": [
    {
      "CompanyID": 31,
      "InsertTime": 1781687857,
      "Name": "VPC-1",
      "NetworkID": "uvnet-1ohmq6nnapc2",
      "OrgID": 630018,
      "OrgName": "org-1jzytw",
      "Region": "test03",
      "RegionID": 666003,
      "Type": "VPC",
      "VNI": 2130733152
    }
  ],
  "RetCode": 0,
  "UGNID": "ugn-1nnk7s9fw238"
}
```





