< Home

Querying an ACL-based Simplified Traffic Policy

This section describes how to query an ACL-based simplified traffic policy using the rpc method.

Table 1 Querying an ACL-based simplified traffic policy

Operation

XPATH

rpc

  • /huawei-sacl:get-traffic-apply-status/input/acls/acl
  • /huawei-sacl:get-traffic-apply-status/input/acls/ruleid
  • /huawei-sacl:get-traffic-apply-status/input/acls/application-type
  • /huawei-sacl:get-traffic-apply-status/input/acls/application-view
  • /huawei-sacl:get-traffic-apply-status/input/acls/interface-global
  • /huawei-sacl:get-traffic-apply-status/input/acls/direction
  • /huawei-sacl:get-traffic-apply-statistic/input/acls/acl
  • /huawei-sacl:get-traffic-apply-statistic/input/acls/ruleid
  • /huawei-sacl:get-traffic-apply-statistic/input/acls/application-type
  • /huawei-sacl:get-traffic-apply-statistic/input/acls/application-view
  • /huawei-sacl:get-traffic-apply-statistic/input/acls/interface-global
  • /huawei-sacl:get-traffic-apply-statistic/input/acls/direction
  • /huawei-sacl:get-traffic-apply-statistic/input/clearflag

Data Requirement 1

Query the status of an ACL-based simplified traffic policy.

Item

Data

Description

Name of an ACL in an ACL-based simplified traffic policy

3000

Query an ACL-based simplified traffic policy whose name is 3000.

ID of an ACL rule in an ACL-based simplified traffic policy

1

Query an ACL-based simplified traffic policy whose rule ID is 1.

Filtering type in an ACL-based simplified traffic policy

filter

Query an ACL-based simplified traffic policy whose filtering type is filter.

Whether an ACL-based simplified traffic policy is applied globally or on an interface

global

Query an ACL-based simplified traffic policy that is applied globally.

Name of an interface to which an ACL-based simplified traffic policy is applied

global

Query an ACL-based simplified traffic policy that is applied globally.

Direction in which an ACL-based simplified traffic policy is applied

inbound

Query an ACL-based simplified traffic policy that is applied in the inbound direction.

Request Example

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <hw-sacl:get-traffic-apply-status xmlns:hw-sacl="urn:huawei:params:xml:ns:yang:huawei-sacl">
    <hw-sacl:acls>
      <hw-sacl:acl>3000</hw-sacl:acl>
      <hw-sacl:ruleid>1</hw-sacl:ruleid>
      <hw-sacl:application-type>filter</hw-sacl:application-type>
      <hw-sacl:application-view>global</hw-sacl:application-view>
      <hw-sacl:direction>inbound</hw-sacl:direction>
      <hw-sacl:interface-global>global</hw-sacl:interface-global>
    </hw-sacl:acls>
  </hw-sacl:get-traffic-apply-status>
</rpc>

Response Example

Sample of successful response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <data>
    <get-traffic-apply-status xmlns="urn:huawei:params:xml:ns:yang:huawei-sacl">
      <acls>
        <acl>3000</acl>
        <ruleid>1</ruleid>
        <application-type>filter</application-type>
        <application-view>global</application-view>
        <interface-global>global</interface-global>
        <direction>inbound</direction>
        <application-result>
          <slot>0</slot>
          <status>success</status>
          <failure-message/>
        </application-result>
      </acls>
    </get-traffic-apply-status>
  </data>
</rpc-reply>

Sample of failed response

None

Data Requirement 2

Query ACL-based traffic statistics.

Item

Data

Description

Name of an ACL in ACL-based traffic statistics

3000

Query traffic statistics that are collected based on ACL 3000.

ID of an ACL rule in ACL-based traffic statistics

1

Query traffic statistics that are collected based on ACL rule ID 1.

Filtering type in ACL-based traffic statistics

secure

Query traffic statistics whose filtering type is secure.

Whether ACL-based traffic statistics are collected globally or on an interface

global

Collect ACL-based traffic statistics globally.

Name of an interface on which ACL-based traffic statistics are collected

global

Collect ACL-based traffic statistics globally.

Direction in which ACL-based traffic statistics are collected

inbound

Collect ACL-based traffic statistics in the inbound direction.

Whether to clear the statistics after the query

false

The statistics are not cleared after the query.

Request Example

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3">
  <hw-sacl:get-traffic-apply-statistic xmlns:hw-sacl="urn:huawei:params:xml:ns:yang:huawei-sacl">
    <hw-sacl:acls>
      <hw-sacl:acl>3000</hw-sacl:acl>
      <hw-sacl:ruleid>1</hw-sacl:ruleid>
      <hw-sacl:application-type>secure</hw-sacl:application-type>
      <hw-sacl:application-view>global</hw-sacl:application-view>
      <hw-sacl:direction>inbound</hw-sacl:direction>
      <hw-sacl:interface-global>global</hw-sacl:interface-global>
</hw-sacl:acls>
<hw-sacl:clearflag>false</hw-sacl:clearflag>
  </hw-sacl:get-traffic-apply-statistic>
</rpc>

Response Example

Sample of successful response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3">
  <data>
    <get-traffic-apply-statistic xmlns="urn:huawei:params:xml:ns:yang:huawei-sacl">
      <acls>
        <acl>3000</acl>
        <ruleid>1</ruleid>
        <application-type>secure</application-type>
        <application-view>global</application-view>
        <interface-global>global</interface-global>
        <direction>inbound</direction>
        <statistic>
          <statistic-key>
            <slot-statistic>0</slot-statistic>
            <match-permit-packet>9.767K</match-permit-packet>
            <match-permit-byte>1.392M</match-permit-byte>
            <match-discarded-packet>0</match-discarded-packet>
            <match-discarded-byte>0</match-discarded-byte>
          </statistic-key>
        </statistic>
      </acls>
    </get-traffic-apply-statistic>
  </data>
</rpc-reply>

Sample of failed response

None

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic