This section provides samples of configuring the ECA function and deleting the ECA configuration using the edit-config method.
Operation |
XPATH |
---|---|
edit-config |
|
Item |
Data |
Description |
---|---|---|
Whether to enable the IAE |
true |
Enable the IAE. |
Aging time of active flows of the ECA session |
300 |
Set the aging time of active flows of the ECA session to 300 seconds. |
Aging time of inactive flows of the ECA session |
300 |
Set the aging time of inactive flows of the ECA session to 300 seconds. |
ACL to be added to the ECA whitelist |
3999 |
Add ACL 3999 to the ECA whitelist. |
Whether to enable the ECA enhanced mode |
false |
Disable the ECA enhanced mode. |
Name of a flexible flow statistics template to be created |
eca |
Create a flexible flow statistics template named eca. |
Aggregation keywords for flexible flow statistics |
destination-address source-address destination-port source-port protocol |
Configure flexible flow statistics collection based on the destination IP address, source IP address, destination port number, source port number, and protocol type. |
Types of information included in flexible flow statistics |
bytes packets input output |
Configure flexible flow statistics to include the number of bytes, number of packets, inbound interface index, and outbound interface index. |
Interface name |
XGigabitEthernet0/0/2 |
Set the interface name to XGigabitEthernet0/0/2. |
Name of the flexible flow statistics template applied to the interface |
eca |
Apply the flexible flow statistics template eca to XGigabitEthernet0/0/2. |
Direction in which the flexible flow statistics template is applied to the interface |
inbound |
Apply the flexible flow statistics template to the inbound direction on the interface. |
Direction in which the flexible flow statistics template is applied to the interface |
outbound |
Apply the flexible flow statistics template to the outbound direction on the interface. |
Fixed sampling ratio for IPv4 packets on the interface |
1 |
Set the fixed sampling ratio for IPv4 packets on the interface to 1. |
Direction of IPv4 packets to be sampled on the interface |
inbound |
Sample inbound IPv4 packets on the interface. |
Direction of IPv4 packets to be sampled on the interface |
outbound |
Sample outbound IPv4 packets on the interface. |
Whether to enable the ECA function and direction of traffic for which ECA is performed |
both |
Enable the ECA function and configure the device to perform ECA on both inbound and outbound traffic. |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="4" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <hw-ns:nge xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream"> <hw-ns:enable>true</hw-ns:enable> <hw-ns:active-timeout>300</hw-ns:active-timeout> <hw-ns:inactive-timeout>300</hw-ns:inactive-timeout> </hw-ns:nge> <hw-ns:eca xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream"> <hw-ns:acl>3999</hw-ns:acl> <hw-ns:enhanced-mode>false</hw-ns:enhanced-mode> </hw-ns:eca> <hw-ns:netstream-policy xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream"> <hw-ns:sample-rule> <hw-ns:name>eca</hw-ns:name> <hw-ns:record-info> <hw-ns:match-field-bits>destination-address source-address destination-port source-port protocol</hw-ns:match-field-bits> <hw-ns:collect-field-bits>bytes packets input output</hw-ns:collect-field-bits> </hw-ns:record-info> </hw-ns:sample-rule> </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>XGigabitEthernet0/0/2</hw-ns:name> <hw-ns:record-applys> <hw-ns:record-apply> <hw-ns:direction>outbound</hw-ns:direction> <hw-ns:record-name>eca</hw-ns:record-name> </hw-ns:record-apply> <hw-ns:record-apply> <hw-ns:direction>inbound</hw-ns:direction> <hw-ns:record-name>eca</hw-ns:record-name> </hw-ns:record-apply> </hw-ns:record-applys> <hw-ns:packets-samples> <hw-ns:packets-sample> <hw-ns:direction>inbound</hw-ns:direction> <hw-ns:fix-packets>1</hw-ns:fix-packets> </hw-ns:packets-sample> <hw-ns:packets-sample> <hw-ns:direction>outbound</hw-ns:direction> <hw-ns:fix-packets>1</hw-ns:fix-packets> </hw-ns:packets-sample> </hw-ns:packets-samples> <hw-ns:eca-enable> <hw-ns:direction>both</hw-ns:direction> </hw-ns:eca-enable> </hw-ns:interface> </hw-ns:netstream-apply> <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <if:interface> <if:name>XGigabitEthernet0/0/2</if:name> <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type> </if:interface> </if:interfaces> </config> </edit-config> </rpc>
Response Example
# 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="4"> <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="4"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message> The slot 0 and 1 mode is not ECA mode. Please execute command assign resource-mode eca.</error-message> <error-info>Error on node /huawei-netstream:nge/active-timeout</error-info> </rpc-error> </rpc-reply>
Delete the configuration performed in Data Requirement 1.
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <hw-ns:nge xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream" xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete"> <hw-ns:enable>true</hw-ns:enable> <hw-ns:active-timeout>300</hw-ns:active-timeout> <hw-ns:inactive-timeout>300</hw-ns:inactive-timeout> </hw-ns:nge> <hw-ns:eca xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream" xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete"> <hw-ns:acl>3999</hw-ns:acl> <hw-ns:enhanced-mode>false</hw-ns:enhanced-mode> </hw-ns:eca> <hw-ns:netstream-policy xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream"> <hw-ns:sample-rule xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete"> <hw-ns:name>eca</hw-ns:name> <hw-ns:record-info> <hw-ns:match-field-bits>destination-address source-address destination-port source-port protocol</hw-ns:match-field-bits> <hw-ns:collect-field-bits>bytes packets input output</hw-ns:collect-field-bits> </hw-ns:record-info> </hw-ns:sample-rule> </hw-ns:netstream-policy> <hw-ns:netstream-apply xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream"> <hw-ns:interface xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete"> <hw-ns:name>XGigabitEthernet0/0/2</hw-ns:name> <hw-ns:record-applys> <hw-ns:record-apply> <hw-ns:direction>outbound</hw-ns:direction> <hw-ns:record-name>eca</hw-ns:record-name> </hw-ns:record-apply> <hw-ns:record-apply> <hw-ns:direction>inbound</hw-ns:direction> <hw-ns:record-name>eca</hw-ns:record-name> </hw-ns:record-apply> </hw-ns:record-applys> <hw-ns:packets-samples> <hw-ns:packets-sample> <hw-ns:direction>inbound</hw-ns:direction> <hw-ns:fix-packets>1</hw-ns:fix-packets> </hw-ns:packets-sample> <hw-ns:packets-sample> <hw-ns:direction>outbound</hw-ns:direction> <hw-ns:fix-packets>1</hw-ns:fix-packets> </hw-ns:packets-sample> </hw-ns:packets-samples> <hw-ns:eca-enable> <hw-ns:direction>both</hw-ns:direction> </hw-ns:eca-enable> </hw-ns:interface> </hw-ns:netstream-apply> <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <if:interface xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete"> <if:name>XGigabitEthernet0/0/2</if:name> <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type> </if:interface> </if:interfaces> </config> </edit-config> </rpc>
Response Example
# 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="5"> <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="5"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message>Invalid space in record name.</error-message> <error-info>Error on node /huawei-netstream:netstream-policy/sample-rule[name="rt ewt"]/name</error-info> </rpc-error> </rpc-reply>