华为乾坤-创建TNP:响应示例

时间:2025-05-12 15:32:17

响应示例

返回状态码为201:创建TNP成功,响应体参考TnpResponse。

HTTP/1.1 201 Created
Date: Sun,11 May 2025 10:00:00 GMT
Server: example-server
Content-Type: application/json;charset=UTF-8
Content-Length: 250
Connection: keep-alive
{
	"errcode" : "0",
	"errmsg" : "",
	"success" : [
		{
			"id" : "00000000-0000-0000-0000-000000000000",
			"name" : "Link1",
			"siteId" : "00000000-0000-0000-0000-000000000000",
			"deviceId" : "00000000-0000-0000-0000-000000000000",
			"portId" : "00000000-0000-0000-0000-000000000000",
			"portType" : 1,
			"portNum" : "0/0/1",
			"enable5G" : "",
			"inSubInterface" : false,
			"vlanId" : 1,
			"subInterfaceNumber" : 1,
			"tnplinkInfo" : {
				"cellular" : {
					"apn" : "abc",
					"userName" : "user1",
					"userKey" : "******",
					"authType" : 0,
					"priority" : 100,
					"trackEnable" : false,
					"nqaInfo" : {
						"destAddress" : "192.168.1.1"
					}
				},
				"standbyCellularEnable" : false,
				"standbyCellular" : {
					"apn" : "abc",
					"userName" : "user1",
					"userKey" : "******",
					"authType" : 0,
					"priority" : 100,
					"trackEnable" : false,
					"nqaInfo" : {
						"destAddress" : "192.168.1.1"
					}
				},
				"simSwitchBackEnable" : false,
				"simSwitchBackTime" : 60,
				"atm" : {
					"pvcVpi" : 123,
					"pvcVci" : 123
				}
			},
			"ipConnection" : {
				"ipv4" : {
					"publicIP" : "192.168.1.1",
					"accessType" : "PPPoE",
					"ipMode" : "Static",
					"customerAddress" : "192.168.1.1",
					"prefixLength" : 24,
					"providerAddress" : "192.168.1.1",
					"peerIp" : "192.168.1.1",
					"userName" : "admin",
					"userKey" : "******",
					"authType" : 0,
					"dlci" : 55,
					"interfaceMode" : 0
				},
				"ipv6" : {
					"accessType" : "IPoE",
					"ipMode" : "Static",
					"customerIPv6Address" : "fc00:3::1",
					"ipv6PrefixLength" : 64,
					"providerIpv6Address" : "fc00:3::1",
					"linkIpv6Pd" : "sdwanprefix",
					"linkIpv6PdAddr" : "fc00:3::1/64",
					"linkDhcpv6Option16Type" : "ascii",
					"linkDhcpv6Option16" : "101068,0001",
					"linkDhcpv6Pd" : "sdwanprefix",
					"enableIPv6AcSouthAccess" : true,
					"ipv6AcSouthAccessId" : "00000000-0000-0000-0000-000000000003",
					"ipv6MailUsedSouthAccess" : false,
					"ipv6AccessPreference" : "low"
				}
			},
			"transportNetworkInfo" : {
				"transportNetworkId" : "00000000-0000-0000-0000-000000000000",
				"workMode" : "active",
				"sendAlarmEnabled" : false
			},
			"ntp" : [
				{
					"id" : "00000000-0000-0000-0000-000000000000",
					"ntpType" : "IPv6",
					"preferEn" : false,
					"serverIP" : "fc00:3::1",
					"authentication" : false,
					"mode" : "HMAC-SHA256",
					"authKey" : "******",
					"authId" : 10
				}
			],
			"attributes" : {
				"inputBandwidth" : 1000,
				"outputBandwidth" : 1000,
				"mtu" : 1500,
				"TCPmss" : 1200,
				"ipv6Mtu" : 1500
			},
			"description" : "site tnp",
			"natEnable" : false,
			"ztpMode" : 0,
			"ipv6ZtpMode" : 0,
			"underlayVrf" : "underlay_1",
			"routingDistinguisher" : "1111:1111",
			"clearDeviceConfig" : true,
			"enableOverlay" : true,
			"enableIpv6Overlay" : false,
			"acSouthAccessId" : "00000000-0000-0000-0000-000000000001",
			"mailUsedSouthAccess" : false,
			"linkInformation" : "link1",
			"accessPreference" : "low",
			"enableSecondSouthAccess" : false,
			"secondSouthAccess" : {
				"acSouthAccessId" : "00000000-0000-0000-0000-000000000002",
				"accessPreference" : "low"
			},
			"syncModifyDeviceUrlConfig" : false,
			"enableLoopbackSrcInterface" : false,
			"enableRu" : false,
			"disableDefaultRuRoute" : false
		}
	],
	"fail" : [
		{
			"errcode" : "error",
			"errmsg" : "error message",
			"data" : {
				"id" : "00000000-0000-0000-0000-000000000000",
				"name" : "Link1",
				"siteId" : "00000000-0000-0000-0000-000000000000",
				"deviceId" : "00000000-0000-0000-0000-000000000000",
				"portId" : "00000000-0000-0000-0000-000000000000",
				"portType" : 1,
				"portNum" : "0/0/1",
				"enable5G" : "",
				"inSubInterface" : false,
				"vlanId" : 1,
				"subInterfaceNumber" : 1,
				"tnplinkInfo" : {
					"cellular" : {
						"apn" : "abc",
						"userName" : "user1",
						"userKey" : "******",
						"authType" : 0,
						"priority" : 100,
						"trackEnable" : false,
						"nqaInfo" : {
							"destAddress" : "192.168.1.1"
						}
					},
					"standbyCellularEnable" : false,
					"standbyCellular" : {
						"apn" : "abc",
						"userName" : "user1",
						"userKey" : "******",
						"authType" : 0,
						"priority" : 100,
						"trackEnable" : false,
						"nqaInfo" : {
							"destAddress" : "192.168.1.1"
						}
					},
					"simSwitchBackEnable" : false,
					"simSwitchBackTime" : 60,
					"atm" : {
						"pvcVpi" : 123,
						"pvcVci" : 123
					}
				},
				"ipConnection" : {
					"ipv4" : {
						"publicIP" : "192.168.1.1",
						"accessType" : "PPPoE",
						"ipMode" : "Static",
						"customerAddress" : "192.168.1.1",
						"prefixLength" : 24,
						"providerAddress" : "192.168.1.1",
						"peerIp" : "192.168.1.1",
						"userName" : "admin",
						"userKey" : "******",
						"authType" : 0,
						"dlci" : 55,
						"interfaceMode" : 0
					},
					"ipv6" : {
						"accessType" : "IPoE",
						"ipMode" : "Static",
						"customerIPv6Address" : "fc00:3::1",
						"ipv6PrefixLength" : 64,
						"providerIpv6Address" : "fc00:3::1",
						"linkIpv6Pd" : "sdwanprefix",
						"linkIpv6PdAddr" : "fc00:3::1/64",
						"linkDhcpv6Option16Type" : "ascii",
						"linkDhcpv6Option16" : "101068,0001",
						"linkDhcpv6Pd" : "sdwanprefix",
						"enableIPv6AcSouthAccess" : true,
						"ipv6AcSouthAccessId" : "00000000-0000-0000-0000-000000000003",
						"ipv6MailUsedSouthAccess" : false,
						"ipv6AccessPreference" : "low"
					}
				},
				"transportNetworkInfo" : {
					"transportNetworkId" : "00000000-0000-0000-0000-000000000000",
					"workMode" : "active",
					"sendAlarmEnabled" : false
				},
				"ntp" : [
					{
						"id" : "00000000-0000-0000-0000-000000000000",
						"ntpType" : "IPv6",
						"preferEn" : false,
						"serverIP" : "fc00:3::1",
						"authentication" : false,
						"mode" : "HMAC-SHA256",
						"authKey" : "******",
						"authId" : 10
					}
				],
				"attributes" : {
					"inputBandwidth" : 1000,
					"outputBandwidth" : 1000,
					"mtu" : 1500,
					"TCPmss" : 1200,
					"ipv6Mtu" : 1500
				},
				"description" : "site tnp",
				"natEnable" : false,
				"ztpMode" : 0,
				"ipv6ZtpMode" : 0,
				"underlayVrf" : "underlay_1",
				"routingDistinguisher" : "1111:1111",
				"clearDeviceConfig" : true,
				"enableOverlay" : true,
				"enableIpv6Overlay" : false,
				"acSouthAccessId" : "00000000-0000-0000-0000-000000000001",
				"mailUsedSouthAccess" : false,
				"linkInformation" : "link1",
				"accessPreference" : "low",
				"enableSecondSouthAccess" : false,
				"secondSouthAccess" : {
					"acSouthAccessId" : "00000000-0000-0000-0000-000000000002",
					"accessPreference" : "low"
				},
				"syncModifyDeviceUrlConfig" : false,
				"enableLoopbackSrcInterface" : false,
				"enableRu" : false,
				"disableDefaultRuRoute" : false
			}
		}
	]
}

返回状态码为400:校验异常。

HTTP/1.1 400 Bad Request
Date: Sun,11 May 2025 10:00:00 GMT
Server: example-server
Content-Type: application/json;charset=UTF-8
Content-Length: 250
Connection: keep-alive

返回状态码为500:内部错误。

HTTP/1.1 500 Internal Server Error
Date: Sun,11 May 2025 10:00:00 GMT
Server: example-server
Content-Type: application/json;charset=UTF-8
Content-Length: 250
Connection: keep-alive
support.huaweicloud.com/qiankuncmn-qiankuncs/toctopics/zh-cn_topic_0000001898792881.html