IDFromName for networking resources
diff --git a/openstack/networking/v2/subnets/requests.go b/openstack/networking/v2/subnets/requests.go
index 6e01f05..c3f6364 100644
--- a/openstack/networking/v2/subnets/requests.go
+++ b/openstack/networking/v2/subnets/requests.go
@@ -1,6 +1,8 @@
 package subnets
 
 import (
+	"fmt"
+
 	"github.com/rackspace/gophercloud"
 	"github.com/rackspace/gophercloud/pagination"
 )
@@ -234,3 +236,36 @@
 	_, res.Err = c.Delete(deleteURL(c, id), nil)
 	return res
 }
+
+// IDFromName is a convienience function that returns a subnet's ID given its name.
+func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) {
+	subnetCount := 0
+	subnetID := ""
+	if name == "" {
+		return "", fmt.Errorf("A network name must be provided.")
+	}
+	pager := List(client, nil)
+	pager.EachPage(func(page pagination.Page) (bool, error) {
+		subnetList, err := ExtractSubnets(page)
+		if err != nil {
+			return false, err
+		}
+
+		for _, s := range subnetList {
+			if s.Name == name {
+				subnetCount++
+				subnetID = s.ID
+			}
+		}
+		return true, nil
+	})
+
+	switch subnetCount {
+	case 0:
+		return "", fmt.Errorf("Unable to find network: %s", name)
+	case 1:
+		return subnetID, nil
+	default:
+		return "", fmt.Errorf("Found %d networks matching %s", subnetCount, name)
+	}
+}