ce_netstream_export - Manages netstream export on HUAWEI CloudEngine switches.

New in version 2.4.

Synopsis

  • Configure NetStream flow statistics exporting and versions for exported packets on HUAWEI CloudEngine switches.

Options

parameter required default choices comments
as_option
no
  • origin
  • peer
Specifies the AS number recorded in the statistics as the original or the peer AS number.
bgp_nexthop
no disable
  • enable
  • disable
Configures the statistics to carry BGP next hop information. Currently, only V9 supports the exported packets carrying BGP next hop information.
host_ip
no
Specifies destination address which can be IPv6 or IPv4 of the exported NetStream packet.
host_port
no
Specifies the destination UDP port number of the exported packets. The value is an integer that ranges from 1 to 65535.
host_vpn
no
Specifies the VPN instance of the exported packets carrying flow statistics. Ensure the VPN instance has been created on the device.
source_ip
no
Specifies source address which can be IPv6 or IPv4 of the exported NetStream packet.
state
no present
  • present
  • absent
Manage the state of the resource.
type
yes
  • ip
  • vxlan
Specifies NetStream feature.
version
no
  • 5
  • 9
Sets the version of exported packets.

Examples

- name: netstream export module test
  hosts: cloudengine
  connection: local
  gather_facts: no
  vars:
    cli:
      host: "{{ inventory_hostname }}"
      port: "{{ ansible_ssh_port }}"
      username: "{{ username }}"
      password: "{{ password }}"
      transport: cli

  tasks:

  - name: Configures the source address for the exported packets carrying IPv4 flow statistics.
    ce_netstream_export:
      type: ip
      source_ip: 192.8.2.2
      provider: "{{ cli }}"

  - name: Configures the source IP address for the exported packets carrying VXLAN flexible flow statistics.
    ce_netstream_export:
      type: vxlan
      source_ip: 192.8.2.3
      provider: "{{ cli }}"

  - name: Configures the destination IP address and destination UDP port number for the exported packets carrying IPv4 flow statistics.
    ce_netstream_export:
      type: ip
      host_ip: 192.8.2.4
      host_port: 25
      host_vpn: test
      provider: "{{ cli }}"

  - name: Configures the destination IP address and destination UDP port number for the exported packets carrying VXLAN flexible flow statistics.
    ce_netstream_export:
      type: vxlan
      host_ip: 192.8.2.5
      host_port: 26
      host_vpn: test
      provider: "{{ cli }}"

  - name: Configures the version number of the exported packets carrying IPv4 flow statistics.
    ce_netstream_export:
      type: ip
      version: 9
      as_option: origin
      bgp_nexthop: enable
      provider: "{{ cli }}"

  - name: Configures the version for the exported packets carrying VXLAN flexible flow statistics.
    ce_netstream_export:
      type: vxlan
      version: 9
      provider: "{{ cli }}"

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
changed
check to see if a change was made on the device
always boolean True
end_state
k/v pairs of end attributes on the device
always dict {'bgp_nexthop': 'enable', 'host_port': '26', 'source_ip': '192.8.2.5', 'as_option': 'origin', 'host_ip': '192.8.5.6', 'version': '9', 'type': 'ip', 'host_vpn': 'test'}
existing
k/v pairs of existing attributes on the device
always dict {'bgp_nexthop': 'disable', 'host_port': None, 'source_ip': None, 'as_option': None, 'host_ip': None, 'version': None, 'type': 'ip', 'host_vpn': None}
proposed
k/v pairs of parameters passed into module
always dict {'bgp_nexthop': 'enable', 'host_port': '26', 'source_ip': '192.8.2.5', 'as_option': 'origin', 'host_ip': '192.8.5.6', 'state': 'present', 'version': '9', 'type': 'ip', 'host_vpn': 'test'}
updates
command list sent to the device
always list ['netstream export ip source 192.8.2.5', 'netstream export ip host 192.8.5.6 26 vpn-instance test', 'netstream export ip version 9 origin-as bgp-nexthop']

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.4/ce_netstream_export_module.html