diff --git a/rackspace/rackconnect/v3/publicips/requests.go b/rackspace/rackconnect/v3/publicips/requests.go
new file mode 100644
index 0000000..82a5295
--- /dev/null
+++ b/rackspace/rackconnect/v3/publicips/requests.go
@@ -0,0 +1,59 @@
+package publicips
+
+import (
+	"github.com/rackspace/gophercloud"
+	"github.com/rackspace/gophercloud/pagination"
+)
+
+// List returns all public IPs.
+func List(c *gophercloud.ServiceClient) pagination.Pager {
+	url := listURL(c)
+	createPage := func(r pagination.PageResult) pagination.Page {
+		return PublicIPPage{pagination.SinglePageBase(r)}
+	}
+	return pagination.NewPager(c, url, createPage)
+}
+
+// Create adds a public IP to the server with the given serverID.
+func Create(c *gophercloud.ServiceClient, serverID string) CreateResult {
+	var res CreateResult
+	reqBody := map[string]interface{}{
+		"cloud_server": map[string]string{
+			"id": serverID,
+		},
+	}
+	_, res.Err = c.Request("POST", createURL(c), gophercloud.RequestOpts{
+		JSONBody:     &reqBody,
+		JSONResponse: &res.Body,
+		OkCodes:      []int{201},
+	})
+	return res
+}
+
+// ListForServer returns all public IPs for the server with the given serverID.
+func ListForServer(c *gophercloud.ServiceClient, serverID string) pagination.Pager {
+	url := listForServerURL(c, serverID)
+	createPage := func(r pagination.PageResult) pagination.Page {
+		return PublicIPPage{pagination.SinglePageBase(r)}
+	}
+	return pagination.NewPager(c, url, createPage)
+}
+
+// Get retrieves the public IP with the given 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
+}
+
+// Delete removes the public IP with the given id.
+func Delete(c *gophercloud.ServiceClient, id string) DeleteResult {
+	var res DeleteResult
+	_, res.Err = c.Request("DELETE", deleteURL(c, id), gophercloud.RequestOpts{
+		OkCodes: []int{204},
+	})
+	return res
+}
diff --git a/rackspace/rackconnect/v3/publicips/requests_test.go b/rackspace/rackconnect/v3/publicips/requests_test.go
new file mode 100644
index 0000000..de1df7a
--- /dev/null
+++ b/rackspace/rackconnect/v3/publicips/requests_test.go
@@ -0,0 +1,378 @@
+package publicips
+
+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 TestListIPs(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/public_ips", 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": "2d0f586b-37a7-4ae0-adac-2743d5feb450",
+        "public_ip_v4": "203.0.113.110",
+        "status": "ACTIVE",
+        "status_detail": null,
+        "updated": "2014-05-30T03:24:18Z"
+      }
+    ]`)
+	})
+
+	expected := []PublicIP{
+		PublicIP{
+			ID:         "2d0f586b-37a7-4ae0-adac-2743d5feb450",
+			PublicIPv4: "203.0.113.110",
+			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),
+			},
+			Status:    "ACTIVE",
+			UpdatedAt: time.Date(2014, 5, 30, 3, 24, 18, 0, time.UTC),
+		},
+	}
+
+	count := 0
+	err := List(fake.ServiceClient()).EachPage(func(page pagination.Page) (bool, error) {
+		count++
+		actual, err := ExtractPublicIPs(page)
+		th.AssertNoErr(t, err)
+
+		th.CheckDeepEquals(t, expected, actual)
+
+		return true, nil
+	})
+	th.AssertNoErr(t, err)
+	th.CheckEquals(t, count, 1)
+}
+
+func TestCreateIP(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/public_ips", 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": {
+          "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": "2d0f586b-37a7-4ae0-adac-2743d5feb450",
+        "status": "ADDING"
+      }`)
+	})
+
+	expected := &PublicIP{
+		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:     "2d0f586b-37a7-4ae0-adac-2743d5feb450",
+		Status: "ADDING",
+	}
+
+	actual, err := Create(fake.ServiceClient(), "d95ae0c4-6ab8-4873-b82f-f8433840cff2").Extract()
+	th.AssertNoErr(t, err)
+	th.AssertDeepEquals(t, expected, actual)
+}
+
+func TestGetIP(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/public_ips/2d0f586b-37a7-4ae0-adac-2743d5feb450", 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": {
+          "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": "2d0f586b-37a7-4ae0-adac-2743d5feb450",
+        "public_ip_v4": "203.0.113.110",
+        "status": "ACTIVE",
+        "status_detail": null,
+        "updated": "2014-05-30T03:24:18Z"
+      }`)
+	})
+
+	expected := &PublicIP{
+		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:         "2d0f586b-37a7-4ae0-adac-2743d5feb450",
+		Status:     "ACTIVE",
+		PublicIPv4: "203.0.113.110",
+		UpdatedAt:  time.Date(2014, 5, 30, 3, 24, 18, 0, time.UTC),
+	}
+
+	actual, err := Get(fake.ServiceClient(), "2d0f586b-37a7-4ae0-adac-2743d5feb450").Extract()
+	th.AssertNoErr(t, err)
+	th.AssertDeepEquals(t, expected, actual)
+}
+
+func TestDeleteIP(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/public_ips/2d0f586b-37a7-4ae0-adac-2743d5feb450", 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 := Delete(client.ServiceClient(), "2d0f586b-37a7-4ae0-adac-2743d5feb450").ExtractErr()
+	th.AssertNoErr(t, err)
+}
+
+func TestListForServer(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/public_ips", 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": "2d0f586b-37a7-4ae0-adac-2743d5feb450",
+      "public_ip_v4": "203.0.113.110",
+      "status": "ACTIVE",
+      "updated": "2014-05-30T03:24:18Z"
+    }
+    ]`)
+	})
+
+	expected := []PublicIP{
+		PublicIP{
+			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:         "2d0f586b-37a7-4ae0-adac-2743d5feb450",
+			Status:     "ACTIVE",
+			PublicIPv4: "203.0.113.110",
+			UpdatedAt:  time.Date(2014, 5, 30, 3, 24, 18, 0, time.UTC),
+		},
+	}
+	count := 0
+	err := ListForServer(fake.ServiceClient(), "d95ae0c4-6ab8-4873-b82f-f8433840cff2").EachPage(func(page pagination.Page) (bool, error) {
+		count++
+		actual, err := ExtractPublicIPs(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/publicips/results.go b/rackspace/rackconnect/v3/publicips/results.go
new file mode 100644
index 0000000..132cf77
--- /dev/null
+++ b/rackspace/rackconnect/v3/publicips/results.go
@@ -0,0 +1,221 @@
+package publicips
+
+import (
+	"fmt"
+	"reflect"
+	"time"
+
+	"github.com/mitchellh/mapstructure"
+	"github.com/rackspace/gophercloud"
+	"github.com/rackspace/gophercloud/pagination"
+)
+
+// PublicIP represents a public IP address.
+type PublicIP struct {
+	// The unique ID of the public IP.
+	ID string `mapstructure:"id"`
+	// The IPv4 address of the public IP.
+	PublicIPv4 string `mapstructure:"public_ip_v4"`
+	// The cloud server (node) of the public IP.
+	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 status of the public IP.
+	Status string `mapstructure:"status"`
+	// The details of the status of the public IP.
+	StatusDetail string `mapstructure:"status_detail"`
+	// The time the public IP was created.
+	CreatedAt time.Time `mapstructure:"-"`
+	// The time the public IP was last updated.
+	UpdatedAt time.Time `mapstructure:"-"`
+}
+
+// PublicIPPage is the page returned by a pager when traversing over a
+// collection of PublicIPs.
+type PublicIPPage struct {
+	pagination.SinglePageBase
+}
+
+// IsEmpty returns true if a PublicIPPage contains no PublicIPs.
+func (r PublicIPPage) IsEmpty() (bool, error) {
+	n, err := ExtractPublicIPs(r)
+	if err != nil {
+		return true, err
+	}
+	return len(n) == 0, nil
+}
+
+// ExtractPublicIPs extracts and returns a slice of PublicIPs. It is used while iterating over
+// a publicips.List call.
+func ExtractPublicIPs(page pagination.Page) ([]PublicIP, error) {
+	var res []PublicIP
+	casted := page.(PublicIPPage).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
+}
+
+// PublicIPResult represents a result that can be extracted into a PublicIP.
+type PublicIPResult struct {
+	gophercloud.Result
+}
+
+// CreateResult represents the result of a Create operation.
+type CreateResult struct {
+	PublicIPResult
+}
+
+// GetResult represents the result of a Get operation.
+type GetResult struct {
+	PublicIPResult
+}
+
+// Extract is a function that extracts a PublicIP from a PublicIPResult.
+func (r PublicIPResult) Extract() (*PublicIP, error) {
+	if r.Err != nil {
+		return nil, r.Err
+	}
+	var res PublicIP
+	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
+}
+
+// DeleteResult represents the result of a Delete operation.
+type DeleteResult struct {
+	gophercloud.ErrResult
+}
diff --git a/rackspace/rackconnect/v3/publicips/urls.go b/rackspace/rackconnect/v3/publicips/urls.go
new file mode 100644
index 0000000..6f310be
--- /dev/null
+++ b/rackspace/rackconnect/v3/publicips/urls.go
@@ -0,0 +1,25 @@
+package publicips
+
+import "github.com/rackspace/gophercloud"
+
+var root = "public_ips"
+
+func listURL(c *gophercloud.ServiceClient) string {
+	return c.ServiceURL(root)
+}
+
+func createURL(c *gophercloud.ServiceClient) string {
+	return c.ServiceURL(root)
+}
+
+func listForServerURL(c *gophercloud.ServiceClient, serverID string) string {
+	return c.ServiceURL(root + "?cloud_server_id=" + serverID)
+}
+
+func getURL(c *gophercloud.ServiceClient, id string) string {
+	return c.ServiceURL(root, id)
+}
+
+func deleteURL(c *gophercloud.ServiceClient, id string) string {
+	return getURL(c, id)
+}
