Added gophercloud startstop dependency
This commit is contained in:
parent
004cec60b3
commit
20bb0b352a
5
vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop/doc.go
generated
vendored
Normal file
5
vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop/doc.go
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
/*
|
||||
Package startstop provides functionality to start and stop servers that have
|
||||
been provisioned by the OpenStack Compute service.
|
||||
*/
|
||||
package startstop
|
29
vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop/fixtures.go
generated
vendored
Normal file
29
vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop/fixtures.go
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
// +build fixtures
|
||||
|
||||
package startstop
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
th "github.com/rackspace/gophercloud/testhelper"
|
||||
"github.com/rackspace/gophercloud/testhelper/client"
|
||||
)
|
||||
|
||||
func mockStartServerResponse(t *testing.T, id string) {
|
||||
th.Mux.HandleFunc("/servers/"+id+"/action", func(w http.ResponseWriter, r *http.Request) {
|
||||
th.TestMethod(t, r, "POST")
|
||||
th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
|
||||
th.TestJSONRequest(t, r, `{"os-start": null}`)
|
||||
w.WriteHeader(http.StatusAccepted)
|
||||
})
|
||||
}
|
||||
|
||||
func mockStopServerResponse(t *testing.T, id string) {
|
||||
th.Mux.HandleFunc("/servers/"+id+"/action", func(w http.ResponseWriter, r *http.Request) {
|
||||
th.TestMethod(t, r, "POST")
|
||||
th.TestHeader(t, r, "X-Auth-Token", client.TokenID)
|
||||
th.TestJSONRequest(t, r, `{"os-stop": null}`)
|
||||
w.WriteHeader(http.StatusAccepted)
|
||||
})
|
||||
}
|
23
vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop/requests.go
generated
vendored
Normal file
23
vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop/requests.go
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
package startstop
|
||||
|
||||
import "github.com/rackspace/gophercloud"
|
||||
|
||||
func actionURL(client *gophercloud.ServiceClient, id string) string {
|
||||
return client.ServiceURL("servers", id, "action")
|
||||
}
|
||||
|
||||
// Start is the operation responsible for starting a Compute server.
|
||||
func Start(client *gophercloud.ServiceClient, id string) gophercloud.ErrResult {
|
||||
var res gophercloud.ErrResult
|
||||
reqBody := map[string]interface{}{"os-start": nil}
|
||||
_, res.Err = client.Post(actionURL(client, id), reqBody, nil, nil)
|
||||
return res
|
||||
}
|
||||
|
||||
// Stop is the operation responsible for stopping a Compute server.
|
||||
func Stop(client *gophercloud.ServiceClient, id string) gophercloud.ErrResult {
|
||||
var res gophercloud.ErrResult
|
||||
reqBody := map[string]interface{}{"os-stop": nil}
|
||||
_, res.Err = client.Post(actionURL(client, id), reqBody, nil, nil)
|
||||
return res
|
||||
}
|
|
@ -1184,6 +1184,12 @@
|
|||
"revision": "d47105ce4ef90cea9a14b85c8dd172b760085828",
|
||||
"revisionTime": "2016-06-03T22:34:01Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "jqSmOJoNKVtGwDhuoilAF7iftqA=",
|
||||
"path": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop",
|
||||
"revision": "d47105ce4ef90cea9a14b85c8dd172b760085828",
|
||||
"revisionTime": "2016-06-03T22:34:01Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "rHEOEAm10HDsfBLU8FqKSUdwqFY=",
|
||||
"path": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/tenantnetworks",
|
||||
|
|
Loading…
Reference in New Issue