Skip to content

Commit

Permalink
Rename Remote API to Engine API
Browse files Browse the repository at this point in the history
Implementation of moby#28319

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
  • Loading branch information
bfirsh committed Nov 22, 2016
1 parent 993854f commit f0d55cd
Show file tree
Hide file tree
Showing 33 changed files with 92 additions and 100 deletions.
10 changes: 5 additions & 5 deletions api/swagger.yaml
Expand Up @@ -10,18 +10,18 @@ consumes:
- "text/plain"
basePath: "/v1.26"
info:
title: "Docker Remote API"
title: "Docker Engine API"
version: "1.26"
x-logo:
url: "https://docs.docker.com/images/logo-docker-main.png"
description: |
The Docker API is an HTTP REST API served by Docker Engine. It is the API the Docker client uses to communicate with the Engine, so everything the Docker client can do can be done with the API.
The Engine API is an HTTP REST API served by Docker Engine. It is the API the Docker client uses to communicate with the Engine, so everything the Docker client can do can be done with the API.
Most of the client's commands map directly to API endpoints (e.g. `docker ps` is `GET /containers/json`). The notable exception is running containers, which consists of several API calls. [There is example of using `curl` to run a container in the SDK documentation.](#TODO)
Most of the client's commands map directly to API endpoints (e.g. `docker ps` is `GET /containers/json`). The notable exception is running containers, which consists of several API calls.
# Errors
The Remote API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format:
The API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format:
```
{
Expand Down Expand Up @@ -1262,7 +1262,7 @@ definitions:
x-nullable: false

Plugin:
description: "A plugin for the Remote API"
description: "A plugin for the Engine API"
type: "object"
required: [Settings, Enabled, Config, Name, Tag]
properties:
Expand Down
2 changes: 1 addition & 1 deletion api/types/client.go
Expand Up @@ -351,7 +351,7 @@ type SecretRequestOption struct {
Mode os.FileMode
}

// SwarmUnlockKeyResponse contains the response for Remote API:
// SwarmUnlockKeyResponse contains the response for Engine API:
// GET /swarm/unlockkey
type SwarmUnlockKeyResponse struct {
// UnlockKey is the unlock key in ASCII-armored format.
Expand Down
2 changes: 1 addition & 1 deletion api/types/plugin.go
Expand Up @@ -3,7 +3,7 @@ package types
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

// Plugin A plugin for the Remote API
// Plugin A plugin for the Engine API
// swagger:model Plugin
type Plugin struct {

Expand Down
2 changes: 1 addition & 1 deletion api/types/plugin_responses.go
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
)

// PluginsListResponse contains the response for the remote API
// PluginsListResponse contains the response for the Engine API
type PluginsListResponse []*Plugin

const (
Expand Down
42 changes: 21 additions & 21 deletions api/types/types.go
Expand Up @@ -17,14 +17,14 @@ import (
"github.com/docker/go-connections/nat"
)

// ContainerChange contains response of Remote API:
// ContainerChange contains response of Engine API:
// GET "/containers/{name:.*}/changes"
type ContainerChange struct {
Kind int
Path string
}

// ImageHistory contains response of Remote API:
// ImageHistory contains response of Engine API:
// GET "/images/{name:.*}/history"
type ImageHistory struct {
ID string `json:"Id"`
Expand All @@ -35,7 +35,7 @@ type ImageHistory struct {
Comment string
}

// ImageDelete contains response of Remote API:
// ImageDelete contains response of Engine API:
// DELETE "/images/{name:.*}"
type ImageDelete struct {
Untagged string `json:",omitempty"`
Expand All @@ -56,7 +56,7 @@ type RootFS struct {
BaseLayer string `json:",omitempty"`
}

// ImageInspect contains response of Remote API:
// ImageInspect contains response of Engine API:
// GET "/images/{name:.*}/json"
type ImageInspect struct {
ID string `json:"Id"`
Expand All @@ -79,7 +79,7 @@ type ImageInspect struct {
RootFS RootFS
}

// Container contains response of Remote API:
// Container contains response of Engine API:
// GET "/containers/json"
type Container struct {
ID string `json:"Id"`
Expand All @@ -101,7 +101,7 @@ type Container struct {
Mounts []MountPoint
}

// CopyConfig contains request body of Remote API:
// CopyConfig contains request body of Engine API:
// POST "/containers/"+containerID+"/copy"
type CopyConfig struct {
Resource string
Expand All @@ -118,28 +118,28 @@ type ContainerPathStat struct {
LinkTarget string `json:"linkTarget"`
}

// ContainerStats contains response of Remote API:
// ContainerStats contains response of Engine API:
// GET "/stats"
type ContainerStats struct {
Body io.ReadCloser `json:"body"`
OSType string `json:"ostype"`
}

// ContainerProcessList contains response of Remote API:
// ContainerProcessList contains response of Engine API:
// GET "/containers/{name:.*}/top"
type ContainerProcessList struct {
Processes [][]string
Titles []string
}

// Ping contains response of Remote API:
// Ping contains response of Engine API:
// GET "/_ping"
type Ping struct {
APIVersion string
Experimental bool
}

// Version contains response of Remote API:
// Version contains response of Engine API:
// GET "/version"
type Version struct {
Version string
Expand All @@ -161,7 +161,7 @@ type Commit struct {
Expected string
}

// Info contains response of Remote API:
// Info contains response of Engine API:
// GET "/info"
type Info struct {
ID string
Expand Down Expand Up @@ -339,7 +339,7 @@ type ContainerNode struct {
Labels map[string]string
}

// ContainerJSONBase contains response of Remote API:
// ContainerJSONBase contains response of Engine API:
// GET "/containers/{name:.*}/json"
type ContainerJSONBase struct {
ID string `json:"Id"`
Expand Down Expand Up @@ -500,7 +500,7 @@ type Runtime struct {
Args []string `json:"runtimeArgs,omitempty"`
}

// DiskUsage contains response of Remote API:
// DiskUsage contains response of Engine API:
// GET "/system/df"
type DiskUsage struct {
LayersSize int64
Expand All @@ -509,49 +509,49 @@ type DiskUsage struct {
Volumes []*Volume
}

// ImagesPruneConfig contains the configuration for Remote API:
// ImagesPruneConfig contains the configuration for Engine API:
// POST "/images/prune"
type ImagesPruneConfig struct {
DanglingOnly bool
}

// ContainersPruneConfig contains the configuration for Remote API:
// ContainersPruneConfig contains the configuration for Engine API:
// POST "/images/prune"
type ContainersPruneConfig struct {
}

// VolumesPruneConfig contains the configuration for Remote API:
// VolumesPruneConfig contains the configuration for Engine API:
// POST "/images/prune"
type VolumesPruneConfig struct {
}

// NetworksPruneConfig contains the configuration for Remote API:
// NetworksPruneConfig contains the configuration for Engine API:
// POST "/networks/prune"
type NetworksPruneConfig struct {
}

// ContainersPruneReport contains the response for Remote API:
// ContainersPruneReport contains the response for Engine API:
// POST "/containers/prune"
type ContainersPruneReport struct {
ContainersDeleted []string
SpaceReclaimed uint64
}

// VolumesPruneReport contains the response for Remote API:
// VolumesPruneReport contains the response for Engine API:
// POST "/volumes/prune"
type VolumesPruneReport struct {
VolumesDeleted []string
SpaceReclaimed uint64
}

// ImagesPruneReport contains the response for Remote API:
// ImagesPruneReport contains the response for Engine API:
// POST "/images/prune"
type ImagesPruneReport struct {
ImagesDeleted []ImageDelete
SpaceReclaimed uint64
}

// NetworksPruneReport contains the response for Remote API:
// NetworksPruneReport contains the response for Engine API:
// POST "/networks/prune"
type NetworksPruneReport struct {
NetworksDeleted []string
Expand Down
2 changes: 1 addition & 1 deletion client/README.md
@@ -1,4 +1,4 @@
# Go client for the Docker Remote API
# Go client for the Docker Engine API

The `docker` command uses this package to communicate with the daemon. It can also be used by your own Go applications to do anything the command-line interface does – running containers, pulling images, managing swarms, etc.

Expand Down
6 changes: 3 additions & 3 deletions client/client.go
@@ -1,12 +1,12 @@
/*
Package client is a Go client for the Docker Remote API.
Package client is a Go client for the Docker Engine API.
The "docker" command uses this package to communicate with the daemon. It can also
be used by your own Go applications to do anything the command-line interface does
- running containers, pulling images, managing swarms, etc.
For more information about the Remote API, see the documentation:
https://docs.docker.com/engine/reference/api/docker_remote_api/
For more information about the Engine API, see the documentation:
https://docs.docker.com/engine/reference/api/
Usage
Expand Down
2 changes: 1 addition & 1 deletion container/container.go
Expand Up @@ -70,7 +70,7 @@ func (DetachError) Error() string {
type CommonContainer struct {
StreamConfig *stream.Config
// embed for Container to support states directly.
*State `json:"State"` // Needed for remote api version <= 1.11
*State `json:"State"` // Needed for Engine API version <= 1.11
Root string `json:"-"` // Path to the "home" of the container, including metadata.
BaseFS string `json:"-"` // Path to the graphdriver mountpoint
RWLayer layer.RWLayer `json:"-"`
Expand Down
2 changes: 1 addition & 1 deletion contrib/completion/fish/docker.fish
Expand Up @@ -43,7 +43,7 @@ function __fish_print_docker_repositories --description 'Print a list of docker
end

# common options
complete -c docker -f -n '__fish_docker_no_subcommand' -l api-cors-header -d "Set CORS headers in the remote API. Default is cors disabled"
complete -c docker -f -n '__fish_docker_no_subcommand' -l api-cors-header -d "Set CORS headers in the Engine API. Default is cors disabled"
complete -c docker -f -n '__fish_docker_no_subcommand' -s b -l bridge -d 'Attach containers to a pre-existing network bridge'
complete -c docker -f -n '__fish_docker_no_subcommand' -l bip -d "Use this CIDR notation address for the network bridge's IP, not compatible with -b"
complete -c docker -f -n '__fish_docker_no_subcommand' -s D -l debug -d 'Enable debug mode'
Expand Down
2 changes: 1 addition & 1 deletion contrib/completion/zsh/_docker
Expand Up @@ -2200,7 +2200,7 @@ __docker_subcommand() {
_arguments $(__docker_arguments) \
$opts_help \
"($help)*--add-runtime=[Register an additional OCI compatible runtime]:runtime:__docker_complete_runtimes" \
"($help)--api-cors-header=[CORS headers in the remote API]:CORS headers: " \
"($help)--api-cors-header=[CORS headers in the Engine API]:CORS headers: " \
"($help)*--authorization-plugin=[Authorization plugins to load]" \
"($help -b --bridge)"{-b=,--bridge=}"[Attach containers to a network bridge]:bridge:_net_interfaces" \
"($help)--bip=[Network bridge IP]:IP address: " \
Expand Down
2 changes: 1 addition & 1 deletion contrib/vagrant-docker/README.md
Expand Up @@ -18,7 +18,7 @@ meaning you can use Vagrant to control Docker containers.
* [docker-provider](https://github.com/fgrehm/docker-provider)
* [vagrant-shell](https://github.com/destructuring/vagrant-shell)

## Setting up Vagrant-docker with the Remote API
## Setting up Vagrant-docker with the Engine API

The initial Docker upstart script will not work because it runs on `127.0.0.1`, which is not accessible to the host machine. Instead, we need to change the script to connect to `0.0.0.0`. To do this, modify `/etc/init/docker.conf` to look like this:

Expand Down
2 changes: 1 addition & 1 deletion daemon/config.go
Expand Up @@ -185,7 +185,7 @@ func (config *Config) InstallCommonFlags(flags *pflag.FlagSet) {
flags.StringVar(&config.ClusterAdvertise, "cluster-advertise", "", "Address or interface name to advertise")
flags.StringVar(&config.ClusterStore, "cluster-store", "", "URL of the distributed storage backend")
flags.Var(opts.NewNamedMapOpts("cluster-store-opts", config.ClusterOpts, nil), "cluster-store-opt", "Set cluster store options")
flags.StringVar(&config.CorsHeaders, "api-cors-header", "", "Set CORS headers in the remote API")
flags.StringVar(&config.CorsHeaders, "api-cors-header", "", "Set CORS headers in the Engine API")
flags.IntVar(&maxConcurrentDownloads, "max-concurrent-downloads", defaultMaxConcurrentDownloads, "Set the max concurrent downloads for each pull")
flags.IntVar(&maxConcurrentUploads, "max-concurrent-uploads", defaultMaxConcurrentUploads, "Set the max concurrent uploads for each push")
flags.IntVar(&config.ShutdownTimeout, "shutdown-timeout", defaultShutdownTimeout, "Set the default shutdown timeout")
Expand Down
2 changes: 1 addition & 1 deletion daemon/config_unix.go
Expand Up @@ -77,7 +77,7 @@ func (config *Config) InstallFlags(flags *pflag.FlagSet) {
flags.StringVar(&config.bridgeConfig.FixedCIDRv6, "fixed-cidr-v6", "", "IPv6 subnet for fixed IPs")
flags.BoolVar(&config.bridgeConfig.EnableUserlandProxy, "userland-proxy", true, "Use userland proxy for loopback traffic")
flags.StringVar(&config.bridgeConfig.UserlandProxyPath, "userland-proxy-path", "", "Path to the userland proxy binary")
flags.BoolVar(&config.EnableCors, "api-enable-cors", false, "Enable CORS headers in the remote API, this is deprecated by --api-cors-header")
flags.BoolVar(&config.EnableCors, "api-enable-cors", false, "Enable CORS headers in the Engine API, this is deprecated by --api-cors-header")
flags.MarkDeprecated("api-enable-cors", "Please use --api-cors-header")
flags.StringVar(&config.CgroupParent, "cgroup-parent", "", "Set parent cgroup for all containers")
flags.StringVar(&config.RemappedRoot, "userns-remap", "", "User/Group setting for user namespaces")
Expand Down
2 changes: 1 addition & 1 deletion daemon/create.go
Expand Up @@ -226,7 +226,7 @@ func (daemon *Daemon) setRWLayer(container *container.Container) error {
}

// VolumeCreate creates a volume with the specified name, driver, and opts
// This is called directly from the remote API
// This is called directly from the Engine API
func (daemon *Daemon) VolumeCreate(name, driverName string, opts, labels map[string]string) (*types.Volume, error) {
if name == "" {
name = stringid.GenerateNonCryptoID()
Expand Down
2 changes: 1 addition & 1 deletion daemon/delete.go
Expand Up @@ -140,7 +140,7 @@ func (daemon *Daemon) cleanupContainer(container *container.Container, forceRemo

// VolumeRm removes the volume with the given name.
// If the volume is referenced by a container it is not removed
// This is called directly from the remote API
// This is called directly from the Engine API
func (daemon *Daemon) VolumeRm(name string, force bool) error {
err := daemon.volumeRm(name)
if err == nil || force {
Expand Down
2 changes: 1 addition & 1 deletion daemon/exec.go
Expand Up @@ -27,7 +27,7 @@ const termProcessTimeout = 10
func (d *Daemon) registerExecCommand(container *container.Container, config *exec.Config) {
// Storing execs in container in order to kill them gracefully whenever the container is stopped or removed.
container.ExecCommands.Add(config.ID, config)
// Storing execs in daemon for easy access via remote API.
// Storing execs in daemon for easy access via Engine API.
d.execCommands.Add(config.ID, config)
}

Expand Down
2 changes: 1 addition & 1 deletion daemon/stats.go
Expand Up @@ -23,7 +23,7 @@ func (daemon *Daemon) ContainerStats(ctx context.Context, prefixOrName string, c
if runtime.GOOS == "solaris" {
return fmt.Errorf("%+v does not support stats", runtime.GOOS)
}
// Remote API version (used for backwards compatibility)
// Engine API version (used for backwards compatibility)
apiVersion := config.Version

container, err := daemon.GetContainer(prefixOrName)
Expand Down
2 changes: 1 addition & 1 deletion daemon/volumes.go
Expand Up @@ -26,7 +26,7 @@ var (

type mounts []container.Mount

// volumeToAPIType converts a volume.Volume to the type used by the remote API
// volumeToAPIType converts a volume.Volume to the type used by the Engine API
func volumeToAPIType(v volume.Volume) *types.Volume {
tv := &types.Volume{
Name: v.Name(),
Expand Down
7 changes: 3 additions & 4 deletions docs/api/v1.18.md
@@ -1,5 +1,5 @@
---
title: "Remote API v1.18"
title: "Engine API v1.18"
description: "API Documentation for Docker"
keywords: "API, Docker, rcli, REST, documentation"
redirect_from:
Expand All @@ -16,11 +16,10 @@ redirect_from:
will be rejected.
-->

# Docker Remote API v1.18
# Docker Engine API v1.18

# 1. Brief introduction

- The Remote API has replaced `rcli`.
- The daemon listens on `unix:///var/run/docker.sock` but you can
[Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
- The API tends to be REST, but for some complex commands, like `attach`
Expand Down Expand Up @@ -2151,7 +2150,7 @@ This might change in the future.

## 3.3 CORS Requests

To set cross origin requests to the remote api please give values to
To set cross origin requests to the Engine API please give values to
`--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,
default or blank means CORS disabled

Expand Down

0 comments on commit f0d55cd

Please sign in to comment.