mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client: consolidate node options with their methods
Move them together, as we did for most of the other options. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -9,6 +9,9 @@ import (
|
|||||||
"github.com/moby/moby/api/types/swarm"
|
"github.com/moby/moby/api/types/swarm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// NodeInspectOptions holds parameters to inspect nodes with.
|
||||||
|
type NodeInspectOptions struct{}
|
||||||
|
|
||||||
type NodeInspectResult struct {
|
type NodeInspectResult struct {
|
||||||
Node swarm.Node
|
Node swarm.Node
|
||||||
Raw []byte
|
Raw []byte
|
||||||
|
|||||||
@@ -8,6 +8,11 @@ import (
|
|||||||
"github.com/moby/moby/api/types/swarm"
|
"github.com/moby/moby/api/types/swarm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// NodeListOptions holds parameters to list nodes with.
|
||||||
|
type NodeListOptions struct {
|
||||||
|
Filters Filters
|
||||||
|
}
|
||||||
|
|
||||||
type NodeListResult struct {
|
type NodeListResult struct {
|
||||||
Items []swarm.Node
|
Items []swarm.Node
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// NodeRemoveOptions holds parameters to remove nodes with.
|
||||||
|
type NodeRemoveOptions struct {
|
||||||
|
Force bool
|
||||||
|
}
|
||||||
type NodeRemoveResult struct{}
|
type NodeRemoveResult struct{}
|
||||||
|
|
||||||
// NodeRemove removes a Node.
|
// NodeRemove removes a Node.
|
||||||
|
|||||||
@@ -3,8 +3,16 @@ package client
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
|
"github.com/moby/moby/api/types/swarm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// NodeUpdateOptions holds parameters to update nodes with.
|
||||||
|
type NodeUpdateOptions struct {
|
||||||
|
Version swarm.Version
|
||||||
|
Node swarm.NodeSpec
|
||||||
|
}
|
||||||
|
|
||||||
type NodeUpdateResult struct{}
|
type NodeUpdateResult struct{}
|
||||||
|
|
||||||
// NodeUpdate updates a Node.
|
// NodeUpdate updates a Node.
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
package client
|
|
||||||
|
|
||||||
// NodeInspectOptions holds parameters to inspect nodes with.
|
|
||||||
type NodeInspectOptions struct{}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
package client
|
|
||||||
|
|
||||||
// NodeListOptions holds parameters to list nodes with.
|
|
||||||
type NodeListOptions struct {
|
|
||||||
Filters Filters
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
package client
|
|
||||||
|
|
||||||
// NodeRemoveOptions holds parameters to remove nodes with.
|
|
||||||
type NodeRemoveOptions struct {
|
|
||||||
Force bool
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package client
|
|
||||||
|
|
||||||
import "github.com/moby/moby/api/types/swarm"
|
|
||||||
|
|
||||||
// NodeUpdateOptions holds parameters to update nodes with.
|
|
||||||
type NodeUpdateOptions struct {
|
|
||||||
Version swarm.Version
|
|
||||||
Node swarm.NodeSpec
|
|
||||||
}
|
|
||||||
4
vendor/github.com/moby/moby/client/container_exec.go
generated
vendored
4
vendor/github.com/moby/moby/client/container_exec.go
generated
vendored
@@ -26,7 +26,7 @@ type ExecCreateOptions struct {
|
|||||||
|
|
||||||
// ExecCreateResult holds the result of creating a container exec.
|
// ExecCreateResult holds the result of creating a container exec.
|
||||||
type ExecCreateResult struct {
|
type ExecCreateResult struct {
|
||||||
container.ExecCreateResponse
|
ID string
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExecCreate creates a new exec configuration to run an exec process.
|
// ExecCreate creates a new exec configuration to run an exec process.
|
||||||
@@ -58,7 +58,7 @@ func (cli *Client) ExecCreate(ctx context.Context, containerID string, options E
|
|||||||
|
|
||||||
var response container.ExecCreateResponse
|
var response container.ExecCreateResponse
|
||||||
err = json.NewDecoder(resp.Body).Decode(&response)
|
err = json.NewDecoder(resp.Body).Decode(&response)
|
||||||
return ExecCreateResult{ExecCreateResponse: response}, err
|
return ExecCreateResult{ID: response.ID}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
type execStartAttachOptions struct {
|
type execStartAttachOptions struct {
|
||||||
|
|||||||
3
vendor/github.com/moby/moby/client/node_inspect.go
generated
vendored
3
vendor/github.com/moby/moby/client/node_inspect.go
generated
vendored
@@ -9,6 +9,9 @@ import (
|
|||||||
"github.com/moby/moby/api/types/swarm"
|
"github.com/moby/moby/api/types/swarm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// NodeInspectOptions holds parameters to inspect nodes with.
|
||||||
|
type NodeInspectOptions struct{}
|
||||||
|
|
||||||
type NodeInspectResult struct {
|
type NodeInspectResult struct {
|
||||||
Node swarm.Node
|
Node swarm.Node
|
||||||
Raw []byte
|
Raw []byte
|
||||||
|
|||||||
5
vendor/github.com/moby/moby/client/node_list.go
generated
vendored
5
vendor/github.com/moby/moby/client/node_list.go
generated
vendored
@@ -8,6 +8,11 @@ import (
|
|||||||
"github.com/moby/moby/api/types/swarm"
|
"github.com/moby/moby/api/types/swarm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// NodeListOptions holds parameters to list nodes with.
|
||||||
|
type NodeListOptions struct {
|
||||||
|
Filters Filters
|
||||||
|
}
|
||||||
|
|
||||||
type NodeListResult struct {
|
type NodeListResult struct {
|
||||||
Items []swarm.Node
|
Items []swarm.Node
|
||||||
}
|
}
|
||||||
|
|||||||
4
vendor/github.com/moby/moby/client/node_remove.go
generated
vendored
4
vendor/github.com/moby/moby/client/node_remove.go
generated
vendored
@@ -5,6 +5,10 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// NodeRemoveOptions holds parameters to remove nodes with.
|
||||||
|
type NodeRemoveOptions struct {
|
||||||
|
Force bool
|
||||||
|
}
|
||||||
type NodeRemoveResult struct{}
|
type NodeRemoveResult struct{}
|
||||||
|
|
||||||
// NodeRemove removes a Node.
|
// NodeRemove removes a Node.
|
||||||
|
|||||||
8
vendor/github.com/moby/moby/client/node_update.go
generated
vendored
8
vendor/github.com/moby/moby/client/node_update.go
generated
vendored
@@ -3,8 +3,16 @@ package client
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
|
"github.com/moby/moby/api/types/swarm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// NodeUpdateOptions holds parameters to update nodes with.
|
||||||
|
type NodeUpdateOptions struct {
|
||||||
|
Version swarm.Version
|
||||||
|
Node swarm.NodeSpec
|
||||||
|
}
|
||||||
|
|
||||||
type NodeUpdateResult struct{}
|
type NodeUpdateResult struct{}
|
||||||
|
|
||||||
// NodeUpdate updates a Node.
|
// NodeUpdate updates a Node.
|
||||||
|
|||||||
4
vendor/github.com/moby/moby/client/swarm_node_inspect_opts.go
generated
vendored
4
vendor/github.com/moby/moby/client/swarm_node_inspect_opts.go
generated
vendored
@@ -1,4 +0,0 @@
|
|||||||
package client
|
|
||||||
|
|
||||||
// NodeInspectOptions holds parameters to inspect nodes with.
|
|
||||||
type NodeInspectOptions struct{}
|
|
||||||
6
vendor/github.com/moby/moby/client/swarm_node_list_opts.go
generated
vendored
6
vendor/github.com/moby/moby/client/swarm_node_list_opts.go
generated
vendored
@@ -1,6 +0,0 @@
|
|||||||
package client
|
|
||||||
|
|
||||||
// NodeListOptions holds parameters to list nodes with.
|
|
||||||
type NodeListOptions struct {
|
|
||||||
Filters Filters
|
|
||||||
}
|
|
||||||
6
vendor/github.com/moby/moby/client/swarm_node_remove_opts.go
generated
vendored
6
vendor/github.com/moby/moby/client/swarm_node_remove_opts.go
generated
vendored
@@ -1,6 +0,0 @@
|
|||||||
package client
|
|
||||||
|
|
||||||
// NodeRemoveOptions holds parameters to remove nodes with.
|
|
||||||
type NodeRemoveOptions struct {
|
|
||||||
Force bool
|
|
||||||
}
|
|
||||||
9
vendor/github.com/moby/moby/client/swarm_node_update_opts.go
generated
vendored
9
vendor/github.com/moby/moby/client/swarm_node_update_opts.go
generated
vendored
@@ -1,9 +0,0 @@
|
|||||||
package client
|
|
||||||
|
|
||||||
import "github.com/moby/moby/api/types/swarm"
|
|
||||||
|
|
||||||
// NodeUpdateOptions holds parameters to update nodes with.
|
|
||||||
type NodeUpdateOptions struct {
|
|
||||||
Version swarm.Version
|
|
||||||
Node swarm.NodeSpec
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user