Merge lp:~gz/goose/run_server_networks into lp:goose
Status: | Merged |
---|---|
Approved by: | Martin Packman |
Approved revision: | 116 |
Merged at revision: | 116 |
Proposed branch: | lp:~gz/goose/run_server_networks |
Merge into: | lp:goose |
Diff against target: |
54 lines (+19/-0) 2 files modified
nova/nova.go (+10/-0) testservices/novaservice/service_http.go (+9/-0) |
To merge this branch: | bzr merge lp:~gz/goose/run_server_networks |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+203113@code.launchpad.net |
Commit message
Add networks attribute to RunServer params
This enables the starting of a server on a specific
network, which is required for some situations where
multiple networks exist.
This is not well tested at present, to do a proper job some
more network related operations need to be added so the
tests can do real operations.
https:/
R=natefinch
Description of the change
Add networks attribute to RunServer params
This enables the starting of a server on a specific
network, which is required for some situations where
multiple networks exist.
This is not well tested at present, to do a proper job some
more network related operations need to be added so the
tests can do real operations.
Reviewers: mp+203113_ code.launchpad. net,
Message:
Please take a look.
Description:
Add networks attribute to RunServer params
This enables the starting of a server on a specific
network, which is required for some situations where
multiple networks exist.
This is not well tested at present, to do a proper job some
more network related operations need to be added so the
tests can do real operations.
https:/ /code.launchpad .net/~gz/ goose/run_ server_ networks/ +merge/ 203113
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/56670043/
Affected files (+21, -0 lines): novaservice/ service_ http.go
A [revision details]
M nova/nova.go
M testservices/
Index: [revision details] 20140120121239- twy42hxhmht9f2r u
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: nova/nova.go
=== modified file 'nova/nova.go'
--- nova/nova.go 2013-11-25 20:25:17 +0000
+++ nova/nova.go 2014-01-24 16:33:31 +0000
@@ -296,6 +296,15 @@
Name string `json:"name"`
}
+// ServerNetworks sets what networks a server should be connected to on uuid,omitempty" ` fixed_ip, omitempty" ` port,omitempty" ` pNames []SecurityGroupName `json:" security_ groups" ` //
boot.
+// - FixedIp may be supplied only when NetworkId is also given.
+// - PortId may be supplied only if neither NetworkId or FixedIp is set.
+type ServerNetworks struct {
+ NetworkId string `json:"
+ FixedIp string `json:"
+ PortId string `json:"
+}
+
// RunServerOpts defines required and optional arguments for RunServer().
type RunServerOpts struct {
Name string `json:"name"` //
Required
@@ -303,6 +312,7 @@
ImageId string `json:"imageRef"` //
Required
UserData []byte `json:"user_data"` //
Optional
SecurityGrou
Optional
+ Networks []ServerNetworks `json:"networks"` //
Optional
}
// RunServer creates a new server, based on the given RunServerOpts.
Index: testservices/ novaservice/ service_ http.go novaservice/ service_ http.go' novaservice/ service_ http.go 2014-01-16 10:50:02 +0000 novaservice/ service_ http.go 2014-01-24 16:33:31 +0000 security_ groups" ` body, &req); err != nil { networkId] il{Id: req.Server. FlavorRef}
=== modified file 'testservices/
--- testservices/
+++ testservices/
@@ -539,6 +539,7 @@
Name string
Metadata map[string]string
SecurityGroups []map[string]string `json:"
+ Networks []map[string]string
}
}
if err := json.Unmarshal(
@@ -570,6 +571,14 @@
}
}
}
+ // TODO(gz) some kind of sane handling of networks
+ for _, network := range req.Server.Networks {
+ networkId := network["uuid"]
+ _, ok := n.networks[
+ if !ok {
+ return errNotFoundJSON
+ }
+ }
// TODO(dimitern) - 2013-02-11 bug=1121684
// make sure flavor/image exist (if needed)
flavor := nova.FlavorDeta