def network_security_groups_list(resource_group, **kwargs):
    '''
    .. versionadded:: 2019.2.0

    List all network security groups within a resource group.

    :param resource_group: The resource group name to list network security \
        groups within.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_network.network_security_groups_list testgroup

    '''
    result = {}
    netconn = __utils__['azurearm.get_client']('network', **kwargs)
    try:
        secgroups = __utils__['azurearm.paged_object_to_list'](
            netconn.network_security_groups.list(
                resource_group_name=resource_group
            )
        )
        for secgroup in secgroups:
            result[secgroup['name']] = secgroup
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('network', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
def network_security_groups_list ( resource_group , ** kwargs ) : result = { } netconn = __utils__ [ 'azurearm.get_client' ] ( 'network' , ** kwargs ) try : secgroups = __utils__ [ 'azurearm.paged_object_to_list' ] ( netconn . network_security_groups . list ( resource_group_name = resource_group ) ) for secgroup in secgroups : result [ secgroup [ 'name' ] ] = secgroup except CloudError as exc : __utils__ [ 'azurearm.log_cloud_error' ] ( 'network' , str ( exc ) , ** kwargs ) result = { 'error' : str ( exc ) } return result
.. versionadded:: 2019.2.0

    List all network security groups within a resource group.

    :param resource_group: The resource group name to list network security \
        groups within.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_network.network_security_groups_list testgroup