<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-

# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import absolute_import, division, print_function
__metaclass__ = type

ANSIBLE_METADATA = {'metadata_version': '1.1',
                    'status': ['preview'],
                    'supported_by': 'community'}

DOCUMENTATION = r'''
---
module: aci_encap_pool_range
short_description: Manage encap ranges assigned to pools on Cisco ACI fabrics (fvns:EncapBlk, fvns:VsanEncapBlk)
description:
- Manage vlan, vxlan, and vsan ranges that are assigned to pools on Cisco ACI fabrics.
- More information from the internal APIC class
  I(fvns:EncapBlk) and I(fvns:VsanEncapBlk) at U(https://developer.cisco.com/site/aci/docs/apis/apic-mim-ref/).
author:
- <NAME> (@jmcgill298)
version_added: '2.5'
requirements:
- The C(pool) must exist in order to add or delete a range.
options:
  allocation_mode:
    description:
    - The method used for allocating encaps to resources.
    - Only vlan and vsan support allocation modes.
    aliases: [ mode ]
    choices: [ dynamic, inherit, static]
  description:
    description:
    - Description for the pool range.
    aliases: [ descr ]
  pool:
    description:
    - The name of the pool that the range should be assigned to.
    aliases: [ pool_name ]
  pool_type:
    description:
    - The encap type of C(pool).
    required: yes
    aliases: [ type ]
    choices: [ vlan, vxlan, vsan]
  range_end:
    description:
    - The end of encap range.
    aliases: [ end ]
  range_name:
    description:
    - The name to give to the encap range.
    aliases: [ name, range ]
  range_start:
    description:
    - The start of the encap range.
    aliases: [ start ]
  state:
    description:
    - Use C(present) or C(absent) for adding or removing.
    - Use C(query) for listing an object or multiple objects.
    choices: [ absent, present, query ]
    default: present
extends_documentation_fragment: aci
'''

EXAMPLES = r'''
- name: Add a new vlan range
  aci_pool_to_range:
    hostname: apic
    username: admin
    password: <PASSWORD>
    pool: production
    pool_type: vlan
    encap_start: 20
    encap_end: 50
    state: present

- name: Remove a vlan range
  aci_pool_to_range:
    hostname: apic
    username: admin
    password: <PASSWORD>
    pool: production
    pool_type: vlan
    encap_start: 20
    encap_end: 50
    state: absent

- name: Query a vlan range
  aci_pool_to_range:
    hostname: apic
    username: admin
    password: <PASSWORD>
    pool: production
    pool_type: vlan
    encap_start: 20
    encap_end: 50
    state: query

- name: Query a vlan pool for ranges
  aci_pool_to_range:
    hostname: apic
    username: admin
    password: <PASSWORD>
    pool: production
    pool_type: vlan
    state: query

- name: Query all vlan ranges
  aci_pool_to_range:
    hostname: apic
    username: admin
    password: <PASSWORD>
    pool_type: vlan
    state: query
'''

RETURN = r'''
#
'''
<commit_msg>Fix examples with correct names<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-

# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import absolute_import, division, print_function
__metaclass__ = type

ANSIBLE_METADATA = {'metadata_version': '1.1',
                    'status': ['preview'],
                    'supported_by': 'community'}

DOCUMENTATION = r'''
---
module: aci_encap_pool_range
short_description: Manage encap ranges assigned to pools on Cisco ACI fabrics (fvns:EncapBlk, fvns:VsanEncapBlk)
description:
- Manage vlan, vxlan, and vsan ranges that are assigned to pools on Cisco ACI fabrics.
- More information from the internal APIC class
  I(fvns:EncapBlk) and I(fvns:VsanEncapBlk) at U(https://developer.cisco.com/site/aci/docs/apis/apic-mim-ref/).
author:
- <NAME> (@jmcgill298)
version_added: '2.5'
requirements:
- The C(pool) must exist in order to add or delete a range.
options:
  allocation_mode:
    description:
    - The method used for allocating encaps to resources.
    - Only vlan and vsan support allocation modes.
    aliases: [ mode ]
    choices: [ dynamic, inherit, static]
  description:
    description:
    - Description for the pool range.
    aliases: [ descr ]
  pool:
    description:
    - The name of the pool that the range should be assigned to.
    aliases: [ pool_name ]
  pool_type:
    description:
    - The encap type of C(pool).
    required: yes
    aliases: [ type ]
    choices: [ vlan, vxlan, vsan]
  range_end:
    description:
    - The end of encap range.
    aliases: [ end ]
  range_name:
    description:
    - The name to give to the encap range.
    aliases: [ name, range ]
  range_start:
    description:
    - The start of the encap range.
    aliases: [ start ]
  state:
    description:
    - Use C(present) or C(absent) for adding or removing.
    - Use C(query) for listing an object or multiple objects.
    choices: [ absent, present, query ]
    default: present
extends_documentation_fragment: aci
'''

EXAMPLES = r'''
- name: Add a new vlan range
  aci_vlan_pool_encap_block:
    hostname: apic
    username: admin
    password: <PASSWORD>
    pool: production
    pool_type: vlan
    encap_start: 20
    encap_end: 50
    state: present

- name: Remove a vlan range
  aci_vlan_pool_encap_block:
    hostname: apic
    username: admin
    password: <PASSWORD>
    pool: production
    pool_type: vlan
    encap_start: 20
    encap_end: 50
    state: absent

- name: Query a vlan range
  aci_vlan_pool_encap_block:
    hostname: apic
    username: admin
    password: <PASSWORD>
    pool: production
    pool_type: vlan
    encap_start: 20
    encap_end: 50
    state: query

- name: Query a vlan pool for ranges
  aci_vlan_pool_encap_block:
    hostname: apic
    username: admin
    password: <PASSWORD>
    pool: production
    pool_type: vlan
    state: query

- name: Query all vlan ranges
  aci_vlan_pool_encap_block:
    hostname: apic
    username: admin
    password: <PASSWORD>
    pool_type: vlan
    state: query
'''

RETURN = r'''
#
'''

{'fraction_non_alphanumeric': 0.09096837300293446, 'fraction_numerical': 0.0078252363873492, 'mean_word_length': 2.9402697495183046, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '527325', 'n_tokens_mistral': 2115, 'n_tokens_neox': 2050, 'n_words': 644}