Removing ServerID as a parameter from volumeattach
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index eb97094..63beb30 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -10,3 +10,4 @@
| Ash Wilson | <ash.wilson@rackspace.com>
| Jamie Hannaford | <jamie.hannaford@rackspace.com>
| Don Schenck | don.schenck@rackspace.com>
+| Joe Topjian | <joe@topjian.net>
diff --git a/openstack/compute/v2/extensions/volumeattach/fixtures.go b/openstack/compute/v2/extensions/volumeattach/fixtures.go
index 6b08e18..a7f03b3 100644
--- a/openstack/compute/v2/extensions/volumeattach/fixtures.go
+++ b/openstack/compute/v2/extensions/volumeattach/fixtures.go
@@ -116,7 +116,6 @@
{
"volumeAttachment": {
"volumeId": "a26887c6-c47b-4654-abb5-dfadf7d3f804",
- "serverId": "4d8c3732-a248-40ed-bebc-539a6ffd25c0",
"device": "/dev/vdc"
}
}
diff --git a/openstack/compute/v2/extensions/volumeattach/requests.go b/openstack/compute/v2/extensions/volumeattach/requests.go
index ba1b7d4..0f79cd3 100644
--- a/openstack/compute/v2/extensions/volumeattach/requests.go
+++ b/openstack/compute/v2/extensions/volumeattach/requests.go
@@ -14,7 +14,6 @@
servers.CreateOptsBuilder
Device string `json:"device"`
VolumeID string `json:"volumeId"`
- ServerID string `json:"serverId"`
}
// ToServerCreateMap adds the volume_id, device, and optionally server_id to
@@ -28,7 +27,6 @@
serverMap := base["server"].(map[string]interface{})
serverMap["device"] = opts.Device
serverMap["volume_id"] = opts.VolumeID
- serverMap["server_id"] = opts.ServerID
return base, nil
}
@@ -53,9 +51,6 @@
// VolumeID is the ID of the volume to attach to the instance
VolumeID string
-
- // ServerID is the ID of the server that the volume will be attached to
- ServerID string
}
// ToVolumeAttachmentCreateMap constructs a request body from CreateOpts.
@@ -64,13 +59,8 @@
return nil, errors.New("Missing field required for volume attachment creation: VolumeID")
}
- if opts.ServerID == "" {
- return nil, errors.New("Missing field required for volume attachment creation: ServerID")
- }
-
volumeAttachment := make(map[string]interface{})
volumeAttachment["volumeId"] = opts.VolumeID
- volumeAttachment["serverId"] = opts.ServerID
if opts.Device != "" {
volumeAttachment["device"] = opts.Device
}
diff --git a/openstack/compute/v2/extensions/volumeattach/requests_test.go b/openstack/compute/v2/extensions/volumeattach/requests_test.go
index e0d5fdf..e17f7e0 100644
--- a/openstack/compute/v2/extensions/volumeattach/requests_test.go
+++ b/openstack/compute/v2/extensions/volumeattach/requests_test.go
@@ -36,7 +36,6 @@
actual, err := Create(client.ServiceClient(), serverId, CreateOpts{
Device: "/dev/vdc",
VolumeID: "a26887c6-c47b-4654-abb5-dfadf7d3f804",
- ServerID: serverId,
}).Extract()
th.AssertNoErr(t, err)
th.CheckDeepEquals(t, &CreatedVolumeAttachment, actual)