Rackspace Auto Scale: Add policies Execute()
diff --git a/rackspace/autoscale/v1/policies/fixtures.go b/rackspace/autoscale/v1/policies/fixtures.go
index a0ce86e..ac54268 100644
--- a/rackspace/autoscale/v1/policies/fixtures.go
+++ b/rackspace/autoscale/v1/policies/fixtures.go
@@ -241,3 +241,19 @@
w.WriteHeader(http.StatusNoContent)
})
}
+
+// HandlePolicyExecuteSuccessfully sets up the test server to respond to a policies Execute request.
+func HandlePolicyExecuteSuccessfully(t *testing.T) {
+ groupID := "60b15dad-5ea1-43fa-9a12-a1d737b4da07"
+ policyID := "2b48d247-0282-4b9d-8775-5c4b67e8e649"
+
+ path := fmt.Sprintf("/groups/%s/policies/%s/execute", groupID, policyID)
+
+ th.Mux.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) {
+ th.TestMethod(t, r, "POST")
+ th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
+
+ w.WriteHeader(http.StatusAccepted)
+ fmt.Fprintf(w, "{}")
+ })
+}