2015-05-16 15:23:59 +00:00
|
|
|
package client
|
|
|
|
|
2021-04-06 00:24:47 +00:00
|
|
|
import "github.com/docker/docker/libnetwork/types"
|
2015-05-16 15:23:59 +00:00
|
|
|
|
|
|
|
/***********
|
|
|
|
Resources
|
|
|
|
************/
|
|
|
|
|
|
|
|
// networkResource is the body of the "get network" http response message
|
|
|
|
type networkResource struct {
|
2015-06-11 15:30:45 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
ID string `json:"id"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
Services []*serviceResource `json:"services"`
|
2015-05-16 15:23:59 +00:00
|
|
|
}
|
|
|
|
|
2015-06-11 15:30:45 +00:00
|
|
|
// serviceResource is the body of the "get service" http response message
|
|
|
|
type serviceResource struct {
|
2015-05-29 22:28:50 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
ID string `json:"id"`
|
|
|
|
Network string `json:"network"`
|
2015-05-16 15:23:59 +00:00
|
|
|
}
|
|
|
|
|
2015-09-16 05:26:27 +00:00
|
|
|
// SandboxResource is the body of "get service backend" response message
|
|
|
|
type SandboxResource struct {
|
2015-07-02 05:00:48 +00:00
|
|
|
ID string `json:"id"`
|
|
|
|
Key string `json:"key"`
|
|
|
|
ContainerID string `json:"container_id"`
|
2015-06-11 15:30:45 +00:00
|
|
|
}
|
|
|
|
|
2015-05-16 15:23:59 +00:00
|
|
|
/***********
|
|
|
|
Body types
|
|
|
|
************/
|
2016-04-01 17:26:57 +00:00
|
|
|
type ipamConf struct {
|
|
|
|
PreferredPool string
|
|
|
|
SubPool string
|
|
|
|
Gateway string
|
|
|
|
AuxAddresses map[string]string
|
|
|
|
}
|
2015-05-16 15:23:59 +00:00
|
|
|
|
|
|
|
// networkCreate is the expected body of the "create network" http request message
|
|
|
|
type networkCreate struct {
|
2015-12-22 01:31:50 +00:00
|
|
|
Name string `json:"name"`
|
2016-04-01 17:26:57 +00:00
|
|
|
ID string `json:"id"`
|
2015-12-22 01:31:50 +00:00
|
|
|
NetworkType string `json:"network_type"`
|
2016-04-01 17:26:57 +00:00
|
|
|
IPv4Conf []ipamConf `json:"ipv4_configuration"`
|
|
|
|
DriverOpts map[string]string `json:"driver_opts"`
|
2015-12-22 01:31:50 +00:00
|
|
|
NetworkOpts map[string]string `json:"network_opts"`
|
2015-05-16 15:23:59 +00:00
|
|
|
}
|
2015-05-22 14:54:23 +00:00
|
|
|
|
2015-06-11 15:30:45 +00:00
|
|
|
// serviceCreate represents the body of the "publish service" http request message
|
|
|
|
type serviceCreate struct {
|
2015-12-07 22:45:51 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
MyAliases []string `json:"my_aliases"`
|
|
|
|
Network string `json:"network_name"`
|
2015-05-22 14:54:23 +00:00
|
|
|
}
|
|
|
|
|
2016-01-12 02:53:27 +00:00
|
|
|
// serviceDelete represents the body of the "unpublish service" http request message
|
|
|
|
type serviceDelete struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
Force bool `json:"force"`
|
|
|
|
}
|
|
|
|
|
2015-07-02 05:00:48 +00:00
|
|
|
// serviceAttach represents the expected body of the "attach/detach sandbox to/from service" http request messages
|
2015-06-11 15:30:45 +00:00
|
|
|
type serviceAttach struct {
|
2016-01-06 13:23:05 +00:00
|
|
|
SandboxID string `json:"sandbox_id"`
|
|
|
|
Aliases []string `json:"aliases"`
|
2015-05-22 14:54:23 +00:00
|
|
|
}
|
|
|
|
|
2015-09-16 05:26:27 +00:00
|
|
|
// SandboxCreate is the body of the "post /sandboxes" http request message
|
|
|
|
type SandboxCreate struct {
|
2015-12-07 22:45:51 +00:00
|
|
|
ContainerID string `json:"container_id"`
|
|
|
|
HostName string `json:"host_name"`
|
|
|
|
DomainName string `json:"domain_name"`
|
|
|
|
HostsPath string `json:"hosts_path"`
|
|
|
|
ResolvConfPath string `json:"resolv_conf_path"`
|
|
|
|
DNS []string `json:"dns"`
|
|
|
|
ExtraHosts []extraHost `json:"extra_hosts"`
|
|
|
|
UseDefaultSandbox bool `json:"use_default_sandbox"`
|
|
|
|
ExposedPorts []types.TransportPort `json:"exposed_ports"`
|
|
|
|
PortMapping []types.PortBinding `json:"port_mapping"`
|
2015-07-02 05:00:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// extraHost represents the extra host object
|
|
|
|
type extraHost struct {
|
2015-05-29 22:28:50 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
Address string `json:"address"`
|
2015-05-22 14:54:23 +00:00
|
|
|
}
|