Fixing tests
diff --git a/rackspace/lb/v1/lbs/requests.go b/rackspace/lb/v1/lbs/requests.go
index 2d80062..8e53020 100644
--- a/rackspace/lb/v1/lbs/requests.go
+++ b/rackspace/lb/v1/lbs/requests.go
@@ -433,7 +433,7 @@
_, res.Err = perigee.Request("PUT", loggingURL(client, id), perigee.Options{
MoreHeaders: client.AuthenticatedHeaders(),
ReqBody: &reqBody,
- OkCodes: []int{200},
+ OkCodes: []int{202},
})
return res
@@ -447,7 +447,7 @@
_, res.Err = perigee.Request("PUT", loggingURL(client, id), perigee.Options{
MoreHeaders: client.AuthenticatedHeaders(),
ReqBody: &reqBody,
- OkCodes: []int{200},
+ OkCodes: []int{202},
})
return res
@@ -509,6 +509,14 @@
return res
}
+// IsContentCached will check to see whether the specified load balancer caches
+// content. When content caching is enabled, recently-accessed files are stored
+// on the load balancer for easy retrieval by web clients. Content caching
+// improves the performance of high traffic web sites by temporarily storing
+// data that was recently accessed. While it's cached, requests for that data
+// are served by the load balancer, which in turn reduces load off the back end
+// nodes. The result is improved response times for those requests and less
+// load on the web server.
func IsContentCached(client *gophercloud.ServiceClient, id int) (bool, error) {
var body interface{}
@@ -537,6 +545,7 @@
}
}
+// EnableCaching will enable content-caching for the specified load balancer.
func EnableCaching(client *gophercloud.ServiceClient, id int) gophercloud.ErrResult {
reqBody := toCachingMap(true)
var res gophercloud.ErrResult
@@ -544,12 +553,13 @@
_, res.Err = perigee.Request("PUT", cacheURL(client, id), perigee.Options{
MoreHeaders: client.AuthenticatedHeaders(),
ReqBody: &reqBody,
- OkCodes: []int{200},
+ OkCodes: []int{202},
})
return res
}
+// DisableCaching will disable content-caching for the specified load balancer.
func DisableCaching(client *gophercloud.ServiceClient, id int) gophercloud.ErrResult {
reqBody := toCachingMap(false)
var res gophercloud.ErrResult
@@ -557,7 +567,7 @@
_, res.Err = perigee.Request("PUT", cacheURL(client, id), perigee.Options{
MoreHeaders: client.AuthenticatedHeaders(),
ReqBody: &reqBody,
- OkCodes: []int{200},
+ OkCodes: []int{202},
})
return res
diff --git a/rackspace/lb/v1/throttle/requests.go b/rackspace/lb/v1/throttle/requests.go
index 78c878f..8c2e4be 100644
--- a/rackspace/lb/v1/throttle/requests.go
+++ b/rackspace/lb/v1/throttle/requests.go
@@ -19,6 +19,15 @@
type CreateOpts struct {
// Required - the maximum amount of connections per IP address to allow per LB.
MaxConnections int
+
+ // Deprecated as of v1.22.
+ MaxConnectionRate int
+
+ // Deprecated as of v1.22.
+ MinConnections int
+
+ // Deprecated as of v1.22.
+ RateInterval int
}
// ToCTCreateMap casts a CreateOpts struct to a map.
@@ -30,6 +39,10 @@
}
ct["maxConnections"] = opts.MaxConnections
+ ct["maxConnectionRate"] = opts.MaxConnectionRate
+ ct["minConnections"] = opts.MinConnections
+ ct["rateInterval"] = opts.RateInterval
+
return map[string]interface{}{"connectionThrottle": ct}, nil
}
@@ -48,7 +61,7 @@
MoreHeaders: c.AuthenticatedHeaders(),
ReqBody: &reqBody,
Results: &res.Body,
- OkCodes: []int{200},
+ OkCodes: []int{202},
})
return res
@@ -75,7 +88,7 @@
_, res.Err = perigee.Request("DELETE", rootURL(c, lbID), perigee.Options{
MoreHeaders: c.AuthenticatedHeaders(),
- OkCodes: []int{200},
+ OkCodes: []int{202},
})
return res