Network ResourcesDistributed Port Group Related Interfaces
AddDnsToL3Network
Headers
Authorization: OAuth the-session-uuidBody
{
"params": {
"dns": "8.8.8.8"
},
"systemTags": [],
"userTags": []
}Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"dns":"8.8.8.8"}}' \
http://localhost:8080/zstack/v1/l3-networks/0b8da8c298ed3960925abbcc4f913da8/dnsRequest Parameters
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| l3NetworkUuid | String | url | The L3 network UUID. | 0.6 | |
| dns | String | url | The DNS address. | 0.6 | |
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
API Response
Sample Response
{
"inventory": {
"name": "Test-L3Network",
"l2NetworkUuid": "08f7b0b577a84c28968ddce5a9377c5d",
"dns": [
"8.8.8.8"
]
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
| inventory | L3NetworkInventory | See inventory. | 0.6 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| name | String | The resource name. | 0.6 |
| description | String | The detailed description of the resource. | 0.6 |
| type | String | 0.6 | |
| zoneUuid | String | The zone UUID. | 0.6 |
| l2NetworkUuid | String | The L2 network UUID. | 0.6 |
| state | String | 0.6 | |
| dnsDomain | String | 0.6 | |
| system | Boolean | 0.6 | |
| category | String | 0.6 | |
| ipVersion | Integer | The IP version. | 3.1.0 |
| enableIPAM | Boolean | Enables IP address management. | 4.10.16 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
| dns | List | 0.6 | |
| ipRanges | List | See ipRanges. | 0.6 |
| networkServices | List | See networkServices. | 0.6 |
| hostRoute | List | See hostRoute. | 2.3 |
| reservedIpRanges | List | See reservedIpRanges | 4.10.16 |
ipRanges
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| l3NetworkUuid | String | The L3 network UUID. | 0.6 |
| name | String | The resource name. | 0.6 |
| description | String | The detailed description of the resource. | 0.6 |
| startIp | String | 0.6 | |
| endIp | String | 0.6 | |
| netmask | String | 0.6 | |
| prefixLen | String | The prefix length. | 3.1.0 |
| gateway | String | 0.6 | |
| networkCidr | String | 0.6 | |
| ipVersion | Integer | The IP version. | 3.1.0 |
| addressMode | String | The IPv6 address allocation mode. | 3.1.0 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
networkServices
| Name | Type | Description | Starting Version |
|---|---|---|---|
| l3NetworkUuid | String | The L3 network UUID. | 0.6 |
| networkServiceProviderUuid | String | The network service provider UUID. | 0.6 |
| networkServiceType | String | 0.6 |
hostRoute
| Name | Type | Description | Starting Version |
|---|---|---|---|
| id | Long | 2.3 | |
| l3NetworkUuid | String | The L3 network UUID. | 2.3 |
| prefix | String | 2.3 | |
| nexthop | String | 2.3 | |
| createDate | Timestamp | The creation date. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
reservedIpRanges
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.10.16 |
| l3NetworkUuid | String | The L3 network UUID. | 4.10.16 |
| name | String | The resource name. | 4.10.16 |
| description | String | The detailed description of the resource. | 4.10.16 |
| startIp | String | The start IP address (included in the reserved IP range). | 4.10.16 |
| endIp | String | The end IP address (included in the reserved IP range). | 4.10.16 |
| ipVersion | Integer | The IP version. | 4.10.16 |
| createDate | Timestamp | The creation date. | 4.10.16 |
| lastOpDate | Timestamp | The last operation date. | 4.10.16 |
SDK Sample
Java SDK
AddDnsToL3NetworkAction action = new AddDnsToL3NetworkAction();
action.l3NetworkUuid = "80bfafb9c4534a2593fcda534ee6414f";
action.dns = "8.8.8.8";
action.sessionId = "0a24af3791134b81bba960844b3aa899";
AddDnsToL3NetworkAction.Result res = action.call();Python SDK
action = AddDnsToL3NetworkAction()
action.l3NetworkUuid = "0b8da8c298ed3960925abbcc4f913da8"
action.dns = "8.8.8.8"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()