华为乾坤-批量更新VPN路由策略:响应示例

时间:2025-02-17 11:38:52

响应示例

返回状态码为200:接口调用成功,响应体参考VpnRoutePolicyResponse。

HTTP/1.1 200 OK
Date: Sun,16 Feb 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" : [
		{
			"vpnId" : "fbb684c8-0d37-496f-bafa-4b06d515j7l6",
			"siteId" : "fbb684c8-0d37-496f-bafa-4b06d515j7l6",
			"exportRoutePolicy" : {
				"nodes" : [
					{
						"nodeIndex" : 20000,
						"mode" : "permit",
						"matchCondition" : {
							"ipPrefix" : {
								"name" : "",
								"prefixFilters" : [
									{
										"matchMode" : "permit",
										"ipv4Address" : "10.1.0.0",
										"maskLength" : 24,
										"greaterEqual" : 24,
										"lessEqual" : 24
									}
								]
							},
							"ipv6Prefix" : {
								"name" : "",
								"ipv6PrefixFilters" : [
									{
										"matchMode" : "permit",
										"ipv6Address" : "fc00::",
										"maskLength" : 96,
										"greaterEqual" : 96,
										"lessEqual" : 96
									}
								]
							},
							"communityFilters" : [
								{
									"name" : "filterName",
									"communityNodes" : [
										{
											"matchMode" : "permit",
											"communityMembers" : [
												 "10"
											]
										}
									],
									"wholeMatch" : false
								}
							]
						},
						"applyAction" : {
							"applyCommunity" : {
								"communityNumbers" : [
									 "100"
								],
								"additive" : false,
								"none" : false
							},
							"applyExtCommunity" : {
								"rtFilters" : [
									 "100:1"
								],
								"additive" : false
							},
							"applyAsPath" : {
								"asNumbers" : [
									 "100"
								],
								"additive" : false,
								"overwrite" : false,
								"none" : false
							},
							"applyMetric" : {
								"cost" : "24",
								"sign" : "add"
							},
							"localPreference" : 100,
							"preferredValue" : 100
						},
						"nextNode" : {
							"nextNodeIndex" : 20001
						}
					}
				]
			},
			"importRoutePolicy" : {
				"nodes" : [
					{
						"nodeIndex" : 20000,
						"mode" : "permit",
						"matchCondition" : {
							"ipPrefix" : {
								"name" : "",
								"prefixFilters" : [
									{
										"matchMode" : "permit",
										"ipv4Address" : "10.1.0.0",
										"maskLength" : 24,
										"greaterEqual" : 24,
										"lessEqual" : 24
									}
								]
							},
							"ipv6Prefix" : {
								"name" : "",
								"ipv6PrefixFilters" : [
									{
										"matchMode" : "permit",
										"ipv6Address" : "fc00::",
										"maskLength" : 96,
										"greaterEqual" : 96,
										"lessEqual" : 96
									}
								]
							},
							"communityFilters" : [
								{
									"name" : "filterName",
									"communityNodes" : [
										{
											"matchMode" : "permit",
											"communityMembers" : [
												 "10"
											]
										}
									],
									"wholeMatch" : false
								}
							]
						},
						"applyAction" : {
							"applyCommunity" : {
								"communityNumbers" : [
									 "100"
								],
								"additive" : false,
								"none" : false
							},
							"applyExtCommunity" : {
								"rtFilters" : [
									 "100:1"
								],
								"additive" : false
							},
							"applyAsPath" : {
								"asNumbers" : [
									 "100"
								],
								"additive" : false,
								"overwrite" : false,
								"none" : false
							},
							"applyMetric" : {
								"cost" : "24",
								"sign" : "add"
							},
							"localPreference" : 100,
							"preferredValue" : 100
						},
						"nextNode" : {
							"nextNodeIndex" : 20001
						}
					}
				]
			}
		}
	],
	"fail" : [
		{
			"errcode" : "0",
			"errmsg" : "",
			"data" : {
				"vpnId" : "fbb684c8-0d37-496f-bafa-4b06d515j7l6",
				"siteId" : "fbb684c8-0d37-496f-bafa-4b06d515j7l6",
				"exportRoutePolicy" : {
					"nodes" : [
						{
							"nodeIndex" : 20000,
							"mode" : "permit",
							"matchCondition" : {
								"ipPrefix" : {
									"name" : "",
									"prefixFilters" : [
										{
											"matchMode" : "permit",
											"ipv4Address" : "10.1.0.0",
											"maskLength" : 24,
											"greaterEqual" : 24,
											"lessEqual" : 24
										}
									]
								},
								"ipv6Prefix" : {
									"name" : "",
									"ipv6PrefixFilters" : [
										{
											"matchMode" : "permit",
											"ipv6Address" : "fc00::",
											"maskLength" : 96,
											"greaterEqual" : 96,
											"lessEqual" : 96
										}
									]
								},
								"communityFilters" : [
									{
										"name" : "filterName",
										"communityNodes" : [
											{
												"matchMode" : "permit",
												"communityMembers" : [
													 "10"
												]
											}
										],
										"wholeMatch" : false
									}
								]
							},
							"applyAction" : {
								"applyCommunity" : {
									"communityNumbers" : [
										 "100"
									],
									"additive" : false,
									"none" : false
								},
								"applyExtCommunity" : {
									"rtFilters" : [
										 "100:1"
									],
									"additive" : false
								},
								"applyAsPath" : {
									"asNumbers" : [
										 "100"
									],
									"additive" : false,
									"overwrite" : false,
									"none" : false
								},
								"applyMetric" : {
									"cost" : "24",
									"sign" : "add"
								},
								"localPreference" : 100,
								"preferredValue" : 100
							},
							"nextNode" : {
								"nextNodeIndex" : 20001
							}
						}
					]
				},
				"importRoutePolicy" : {
					"nodes" : [
						{
							"nodeIndex" : 20000,
							"mode" : "permit",
							"matchCondition" : {
								"ipPrefix" : {
									"name" : "",
									"prefixFilters" : [
										{
											"matchMode" : "permit",
											"ipv4Address" : "10.1.0.0",
											"maskLength" : 24,
											"greaterEqual" : 24,
											"lessEqual" : 24
										}
									]
								},
								"ipv6Prefix" : {
									"name" : "",
									"ipv6PrefixFilters" : [
										{
											"matchMode" : "permit",
											"ipv6Address" : "fc00::",
											"maskLength" : 96,
											"greaterEqual" : 96,
											"lessEqual" : 96
										}
									]
								},
								"communityFilters" : [
									{
										"name" : "filterName",
										"communityNodes" : [
											{
												"matchMode" : "permit",
												"communityMembers" : [
													 "10"
												]
											}
										],
										"wholeMatch" : false
									}
								]
							},
							"applyAction" : {
								"applyCommunity" : {
									"communityNumbers" : [
										 "100"
									],
									"additive" : false,
									"none" : false
								},
								"applyExtCommunity" : {
									"rtFilters" : [
										 "100:1"
									],
									"additive" : false
								},
								"applyAsPath" : {
									"asNumbers" : [
										 "100"
									],
									"additive" : false,
									"overwrite" : false,
									"none" : false
								},
								"applyMetric" : {
									"cost" : "24",
									"sign" : "add"
								},
								"localPreference" : 100,
								"preferredValue" : 100
							},
							"nextNode" : {
								"nextNodeIndex" : 20001
							}
						}
					]
				}
			}
		}
	]
}

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

HTTP/1.1 400 Bad Request
Date: Sun,16 Feb 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,16 Feb 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_0000001988274010.html