Update azure_rm_subnet related document (#58445)

* Update azure_rm_subnet related document
pull/58853/merge
Fred-sun 5 years ago committed by Alicia Cozine
parent a269c564c7
commit d1226b7663

@ -18,11 +18,11 @@ DOCUMENTATION = '''
--- ---
module: azure_rm_subnet module: azure_rm_subnet
version_added: "2.1" version_added: "2.1"
short_description: Manage Azure subnets. short_description: Manage Azure subnets
description: description:
- Create, update or delete a subnet within a given virtual network. Allows setting and updating the address - Create, update or delete a subnet within a given virtual network.
prefix CIDR, which must be valid within the context of the virtual network. Use the azure_rm_networkinterface - Allows setting and updating the address prefix CIDR, which must be valid within the context of the virtual network.
module to associate interfaces with the subnet and assign specific IP addresses. - Use the M(azure_rm_networkinterface) module to associate interfaces with the subnet and assign specific IP addresses.
options: options:
resource_group: resource_group:
description: description:
@ -34,22 +34,20 @@ options:
required: true required: true
address_prefix_cidr: address_prefix_cidr:
description: description:
- CIDR defining the IPv4 address space of the subnet. Must be valid within the context of the - CIDR defining the IPv4 address space of the subnet. Must be valid within the context of the virtual network.
virtual network.
aliases: aliases:
- address_prefix - address_prefix
security_group: security_group:
description: description:
- Existing security group with which to associate the subnet. - Existing security group with which to associate the subnet.
- It can be the security group name which is in the same resource group. - It can be the security group name which is in the same resource group.
- It can be the resource Id. - Can be the resource ID of the security group.
- It can be a dict which contains C(name) and C(resource_group) of the security group. - Can be a dict containing the I(name) and I(resource_group) of the security group.
aliases: aliases:
- security_group_name - security_group_name
state: state:
description: description:
- Assert the state of the subnet. Use C(present) to create or update a subnet and - Assert the state of the subnet. Use C(present) to create or update a subnet and use C(absent) to delete a subnet.
C(absent) to delete a subnet.
default: present default: present
choices: choices:
- absent - absent
@ -63,9 +61,8 @@ options:
route_table: route_table:
description: description:
- The reference of the RouteTable resource. - The reference of the RouteTable resource.
- It can accept both a str or a dict. - Can be the name or resource ID of the route table.
- The str can be the name or resource id of the route table. - Can be a dict containing the I(name) and I(resource_group) of the route table.
- The dict can contains C(name) and C(resource_group) of the route_table.
version_added: "2.7" version_added: "2.7"
service_endpoints: service_endpoints:
description: description:
@ -86,8 +83,8 @@ extends_documentation_fragment:
- azure - azure
author: author:
- "Chris Houseknecht (@chouseknecht)" - Chris Houseknecht (@chouseknecht)
- "Matt Davis (@nitzmahone)" - Matt Davis (@nitzmahone)
''' '''
@ -120,37 +117,53 @@ EXAMPLES = '''
RETURN = ''' RETURN = '''
state: state:
description: Current state of the subnet. description:
- Current state of the subnet.
returned: success returned: success
type: complex type: complex
contains: contains:
address_prefix: address_prefix:
description: IP address CIDR. description:
type: str - IP address CIDR.
example: "10.1.0.0/16" returned: always
type: str
sample: "10.1.0.0/16"
id: id:
description: Subnet resource path. description:
type: str - Subnet resource path.
example: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/mySubnet" returned: always
type: str
sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/mySubnet"
name: name:
description: Subnet name. description:
type: str - Subnet name.
example: "foobar" returned: always
type: str
sample: "foobar"
network_security_group: network_security_group:
type: complex description:
contains: - Associated network security group of subnets.
id: returned: always
description: Security group resource identifier. type: complex
type: str contains:
example: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/secgroupfoo" id:
name: description:
description: Name of the security group. - Security group resource identifier.
type: str returned: always
example: "secgroupfoo" type: str
sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroup/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/secgroupfoo"
name:
description:
- Name of the security group.
returned: always
type: str
sample: "secgroupfoo"
provisioning_state: provisioning_state:
description: Success or failure of the provisioning event. description:
type: str - Success or failure of the provisioning event.
example: "Succeeded" returned: always
type: str
sample: "Succeeded"
''' # NOQA ''' # NOQA
from ansible.module_utils.azure_rm_common import AzureRMModuleBase, CIDR_PATTERN, azure_id_to_dict, format_resource_id from ansible.module_utils.azure_rm_common import AzureRMModuleBase, CIDR_PATTERN, azure_id_to_dict, format_resource_id

@ -17,7 +17,7 @@ DOCUMENTATION = '''
--- ---
module: azure_rm_subnet_facts module: azure_rm_subnet_facts
version_added: "2.8" version_added: "2.8"
short_description: Get Azure Subnet facts. short_description: Get Azure Subnet facts
description: description:
- Get facts of Azure Subnet. - Get facts of Azure Subnet.
@ -38,7 +38,7 @@ extends_documentation_fragment:
- azure - azure
author: author:
- "Zim Kalinowski (@zikalino)" - Zim Kalinowski (@zikalino)
''' '''
@ -58,7 +58,8 @@ EXAMPLES = '''
RETURN = ''' RETURN = '''
subnets: subnets:
description: A list of dictionaries containing facts for subnet. description:
- A list of dictionaries containing facts for subnet.
returned: always returned: always
type: complex type: complex
contains: contains:
@ -95,13 +96,13 @@ subnets:
sample: "10.1.0.0/16" sample: "10.1.0.0/16"
route_table: route_table:
description: description:
- Associated route table id. - Associated route table ID.
returned: always returned: always
type: str type: str
sample: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/routeTables/myRouteTable sample: /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/routeTables/myRouteTable
security_group: security_group:
description: description:
- Associated security group id. - Associated security group ID.
returned: always returned: always
type: str type: str
sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkSecurityGr sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkSecurityGr
@ -115,11 +116,16 @@ subnets:
service: service:
description: description:
- The type of the endpoint service. - The type of the endpoint service.
returned: always
type: str
required: True required: True
sample: Microsoft.Sql
locations: locations:
description: description:
- A list of location names. - A list of location names.
type: list type: list
returned: always
sample: [ 'eastus', 'westus' ]
provisioning_state: provisioning_state:
description: description:
- Provisioning state. - Provisioning state.

Loading…
Cancel
Save