云服务器内容精选

  • 请求示例 HTTP的示例 PUT /controller/campus/v1/sdwan/snmp/trap/00000000-0000-0000-0000-000000000000 HTTP/1.1 Host: 192.168.1.125:18002 Content-Type: application/json Accept: application/json Accept-Language: en-US X-AC CES S-TOKEN: x-yyyyyy { "config-status" : "reserved", "errorInfo" : "", "trapSwitch" : true, "trapQueueSize" : 1000, "trapSourceInterfaceName" : "GE0/0/0", "serverSource" : "192.168.1.1", "targetHosts" : { "targetHost" : [ { "name" : "hostName", "address" : "192.168.2.1", "isPublicNet" : false, "notifyType" : "trap", "portNumber" : 162, "vpnInstanceName" : "underlay_1", "interfaceName" : "GE0/0/1", "userName" : "user", "securityLevel" : "privacy" } ] }, "traps" : { "trap" : [ { "featureName" : "IFNET", "trapName" : "linkdown" } ] } }
  • 响应示例 返回状态码为200:配置成功,响应体参考SnmpResponse。 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" : "", "data" : { "config-status" : "reserved", "errorInfo" : "", "trapSwitch" : true, "trapQueueSize" : 1000, "trapSourceInterfaceName" : "GE0/0/0", "serverSource" : "192.168.1.1", "targetHosts" : { "targetHost" : [ { "name" : "hostName", "address" : "192.168.2.1", "isPublicNet" : false, "notifyType" : "trap", "portNumber" : 162, "vpnInstanceName" : "underlay_1", "interfaceName" : "GE0/0/1", "userName" : "user", "securityLevel" : "privacy" } ] }, "traps" : { "trap" : [ { "featureName" : "IFNET", "trapName" : "linkdown" } ] } } } 返回状态码为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
  • 响应示例 返回状态码为200:删除成功,响应体参考CommonResponse。 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" : "" } 返回状态码为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
  • 请求参数 表2 body参数列表 参数名称 必选 类型 参数值域 默认值 参数说明 参数示例 delTargetHostInfo 是 REFERENCE 详细请参见表3。 删除SNMP目标主机信息 - 表3 DelTargetHostInfo对象的参数列表 参数名称 必选 类型 参数值域 默认值 参数说明 参数示例 name 是 string 1~32个字符。 - 指定SNMP目标主机名。 "hostName"
  • 请求示例 HTTP的示例 POST /controller/campus/v1/sdwan/snmp/trap/00000000-0000-0000-0000-000000000000/targetHost/delete HTTP/1.1 Host: 192.168.1.125:18002 Content-Type: application/json Accept: application/json Accept-Language: en-US X-ACCESS-TOKEN: x-yyyyyy { "name" : "hostName" }
  • 响应示例 返回状态码为200:删除成功,响应体参考CommonResponse。 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" : "" } 返回状态码为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
  • 响应参数 返回状态码为200:删除成功,响应体参考CommonResponse。 表2 CommonResponse对象的参数列表 参数名称 类型 参数值域 默认值 参数说明 参数示例 errCode string 0~10个字符。 - 错误码。 "0" errMsg string 0~255个字符。 - 错误描述。 "" 返回状态码为400:请求参数错误。 详细信息请参见实际响应消息体。 返回状态码为500:内部异常。 详细信息请参见实际响应消息体。
  • 请求示例 HTTP的示例 DELETE /controller/campus/v1/sdwan/snmp/trap/00000000-0000-0000-0000-000000000000 HTTP/1.1 Host: 192.168.1.125:18002 Content-Type: application/json Accept: application/json Accept-Language: en-US X-ACCESS-TOKEN: x-yyyyyy
  • 响应示例 返回状态码为200:配置成功,响应体参考SnmpUserResponse。 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" : "", "data" : { "config-status" : "reserved", "errorInfo" : "", "agentEnable" : true, "allIpv4Interface" : false, "passwordMinLength" : 8, "usmUserCmplxCheck" : false, "sysContact" : "R&D Beijing, Huawei Technologies co.,Ltd.", "sysLocation" : "Beijing China", "mibViews" : { "mibView" : [ { "viewName" : "view1", "whiteList" : [ "iso" ], "blackList" : [ "internet" ] } ] }, "v3Groups" : { "group" : [ { "groupName" : "group", "securityLevel" : "privacy", "acl" : 2000, "readView" : "view1", "writeView" : "view1", "notifyView" : "view1" } ] }, "usmUsers" : { "usmUser" : [ { "name" : "user", "groupName" : "group", "authProtocol" : "sha2-512", "authKey" : "Example@123", "privProtocol" : "aes256", "privKey" : "Example@234" } ] } } } 返回状态码为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
  • 请求示例 HTTP的示例 PUT /controller/campus/v1/sdwan/snmp/user/00000000-0000-0000-0000-000000000000 HTTP/1.1 Host: 192.168.1.125:18002 Content-Type: application/json Accept: application/json Accept-Language: en-US X-ACCESS-TOKEN: x-yyyyyy { "config-status" : "reserved", "errorInfo" : "", "agentEnable" : true, "allIpv4Interface" : false, "passwordMinLength" : 8, "usmUserCmplxCheck" : false, "sysContact" : "R&D Beijing, Huawei Technologies co.,Ltd.", "sysLocation" : "Beijing China", "mibViews" : { "mibView" : [ { "viewName" : "view1", "whiteList" : [ "iso" ], "blackList" : [ "internet" ] } ] }, "v3Groups" : { "group" : [ { "groupName" : "group", "securityLevel" : "privacy", "acl" : 2000, "readView" : "view1", "writeView" : "view1", "notifyView" : "view1" } ] }, "usmUsers" : { "usmUser" : [ { "name" : "user", "groupName" : "group", "authProtocol" : "sha2-512", "authKey" : "Example@123", "privProtocol" : "aes256", "privKey" : "Example@234" } ] } }
  • 响应示例 返回状态码为200:配置成功,响应体参考SnmpResponse。 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" : "", "data" : { "config-status" : "reserved", "errorInfo" : "", "trapSwitch" : true, "trapQueueSize" : 1000, "trapSourceInterfaceName" : "GE0/0/0", "serverSource" : "192.168.1.1", "targetHosts" : { "targetHost" : [ { "name" : "hostName", "address" : "192.168.2.1", "isPublicNet" : false, "notifyType" : "trap", "portNumber" : 162, "vpnInstanceName" : "underlay_1", "interfaceName" : "GE0/0/1", "userName" : "user", "securityLevel" : "privacy" } ] }, "traps" : { "trap" : [ { "featureName" : "IFNET", "trapName" : "linkdown" } ] } } } 返回状态码为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
  • 响应参数 返回状态码为200:配置成功,响应体参考SnmpResponse。 表8 SnmpResponse对象的参数列表 参数名称 类型 参数值域 默认值 参数说明 参数示例 errCode string 0~10个字符。 - 错误码。 "0" errMsg string 0~255个字符。 - 错误描述。 "" data REFERENCE 详细请参见表9。 Trap信息。 - 表9 TrapInfo对象的参数列表 参数名称 类型 参数值域 默认值 参数说明 参数示例 config-status string reserved initial configuring-database configured-database-success configured-database-failed configuring-device configured-device-success configured-device-failed reserved 1:配置状态; 2:查询接口返回业务数据配置状态结果; 3:创建、修改、删除不返回状态; 4:入参设置此字段无效; 5:取值范围: reserved:保留未用, initial:初始状态, configuring-database:数据库存储中, configured-database-success:预配置, configured-database-failed:数据库存储失败, configuring-device:部署中, configured-device-success:成功, configured-device-failed:失败。 "reserved" errorInfo string 0~1000个字符。 - 配置下发结果错误描述。 "" trapSwitch boolean true false - 使能Trap发送。true表示开启全部Trap发送,false表示关闭全部Trap发送,参数不传表示恢复Trap开关至设备缺省状态。V600系列设备不支持关闭全部Trap发送。对于V600设备,当使能所有特性告警开关后,不需要再配置具体特性告警消息。 true trapQueueSize int32 [1-1000] 100 用来设置发往目的主机(Host)的Trap报文的消息队列的长度。只有V300系列设备支持该参数。默认值为100。 1000 trapSourceInterfaceName string 0~63个字符。 - 发送Trap信息的接口名称,接口名称需要已经存在。 "GE0/0/0" serverSource string 0~64个字符。 - 引擎监听的IP地址。只有V300系列设备支持该参数。 "192.168.1.1" targetHosts REFERENCE 详细请参见表10。 目标主机列表。 - traps REFERENCE 详细请参见表12。 配置Trap. 仅V600系列设备支持该参数。 - 表10 TargetHosts对象的参数列表 参数名称 类型 参数值域 默认值 参数说明 参数示例 targetHost ARRAY_REFERENCE 1-20个列表项,详细请参见表11。 目标主机。 - 表11 TargetHost对象的参数列表 参数名称 类型 参数值域 默认值 参数说明 参数示例 name string 1~32个字符。 - 指定SNMP目标主机名,主键字段。 "hostName" address string 0~64个字符。 - IP地址。V300系列设备支持IPv4地址。V600系列设备支持IPv4,IPv6地址。 "192.168.2.1" isPublicNet boolean true false false 使能目标主机公网管理。仅V600系列设备支持该参数。默认值为false,配置为true时,VPN实例名必须是_public_。 false notifyType string trap inform - 告警 消息通知 类型,如果该字段的值不在枚举值范围,则参数变为null。 取值范围trap或者inform。 该参数是必填项。仅V600系列设备支持该参数。 "trap" portNumber int32 [1-65535] 162 网管用来接收告警信息的UDP端口号。默认值是162。 162 vpnInstanceName string 0~31个字符。 - VPN实例,VPN实例需要已经存在。 "underlay_1" interfaceName string 0~63个字符。 - 接口名。仅V600系列设备支持该参数。 "GE0/0/1" userName string 1~32个字符。 - 用户名。 "user" securityLevel string noAuthNoPriv authentication privacy - 指示是否使用身份验证和加密的安全级别,如果该字段的值不在枚举值范围,则参数变为null。 "privacy" 表12 Traps对象的参数列表 参数名称 类型 参数值域 默认值 参数说明 参数示例 trap ARRAY_REFERENCE 1-1000个列表项,详细请参见表13。 trap。 - 表13 Trap对象的参数列表 参数名称 类型 参数值域 默认值 参数说明 参数示例 featureName string 1~32个字符。 - Trap所属模块,联合主键。 "IFNET" trapName string 1~63个字符。 - Trap名称,联合主键。 "linkdown" 返回状态码为400:请求参数错误。 详细信息请参见实际响应消息体。 返回状态码为500:内部异常。 详细信息请参见实际响应消息体。
  • 请求示例 HTTP的示例 POST /controller/campus/v1/sdwan/snmp/trap/00000000-0000-0000-0000-000000000000 HTTP/1.1 Host: 192.168.1.125:18002 Content-Type: application/json Accept: application/json Accept-Language: en-US X-ACCESS-TOKEN: x-yyyyyy { "config-status" : "reserved", "errorInfo" : "", "trapSwitch" : true, "trapQueueSize" : 1000, "trapSourceInterfaceName" : "GE0/0/0", "serverSource" : "192.168.1.1", "targetHosts" : { "targetHost" : [ { "name" : "hostName", "address" : "192.168.2.1", "isPublicNet" : false, "notifyType" : "trap", "portNumber" : 162, "vpnInstanceName" : "underlay_1", "interfaceName" : "GE0/0/1", "userName" : "user", "securityLevel" : "privacy" } ] }, "traps" : { "trap" : [ { "featureName" : "IFNET", "trapName" : "linkdown" } ] } }
  • 请求参数 表2 body参数列表 参数名称 必选 类型 参数值域 默认值 参数说明 参数示例 trap 是 REFERENCE 详细请参见表3。 设备SNMP Trap参数配置。 - 表3 TrapInfo对象的参数列表 参数名称 必选 类型 参数值域 默认值 参数说明 参数示例 config-status 否 string reserved initial configuring-database configured-database-success configured-database-failed configuring-device configured-device-success configured-device-failed reserved 1:配置状态; 2:查询接口返回业务数据配置状态结果; 3:创建、修改、删除不返回状态; 4:入参设置此字段无效; 5:取值范围: reserved:保留未用, initial:初始状态, configuring-database:数据库存储中, configured-database-success:预配置, configured-database-failed:数据库存储失败, configuring-device:部署中, configured-device-success:成功, configured-device-failed:失败。 "reserved" errorInfo 否 string 0~1000个字符。 - 配置下发结果错误描述。 "" trapSwitch 否 boolean true false - 使能Trap发送。true表示开启全部Trap发送,false表示关闭全部Trap发送,参数不传表示恢复Trap开关至设备缺省状态。V600系列设备不支持关闭全部Trap发送。对于V600设备,当使能所有特性告警开关后,不需要再配置具体特性告警消息。 true trapQueueSize 否 int32 [1-1000] 100 用来设置发往目的主机(Host)的Trap报文的消息队列的长度。只有V300系列设备支持该参数。默认值为100。 1000 trapSourceInterfaceName 否 string 0~63个字符。 - 发送Trap信息的接口名称,接口名称需要已经存在。 "GE0/0/0" serverSource 否 string 0~64个字符。 - 引擎监听的IP地址。只有V300系列设备支持该参数。 "192.168.1.1" targetHosts 否 REFERENCE 详细请参见表4。 目标主机列表。 - traps 否 REFERENCE 详细请参见表6。 配置Trap. 仅V600系列设备支持该参数。 - 表4 TargetHosts对象的参数列表 参数名称 必选 类型 参数值域 默认值 参数说明 参数示例 targetHost 否 ARRAY_REFERENCE 1-20个列表项,详细请参见表5。 目标主机。 - 表5 TargetHost对象的参数列表 参数名称 必选 类型 参数值域 默认值 参数说明 参数示例 name 是 string 1~32个字符。 - 指定SNMP目标主机名,主键字段。 "hostName" address 是 string 0~64个字符。 - IP地址。V300系列设备支持IPv4地址。V600系列设备支持IPv4,IPv6地址。 "192.168.2.1" isPublicNet 否 boolean true false false 使能目标主机公网管理。仅V600系列设备支持该参数。默认值为false,配置为true时,VPN实例名必须是_public_。 false notifyType 否 string trap inform - 告警消息通知类型,如果该字段的值不在枚举值范围,则参数变为null。 取值范围trap或者inform。 该参数是必填项。仅V600系列设备支持该参数。 "trap" portNumber 否 int32 [1-65535] 162 网管用来接收告警信息的UDP端口号。默认值是162。 162 vpnInstanceName 否 string 0~31个字符。 - VPN实例,VPN实例需要已经存在。 "underlay_1" interfaceName 否 string 0~63个字符。 - 接口名。仅V600系列设备支持该参数。 "GE0/0/1" userName 是 string 1~32个字符。 - 用户名。 "user" securityLevel 是 string noAuthNoPriv authentication privacy - 指示是否使用身份验证和加密的安全级别,如果该字段的值不在枚举值范围,则参数变为null。 "privacy" 表6 Traps对象的参数列表 参数名称 必选 类型 参数值域 默认值 参数说明 参数示例 trap 否 ARRAY_REFERENCE 1-1000个列表项,详细请参见表7。 trap。 - 表7 Trap对象的参数列表 参数名称 必选 类型 参数值域 默认值 参数说明 参数示例 featureName 是 string 1~32个字符。 - Trap所属模块,联合主键。 "IFNET" trapName 是 string 1~63个字符。 - Trap名称,联合主键。 "linkdown"
  • 请求示例 HTTP的示例 GET /controller/campus/v1/sdwan/snmp/user/00000000-0000-0000-0000-000000000000 HTTP/1.1 Host: 192.168.1.125:18002 Content-Type: application/json Accept: application/json Accept-Language: en-US X-ACCESS-TOKEN: x-yyyyyy