From 21a95c0a1650baa74aba7f5e3af668cc05afca52 Mon Sep 17 00:00:00 2001 From: Fred-sun <37327967+Fred-sun@users.noreply.github.com> Date: Tue, 18 Jun 2019 22:19:52 +0800 Subject: [PATCH] Update azure_rm_route related document (#57928) * Update docs for azure_rm_route, azure_rm_routetable, and azure_rm_routetable_facts --- .../modules/cloud/azure/azure_rm_route.py | 15 +++---- .../cloud/azure/azure_rm_routetable.py | 21 ++++++---- .../cloud/azure/azure_rm_routetable_facts.py | 42 ++++++++++++------- 3 files changed, 47 insertions(+), 31 deletions(-) diff --git a/lib/ansible/modules/cloud/azure/azure_rm_route.py b/lib/ansible/modules/cloud/azure/azure_rm_route.py index ed2a046502c..dd2d0e83249 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_route.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_route.py @@ -17,22 +17,21 @@ DOCUMENTATION = ''' --- module: azure_rm_route version_added: "2.7" -short_description: Manage Azure route resource. +short_description: Manage Azure route resource description: - Create, update or delete a route. options: resource_group: description: - - name of resource group. + - Name of resource group. required: true name: description: - - name of the route. + - Name of the route. required: true state: description: - - Assert the state of the route. Use C(present) to create or update and - C(absent) to delete. + - Assert the state of the route. Use C(present) to create or update and C(absent) to delete. default: present choices: - absent @@ -65,7 +64,7 @@ extends_documentation_fragment: - azure_tags author: - - "Yuwei Zhou (@yuwzho)" + - Yuwei Zhou (@yuwzho) ''' @@ -87,9 +86,11 @@ EXAMPLES = ''' ''' RETURN = ''' id: - description: Current state of the route. + description: + - Current state of the route. returned: success type: str + sample: "/subscriptions/xxxx...xxxx/resourceGroups/v-xisuRG/providers/Microsoft.Network/routeTables/tableb57/routes/routeb57" ''' try: diff --git a/lib/ansible/modules/cloud/azure/azure_rm_routetable.py b/lib/ansible/modules/cloud/azure/azure_rm_routetable.py index 1dc6180ba83..8eb203b93df 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_routetable.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_routetable.py @@ -17,22 +17,21 @@ DOCUMENTATION = ''' --- module: azure_rm_routetable version_added: "2.7" -short_description: Manage Azure route table resource. +short_description: Manage Azure route table resource description: - Create, update or delete a route table. options: resource_group: description: - - name of resource group. + - Name of resource group. required: true name: description: - - name of the route table. + - Name of the route table. required: true state: description: - - Assert the state of the route table. Use C(present) to create or update and - C(absent) to delete. + - Assert the state of the route table. Use C(present) to create or update and C(absent) to delete. default: present choices: - absent @@ -45,14 +44,14 @@ options: location: description: - Region of the resource. - - Derived from C(resource_group) if not specified + - Derived from I(resource_group) if not specified. extends_documentation_fragment: - azure - azure_tags author: - - "Yuwei Zhou (@yuwzho)" + - Yuwei Zhou (@yuwzho) ''' @@ -73,13 +72,17 @@ EXAMPLES = ''' ''' RETURN = ''' changed: - description: Whether the resource is changed. + description: + - Whether the resource is changed. returned: always type: bool + sample: true id: - description: resource id. + description: + - Resource ID. returned: success type: str + sample: "/subscriptions/xxx...xxx/resourceGroups/v-xisuRG/providers/Microsoft.Network/routeTables/tableb57dc95642/routes/routeb57dc95986" ''' try: diff --git a/lib/ansible/modules/cloud/azure/azure_rm_routetable_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_routetable_facts.py index 1ef05e4b0c0..59fda980b81 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_routetable_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_routetable_facts.py @@ -19,7 +19,7 @@ module: azure_rm_routetable_facts version_added: "2.7" -short_description: Get route table facts. +short_description: Get route table facts description: - Get facts for a specific route table or all route table in a resource group or subscription. @@ -39,7 +39,7 @@ extends_documentation_fragment: - azure author: - - "Yuwei Zhou (@yuwzho)" + - Yuwei Zhou (@yuwzho) ''' @@ -61,37 +61,49 @@ EXAMPLES = ''' ''' RETURN = ''' id: - description: Resource id. + description: + - Resource ID. returned: success type: str + sample: "/subscriptions/xxxx...xxxx/resourceGroups/v-xisuRG/providers/Microsoft.Network/routeTables/tableb57dc95236" name: - description: Name of the resource. + description: + - Name of the resource. returned: success type: str + sample: tableb57dc95236 resource_group: - description: Resource group of the route table. + description: + - Resource group of the route table. returned: success type: str + sample: v-xisuRG disable_bgp_route_propagation: - description: Whether the routes learned by BGP on that route table disabled. + description: + - Whether the routes learned by BGP on that route table disabled. returned: success type: bool + sample: false tags: - description: Tags of the route table. + description: + - Tags of the route table. returned: success - type: list + type: dict + sample: { 'key1':'value1', 'key2':'value2'} routes: - description: Current routes of the route table. + description: + - Current routes of the route table. returned: success type: list sample: [ { - "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/routeTables/foobar/routes/route", - "name": "route", - "resource_group": "Testing", - "routeTables": "foobar", - "address_prefix": "192.0.0.1", - "next_hop_type": "virtual_networkGateway" + "id": "/subscriptions/xxx...xxx/resourceGroups/v-xisuRG/providers/Microsoft.Network/routeTables/tableb57dc95236/routes/routeb57dc95540", + "name": "routeb57dc95540", + "resource_group": "v-xisuRG", + "route_table_name": "tableb57dc95236", + "address_prefix": "10.1.0.0/24", + "next_hop_type": "virtual_network_gateway", + "next_hop_ip_address": null } ] '''