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

# (c) 2017, <NAME> (<EMAIL>)
# 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: purefa_snap
version_added: '2.4'
short_description: Manage volume snapshots on Pure Storage FlashArrays
description:
- Create or delete volumes and volume snapshots on Pure Storage FlashArray.
author:
- <NAME> (@sdodsley)
options:
  name:
    description:
    - The name of the source volume.
    required: true
  suffix:
    description:
    - Suffix of snapshot name.
  target:
    description:
    - Name of target volume if creating from snapshot.
  overwrite:
    description:
    - Define whether to overwrite existing volume when creating from snapshot.
    type: bool
    default: 'no'
  state:
    description:
    - Define whether the volume snapshot should exist or not.
    choices: [ absent, copy, present ]
    default: present
  eradicate:
    description:
    - Define whether to eradicate the snapshot on delete or leave in trash.
    type: bool
    default: 'no'
extends_documentation_fragment:
- purestorage
'''

EXAMPLES = r'''
- name: Create snapshot foo.ansible
  purefa_snap:
    name: foo
    suffix: ansible
    fa_url: 10.10.10.2
    fa_api_token: <PASSWORD>
    state: present

- name: Create R/W clone foo_clone from snapshot foo.snap
  purefa_snap:
    name: foo
    suffix: snap
    target: foo_clone
    fa_url: 10.10.10.2
    fa_api_token: <PASSWORD>
    state: copy

- name: Overwrite existing volume foo_clone with snapshot foo.snap
  purefa_snap:
    name: foo
    suffix: snap
    target: foo_clone
    overwrite: true
    fa_url: 10.10.10.2
    fa_api_token: <PASSWORD>
    state: copy

- name: Delete and eradicate snapshot named foo.snap
  purefa_snap:
    name: foo
    suffix: snap
    eradicate: true
    fa_url: 10.10.10.2
    fa_api_token: <PASSWORD>
    state: absent
'''

RETURN = r'''
'''
<commit_msg>Fix issue #32138 - fix examples typo (#32140)<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-

# (c) 2017, <NAME> (<EMAIL>)
# 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: purefa_snap
version_added: '2.4'
short_description: Manage volume snapshots on Pure Storage FlashArrays
description:
- Create or delete volumes and volume snapshots on Pure Storage FlashArray.
author:
- <NAME> (@sdodsley)
options:
  name:
    description:
    - The name of the source volume.
    required: true
  suffix:
    description:
    - Suffix of snapshot name.
  target:
    description:
    - Name of target volume if creating from snapshot.
  overwrite:
    description:
    - Define whether to overwrite existing volume when creating from snapshot.
    type: bool
    default: 'no'
  state:
    description:
    - Define whether the volume snapshot should exist or not.
    choices: [ absent, copy, present ]
    default: present
  eradicate:
    description:
    - Define whether to eradicate the snapshot on delete or leave in trash.
    type: bool
    default: 'no'
extends_documentation_fragment:
- purestorage
'''

EXAMPLES = r'''
- name: Create snapshot foo.ansible
  purefa_snap:
    name: foo
    suffix: ansible
    fa_url: 10.10.10.2
    api_token: <PASSWORD>
    state: present

- name: Create R/W clone foo_clone from snapshot foo.snap
  purefa_snap:
    name: foo
    suffix: snap
    target: foo_clone
    fa_url: 10.10.10.2
    api_token: <PASSWORD>
    state: copy

- name: Overwrite existing volume foo_clone with snapshot foo.snap
  purefa_snap:
    name: foo
    suffix: snap
    target: foo_clone
    overwrite: true
    fa_url: 10.10.10.2
    api_token: <PASSWORD>
    state: copy

- name: Delete and eradicate snapshot named foo.snap
  purefa_snap:
    name: foo
    suffix: snap
    eradicate: true
    fa_url: 10.10.10.2
    api_token: <PASSWORD>
    state: absent
'''

RETURN = r'''
'''

{'fraction_non_alphanumeric': 0.09708958617553433, 'fraction_numerical': 0.020918599363346977, 'mean_word_length': 2.945291479820628, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 8, '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': '3951255', 'n_tokens_mistral': 1467, 'n_tokens_neox': 1392, 'n_words': 452}