diff --git a/rackspace/rackconnect/v3/lbpools/doc.go b/rackspace/rackconnect/v3/lbpools/doc.go
new file mode 100644
index 0000000..68e5f67
--- /dev/null
+++ b/rackspace/rackconnect/v3/lbpools/doc.go
@@ -0,0 +1,14 @@
+// Package lbpools provides access to load balancer pools associated with a
+// RackConnect configuration. Load Balancer Pools must be configured in advance
+// by your Network Security team to be elegible for use with RackConnect.
+// If you do not see a pool that you expect to see, contact your Support team
+// for further assistance. The Load Balancer Pool id returned by these calls is
+// automatically generated by the RackConnect automation and will remain constant
+// unless the Load Balancer Pool is renamed on your hardware load balancer.
+// All Load Balancer Pools will currently return a status of ACTIVE. Future
+// features may introduce additional statuses.
+// Node status values are ADDING, ACTIVE, REMOVING, ADD_FAILED, and REMOVE_FAILED.
+// The cloud_servers node count will only include Cloud Servers from the specified
+// cloud account. Any dedicated servers or cloud servers from another cloud account
+// on the same RackConnect Configuration will be counted as external nodes.
+package lbpools
diff --git a/rackspace/rackconnect/v3/lbpools/requests.go b/rackspace/rackconnect/v3/lbpools/requests.go
new file mode 100644
index 0000000..23425d0
--- /dev/null
+++ b/rackspace/rackconnect/v3/lbpools/requests.go
@@ -0,0 +1,156 @@
+package lbpools
+
+import (
+	"github.com/rackspace/gophercloud"
+	"github.com/rackspace/gophercloud/pagination"
+)
+
+// List returns all load balancer pools that are associated with RackConnect.
+func List(c *gophercloud.ServiceClient) pagination.Pager {
+	url := listURL(c)
+	createPage := func(r pagination.PageResult) pagination.Page {
+		return PoolPage{pagination.SinglePageBase(r)}
+	}
+	return pagination.NewPager(c, url, createPage)
+}
+
+// Get retrieves a specific load balancer pool (that is associated with RackConnect)
+// based on its unique ID.
+func Get(c *gophercloud.ServiceClient, id string) GetResult {
+	var res GetResult
+	_, res.Err = c.Request("GET", getURL(c, id), gophercloud.RequestOpts{
+		JSONResponse: &res.Body,
+		OkCodes:      []int{200},
+	})
+	return res
+}
+
+// ListNodes returns all load balancer pool nodes that are associated with RackConnect
+// for the given LB pool ID.
+func ListNodes(c *gophercloud.ServiceClient, id string) pagination.Pager {
+	url := listNodesURL(c, id)
+	createPage := func(r pagination.PageResult) pagination.Page {
+		return NodePage{pagination.SinglePageBase(r)}
+	}
+	return pagination.NewPager(c, url, createPage)
+}
+
+// CreateNode adds the cloud server with the given serverID to the load balancer
+// pool with the given poolID.
+func CreateNode(c *gophercloud.ServiceClient, poolID, serverID string) CreateNodeResult {
+	var res CreateNodeResult
+	reqBody := map[string]interface{}{
+		"cloud_server": map[string]string{
+			"id": serverID,
+		},
+	}
+	_, res.Err = c.Request("POST", createNodeURL(c, poolID), gophercloud.RequestOpts{
+		JSONBody:     &reqBody,
+		JSONResponse: &res.Body,
+		OkCodes:      []int{201},
+	})
+	return res
+}
+
+// ListNodesDetails returns all load balancer pool nodes that are associated with RackConnect
+// for the given LB pool ID with all their details.
+func ListNodesDetails(c *gophercloud.ServiceClient, id string) pagination.Pager {
+	url := listNodesDetailsURL(c, id)
+	createPage := func(r pagination.PageResult) pagination.Page {
+		return NodeDetailsPage{pagination.SinglePageBase(r)}
+	}
+	return pagination.NewPager(c, url, createPage)
+}
+
+// GetNode retrieves a specific LB pool node (that is associated with RackConnect)
+// based on its unique ID and the LB pool's unique ID.
+func GetNode(c *gophercloud.ServiceClient, poolID, nodeID string) GetNodeResult {
+	var res GetNodeResult
+	_, res.Err = c.Request("GET", nodeURL(c, poolID, nodeID), gophercloud.RequestOpts{
+		JSONResponse: &res.Body,
+		OkCodes:      []int{200},
+	})
+	return res
+}
+
+// DeleteNode removes the node with the given nodeID from the LB pool with the
+// given poolID.
+func DeleteNode(c *gophercloud.ServiceClient, poolID, nodeID string) DeleteNodeResult {
+	var res DeleteNodeResult
+	_, res.Err = c.Request("DELETE", deleteNodeURL(c, poolID, nodeID), gophercloud.RequestOpts{
+		OkCodes: []int{204},
+	})
+	return res
+}
+
+// GetNodeDetails retrieves a specific LB pool node's details based on its unique
+// ID and the LB pool's unique ID.
+func GetNodeDetails(c *gophercloud.ServiceClient, poolID, nodeID string) GetNodeDetailsResult {
+	var res GetNodeDetailsResult
+	_, res.Err = c.Request("GET", nodeDetailsURL(c, poolID, nodeID), gophercloud.RequestOpts{
+		JSONResponse: &res.Body,
+		OkCodes:      []int{200},
+	})
+	return res
+}
+
+// NodesOpts are options for bulk adding/deleting nodes to LB pools.
+type NodesOpts struct {
+	ServerID string
+	PoolID   string
+}
+
+// CreateNodes adds the cloud servers with the given serverIDs to the corresponding
+// load balancer pools with the given poolIDs.
+func CreateNodes(c *gophercloud.ServiceClient, opts []NodesOpts) CreateNodesResult {
+	var res CreateNodesResult
+	reqBody := make([]map[string]interface{}, len(opts))
+	for i := range opts {
+		reqBody[i] = map[string]interface{}{
+			"cloud_server": map[string]string{
+				"id": opts[i].ServerID,
+			},
+			"load_balancer_pool": map[string]string{
+				"id": opts[i].PoolID,
+			},
+		}
+	}
+	_, res.Err = c.Request("POST", createNodesURL(c), gophercloud.RequestOpts{
+		JSONBody:     &reqBody,
+		JSONResponse: &res.Body,
+		OkCodes:      []int{201},
+	})
+	return res
+}
+
+// DeleteNodes removes the cloud servers with the given serverIDs to the corresponding
+// load balancer pools with the given poolIDs.
+func DeleteNodes(c *gophercloud.ServiceClient, opts []NodesOpts) DeleteNodesResult {
+	var res DeleteNodesResult
+	reqBody := make([]map[string]interface{}, len(opts))
+	for i := range opts {
+		reqBody[i] = map[string]interface{}{
+			"cloud_server": map[string]string{
+				"id": opts[i].ServerID,
+			},
+			"load_balancer_pool": map[string]string{
+				"id": opts[i].PoolID,
+			},
+		}
+	}
+	_, res.Err = c.Request("DELETE", createNodesURL(c), gophercloud.RequestOpts{
+		JSONBody: &reqBody,
+		OkCodes:  []int{204},
+	})
+	return res
+}
+
+// ListNodesDetailsForServer returns all load balancer pool nodes that are associated with RackConnect
+// for the given LB pool ID with all their details for the server with the given serverID.
+func ListNodesDetailsForServer(c *gophercloud.ServiceClient, serverID string) pagination.Pager {
+	url := listNodesForServerURL(c, serverID)
+	createPage := func(r pagination.PageResult) pagination.Page {
+		return NodeDetailsForServerPage{pagination.SinglePageBase(r)}
+	}
+	return pagination.NewPager(c, url, createPage)
+}
diff --git a/rackspace/rackconnect/v3/lbpools/requests_test.go b/rackspace/rackconnect/v3/lbpools/requests_test.go
new file mode 100644
index 0000000..2286d47
--- /dev/null
+++ b/rackspace/rackconnect/v3/lbpools/requests_test.go
@@ -0,0 +1,876 @@
+package lbpools
+
+import (
+	"fmt"
+	"net/http"
+	"testing"
+	"time"
+
+	"github.com/jrperritt/gophercloud/testhelper/client"
+	"github.com/rackspace/gophercloud/pagination"
+	th "github.com/rackspace/gophercloud/testhelper"
+	fake "github.com/rackspace/gophercloud/testhelper/client"
+)
+
+func TestListPools(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/load_balancer_pools", func(w http.ResponseWriter, r *http.Request) {
+		th.TestMethod(t, r, "GET")
+		th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+		th.TestHeader(t, r, "Accept", "application/json")
+
+		w.Header().Set("Content-Type", "application/json")
+		fmt.Fprintf(w, `[
+      {
+        "id": "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+        "name": "RCv3Test",
+        "node_counts": {
+          "cloud_servers": 3,
+          "external": 4,
+          "total": 7
+        },
+        "port": 80,
+        "status": "ACTIVE",
+        "status_detail": null,
+        "virtual_ip": "203.0.113.5"
+      },
+      {
+        "id": "33021100-4abf-4836-9080-465a6d87ab68",
+        "name": "RCv3Test2",
+        "node_counts": {
+          "cloud_servers": 1,
+          "external": 0,
+          "total": 1
+        },
+        "port": 80,
+        "status": "ACTIVE",
+        "status_detail": null,
+        "virtual_ip": "203.0.113.7"
+      },
+      {
+        "id": "b644350a-301b-47b5-a411-c6e0f933c347",
+        "name": "RCv3Test3",
+        "node_counts": {
+          "cloud_servers": 2,
+          "external": 3,
+          "total": 5
+        },
+        "port": 443,
+        "status": "ACTIVE",
+        "status_detail": null,
+        "virtual_ip": "203.0.113.15"
+      }
+    ]`)
+	})
+
+	expected := []Pool{
+		Pool{
+			ID:   "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+			Name: "RCv3Test",
+			NodeCounts: struct {
+				CloudServers int `mapstructure:"cloud_servers"`
+				External     int `mapstructure:"external"`
+				Total        int `mapstructure:"total"`
+			}{
+				CloudServers: 3,
+				External:     4,
+				Total:        7,
+			},
+			Port:      80,
+			Status:    "ACTIVE",
+			VirtualIP: "203.0.113.5",
+		},
+		Pool{
+			ID:   "33021100-4abf-4836-9080-465a6d87ab68",
+			Name: "RCv3Test2",
+			NodeCounts: struct {
+				CloudServers int `mapstructure:"cloud_servers"`
+				External     int `mapstructure:"external"`
+				Total        int `mapstructure:"total"`
+			}{
+				CloudServers: 1,
+				External:     0,
+				Total:        1,
+			},
+			Port:      80,
+			Status:    "ACTIVE",
+			VirtualIP: "203.0.113.7",
+		},
+		Pool{
+			ID:   "b644350a-301b-47b5-a411-c6e0f933c347",
+			Name: "RCv3Test3",
+			NodeCounts: struct {
+				CloudServers int `mapstructure:"cloud_servers"`
+				External     int `mapstructure:"external"`
+				Total        int `mapstructure:"total"`
+			}{
+				CloudServers: 2,
+				External:     3,
+				Total:        5,
+			},
+			Port:      443,
+			Status:    "ACTIVE",
+			VirtualIP: "203.0.113.15",
+		},
+	}
+
+	count := 0
+	err := List(fake.ServiceClient()).EachPage(func(page pagination.Page) (bool, error) {
+		count++
+		actual, err := ExtractPools(page)
+		th.AssertNoErr(t, err)
+
+		th.CheckDeepEquals(t, expected, actual)
+
+		return true, nil
+	})
+	th.AssertNoErr(t, err)
+	th.CheckEquals(t, count, 1)
+}
+
+func TestGetLBPool(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/load_balancer_pools/d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2", func(w http.ResponseWriter, r *http.Request) {
+		th.TestMethod(t, r, "GET")
+		th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+		th.TestHeader(t, r, "Accept", "application/json")
+
+		w.Header().Set("Content-Type", "application/json")
+		w.WriteHeader(http.StatusOK)
+		fmt.Fprintf(w, `{
+      "id": "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+      "name": "RCv3Test",
+      "node_counts": {
+        "cloud_servers": 3,
+        "external": 4,
+        "total": 7
+      },
+      "port": 80,
+      "status": "ACTIVE",
+      "status_detail": null,
+      "virtual_ip": "203.0.113.5"
+    }`)
+	})
+
+	expected := &Pool{
+		ID:   "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+		Name: "RCv3Test",
+		NodeCounts: struct {
+			CloudServers int `mapstructure:"cloud_servers"`
+			External     int `mapstructure:"external"`
+			Total        int `mapstructure:"total"`
+		}{
+			CloudServers: 3,
+			External:     4,
+			Total:        7,
+		},
+		Port:      80,
+		Status:    "ACTIVE",
+		VirtualIP: "203.0.113.5",
+	}
+
+	actual, err := Get(fake.ServiceClient(), "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2").Extract()
+	th.AssertNoErr(t, err)
+
+	th.AssertDeepEquals(t, expected, actual)
+}
+
+func TestListNodes(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/load_balancer_pools/d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2/nodes", func(w http.ResponseWriter, r *http.Request) {
+		th.TestMethod(t, r, "GET")
+		th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+		th.TestHeader(t, r, "Accept", "application/json")
+
+		w.Header().Set("Content-Type", "application/json")
+		fmt.Fprintf(w, `[
+      {
+        "created": "2014-05-30T03:23:42Z",
+        "cloud_server": {
+          "id": "d95ae0c4-6ab8-4873-b82f-f8433840cff2"
+        },
+        "id": "1860451d-fb89-45b8-b54e-151afceb50e5",
+        "load_balancer_pool": {
+          "id": "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2"
+        },
+        "status": "ACTIVE",
+        "updated": "2014-05-30T03:24:18Z"
+      },
+      {
+        "created": "2014-05-31T08:23:12Z",
+        "cloud_server": {
+          "id": "f28b870f-a063-498a-8b12-7025e5b1caa6"
+        },
+        "id": "b70481dd-7edf-4dbb-a44b-41cc7679d4fb",
+        "load_balancer_pool": {
+          "id": "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2"
+        },
+        "status": "ADDING",
+        "updated": "2014-05-31T08:23:26Z"
+      },
+      {
+        "created": "2014-05-31T08:23:18Z",
+        "cloud_server": {
+          "id": "a3d3a6b3-e4e4-496f-9a3d-5c987163e458"
+        },
+        "id": "ced9ddc8-6fae-4e72-9457-16ead52b5515",
+        "load_balancer_pool": {
+          "id": "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2"
+        },
+        "status": "ADD_FAILED",
+        "status_detail": "Unable to communicate with network device",
+        "updated": "2014-05-31T08:24:36Z"
+      }
+    ]`)
+	})
+
+	expected := []Node{
+		Node{
+			CreatedAt: time.Date(2014, 5, 30, 3, 23, 42, 0, time.UTC),
+			CloudServer: struct {
+				ID string `mapstructure:"id"`
+			}{
+				ID: "d95ae0c4-6ab8-4873-b82f-f8433840cff2",
+			},
+			ID: "1860451d-fb89-45b8-b54e-151afceb50e5",
+			LoadBalancerPool: struct {
+				ID string `mapstructure:"id"`
+			}{
+				ID: "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+			},
+			Status:    "ACTIVE",
+			UpdatedAt: time.Date(2014, 5, 30, 3, 24, 18, 0, time.UTC),
+		},
+		Node{
+			CreatedAt: time.Date(2014, 5, 31, 8, 23, 12, 0, time.UTC),
+			CloudServer: struct {
+				ID string `mapstructure:"id"`
+			}{
+				ID: "f28b870f-a063-498a-8b12-7025e5b1caa6",
+			},
+			ID: "b70481dd-7edf-4dbb-a44b-41cc7679d4fb",
+			LoadBalancerPool: struct {
+				ID string `mapstructure:"id"`
+			}{
+				ID: "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+			},
+			Status:    "ADDING",
+			UpdatedAt: time.Date(2014, 5, 31, 8, 23, 26, 0, time.UTC),
+		},
+		Node{
+			CreatedAt: time.Date(2014, 5, 31, 8, 23, 18, 0, time.UTC),
+			CloudServer: struct {
+				ID string `mapstructure:"id"`
+			}{
+				ID: "a3d3a6b3-e4e4-496f-9a3d-5c987163e458",
+			},
+			ID: "ced9ddc8-6fae-4e72-9457-16ead52b5515",
+			LoadBalancerPool: struct {
+				ID string `mapstructure:"id"`
+			}{
+				ID: "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+			},
+			Status:       "ADD_FAILED",
+			StatusDetail: "Unable to communicate with network device",
+			UpdatedAt:    time.Date(2014, 5, 31, 8, 24, 36, 0, time.UTC),
+		},
+	}
+
+	count := 0
+	err := ListNodes(fake.ServiceClient(), "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2").EachPage(func(page pagination.Page) (bool, error) {
+		count++
+		actual, err := ExtractNodes(page)
+		th.AssertNoErr(t, err)
+
+		th.CheckDeepEquals(t, expected, actual)
+
+		return true, nil
+	})
+	th.AssertNoErr(t, err)
+	th.CheckEquals(t, count, 1)
+}
+
+func TestCreateNode(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/load_balancer_pools/d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2/nodes", func(w http.ResponseWriter, r *http.Request) {
+		th.TestMethod(t, r, "POST")
+		th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+		th.TestHeader(t, r, "Accept", "application/json")
+		th.TestJSONRequest(t, r, `
+      {
+        "cloud_server": {
+          "id": "d95ae0c4-6ab8-4873-b82f-f8433840cff2"
+        }
+      }
+    `)
+
+		w.Header().Set("Content-Type", "application/json")
+		w.WriteHeader(http.StatusCreated)
+		fmt.Fprintf(w, `
+      {
+        "created": "2014-05-30T03:23:42Z",
+        "cloud_server": {
+          "id": "d95ae0c4-6ab8-4873-b82f-f8433840cff2"
+        },
+        "id": "1860451d-fb89-45b8-b54e-151afceb50e5",
+        "load_balancer_pool": {
+          "id": "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2"
+        },
+        "status": "ACTIVE",
+        "status_detail": null,
+        "updated": "2014-05-30T03:24:18Z"
+      }
+    `)
+	})
+
+	expected := &Node{
+		CreatedAt: time.Date(2014, 5, 30, 3, 23, 42, 0, time.UTC),
+		CloudServer: struct {
+			ID string `mapstructure:"id"`
+		}{
+			ID: "d95ae0c4-6ab8-4873-b82f-f8433840cff2",
+		},
+		ID: "1860451d-fb89-45b8-b54e-151afceb50e5",
+		LoadBalancerPool: struct {
+			ID string `mapstructure:"id"`
+		}{
+			ID: "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+		},
+		Status:    "ACTIVE",
+		UpdatedAt: time.Date(2014, 5, 30, 3, 24, 18, 0, time.UTC),
+	}
+
+	actual, err := CreateNode(fake.ServiceClient(), "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2", "d95ae0c4-6ab8-4873-b82f-f8433840cff2").Extract()
+	th.AssertNoErr(t, err)
+
+	th.AssertDeepEquals(t, expected, actual)
+}
+
+func TestListNodesDetails(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/load_balancer_pools/d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2/nodes/details", func(w http.ResponseWriter, r *http.Request) {
+		th.TestMethod(t, r, "GET")
+		th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+		th.TestHeader(t, r, "Accept", "application/json")
+
+		w.Header().Set("Content-Type", "application/json")
+		fmt.Fprintf(w, `
+      [
+      {
+        "created": "2014-05-30T03:23:42Z",
+        "cloud_server": {
+          "cloud_network": {
+            "cidr": "192.168.100.0/24",
+            "created": "2014-05-25T01:23:42Z",
+            "id": "07426958-1ebf-4c38-b032-d456820ca21a",
+            "name": "RC-CLOUD",
+            "private_ip_v4": "192.168.100.5",
+            "updated": "2014-05-25T02:28:44Z"
+          },
+          "created": "2014-05-30T02:18:42Z",
+          "id": "d95ae0c4-6ab8-4873-b82f-f8433840cff2",
+          "name": "RCv3TestServer1",
+          "updated": "2014-05-30T02:19:18Z"
+        },
+        "id": "1860451d-fb89-45b8-b54e-151afceb50e5",
+        "load_balancer_pool": {
+          "id": "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+          "name": "RCv3Test",
+          "node_counts": {
+            "cloud_servers": 3,
+            "external": 4,
+            "total": 7
+          },
+          "port": 80,
+          "status": "ACTIVE",
+          "status_detail": null,
+          "virtual_ip": "203.0.113.5"
+        },
+        "status": "ACTIVE",
+        "status_detail": null,
+        "updated": "2014-05-30T03:24:18Z"
+      }
+      ]
+    `)
+	})
+
+	expected := []NodeDetails{
+		NodeDetails{
+			CreatedAt: time.Date(2014, 5, 30, 3, 23, 42, 0, time.UTC),
+			CloudServer: struct {
+				ID           string `mapstructure:"id"`
+				Name         string `mapstructure:"name"`
+				CloudNetwork struct {
+					ID          string    `mapstructure:"id"`
+					Name        string    `mapstructure:"name"`
+					PrivateIPv4 string    `mapstructure:"private_ip_v4"`
+					CIDR        string    `mapstructure:"cidr"`
+					CreatedAt   time.Time `mapstructure:"-"`
+					UpdatedAt   time.Time `mapstructure:"-"`
+				} `mapstructure:"cloud_network"`
+				CreatedAt time.Time `mapstructure:"-"`
+				UpdatedAt time.Time `mapstructure:"-"`
+			}{
+				ID: "d95ae0c4-6ab8-4873-b82f-f8433840cff2",
+				CloudNetwork: struct {
+					ID          string    `mapstructure:"id"`
+					Name        string    `mapstructure:"name"`
+					PrivateIPv4 string    `mapstructure:"private_ip_v4"`
+					CIDR        string    `mapstructure:"cidr"`
+					CreatedAt   time.Time `mapstructure:"-"`
+					UpdatedAt   time.Time `mapstructure:"-"`
+				}{
+					ID:          "07426958-1ebf-4c38-b032-d456820ca21a",
+					CIDR:        "192.168.100.0/24",
+					CreatedAt:   time.Date(2014, 5, 25, 1, 23, 42, 0, time.UTC),
+					Name:        "RC-CLOUD",
+					PrivateIPv4: "192.168.100.5",
+					UpdatedAt:   time.Date(2014, 5, 25, 2, 28, 44, 0, time.UTC),
+				},
+				CreatedAt: time.Date(2014, 5, 30, 2, 18, 42, 0, time.UTC),
+				Name:      "RCv3TestServer1",
+				UpdatedAt: time.Date(2014, 5, 30, 2, 19, 18, 0, time.UTC),
+			},
+			ID: "1860451d-fb89-45b8-b54e-151afceb50e5",
+			LoadBalancerPool: Pool{
+				ID:   "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+				Name: "RCv3Test",
+				NodeCounts: struct {
+					CloudServers int `mapstructure:"cloud_servers"`
+					External     int `mapstructure:"external"`
+					Total        int `mapstructure:"total"`
+				}{
+					CloudServers: 3,
+					External:     4,
+					Total:        7,
+				},
+				Port:      80,
+				Status:    "ACTIVE",
+				VirtualIP: "203.0.113.5",
+			},
+			Status:    "ACTIVE",
+			UpdatedAt: time.Date(2014, 5, 30, 3, 24, 18, 0, time.UTC),
+		},
+	}
+	count := 0
+	err := ListNodesDetails(fake.ServiceClient(), "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2").EachPage(func(page pagination.Page) (bool, error) {
+		count++
+		actual, err := ExtractNodesDetails(page)
+		th.AssertNoErr(t, err)
+
+		th.CheckDeepEquals(t, expected, actual)
+
+		return true, nil
+	})
+	th.AssertNoErr(t, err)
+	th.CheckEquals(t, count, 1)
+}
+
+func TestGetNode(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/load_balancer_pools/d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2/nodes/1860451d-fb89-45b8-b54e-151afceb50e5", func(w http.ResponseWriter, r *http.Request) {
+		th.TestMethod(t, r, "GET")
+		th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+		th.TestHeader(t, r, "Accept", "application/json")
+
+		w.Header().Set("Content-Type", "application/json")
+		w.WriteHeader(http.StatusOK)
+		fmt.Fprintf(w, `
+      {
+        "created": "2014-05-30T03:23:42Z",
+        "cloud_server": {
+          "id": "d95ae0c4-6ab8-4873-b82f-f8433840cff2"
+        },
+        "id": "1860451d-fb89-45b8-b54e-151afceb50e5",
+        "load_balancer_pool": {
+          "id": "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2"
+        },
+        "status": "ACTIVE",
+        "status_detail": null,
+        "updated": "2014-05-30T03:24:18Z"
+      }
+    `)
+	})
+
+	expected := &Node{
+		CreatedAt: time.Date(2014, 5, 30, 3, 23, 42, 0, time.UTC),
+		CloudServer: struct {
+			ID string `mapstructure:"id"`
+		}{
+			ID: "d95ae0c4-6ab8-4873-b82f-f8433840cff2",
+		},
+		ID: "1860451d-fb89-45b8-b54e-151afceb50e5",
+		LoadBalancerPool: struct {
+			ID string `mapstructure:"id"`
+		}{
+			ID: "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+		},
+		Status:    "ACTIVE",
+		UpdatedAt: time.Date(2014, 5, 30, 3, 24, 18, 0, time.UTC),
+	}
+
+	actual, err := GetNode(fake.ServiceClient(), "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2", "1860451d-fb89-45b8-b54e-151afceb50e5").Extract()
+	th.AssertNoErr(t, err)
+
+	th.AssertDeepEquals(t, expected, actual)
+}
+
+func TestDeleteNode(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/load_balancer_pools/d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2/nodes/1860451d-fb89-45b8-b54e-151afceb50e5", func(w http.ResponseWriter, r *http.Request) {
+		th.TestMethod(t, r, "DELETE")
+		th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+		th.TestHeader(t, r, "Accept", "application/json")
+
+		w.Header().Set("Content-Type", "application/json")
+		w.WriteHeader(http.StatusNoContent)
+	})
+
+	err := DeleteNode(client.ServiceClient(), "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2", "1860451d-fb89-45b8-b54e-151afceb50e5").ExtractErr()
+	th.AssertNoErr(t, err)
+}
+
+func TestGetNodeDetails(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/load_balancer_pools/d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2/nodes/d95ae0c4-6ab8-4873-b82f-f8433840cff2/details", func(w http.ResponseWriter, r *http.Request) {
+		th.TestMethod(t, r, "GET")
+		th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+		th.TestHeader(t, r, "Accept", "application/json")
+
+		w.Header().Set("Content-Type", "application/json")
+		fmt.Fprintf(w, `
+      {
+        "created": "2014-05-30T03:23:42Z",
+        "cloud_server": {
+          "cloud_network": {
+            "cidr": "192.168.100.0/24",
+            "created": "2014-05-25T01:23:42Z",
+            "id": "07426958-1ebf-4c38-b032-d456820ca21a",
+            "name": "RC-CLOUD",
+            "private_ip_v4": "192.168.100.5",
+            "updated": "2014-05-25T02:28:44Z"
+          },
+          "created": "2014-05-30T02:18:42Z",
+          "id": "d95ae0c4-6ab8-4873-b82f-f8433840cff2",
+          "name": "RCv3TestServer1",
+          "updated": "2014-05-30T02:19:18Z"
+        },
+        "id": "1860451d-fb89-45b8-b54e-151afceb50e5",
+        "load_balancer_pool": {
+          "id": "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+          "name": "RCv3Test",
+          "node_counts": {
+            "cloud_servers": 3,
+            "external": 4,
+            "total": 7
+          },
+          "port": 80,
+          "status": "ACTIVE",
+          "status_detail": null,
+          "virtual_ip": "203.0.113.5"
+        },
+        "status": "ACTIVE",
+        "status_detail": null,
+        "updated": "2014-05-30T03:24:18Z"
+      }
+    `)
+	})
+
+	expected := &NodeDetails{
+		CreatedAt: time.Date(2014, 5, 30, 3, 23, 42, 0, time.UTC),
+		CloudServer: struct {
+			ID           string `mapstructure:"id"`
+			Name         string `mapstructure:"name"`
+			CloudNetwork struct {
+				ID          string    `mapstructure:"id"`
+				Name        string    `mapstructure:"name"`
+				PrivateIPv4 string    `mapstructure:"private_ip_v4"`
+				CIDR        string    `mapstructure:"cidr"`
+				CreatedAt   time.Time `mapstructure:"-"`
+				UpdatedAt   time.Time `mapstructure:"-"`
+			} `mapstructure:"cloud_network"`
+			CreatedAt time.Time `mapstructure:"-"`
+			UpdatedAt time.Time `mapstructure:"-"`
+		}{
+			ID: "d95ae0c4-6ab8-4873-b82f-f8433840cff2",
+			CloudNetwork: struct {
+				ID          string    `mapstructure:"id"`
+				Name        string    `mapstructure:"name"`
+				PrivateIPv4 string    `mapstructure:"private_ip_v4"`
+				CIDR        string    `mapstructure:"cidr"`
+				CreatedAt   time.Time `mapstructure:"-"`
+				UpdatedAt   time.Time `mapstructure:"-"`
+			}{
+				ID:          "07426958-1ebf-4c38-b032-d456820ca21a",
+				CIDR:        "192.168.100.0/24",
+				CreatedAt:   time.Date(2014, 5, 25, 1, 23, 42, 0, time.UTC),
+				Name:        "RC-CLOUD",
+				PrivateIPv4: "192.168.100.5",
+				UpdatedAt:   time.Date(2014, 5, 25, 2, 28, 44, 0, time.UTC),
+			},
+			CreatedAt: time.Date(2014, 5, 30, 2, 18, 42, 0, time.UTC),
+			Name:      "RCv3TestServer1",
+			UpdatedAt: time.Date(2014, 5, 30, 2, 19, 18, 0, time.UTC),
+		},
+		ID: "1860451d-fb89-45b8-b54e-151afceb50e5",
+		LoadBalancerPool: Pool{
+			ID:   "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+			Name: "RCv3Test",
+			NodeCounts: struct {
+				CloudServers int `mapstructure:"cloud_servers"`
+				External     int `mapstructure:"external"`
+				Total        int `mapstructure:"total"`
+			}{
+				CloudServers: 3,
+				External:     4,
+				Total:        7,
+			},
+			Port:      80,
+			Status:    "ACTIVE",
+			VirtualIP: "203.0.113.5",
+		},
+		Status:    "ACTIVE",
+		UpdatedAt: time.Date(2014, 5, 30, 3, 24, 18, 0, time.UTC),
+	}
+
+	actual, err := GetNodeDetails(fake.ServiceClient(), "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2", "d95ae0c4-6ab8-4873-b82f-f8433840cff2").Extract()
+	th.AssertNoErr(t, err)
+	th.CheckDeepEquals(t, expected, actual)
+}
+
+func TestCreateNodes(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/load_balancer_pools/nodes", func(w http.ResponseWriter, r *http.Request) {
+		th.TestMethod(t, r, "POST")
+		th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+		th.TestHeader(t, r, "Accept", "application/json")
+		th.TestJSONRequest(t, r, `
+      [
+      {
+        "cloud_server": {
+          "id": "d95ae0c4-6ab8-4873-b82f-f8433840cff2"
+        },
+        "load_balancer_pool": {
+          "id": "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2"
+        }
+      },
+      {
+        "cloud_server": {
+          "id": "d95ae0c4-6ab8-4873-b82f-f8433840cff2"
+        },
+        "load_balancer_pool": {
+          "id": "33021100-4abf-4836-9080-465a6d87ab68"
+      }
+    }
+    ]
+  `)
+
+		w.Header().Set("Content-Type", "application/json")
+		w.WriteHeader(http.StatusCreated)
+		fmt.Fprintf(w, `
+      [
+      {
+        "created": "2014-05-30T03:23:42Z",
+        "cloud_server": {
+          "id": "d95ae0c4-6ab8-4873-b82f-f8433840cff2"
+        },
+        "id": "1860451d-fb89-45b8-b54e-151afceb50e5",
+        "load_balancer_pool": {
+          "id": "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2"
+        },
+        "status": "ADDING",
+        "status_detail": null,
+        "updated": null
+      },
+      {
+        "created": "2014-05-31T08:23:12Z",
+        "cloud_server": {
+          "id": "d95ae0c4-6ab8-4873-b82f-f8433840cff2"
+        },
+        "id": "b70481dd-7edf-4dbb-a44b-41cc7679d4fb",
+        "load_balancer_pool": {
+          "id": "33021100-4abf-4836-9080-465a6d87ab68"
+        },
+        "status": "ADDING",
+        "status_detail": null,
+        "updated": null
+      }
+      ]
+    `)
+	})
+
+	expected := []Node{
+		Node{
+			CreatedAt: time.Date(2014, 5, 30, 3, 23, 42, 0, time.UTC),
+			CloudServer: struct {
+				ID string `mapstructure:"id"`
+			}{
+				ID: "d95ae0c4-6ab8-4873-b82f-f8433840cff2",
+			},
+			ID: "1860451d-fb89-45b8-b54e-151afceb50e5",
+			LoadBalancerPool: struct {
+				ID string `mapstructure:"id"`
+			}{
+				ID: "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+			},
+			Status: "ADDING",
+		},
+		Node{
+			CreatedAt: time.Date(2014, 5, 31, 8, 23, 12, 0, time.UTC),
+			CloudServer: struct {
+				ID string `mapstructure:"id"`
+			}{
+				ID: "d95ae0c4-6ab8-4873-b82f-f8433840cff2",
+			},
+			ID: "b70481dd-7edf-4dbb-a44b-41cc7679d4fb",
+			LoadBalancerPool: struct {
+				ID string `mapstructure:"id"`
+			}{
+				ID: "33021100-4abf-4836-9080-465a6d87ab68",
+			},
+			Status: "ADDING",
+		},
+	}
+
+	opts := []NodesOpts{
+		NodesOpts{
+			ServerID: "d95ae0c4-6ab8-4873-b82f-f8433840cff2",
+			PoolID:   "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+		},
+		NodesOpts{
+			ServerID: "d95ae0c4-6ab8-4873-b82f-f8433840cff2",
+			PoolID:   "33021100-4abf-4836-9080-465a6d87ab68",
+		},
+	}
+	actual, err := CreateNodes(fake.ServiceClient(), opts).Extract()
+	th.AssertNoErr(t, err)
+	th.AssertDeepEquals(t, expected, actual)
+}
+
+func TestDeleteNodes(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/load_balancer_pools/nodes", func(w http.ResponseWriter, r *http.Request) {
+		th.TestMethod(t, r, "DELETE")
+		th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+		th.TestHeader(t, r, "Accept", "application/json")
+		th.TestJSONRequest(t, r, `
+      [
+      {
+        "cloud_server": {
+          "id": "d95ae0c4-6ab8-4873-b82f-f8433840cff2"
+        },
+        "load_balancer_pool": {
+          "id": "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2"
+        }
+      },
+      {
+        "cloud_server": {
+          "id": "d95ae0c4-6ab8-4873-b82f-f8433840cff2"
+        },
+        "load_balancer_pool": {
+          "id": "33021100-4abf-4836-9080-465a6d87ab68"
+        }
+      }
+      ]
+    `)
+
+		w.Header().Set("Content-Type", "application/json")
+		w.WriteHeader(http.StatusNoContent)
+	})
+
+	opts := []NodesOpts{
+		NodesOpts{
+			ServerID: "d95ae0c4-6ab8-4873-b82f-f8433840cff2",
+			PoolID:   "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+		},
+		NodesOpts{
+			ServerID: "d95ae0c4-6ab8-4873-b82f-f8433840cff2",
+			PoolID:   "33021100-4abf-4836-9080-465a6d87ab68",
+		},
+	}
+	err := DeleteNodes(client.ServiceClient(), opts).ExtractErr()
+	th.AssertNoErr(t, err)
+}
+
+func TestListNodesForServerDetails(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/load_balancer_pools/nodes/details", func(w http.ResponseWriter, r *http.Request) {
+		th.TestMethod(t, r, "GET")
+		th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+		th.TestHeader(t, r, "Accept", "application/json")
+
+		w.Header().Set("Content-Type", "application/json")
+		fmt.Fprintf(w, `
+      [
+      {
+        "created": "2014-05-30T03:23:42Z",
+        "id": "1860451d-fb89-45b8-b54e-151afceb50e5",
+        "load_balancer_pool": {
+          "id": "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+          "name": "RCv3Test",
+          "node_counts": {
+            "cloud_servers": 3,
+            "external": 4,
+            "total": 7
+          },
+          "port": 80,
+          "status": "ACTIVE",
+          "status_detail": null,
+          "virtual_ip": "203.0.113.5"
+        },
+        "status": "ACTIVE",
+        "status_detail": null,
+        "updated": "2014-05-30T03:24:18Z"
+      }
+      ]
+    `)
+	})
+
+	expected := []NodeDetailsForServer{
+		NodeDetailsForServer{
+			CreatedAt: time.Date(2014, 5, 30, 3, 23, 42, 0, time.UTC),
+			ID:        "1860451d-fb89-45b8-b54e-151afceb50e5",
+			LoadBalancerPool: Pool{
+				ID:   "d6d3aa7c-dfa5-4e61-96ee-1d54ac1075d2",
+				Name: "RCv3Test",
+				NodeCounts: struct {
+					CloudServers int `mapstructure:"cloud_servers"`
+					External     int `mapstructure:"external"`
+					Total        int `mapstructure:"total"`
+				}{
+					CloudServers: 3,
+					External:     4,
+					Total:        7,
+				},
+				Port:      80,
+				Status:    "ACTIVE",
+				VirtualIP: "203.0.113.5",
+			},
+			Status:    "ACTIVE",
+			UpdatedAt: time.Date(2014, 5, 30, 3, 24, 18, 0, time.UTC),
+		},
+	}
+	count := 0
+	err := ListNodesDetailsForServer(fake.ServiceClient(), "07426958-1ebf-4c38-b032-d456820ca21a").EachPage(func(page pagination.Page) (bool, error) {
+		count++
+		actual, err := ExtractNodesDetailsForServer(page)
+		th.AssertNoErr(t, err)
+
+		th.CheckDeepEquals(t, expected, actual)
+
+		return true, nil
+	})
+	th.AssertNoErr(t, err)
+	th.CheckEquals(t, count, 1)
+}
diff --git a/rackspace/rackconnect/v3/lbpools/results.go b/rackspace/rackconnect/v3/lbpools/results.go
new file mode 100644
index 0000000..e5e914b
--- /dev/null
+++ b/rackspace/rackconnect/v3/lbpools/results.go
@@ -0,0 +1,505 @@
+package lbpools
+
+import (
+	"fmt"
+	"reflect"
+	"time"
+
+	"github.com/mitchellh/mapstructure"
+	"github.com/rackspace/gophercloud"
+	"github.com/rackspace/gophercloud/pagination"
+)
+
+// Pool represents a load balancer pool associated with a RackConnect configuration.
+type Pool struct {
+	// The unique ID of the load balancer pool.
+	ID string `mapstructure:"id"`
+	// The name of the load balancer pool.
+	Name string `mapstructure:"name"`
+	// The node counts associated witht the load balancer pool.
+	NodeCounts struct {
+		// The number of nodes associated with this LB pool for this account.
+		CloudServers int `mapstructure:"cloud_servers"`
+		// The number of nodes associated with this LB pool from other accounts.
+		External int `mapstructure:"external"`
+		// The total number of nodes associated with this LB pool.
+		Total int `mapstructure:"total"`
+	} `mapstructure:"node_counts"`
+	// The port of the LB pool
+	Port int `mapstructure:"port"`
+	// The status of the LB pool
+	Status string `mapstructure:"status"`
+	// The details of the status of the LB pool
+	StatusDetail string `mapstructure:"status_detail"`
+	// The virtual IP of the LB pool
+	VirtualIP string `mapstructure:"virtual_ip"`
+}
+
+// PoolPage is the page returned by a pager when traversing over a
+// collection of Pools.
+type PoolPage struct {
+	pagination.SinglePageBase
+}
+
+// IsEmpty returns true if a PoolPage contains no Pools.
+func (r PoolPage) IsEmpty() (bool, error) {
+	cns, err := ExtractPools(r)
+	if err != nil {
+		return true, err
+	}
+	return len(cns) == 0, nil
+}
+
+// ExtractPools extracts and returns Pools. It is used while iterating over
+// an lbpools.List call.
+func ExtractPools(page pagination.Page) ([]Pool, error) {
+	var res []Pool
+	err := mapstructure.Decode(page.(PoolPage).Body, &res)
+	return res, err
+}
+
+// GetResult represents the result of a Get operation.
+type GetResult struct {
+	gophercloud.Result
+}
+
+// Extract is a function that extracts an LBPool from a GetResult.
+func (r GetResult) Extract() (*Pool, error) {
+	if r.Err != nil {
+		return nil, r.Err
+	}
+	var res Pool
+	err := mapstructure.Decode(r.Body, &res)
+	return &res, err
+}
+
+// Node represents a load balancer pool node associated with a RackConnect configuration.
+type Node struct {
+	// The unique ID of the LB node.
+	ID string `mapstructure:"id"`
+	// The cloud server (node) of the load balancer pool.
+	CloudServer struct {
+		// The cloud server ID.
+		ID string `mapstructure:"id"`
+	} `mapstructure:"cloud_server"`
+	// The load balancer pool.
+	LoadBalancerPool struct {
+		// The LB pool ID.
+		ID string `mapstructure:"id"`
+	} `mapstructure:"load_balancer_pool"`
+	// The status of the LB pool.
+	Status string `mapstructure:"status"`
+	// The details of the status of the LB pool.
+	StatusDetail string `mapstructure:"status_detail"`
+	// The time the LB node was created.
+	CreatedAt time.Time `mapstructure:"-"`
+	// The time the LB node was last updated.
+	UpdatedAt time.Time `mapstructure:"-"`
+}
+
+// NodePage is the page returned by a pager when traversing over a
+// collection of Nodes.
+type NodePage struct {
+	pagination.SinglePageBase
+}
+
+// IsEmpty returns true if a NodePage contains no Nodes.
+func (r NodePage) IsEmpty() (bool, error) {
+	n, err := ExtractNodes(r)
+	if err != nil {
+		return true, err
+	}
+	return len(n) == 0, nil
+}
+
+// ExtractNodes extracts and returns a slice of Nodes. It is used while iterating over
+// an lbpools.ListNodes call.
+func ExtractNodes(page pagination.Page) ([]Node, error) {
+	var res []Node
+	casted := page.(NodePage).Body
+	err := mapstructure.Decode(casted, &res)
+
+	var rawNodes []interface{}
+	switch casted.(type) {
+	case interface{}:
+		rawNodes = casted.([]interface{})
+	default:
+		return res, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted))
+	}
+
+	for i := range rawNodes {
+		thisNode := (rawNodes[i]).(map[string]interface{})
+
+		if t, ok := thisNode["created"].(string); ok && t != "" {
+			creationTime, err := time.Parse(time.RFC3339, t)
+			if err != nil {
+				return res, err
+			}
+			res[i].CreatedAt = creationTime
+		}
+
+		if t, ok := thisNode["updated"].(string); ok && t != "" {
+			updatedTime, err := time.Parse(time.RFC3339, t)
+			if err != nil {
+				return res, err
+			}
+			res[i].UpdatedAt = updatedTime
+		}
+	}
+
+	return res, err
+}
+
+// NodeResult represents a result that can be extracted as a Node.
+type NodeResult struct {
+	gophercloud.Result
+}
+
+// CreateNodeResult represents the result of an CreateNode operation.
+type CreateNodeResult struct {
+	NodeResult
+}
+
+// GetNodeResult represents the result of an GetNode operation.
+type GetNodeResult struct {
+	NodeResult
+}
+
+// Extract is a function that extracts a Node from a NodeResult.
+func (r NodeResult) Extract() (*Node, error) {
+	if r.Err != nil {
+		return nil, r.Err
+	}
+	var res Node
+	err := mapstructure.Decode(r.Body, &res)
+
+	b := r.Body.(map[string]interface{})
+
+	if date, ok := b["created"]; ok && date != nil {
+		t, err := time.Parse(time.RFC3339, date.(string))
+		if err != nil {
+			return nil, err
+		}
+		res.CreatedAt = t
+	}
+
+	if date, ok := b["updated"]; ok && date != nil {
+		t, err := time.Parse(time.RFC3339, date.(string))
+		if err != nil {
+			return nil, err
+		}
+		res.UpdatedAt = t
+	}
+
+	return &res, err
+}
+
+// NodeDetails represents a load balancer pool node associated with a RackConnect configuration
+// with all its details.
+type NodeDetails struct {
+	// The unique ID of the LB node.
+	ID string `mapstructure:"id"`
+	// The cloud server (node) of the load balancer pool.
+	CloudServer struct {
+		// The cloud server ID.
+		ID string `mapstructure:"id"`
+		// The name of the server.
+		Name string `mapstructure:"name"`
+		// The cloud network for the cloud server.
+		CloudNetwork struct {
+			// The network ID.
+			ID string `mapstructure:"id"`
+			// The network name.
+			Name string `mapstructure:"name"`
+			// The network's private IPv4 address.
+			PrivateIPv4 string `mapstructure:"private_ip_v4"`
+			// The IP range for the network.
+			CIDR string `mapstructure:"cidr"`
+			// The datetime the network was created.
+			CreatedAt time.Time `mapstructure:"-"`
+			// The last datetime the network was updated.
+			UpdatedAt time.Time `mapstructure:"-"`
+		} `mapstructure:"cloud_network"`
+		// The datetime the server was created.
+		CreatedAt time.Time `mapstructure:"-"`
+		// The datetime the server was last updated.
+		UpdatedAt time.Time `mapstructure:"-"`
+	} `mapstructure:"cloud_server"`
+	// The load balancer pool.
+	LoadBalancerPool Pool `mapstructure:"load_balancer_pool"`
+	// The status of the LB pool.
+	Status string `mapstructure:"status"`
+	// The details of the status of the LB pool.
+	StatusDetail string `mapstructure:"status_detail"`
+	// The time the LB node was created.
+	CreatedAt time.Time `mapstructure:"-"`
+	// The time the LB node was last updated.
+	UpdatedAt time.Time `mapstructure:"-"`
+}
+
+// NodeDetailsPage is the page returned by a pager when traversing over a
+// collection of NodeDetails.
+type NodeDetailsPage struct {
+	pagination.SinglePageBase
+}
+
+// IsEmpty returns true if a NodeDetailsPage contains no NodeDetails.
+func (r NodeDetailsPage) IsEmpty() (bool, error) {
+	n, err := ExtractNodesDetails(r)
+	if err != nil {
+		return true, err
+	}
+	return len(n) == 0, nil
+}
+
+// ExtractNodesDetails extracts and returns a slice of NodeDetails. It is used while iterating over
+// an lbpools.ListNodesDetails call.
+func ExtractNodesDetails(page pagination.Page) ([]NodeDetails, error) {
+	var res []NodeDetails
+	casted := page.(NodeDetailsPage).Body
+	err := mapstructure.Decode(casted, &res)
+
+	var rawNodesDetails []interface{}
+	switch casted.(type) {
+	case interface{}:
+		rawNodesDetails = casted.([]interface{})
+	default:
+		return res, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted))
+	}
+
+	for i := range rawNodesDetails {
+		thisNodeDetails := (rawNodesDetails[i]).(map[string]interface{})
+
+		if t, ok := thisNodeDetails["created"].(string); ok && t != "" {
+			creationTime, err := time.Parse(time.RFC3339, t)
+			if err != nil {
+				return res, err
+			}
+			res[i].CreatedAt = creationTime
+		}
+
+		if t, ok := thisNodeDetails["updated"].(string); ok && t != "" {
+			updatedTime, err := time.Parse(time.RFC3339, t)
+			if err != nil {
+				return res, err
+			}
+			res[i].UpdatedAt = updatedTime
+		}
+
+		if cs, ok := thisNodeDetails["cloud_server"].(map[string]interface{}); ok {
+			if t, ok := cs["created"].(string); ok && t != "" {
+				creationTime, err := time.Parse(time.RFC3339, t)
+				if err != nil {
+					return res, err
+				}
+				res[i].CloudServer.CreatedAt = creationTime
+			}
+			if t, ok := cs["updated"].(string); ok && t != "" {
+				updatedTime, err := time.Parse(time.RFC3339, t)
+				if err != nil {
+					return res, err
+				}
+				res[i].CloudServer.UpdatedAt = updatedTime
+			}
+			if cn, ok := cs["cloud_network"].(map[string]interface{}); ok {
+				if t, ok := cn["created"].(string); ok && t != "" {
+					creationTime, err := time.Parse(time.RFC3339, t)
+					if err != nil {
+						return res, err
+					}
+					res[i].CloudServer.CloudNetwork.CreatedAt = creationTime
+				}
+				if t, ok := cn["updated"].(string); ok && t != "" {
+					updatedTime, err := time.Parse(time.RFC3339, t)
+					if err != nil {
+						return res, err
+					}
+					res[i].CloudServer.CloudNetwork.UpdatedAt = updatedTime
+				}
+			}
+		}
+	}
+
+	return res, err
+}
+
+// GetNodeDetailsResult represents the result of an NodeDetails operation.
+type GetNodeDetailsResult struct {
+	gophercloud.Result
+}
+
+// Extract is a function that extracts a NodeDetails from a NodeDetailsResult.
+func (r GetNodeDetailsResult) Extract() (*NodeDetails, error) {
+	if r.Err != nil {
+		return nil, r.Err
+	}
+	var res NodeDetails
+	err := mapstructure.Decode(r.Body, &res)
+
+	b := r.Body.(map[string]interface{})
+
+	if date, ok := b["created"]; ok && date != nil {
+		t, err := time.Parse(time.RFC3339, date.(string))
+		if err != nil {
+			return nil, err
+		}
+		res.CreatedAt = t
+	}
+
+	if date, ok := b["updated"]; ok && date != nil {
+		t, err := time.Parse(time.RFC3339, date.(string))
+		if err != nil {
+			return nil, err
+		}
+		res.UpdatedAt = t
+	}
+
+	if cs, ok := b["cloud_server"].(map[string]interface{}); ok {
+		if t, ok := cs["created"].(string); ok && t != "" {
+			creationTime, err := time.Parse(time.RFC3339, t)
+			if err != nil {
+				return &res, err
+			}
+			res.CloudServer.CreatedAt = creationTime
+		}
+		if t, ok := cs["updated"].(string); ok && t != "" {
+			updatedTime, err := time.Parse(time.RFC3339, t)
+			if err != nil {
+				return &res, err
+			}
+			res.CloudServer.UpdatedAt = updatedTime
+		}
+		if cn, ok := cs["cloud_network"].(map[string]interface{}); ok {
+			if t, ok := cn["created"].(string); ok && t != "" {
+				creationTime, err := time.Parse(time.RFC3339, t)
+				if err != nil {
+					return &res, err
+				}
+				res.CloudServer.CloudNetwork.CreatedAt = creationTime
+			}
+			if t, ok := cn["updated"].(string); ok && t != "" {
+				updatedTime, err := time.Parse(time.RFC3339, t)
+				if err != nil {
+					return &res, err
+				}
+				res.CloudServer.CloudNetwork.UpdatedAt = updatedTime
+			}
+		}
+	}
+
+	return &res, err
+}
+
+// DeleteNodeResult represents the result of a DeleteNode operation.
+type DeleteNodeResult struct {
+	gophercloud.ErrResult
+}
+
+// CreateNodesResult represents the result of a CreateNodes operation.
+type CreateNodesResult struct {
+	gophercloud.Result
+}
+
+// Extract is a function that extracts a slice of Nodes from a CreateNodesResult.
+func (r CreateNodesResult) Extract() ([]Node, error) {
+	if r.Err != nil {
+		return nil, r.Err
+	}
+	var res []Node
+	err := mapstructure.Decode(r.Body, &res)
+
+	b := r.Body.([]interface{})
+	for i := range b {
+		if date, ok := b[i].(map[string]interface{})["created"]; ok && date != nil {
+			t, err := time.Parse(time.RFC3339, date.(string))
+			if err != nil {
+				return nil, err
+			}
+			res[i].CreatedAt = t
+		}
+		if date, ok := b[i].(map[string]interface{})["updated"]; ok && date != nil {
+			t, err := time.Parse(time.RFC3339, date.(string))
+			if err != nil {
+				return nil, err
+			}
+			res[i].UpdatedAt = t
+		}
+	}
+
+	return res, err
+}
+
+// DeleteNodesResult represents the result of a DeleteNodes operation.
+type DeleteNodesResult struct {
+	gophercloud.ErrResult
+}
+
+// NodeDetailsForServer represents a load balancer pool node associated with a RackConnect configuration
+// with all its details for a particular server.
+type NodeDetailsForServer struct {
+	// The unique ID of the LB node.
+	ID string `mapstructure:"id"`
+	// The load balancer pool.
+	LoadBalancerPool Pool `mapstructure:"load_balancer_pool"`
+	// The status of the LB pool.
+	Status string `mapstructure:"status"`
+	// The details of the status of the LB pool.
+	StatusDetail string `mapstructure:"status_detail"`
+	// The time the LB node was created.
+	CreatedAt time.Time `mapstructure:"-"`
+	// The time the LB node was last updated.
+	UpdatedAt time.Time `mapstructure:"-"`
+}
+
+// NodeDetailsForServerPage is the page returned by a pager when traversing over a
+// collection of NodeDetailsForServer.
+type NodeDetailsForServerPage struct {
+	pagination.SinglePageBase
+}
+
+// IsEmpty returns true if a NodeDetailsForServerPage contains no NodeDetailsForServer.
+func (r NodeDetailsForServerPage) IsEmpty() (bool, error) {
+	n, err := ExtractNodesDetailsForServer(r)
+	if err != nil {
+		return true, err
+	}
+	return len(n) == 0, nil
+}
+
+// ExtractNodesDetailsForServer extracts and returns a slice of NodeDetailsForServer. It is used while iterating over
+// an lbpools.ListNodesDetailsForServer call.
+func ExtractNodesDetailsForServer(page pagination.Page) ([]NodeDetailsForServer, error) {
+	var res []NodeDetailsForServer
+	casted := page.(NodeDetailsForServerPage).Body
+	err := mapstructure.Decode(casted, &res)
+
+	var rawNodesDetails []interface{}
+	switch casted.(type) {
+	case interface{}:
+		rawNodesDetails = casted.([]interface{})
+	default:
+		return res, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted))
+	}
+
+	for i := range rawNodesDetails {
+		thisNodeDetails := (rawNodesDetails[i]).(map[string]interface{})
+
+		if t, ok := thisNodeDetails["created"].(string); ok && t != "" {
+			creationTime, err := time.Parse(time.RFC3339, t)
+			if err != nil {
+				return res, err
+			}
+			res[i].CreatedAt = creationTime
+		}
+
+		if t, ok := thisNodeDetails["updated"].(string); ok && t != "" {
+			updatedTime, err := time.Parse(time.RFC3339, t)
+			if err != nil {
+				return res, err
+			}
+			res[i].UpdatedAt = updatedTime
+		}
+	}
+
+	return res, err
+}
diff --git a/rackspace/rackconnect/v3/lbpools/urls.go b/rackspace/rackconnect/v3/lbpools/urls.go
new file mode 100644
index 0000000..c238239
--- /dev/null
+++ b/rackspace/rackconnect/v3/lbpools/urls.go
@@ -0,0 +1,49 @@
+package lbpools
+
+import "github.com/rackspace/gophercloud"
+
+var root = "load_balancer_pools"
+
+func listURL(c *gophercloud.ServiceClient) string {
+	return c.ServiceURL(root)
+}
+
+func getURL(c *gophercloud.ServiceClient, id string) string {
+	return c.ServiceURL(root, id)
+}
+
+func listNodesURL(c *gophercloud.ServiceClient, id string) string {
+	return c.ServiceURL(root, id, "nodes")
+}
+
+func createNodeURL(c *gophercloud.ServiceClient, id string) string {
+	return listNodesURL(c, id)
+}
+
+func listNodesDetailsURL(c *gophercloud.ServiceClient, id string) string {
+	return c.ServiceURL(root, id, "nodes", "details")
+}
+
+func nodeURL(c *gophercloud.ServiceClient, poolID, nodeID string) string {
+	return c.ServiceURL(root, poolID, "nodes", nodeID)
+}
+
+func deleteNodeURL(c *gophercloud.ServiceClient, poolID, nodeID string) string {
+	return nodeURL(c, poolID, nodeID)
+}
+
+func nodeDetailsURL(c *gophercloud.ServiceClient, poolID, nodeID string) string {
+	return c.ServiceURL(root, poolID, "nodes", nodeID, "details")
+}
+
+func createNodesURL(c *gophercloud.ServiceClient) string {
+	return c.ServiceURL(root, "nodes")
+}
+
+func deleteNodesURL(c *gophercloud.ServiceClient) string {
+	return createNodesURL(c)
+}
+
+func listNodesForServerURL(c *gophercloud.ServiceClient, serverID string) string {
+	return c.ServiceURL(root, "nodes", "details?cloud_server_id="+serverID)
+}
