Skip to content

Commit

Permalink
[PR #9373/d96e5604 backport][stable-10] [onev ... ovh]*.py: normalize…
Browse files Browse the repository at this point in the history
… docs (#9381)

[onev ... ovh]*.py: normalize docs (#9373)

* [onev ... ovh]*.py: normalize docs

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit d96e560)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
  • Loading branch information
patchback[bot] and russoz authored Dec 25, 2024
1 parent 60ba39d commit e38f9e5
Show file tree
Hide file tree
Showing 25 changed files with 962 additions and 1,027 deletions.
62 changes: 30 additions & 32 deletions plugins/modules/oneview_datacenter_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,41 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: oneview_datacenter_info
short_description: Retrieve information about the OneView Data Centers
description:
- Retrieve information about the OneView Data Centers.
- Retrieve information about the OneView Data Centers.
requirements:
- "hpOneView >= 2.0.1"
- "hpOneView >= 2.0.1"
author:
- Alex Monteiro (@aalexmonteiro)
- Madhav Bharadwaj (@madhav-bharadwaj)
- Priyanka Sood (@soodpr)
- Ricardo Galeno (@ricardogpsf)
- Alex Monteiro (@aalexmonteiro)
- Madhav Bharadwaj (@madhav-bharadwaj)
- Priyanka Sood (@soodpr)
- Ricardo Galeno (@ricardogpsf)
attributes:
check_mode:
version_added: 3.3.0
# This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix
check_mode:
version_added: 3.3.0
# This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix
options:
name:
description:
- Data Center name.
type: str
options:
description:
- "Retrieve additional information. Options available: 'visualContent'."
type: list
elements: str
name:
description:
- Data Center name.
type: str
options:
description:
- "Retrieve additional information. Options available: V(visualContent)."
type: list
elements: str
extends_documentation_fragment:
- community.general.oneview
- community.general.oneview.factsparams
- community.general.attributes
- community.general.attributes.info_module
"""

'''

EXAMPLES = '''
EXAMPLES = r"""
- name: Gather information about all Data Centers
community.general.oneview_datacenter_info:
hostname: 172.16.101.48
Expand Down Expand Up @@ -107,19 +105,19 @@
- name: Print fetched information about Data Center Visual Content
ansible.builtin.debug:
msg: "{{ result.datacenter_visual_content }}"
'''
"""

RETURN = '''
RETURN = r"""
datacenters:
description: Has all the OneView information about the Data Centers.
returned: Always, but can be null.
type: dict
description: Has all the OneView information about the Data Centers.
returned: Always, but can be null.
type: dict
datacenter_visual_content:
description: Has information about the Data Center Visual Content.
returned: When requested, but can be null.
type: dict
'''
description: Has information about the Data Center Visual Content.
returned: When requested, but can be null.
type: dict
"""

from ansible_collections.community.general.plugins.module_utils.oneview import OneViewModuleBase

Expand Down
86 changes: 41 additions & 45 deletions plugins/modules/oneview_enclosure_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,41 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: oneview_enclosure_info
short_description: Retrieve information about one or more Enclosures
description:
- Retrieve information about one or more of the Enclosures from OneView.
- Retrieve information about one or more of the Enclosures from OneView.
requirements:
- hpOneView >= 2.0.1
- hpOneView >= 2.0.1
author:
- Felipe Bulsoni (@fgbulsoni)
- Thiago Miotto (@tmiotto)
- Adriane Cardozo (@adriane-cardozo)
- Felipe Bulsoni (@fgbulsoni)
- Thiago Miotto (@tmiotto)
- Adriane Cardozo (@adriane-cardozo)
attributes:
check_mode:
version_added: 3.3.0
# This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix
check_mode:
version_added: 3.3.0
# This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix
options:
name:
description:
- Enclosure name.
type: str
options:
description:
- "List with options to gather additional information about an Enclosure and related resources.
Options allowed: V(script), V(environmentalConfiguration), and V(utilization). For the option V(utilization),
you can provide specific parameters."
type: list
elements: raw
name:
description:
- Enclosure name.
type: str
options:
description:
- 'List with options to gather additional information about an Enclosure and related resources. Options allowed: V(script), V(environmentalConfiguration),
and V(utilization). For the option V(utilization), you can provide specific parameters.'
type: list
elements: raw
extends_documentation_fragment:
- community.general.oneview
- community.general.oneview.factsparams
- community.general.attributes
- community.general.attributes.info_module
"""

'''

EXAMPLES = '''
EXAMPLES = r"""
- name: Gather information about all Enclosures
community.general.oneview_enclosure_info:
hostname: 172.16.101.48
Expand Down Expand Up @@ -98,9 +95,9 @@
community.general.oneview_enclosure_info:
name: Test-Enclosure
options:
- script # optional
- environmentalConfiguration # optional
- utilization # optional
- script # optional
- environmentalConfiguration # optional
- utilization # optional
hostname: 172.16.101.48
username: administrator
password: my_password
Expand All @@ -125,12 +122,11 @@
ansible.builtin.debug:
msg: "{{ result.enclosure_utilization }}"
- name: "Gather information about an Enclosure with temperature data at a resolution of one sample per day, between two
specified dates"
- name: "Gather information about an Enclosure with temperature data at a resolution of one sample per day, between two specified dates"
community.general.oneview_enclosure_info:
name: Test-Enclosure
options:
- utilization: # optional
- utilization: # optional
fields: AmbientTemperature
filter:
- startDate=2016-07-01T14:29:42.000Z
Expand All @@ -152,29 +148,29 @@
- name: Print fetched information about Enclosure Utilization
ansible.builtin.debug:
msg: "{{ result.enclosure_utilization }}"
'''
"""

RETURN = '''
RETURN = r"""
enclosures:
description: Has all the OneView information about the Enclosures.
returned: Always, but can be null.
type: dict
description: Has all the OneView information about the Enclosures.
returned: Always, but can be null.
type: dict
enclosure_script:
description: Has all the OneView information about the script of an Enclosure.
returned: When requested, but can be null.
type: str
description: Has all the OneView information about the script of an Enclosure.
returned: When requested, but can be null.
type: str
enclosure_environmental_configuration:
description: Has all the OneView information about the environmental configuration of an Enclosure.
returned: When requested, but can be null.
type: dict
description: Has all the OneView information about the environmental configuration of an Enclosure.
returned: When requested, but can be null.
type: dict
enclosure_utilization:
description: Has all the OneView information about the utilization of an Enclosure.
returned: When requested, but can be null.
type: dict
'''
description: Has all the OneView information about the utilization of an Enclosure.
returned: When requested, but can be null.
type: dict
"""

from ansible_collections.community.general.plugins.module_utils.oneview import OneViewModuleBase

Expand Down
88 changes: 43 additions & 45 deletions plugins/modules/oneview_ethernet_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,44 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: oneview_ethernet_network
short_description: Manage OneView Ethernet Network resources
description:
- Provides an interface to manage Ethernet Network resources. Can create, update, or delete.
- Provides an interface to manage Ethernet Network resources. Can create, update, or delete.
requirements:
- hpOneView >= 3.1.0
- hpOneView >= 3.1.0
author:
- Felipe Bulsoni (@fgbulsoni)
- Thiago Miotto (@tmiotto)
- Adriane Cardozo (@adriane-cardozo)
- Felipe Bulsoni (@fgbulsoni)
- Thiago Miotto (@tmiotto)
- Adriane Cardozo (@adriane-cardozo)
attributes:
check_mode:
support: none
diff_mode:
support: none
check_mode:
support: none
diff_mode:
support: none
options:
state:
description:
- Indicates the desired state for the Ethernet Network resource.
- V(present) will ensure data properties are compliant with OneView.
- V(absent) will remove the resource from OneView, if it exists.
- V(default_bandwidth_reset) will reset the network connection template to the default.
type: str
default: present
choices: [present, absent, default_bandwidth_reset]
data:
description:
- List with Ethernet Network properties.
type: dict
required: true
state:
description:
- Indicates the desired state for the Ethernet Network resource.
- V(present) will ensure data properties are compliant with OneView.
- V(absent) will remove the resource from OneView, if it exists.
- V(default_bandwidth_reset) will reset the network connection template to the default.
type: str
default: present
choices: [present, absent, default_bandwidth_reset]
data:
description:
- List with Ethernet Network properties.
type: dict
required: true
extends_documentation_fragment:
- community.general.oneview
- community.general.oneview.validateetag
- community.general.attributes
- community.general.oneview
- community.general.oneview.validateetag
- community.general.attributes
"""

'''

EXAMPLES = '''
EXAMPLES = r"""
- name: Ensure that the Ethernet Network is present using the default configuration
community.general.oneview_ethernet_network:
config: '/etc/oneview/oneview_config.json'
Expand All @@ -64,8 +62,8 @@
name: 'Test Ethernet Network'
purpose: Management
bandwidth:
maximumBandwidth: 3000
typicalBandwidth: 2000
maximumBandwidth: 3000
typicalBandwidth: 2000
delegate_to: localhost
- name: Ensure that the Ethernet Network is present with name 'Renamed Ethernet Network'
Expand Down Expand Up @@ -107,24 +105,24 @@
data:
name: 'Test Ethernet Network'
delegate_to: localhost
'''
"""

RETURN = '''
RETURN = r"""
ethernet_network:
description: Has the facts about the Ethernet Networks.
returned: On state 'present'. Can be null.
type: dict
description: Has the facts about the Ethernet Networks.
returned: On O(state=present). Can be null.
type: dict
ethernet_network_bulk:
description: Has the facts about the Ethernet Networks affected by the bulk insert.
returned: When 'vlanIdRange' attribute is in data argument. Can be null.
type: dict
description: Has the facts about the Ethernet Networks affected by the bulk insert.
returned: When V(vlanIdRange) attribute is in O(data) argument. Can be null.
type: dict
ethernet_network_connection_template:
description: Has the facts about the Ethernet Network Connection Template.
returned: On state 'default_bandwidth_reset'. Can be null.
type: dict
'''
description: Has the facts about the Ethernet Network Connection Template.
returned: On O(state=default_bandwidth_reset). Can be null.
type: dict
"""

from ansible_collections.community.general.plugins.module_utils.oneview import OneViewModuleBase, OneViewModuleResourceNotFound

Expand Down
Loading

0 comments on commit e38f9e5

Please sign in to comment.