mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-04-25 03:01:47 -04:00
Add distributed routers support
This commit is contained in:
@@ -15,6 +15,7 @@ const (
|
||||
Volume SourceType = "volume"
|
||||
Snapshot SourceType = "snapshot"
|
||||
Image SourceType = "image"
|
||||
Blank SourceType = "blank"
|
||||
)
|
||||
|
||||
// BlockDevice is a structure with options for booting a server instance
|
||||
@@ -32,6 +33,9 @@ type BlockDevice struct {
|
||||
// and "local".
|
||||
DestinationType string `json:"destination_type"`
|
||||
|
||||
// GuestFormat [optional] specifies the format of the block device.
|
||||
GuestFormat string `json:"guest_format"`
|
||||
|
||||
// SourceType [required] must be one of: "volume", "snapshot", "image".
|
||||
SourceType SourceType `json:"source_type"`
|
||||
|
||||
@@ -82,6 +86,9 @@ func (opts CreateOptsExt) ToServerCreateMap() (map[string]interface{}, error) {
|
||||
if bd.DestinationType != "" {
|
||||
blockDevice[i]["destination_type"] = bd.DestinationType
|
||||
}
|
||||
if bd.GuestFormat != "" {
|
||||
blockDevice[i]["guest_format"] = bd.GuestFormat
|
||||
}
|
||||
|
||||
}
|
||||
serverMap["block_device_mapping_v2"] = blockDevice
|
||||
|
||||
12
vendor/github.com/rackspace/gophercloud/openstack/compute/v2/servers/fixtures.go
generated
vendored
12
vendor/github.com/rackspace/gophercloud/openstack/compute/v2/servers/fixtures.go
generated
vendored
@@ -399,6 +399,18 @@ func HandleServerDeletionSuccessfully(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
// HandleAdminPasswordChangeSuccessfully sets up the test server to respond to a server password
|
||||
// change request.
|
||||
func HandleServerForceDeletionSuccessfully(t *testing.T) {
|
||||
th.Mux.HandleFunc("/servers/asdfasdfasdf/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, `{ "forceDelete": "" }`)
|
||||
|
||||
w.WriteHeader(http.StatusAccepted)
|
||||
})
|
||||
}
|
||||
|
||||
// HandleServerGetSuccessfully sets up the test server to respond to a server Get request.
|
||||
func HandleServerGetSuccessfully(t *testing.T) {
|
||||
th.Mux.HandleFunc("/servers/1234asdf", func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
11
vendor/github.com/rackspace/gophercloud/openstack/compute/v2/servers/requests.go
generated
vendored
11
vendor/github.com/rackspace/gophercloud/openstack/compute/v2/servers/requests.go
generated
vendored
@@ -303,6 +303,17 @@ func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
|
||||
return res
|
||||
}
|
||||
|
||||
func ForceDelete(client *gophercloud.ServiceClient, id string) ActionResult {
|
||||
var req struct {
|
||||
ForceDelete string `json:"forceDelete"`
|
||||
}
|
||||
|
||||
var res ActionResult
|
||||
_, res.Err = client.Post(actionURL(client, id), req, nil, nil)
|
||||
return res
|
||||
|
||||
}
|
||||
|
||||
// Get requests details on a single server, by ID.
|
||||
func Get(client *gophercloud.ServiceClient, id string) GetResult {
|
||||
var result GetResult
|
||||
|
||||
Reference in New Issue
Block a user