Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker network 1.9 : create method #410

Merged
merged 1 commit into from
Nov 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions network.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ func (c *Client) NetworkInfo(id string) (*Network, error) {
//
// See https://goo.gl/FDkCdQ for more details.
type CreateNetworkOptions struct {
Name string `json:"name"`
NetworkType string `json:"network_type"`
Options map[string]interface{} `json:"options"`
Name string `json:"Name"`
Driver string `json:"Driver"`
Options map[string]interface{} `json:"options"`
}

// CreateNetwork creates a new network, returning the network instance,
Expand All @@ -87,7 +87,7 @@ type CreateNetworkOptions struct {
func (c *Client) CreateNetwork(opts CreateNetworkOptions) (*Network, error) {
resp, err := c.do(
"POST",
"/networks",
"/networks/create",
doOptions{
data: opts,
},
Expand All @@ -113,7 +113,7 @@ func (c *Client) CreateNetwork(opts CreateNetworkOptions) (*Network, error) {

network.Name = opts.Name
network.ID = cnr.ID
network.Type = opts.NetworkType
network.Type = opts.Driver

return &network, nil
}
Expand Down
2 changes: 1 addition & 1 deletion testing/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ func (s *DockerServer) createNetwork(w http.ResponseWriter, r *http.Request) {
network := docker.Network{
Name: config.Name,
ID: generatedID,
Type: config.NetworkType,
Type: config.Driver,
}
s.netMut.Lock()
s.networks = append(s.networks, &network)
Expand Down