... versionadded:: 2017.7.0
    Delete a GCE Subnetwork. Must specify name and region.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f delete_subnetwork gce name=mysubnet network=mynet1 region=us-west1

def delete_subnetwork(kwargs=None, call=None):
    '''
    ... versionadded:: 2017.7.0
    Delete a GCE Subnetwork. Must specify name and region.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f delete_subnetwork gce name=mysubnet network=mynet1 region=us-west1
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The delete_subnet function must be called with -f or --function.'
        )

    if not kwargs or 'name' not in kwargs:
        log.error(
            'Must specify name of subnet.'
        )
        return False

    if 'region' not in kwargs:
        log.error(
            'Must specify region of subnet.'
        )
        return False

    name = kwargs['name']
    region = kwargs['region']
    conn = get_conn()

    __utils__['cloud.fire_event'](
        'event',
        'deleting subnetwork',
        'salt/cloud/subnet/deleting',
        args={
            'name': name,
            'region': region
        },
        sock_dir=__opts__['sock_dir'],
        transport=__opts__['transport']
    )

    try:
        result = conn.ex_destroy_subnetwork(name, region)
    except ResourceNotFoundError as exc:
        log.error(
            'Subnetwork %s was not found. Exception was: %s',
            name, exc, exc_info_on_loglevel=logging.DEBUG
        )
        return False

    __utils__['cloud.fire_event'](
        'event',
        'deleted subnetwork',
        'salt/cloud/subnet/deleted',
        args={
            'name': name,
            'region': region
        },
        sock_dir=__opts__['sock_dir'],
        transport=__opts__['transport']
    )
    return result