From 6fadddeaba390fd5d801729c091272ff38c2e285 Mon Sep 17 00:00:00 2001
From: Damien <dgarros@gmail.com>
Date: Tue, 21 Feb 2017 06:56:12 -0800
Subject: [PATCH] network/aos - Fix doc for session information (#21718)

* Fix EXAMPLES to make session variable homogeneous across all modules

* Fix parameter name in EXAMPLE, template not design_template
---
 .../modules/network/aos/aos_asn_pool.py        | 12 ++++++------
 .../modules/network/aos/aos_blueprint.py       | 12 ++++++------
 .../modules/network/aos/aos_blueprint_param.py | 10 +++++-----
 .../network/aos/aos_blueprint_virtnet.py       |  6 +++---
 .../modules/network/aos/aos_external_router.py | 14 +++++++-------
 lib/ansible/modules/network/aos/aos_ip_pool.py | 18 +++++++++---------
 .../modules/network/aos/aos_logical_device.py  | 10 +++++-----
 .../network/aos/aos_logical_device_map.py      | 16 ++++++++--------
 .../modules/network/aos/aos_rack_type.py       | 10 +++++-----
 .../modules/network/aos/aos_template.py        | 14 +++++++-------
 10 files changed, 61 insertions(+), 61 deletions(-)

diff --git a/lib/ansible/modules/network/aos/aos_asn_pool.py b/lib/ansible/modules/network/aos/aos_asn_pool.py
index aa3ba351b7c..fcfe43fe575 100644
--- a/lib/ansible/modules/network/aos/aos_asn_pool.py
+++ b/lib/ansible/modules/network/aos/aos_asn_pool.py
@@ -66,7 +66,7 @@ EXAMPLES = '''
 
 - name: "Create ASN Pool"
   aos_asn_pool:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "my-asn-pool"
     ranges:
       - [ 100, 200 ]
@@ -86,32 +86,32 @@ EXAMPLES = '''
 
 - name: "Delete ASN Pool"
   aos_asn_pool:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "my-asn-pool"
     state: absent
 
 - name: "Load ASN Pool from File(JSON)"
   aos_asn_pool:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/asn_pool_saved.json') }}"
     state: present
 
 - name: "Delete ASN Pool from File(JSON)"
   aos_asn_pool:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/asn_pool_saved.json') }}"
     state: absent
 
 - name: "Load ASN Pool from File(Yaml)"
   aos_asn_pool:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/asn_pool_saved.yaml') }}"
     state: present
   register: test
 
 - name: "Delete ASN Pool from File(Yaml)"
   aos_asn_pool:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/asn_pool_saved.yaml') }}"
     state: absent
 '''
diff --git a/lib/ansible/modules/network/aos/aos_blueprint.py b/lib/ansible/modules/network/aos/aos_blueprint.py
index 110bfb2e8f2..e6ec2f7e5d0 100644
--- a/lib/ansible/modules/network/aos/aos_blueprint.py
+++ b/lib/ansible/modules/network/aos/aos_blueprint.py
@@ -71,29 +71,29 @@ options:
 EXAMPLES = '''
 - name: Creating blueprint
   aos_blueprint:
-    session: "{{aos_session}}"
+    session: "{{ aos_session }}"
     name: "my-blueprint"
-    design_template: "my-template"
+    template: "my-template"
     reference_arch: two_stage_l3clos
     state: present
 
 - name: Access a blueprint and get content
   aos_blueprint:
-    session: "{{aos_session}}"
+    session: "{{ aos_session }}"
     name: "{{ blueprint_name }}"
-    design_template: "{{ blueprint_template }}"
+    template: "{{ blueprint_template }}"
     state: present
   register: bp
 
 - name: Delete a blueprint
   aos_blueprint:
-    session: "{{aos_session}}"
+    session: "{{ aos_session }}"
     name: "my-blueprint"
     state: absent
 
 - name: Await blueprint build-ready, and obtain contents
   aos_blueprint:
-    session: "{{aos_session}}"
+    session: "{{ aos_session }}"
     name: "{{ blueprint_name }}"
     state: build-ready
   register: bp
diff --git a/lib/ansible/modules/network/aos/aos_blueprint_param.py b/lib/ansible/modules/network/aos/aos_blueprint_param.py
index d6e3a99fb23..7b74b976f63 100644
--- a/lib/ansible/modules/network/aos/aos_blueprint_param.py
+++ b/lib/ansible/modules/network/aos/aos_blueprint_param.py
@@ -77,7 +77,7 @@ EXAMPLES = '''
 
 - name: Add Logical Device Maps information in a Blueprint
   aos_blueprint_param:
-    session: "{{session_ok}}"
+    session: "{{ aos_session }}"
     blueprint: "my-blueprint-l2"
     name: "logical_device_maps"
     value:
@@ -90,21 +90,21 @@ EXAMPLES = '''
 
 - name: Access Logical Device Maps information from a Blueprint
   aos_blueprint_param:
-    session: "{{session_ok}}"
+    session: "{{ aos_session }}"
     blueprint: "my-blueprint-l2"
     name: "logical_device_maps"
     state: present
 
 - name: Reset Logical Device Maps information in a Blueprint
   aos_blueprint_param:
-    session: "{{session_ok}}"
+    session: "{{ aos_session }}"
     blueprint: "my-blueprint-l2"
     name: "logical_device_maps"
     state: absent
 
 - name: Get list of all supported Params for a blueprint
   aos_blueprint_param:
-    session: "{{session_ok}}"
+    session: "{{ aos_session }}"
     blueprint: "my-blueprint-l2"
     get_param_list: yes
   register: params_list
@@ -112,7 +112,7 @@ EXAMPLES = '''
 
 - name: Add Resource Pools information in a Blueprint, by providing a param_map
   aos_blueprint_param:
-    session: "{{session_ok}}"
+    session: "{{ aos_session }}"
     blueprint: "my-blueprint-l2"
     name: "resource_pools"
     value:
diff --git a/lib/ansible/modules/network/aos/aos_blueprint_virtnet.py b/lib/ansible/modules/network/aos/aos_blueprint_virtnet.py
index 4ad2559dcc2..38a98944725 100644
--- a/lib/ansible/modules/network/aos/aos_blueprint_virtnet.py
+++ b/lib/ansible/modules/network/aos/aos_blueprint_virtnet.py
@@ -61,21 +61,21 @@ EXAMPLES = '''
 
 - name: "Access Existing Virtual Network"
   aos_blueprint_virtnet:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     blueprint: "my-blueprint-l2"
     name: "my-virtual-network"
     state: present
 
 - name: "Delete Virtual Network with JSON File"
   aos_blueprint_virtnet:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     blueprint: "my-blueprint-l2"
     content: "{{ lookup('file', 'resources/virtual-network-02.json') }}"
     state: absent
 
 - name: "Create Virtual Network"
   aos_blueprint_virtnet:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     blueprint: "my-blueprint-l2"
     content: "{{ lookup('file', 'resources/virtual-network-02.json') }}"
     state: present
diff --git a/lib/ansible/modules/network/aos/aos_external_router.py b/lib/ansible/modules/network/aos/aos_external_router.py
index 63c72b3574c..0185eef60c5 100644
--- a/lib/ansible/modules/network/aos/aos_external_router.py
+++ b/lib/ansible/modules/network/aos/aos_external_router.py
@@ -69,7 +69,7 @@ EXAMPLES = '''
 
 - name: "Create an External Router"
   aos_external_router:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "my-external-router"
     loopback: 10.0.0.1
     asn: 65000
@@ -77,26 +77,26 @@ EXAMPLES = '''
 
 - name: "Check if an External Router exist by ID"
   aos_external_router:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "45ab26fc-c2ed-4307-b330-0870488fa13e"
     state: present
 
 - name: "Delete an External Router by name"
   aos_external_router:
-    session: "{{ session }}"
+    session: "{{ aos_session }}"
     name: "my-external-router"
     state: absent
 
 - name: "Delete an External Router by id"
   aos_external_router:
-    session: "{{ session }}"
+    session: "{{ aos_session }}"
     id: "45ab26fc-c2ed-4307-b330-0870488fa13e"
     state: absent
 
 # Save an External Router to a file
 - name: "Access External Router 1/3"
   aos_external_router:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "my-external-router"
     state: present
   register: external_router
@@ -113,13 +113,13 @@ EXAMPLES = '''
 
 - name: "Load External Router from a JSON file"
   aos_external_router:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/external_router_saved.json') }}"
     state: present
 
 - name: "Load External Router from a YAML file"
   aos_external_router:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/external_router_saved.yaml') }}"
     state: present
 '''
diff --git a/lib/ansible/modules/network/aos/aos_ip_pool.py b/lib/ansible/modules/network/aos/aos_ip_pool.py
index 69fa67a89db..89ab7bb536c 100644
--- a/lib/ansible/modules/network/aos/aos_ip_pool.py
+++ b/lib/ansible/modules/network/aos/aos_ip_pool.py
@@ -66,34 +66,34 @@ EXAMPLES = '''
 
 - name: "Create an IP Pool with one subnet"
   aos_ip_pool:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "my-ip-pool"
     subnets: [ 172.10.0.0/16 ]
     state: present
 
 - name: "Create an IP Pool with multiple subnets"
   aos_ip_pool:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "my-other-ip-pool"
     subnets: [ 172.10.0.0/16, 192.168.0.0./24 ]
     state: present
 
 - name: "Check if an IP Pool exist with same subnets by ID"
   aos_ip_pool:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "45ab26fc-c2ed-4307-b330-0870488fa13e"
     subnets: [ 172.10.0.0/16, 192.168.0.0./24 ]
     state: present
 
 - name: "Delete an IP Pool by name"
   aos_ip_pool:
-    session: "{{ session }}"
+    session: "{{ aos_session }}"
     name: "my-ip-pool"
     state: absent
 
 - name: "Delete an IP pool by id"
   aos_ip_pool:
-    session: "{{ session }}"
+    session: "{{ aos_session }}"
     id: "45ab26fc-c2ed-4307-b330-0870488fa13e"
     state: absent
 
@@ -101,7 +101,7 @@ EXAMPLES = '''
 
 - name: "Access IP Pool 1/3"
   aos_ip_pool:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "my-ip-pool"
     subnets: [ 172.10.0.0/16, 172.12.0.0/16 ]
     state: present
@@ -119,19 +119,19 @@ EXAMPLES = '''
 
 - name: "Load IP Pool from a JSON file"
   aos_ip_pool:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/ip_pool_saved.json') }}"
     state: present
 
 - name: "Load IP Pool from a YAML file"
   aos_ip_pool:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/ip_pool_saved.yaml') }}"
     state: present
 
 - name: "Load IP Pool from a Variable"
   aos_ip_pool:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content:
       display_name: my-ip-pool
       id: 4276738d-6f86-4034-9656-4bff94a34ea7
diff --git a/lib/ansible/modules/network/aos/aos_logical_device.py b/lib/ansible/modules/network/aos/aos_logical_device.py
index fe8229d14fb..363409a4b09 100644
--- a/lib/ansible/modules/network/aos/aos_logical_device.py
+++ b/lib/ansible/modules/network/aos/aos_logical_device.py
@@ -64,13 +64,13 @@ EXAMPLES = '''
 
 - name: "Delete a Logical Device by name"
   aos_logical_device:
-    session: "{{ session }}"
+    session: "{{ aos_session }}"
     name: "my-logical-device"
     state: absent
 
 - name: "Delete a Logical Device by id"
   aos_logical_device:
-    session: "{{ session }}"
+    session: "{{ aos_session }}"
     id: "45ab26fc-c2ed-4307-b330-0870488fa13e"
     state: absent
 
@@ -78,7 +78,7 @@ EXAMPLES = '''
 
 - name: "Access Logical Device 1/3"
   aos_logical_device:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "my-logical-device"
     state: present
   register: logical_device
@@ -93,13 +93,13 @@ EXAMPLES = '''
 
 - name: "Load Logical Device from a JSON file"
   aos_logical_device:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/logical_device_saved.json') }}"
     state: present
 
 - name: "Load Logical Device from a YAML file"
   aos_logical_device:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/logical_device_saved.yaml') }}"
     state: present
 '''
diff --git a/lib/ansible/modules/network/aos/aos_logical_device_map.py b/lib/ansible/modules/network/aos/aos_logical_device_map.py
index 9dadc949740..6cf772ea212 100644
--- a/lib/ansible/modules/network/aos/aos_logical_device_map.py
+++ b/lib/ansible/modules/network/aos/aos_logical_device_map.py
@@ -63,31 +63,31 @@ EXAMPLES = '''
 
 - name: "Create an Logical Device Map with one subnet"
   aos_logical_device_map:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "my-logical-device-map"
     state: present
 
 - name: "Create an Logical Device Map with multiple subnets"
   aos_logical_device_map:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "my-other-logical-device-map"
     state: present
 
 - name: "Check if an Logical Device Map exist with same subnets by ID"
   aos_logical_device_map:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "45ab26fc-c2ed-4307-b330-0870488fa13e"
     state: present
 
 - name: "Delete an Logical Device Map by name"
   aos_logical_device_map:
-    session: "{{ session }}"
+    session: "{{ aos_session }}"
     name: "my-logical-device-map"
     state: absent
 
 - name: "Delete an Logical Device Map by id"
   aos_logical_device_map:
-    session: "{{ session }}"
+    session: "{{ aos_session }}"
     id: "45ab26fc-c2ed-4307-b330-0870488fa13e"
     state: absent
 
@@ -95,7 +95,7 @@ EXAMPLES = '''
 
 - name: "Access Logical Device Map 1/3"
   aos_logical_device_map:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "my-logical-device-map"
     state: present
   register: logical_device_map
@@ -112,13 +112,13 @@ EXAMPLES = '''
 
 - name: "Load Logical Device Map from a JSON file"
   aos_logical_device_map:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/logical_device_map_saved.json') }}"
     state: present
 
 - name: "Load Logical Device Map from a YAML file"
   aos_logical_device_map:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/logical_device_map_saved.yaml') }}"
     state: present
 
diff --git a/lib/ansible/modules/network/aos/aos_rack_type.py b/lib/ansible/modules/network/aos/aos_rack_type.py
index a414a7d7462..d4f1fff3484 100644
--- a/lib/ansible/modules/network/aos/aos_rack_type.py
+++ b/lib/ansible/modules/network/aos/aos_rack_type.py
@@ -64,13 +64,13 @@ EXAMPLES = '''
 
 - name: "Delete a Rack Type by name"
   aos_rack_type:
-    session: "{{ session }}"
+    session: "{{ aos_session }}"
     name: "my-rack-type"
     state: absent
 
 - name: "Delete a Rack Type by id"
   aos_rack_type:
-    session: "{{ session }}"
+    session: "{{ aos_session }}"
     id: "45ab26fc-c2ed-4307-b330-0870488fa13e"
     state: absent
 
@@ -78,7 +78,7 @@ EXAMPLES = '''
 
 - name: "Access Rack Type 1/3"
   aos_rack_type:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "my-rack-type"
     state: present
   register: rack_type
@@ -93,13 +93,13 @@ EXAMPLES = '''
 
 - name: "Load Rack Type from a JSON file"
   aos_rack_type:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/rack_type_saved.json') }}"
     state: present
 
 - name: "Load Rack Type from a YAML file"
   aos_rack_type:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/rack_type_saved.yaml') }}"
     state: present
 '''
diff --git a/lib/ansible/modules/network/aos/aos_template.py b/lib/ansible/modules/network/aos/aos_template.py
index c9bf9439797..9a94fa96435 100644
--- a/lib/ansible/modules/network/aos/aos_template.py
+++ b/lib/ansible/modules/network/aos/aos_template.py
@@ -63,31 +63,31 @@ EXAMPLES = '''
 
 - name: "Check if an Template exist by name"
   aos_template:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "my-template"
     state: present
 
 - name: "Check if an Template exist by ID"
   aos_template:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     id: "45ab26fc-c2ed-4307-b330-0870488fa13e"
     state: present
 
 - name: "Delete an Template by name"
   aos_template:
-    session: "{{ session }}"
+    session: "{{ aos_session }}"
     name: "my-template"
     state: absent
 
 - name: "Delete an Template by id"
   aos_template:
-    session: "{{ session }}"
+    session: "{{ aos_session }}"
     id: "45ab26fc-c2ed-4307-b330-0870488fa13e"
     state: absent
 
 - name: "Access Template 1/3"
   aos_template:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     name: "my-template"
     state: present
   register: template
@@ -102,13 +102,13 @@ EXAMPLES = '''
 
 - name: "Load Template from File (Json)"
   aos_template:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/template_saved.json') }}"
     state: present
 
 - name: "Load Template from File (yaml)"
   aos_template:
-    session: "{{ session_ok }}"
+    session: "{{ aos_session }}"
     content: "{{ lookup('file', 'resources/template_saved.yaml') }}"
     state: present
 '''