This section provides a sample of configuring NetStream flow statistics collection for IPv4 aggregation flows using the edit-config method.
Operation | XPATH |
---|---|
edit-config |
|
Item | Data |
---|---|
Aggregation method of flow statistics | destination-prefix |
Source IPv4 address of the exported packets carrying IPv4 flow statistics | 192.168.10.1 |
Destination IPv4 address of the exported packets carrying IPv4 flow statistics | 192.168.50.1 |
Destination UDP port number of the exported packets carrying IPv4 flow statistics | 65505 |
Interface where NetStream flow statistics collection is to be enabled | GigabitEthernet0/0/3 |
Direction of traffic to be sampled on the interface | inbound |
# Enable NetStream flow statistics collection for incoming IPv4 aggregation flows on GE0/0/3.
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<config>
<hw-ns:netstream-policy xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream">
<hw-ns:aggregation>
<hw-ns:aggregation-type>destination-prefix</hw-ns:aggregation-type>
<hw-ns:enable> </hw-ns:enable>
<hw-ns:aggregation-export-source>
<hw-ns:ip>192.168.10.1</hw-ns:ip>
</hw-ns:aggregation-export-source>
<hw-ns:aggregation-export-host-no-vpn>
<hw-ns:ip>192.168.50.1</hw-ns:ip>
<hw-ns:port>65505</hw-ns:port>
</hw-ns:aggregation-export-host-no-vpn>
</hw-ns:aggregation>
</hw-ns:netstream-policy>
<hw-ns:netstream-apply xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream">
<hw-ns:interface>
<hw-ns:name>GigabitEthernet0/0/3</hw-ns:name>
<hw-ns:ns-enable>
<hw-ns:direction>inbound</hw-ns:direction>
</hw-ns:ns-enable>
</hw-ns:interface>
</hw-ns:netstream-apply>
</config>
</edit-config>
</rpc>
# Disable NetStream flow statistics collection for incoming IPv4 aggregation flows on GE0/0/3 and delete the aggregation method.
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<config>
<hw-ns:netstream-policy xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream">
<hw-ns:aggregation xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete">
<hw-ns:aggregation-type>destination-prefix</hw-ns:aggregation-type>
<hw-ns:aggregation-export-source xc:operation="delete">
<hw-ns:ip>192.168.10.1</hw-ns:ip>
</hw-ns:aggregation-export-source>
<hw-ns:aggregation-export-host-no-vpn xc:operation="delete">
<hw-ns:ip>192.168.50.1</hw-ns:ip>
<hw-ns:port>65505</hw-ns:port>
</hw-ns:aggregation-export-host-no-vpn>
</hw-ns:aggregation>
</hw-ns:netstream-policy>
<hw-ns:netstream-apply xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream">
<hw-ns:interface>
<hw-ns:name>GigabitEthernet0/0/3</hw-ns:name>
<hw-ns:ns-enable xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete">
<hw-ns:direction>inbound</hw-ns:direction>
</hw-ns:ns-enable>
</hw-ns:interface>
</hw-ns:netstream-apply>
</config>
</edit-config>
</rpc>
# Sample of successful response.
##### Ok Reply or Operation Successful ##### <?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="0"> <ok/> </rpc-reply>
# Sample of failed response.
##### Error Reply or Operation Failed ##### <?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="0"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/huawei-netstream:netstream-policy/aggregation[aggregation-type='destination-prefix']/enable</error-path> <error-message>parse rpc config error.(Invalid value in "enable" element.).</error-message> </rpc-error> </rpc-reply>