Skip to content

Commit

Permalink
Merge pull request #377 from gzecchi/develop
Browse files Browse the repository at this point in the history
Release v5.2.0 - Added the capability to handle OneView Appliance SNMP Settings
  • Loading branch information
sijeesh authored Mar 20, 2019
2 parents ebfb124 + cfa9ac7 commit f3292f0
Show file tree
Hide file tree
Showing 31 changed files with 3,172 additions and 6 deletions.
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
# Ansible Modules for HPE OneView Change Log

## v5.1.2 (Unreleased)
## v5.2.0 (Unreleased)

#### Notes
Added the capability to handle OneView Appliance SNMP Settings
This release adds the [endpoints-support.md](endpoints-support.md) file.
This release extends the planned support for the OneView REST API v800

#### Modules added
- oneview_appliance_device_read_community
- oneview_appliance_device_read_community_facts
- oneview_appliance_device_snmp_v1_trap_destinations
- oneview_appliance_device_snmp_v1_trap_destinations_facts
- oneview_appliance_device_snmp_v3_trap_destinations
- oneview_appliance_device_snmp_v3_trap_destinations_facts
- oneview_appliance_device_snmp_v3_users
- oneview_appliance_device_snmp_v3_users_facts

#### Big fixes
- [#392](https://github.com/HewlettPackard/oneview-ansible/issues/392) Use networkName field for SP with API600

#### Big fixes
- [#392](https://github.com/HewlettPackard/oneview-ansible/issues/392) Use networkName field for SP with API600
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Setting `no_log: true` is highly recommended in this case, as the credentials ar

### 4. Setting your OneView version

The Ansible modules for HPE OneView support the API endpoints for HPE OneView 2.0, 3.0, 3.10 and 4.0.
The Ansible modules for HPE OneView support the API endpoints for HPE OneView 2.0, 3.0, 3.10, 4.0 and 4.10.

The current `default` HPE OneView version used by the modules is `3.00`, API `300`.

Expand All @@ -201,6 +201,7 @@ The API list is as follows:
- HPE OneView 3.0 API version: `300`
- HPE OneView 3.10 API version: `500`
- HPE OneView 4.0 API version: `600`
- HPE OneView 4.10 API version: `800`

### 5. HPE Synergy Image Streamer

Expand Down
3 changes: 2 additions & 1 deletion build-doc/ansible_module_documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

try:
from ansible.utils import plugin_docs
from ansible.plugins.loader import fragment_loader
except ImportError:
# Ignored for the unit tests
pass
Expand Down Expand Up @@ -120,7 +121,7 @@ def main():
module_file_name = os.path.normpath(os.path.join(root, file_name))

# Tuple size may vary according to the Ansible version
docstring = plugin_docs.get_docstring(module_file_name)
docstring = plugin_docs.get_docstring(module_file_name, fragment_loader)
doc = docstring[0]
plainexamples = docstring[1]
returndocs = docstring[2]
Expand Down
28 changes: 26 additions & 2 deletions endpoints-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,37 @@

## HPE OneView

| Endpoints | Verb | V200 | V300 | V500 |V600
| --------------------------------------------------------------------------------------- | -------- | :------------------: | :------------------: | :------------------: | :------------------: |
| Endpoints | Verb | V200 | V300 | V500 | V600 | V800
| --------------------------------------------------------------------------------------- | -------- | :------------------: | :------------------: | :------------------: | :------------------: | :------------------: |
| **Alerts** |
|<sub>/rest/alerts </sub> |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/alerts/{id} </sub> |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/alerts/{id} </sub> |PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/alerts/{id} </sub> |DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| **Appliance Device Read Community String** |
|<sub>/rest/appliance/device-read-community-string</sub> |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/device-read-community-string</sub> |PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| **Appliance SNMPv1 Trap Destinations** |
|<sub>/rest/appliance/trap-destinations</sub> |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/trap-destinations/validation</sub> |POST | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/trap-destinations/{id}</sub> |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/trap-destinations/{id}</sub> |POST | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/trap-destinations/{id}</sub> |PUT | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/trap-destinations/{id}</sub> |DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| **Appliance SNMPv3 Trap Destinations** |
|<sub>/rest/appliance/snmpv3-trap-forwarding/destinations</sub> |GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/snmpv3-trap-forwarding/destinations</sub> |POST | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/snmpv3-trap-forwarding/destinations/validation</sub> |POST | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/snmpv3-trap-forwarding/destinations/{id}}</sub> |GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/snmpv3-trap-forwarding/destinations/{id}</sub> |PUT | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/snmpv3-trap-forwarding/destinations/{id}</sub> |DELETE | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
| **Appliance SNMPv3 Users** |
|<sub>/rest/appliance/snmpv3-trap-forwarding/users</sub> |GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/snmpv3-trap-forwarding/users</sub> |POST | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/snmpv3-trap-forwarding/users</sub> |DELETE | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/snmpv3-trap-forwarding/users/{id}}</sub> |GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/snmpv3-trap-forwarding/users/{id}</sub> |PUT | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/snmpv3-trap-forwarding/users/{id}</sub> |DELETE | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
| **Appliance Time and Locale Configuration** |
|<sub>/rest/appliance/configuration/time-locale</sub> |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/appliance/configuration/time-locale</sub> |POST | :white_check_mark: | :white_check_mark: | :white_check_mark: |
Expand Down
30 changes: 30 additions & 0 deletions examples/oneview_appliance_device_read_community.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
###
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###
---
- hosts: all
vars:
- config: "{{ playbook_dir }}/oneview_config.json"
tasks:
- name: Ensure that the Appliance Device Read Community is present with Community String 'public'
oneview_appliance_device_read_community:
config: "{{ config }}"
state: present
data:
communityString: 'public'
delegate_to: localhost

- debug:
var: appliance_device_read_community
27 changes: 27 additions & 0 deletions examples/oneview_appliance_device_read_community_facts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
###
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###
---
- hosts: all
vars:
- config: "{{ playbook_dir }}/oneview_config.json"
tasks:
- name: Gather facts about the Appliance snmp configuration
oneview_appliance_device_read_community_facts:
config: "{{ config }}"
delegate_to: localhost

- debug:
var: appliance_device_read_community
64 changes: 64 additions & 0 deletions examples/oneview_appliance_device_snmp_v1_trap_destinations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
###
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###
---
- hosts: all
vars:
- config: "{{ playbook_dir }}/oneview_config.json"
tasks:
- name: Create or Update an Appliance Device SNMPv1 Trap Destination by Destination Address
oneview_appliance_device_snmp_v1_trap_destinations:
config: "{{ config }}"
state: present
data:
communityString: "public"
destination: "10.0.0.1"
port: 162
delegate_to: localhost

- debug:
var: appliance_device_snmp_v1_trap_destinations

- name: Create or Update an Appliance Device SNMPv1 Trap Destination by URI
oneview_appliance_device_snmp_v1_trap_destinations:
config: "{{ config }}"
state: present
data:
communityString: "private"
uri: "/rest/appliance/trap-destinations/1"
port: 162
delegate_to: localhost

- debug:
var: appliance_device_snmp_v1_trap_destinations

- name: Delete an Appliance Device SNMPv1 Trap Destination by Destination Address
oneview_appliance_device_snmp_v1_trap_destinations:
config: "{{ config }}"
state: absent
data:
destination: "10.0.0.1"
delegate_to: localhost

- name: Delete an Appliance Device SNMPv1 Trap Destination by URI
oneview_appliance_device_snmp_v1_trap_destinations:
config: "{{ config }}"
state: absent
data:
uri: "/rest/appliance/trap-destinations/1"
delegate_to: localhost

- debug:
var: appliance_device_snmp_v1_trap_destinations
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
###
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###
---
- hosts: all
vars:
- config: "{{ playbook_dir }}/oneview_config.json"
tasks:
- name: Gather facts about all appliance SNMPv1 trap forwarding destinations.
oneview_appliance_device_snmp_v1_trap_destinations_facts:
config: "{{ config_file_path }}"
delegate_to: localhost

- debug:
var: appliance_device_snmp_v1_trap_destinations

- name: Gather paginated, filtered and sorted facts about SNMPv1 trap forwarding destinations
oneview_appliance_device_snmp_v1_trap_destinations_facts:
config: "{{ config }}"
params:
start: 0
count: 3
sort: 'destination:descending'
filter: "port='162'"
delegate_to: localhost

- debug:
var: appliance_device_snmp_v1_trap_destinations

- name: Gather facts about a Trap Destination by ID
oneview_appliance_device_snmp_v1_trap_destinations_facts:
config: "{{ config }}"
id: "1"
delegate_to: localhost

- debug:
var: appliance_device_snmp_v1_trap_destinations

- name: Gather facts about a Trap Destination by Destination
oneview_appliance_device_snmp_v1_trap_destinations_facts:
config: "{{ config }}"
destination: "1.1.1.1"
delegate_to: localhost

- debug:
var: appliance_device_snmp_v1_trap_destinations
53 changes: 53 additions & 0 deletions examples/oneview_appliance_device_snmp_v3_trap_destinations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
###
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###
---
- hosts: all
vars:
- config: "{{ playbook_dir }}/oneview_config.json"
tasks:
- name: Ensure that the SNMPv3 Trap Destination is present
oneview_appliance_device_snmp_v3_trap_destinations:
config: "{{ config }}"
state: present
data:
type: "Destination"
destinationAddress: "10.0.0.1"
port: 162
userId: "8e57d829-2f17-4167-ae23-8fb46607c76c"
delegate_to: localhost

- debug:
var: oneview_appliance_device_snmp_v3_trap_destinations

- name: Update the userId of specified SNMPv3 Trap Destination
oneview_appliance_device_snmp_v3_trap_destinations:
config: "{{ config }}"
state: present
data:
destinationAddress: "10.0.0.1"
userId: "3953867c-5283-4059-a9ae-33487f901e85"
delegate_to: localhost

- debug:
var: oneview_appliance_device_snmp_v3_trap_destinations

- name: Ensure that the SNMPv3 Trap Destination is absent
oneview_appliance_device_snmp_v3_trap_destinations:
config: "{{ config }}"
state: absent
data:
destinationAddress: "10.0.0.1"
delegate_to: localhost
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
###
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###
---
- hosts: all
vars:
- config: "{{ playbook_dir }}/oneview_config.json"
tasks:
- name: Gather facts about the appliance SNMPv3 trap forwarding destinations.
oneview_appliance_device_snmp_v3_trap_destinations_facts:
config: "{{ config }}"
delegate_to: localhost

- debug:
var: appliance_device_snmp_v3_trap_destinations

- name: Gather paginated, filtered and sorted facts about SNMPv3 trap forwarding destinations
oneview_appliance_device_snmp_v3_trap_destinations_facts:
config: "{{ config }}"
params:
start: 0
count: 3
sort: 'destinationAddress:descending'
filter: "port='162'"
delegate_to: localhost

- debug:
var: appliance_device_snmp_v3_trap_destinations

- name: Gather facts about a Trap Destination by ID
oneview_appliance_device_snmp_v3_trap_destinations_facts:
config: "{{ config }}"
id: "19dc6a96-bd04-4724-819b-32bc660fcefc"
delegate_to: localhost

- debug:
var: appliance_device_snmp_v3_trap_destinations
Loading

0 comments on commit f3292f0

Please sign in to comment.