{{- $data := index hugo.Data "api-reference" -}}
{{- $api := dict -}}{{- range
{{ if eq .Params.view "catalog" }} Choose a Docker HTTP API: {{ range $data.apis }}
- [{{ .title }} API {{ .version }}]({{ .url }}): {{ len .operations }} operations; {{ .connection }} connection {{ end }} {{ range $data.legacyAPIs }}
- [{{ .title }}]({{ .url }}): {{ .description }} {{ end }} {{ else }} API catalog · [{{ $api.title }} overview]({{ $api.url }}) · [Product manual]({{ ref . $api.manual }}) · [OpenAPI specification]({{ $api.sourceURL }})
API version: {{ $api.version }}
{{ if $api.experimental }}
This API is experimental. Features, interfaces, and behavior may change. {{ end }}
{{ if eq .Params.view "overview" }}
{{ partial "api-reference/description.html" (dict "text" $api.description "api" $api) }}
{{ if eq $api.connection "unix" }}Connecting to {{ $api.title }}{{ else }}Connecting to the {{ $api.title }} API{{ end }}
{{ range $name, $scheme := $api.securitySchemes }}{{ with $scheme.description }}
{{ . }}
{{ end }}{{ end }}
{{ range $api.servers }}
Server: {{ .url }}
{{ range $name,$variable := .variables }}
{{ $name }}: {{ $variable.description }}
{{ end }}{{ end }}
{{ if eq $api.connection "unix" }}
curl --unix-socket /var/run/docker.sock http://localhost/v{{ $api.version }}/version{{ end }} {{ range $api.guides }} {{ $guide := site.GetPage (index (split . "#") 0) }}
- [{{ $guide.Title }}]({{ ref $ . }}) {{ end }}
{{ range (partial "api-reference/overview-tags.html" $api) }}
{{ partial "api-reference/description.html" (dict "text" .description "api" $api) }} {{ end }}
{{ range $api.operations }}
- [{{ .method }} {{ .path }}]({{ .url }}): {{ .summary }} {{ end }}
{{ range $api.schemas }}
- [{{ .name }}]({{ .url }})
{{ end }}
{{ else if eq .Params.view "operation" }}
{{ range
$api.operations }}{{ if eq .id $ .Params.operationID }}{{ .method }} {{ .path }}
{{ partial "api-reference/description.html" (dict "text" .description "api" $api) }} {{ if .deprecated }} Deprecated operation. {{ end }}
[API connection and authentication guidance]({{ $api.url }}#authentication)
{{ if and (eq $api.product "engine") (where .parameters "name" "X-Registry-Auth") }}
X-Registry-Auth delegates registry credentials and does not authenticate the daemon caller.
{{ end }}
{{ range .servers }}
Server: {{ .url }}
{{ range $name,$variable := .variables }}
{{ $name }}: {{ $variable.description }}
{{ end }}{{ end }}
Effective security: alternatives are OR; schemes within an alternative are AND. An empty array declares no HTTP authentication requirement.
{{ .security | jsonify (dict "indent" " ") }}{{ if .curl }}
Replace placeholders and provide the required credentials or request body.
{{ .curl }}{{ end }} {{ range .curlNotes }} {{ . }} {{ end }} {{ with index .raw "x-websocket" }}
Subprotocol: {{ .subprotocol }}
{{ .authentication }}
{{ .browser }}
{{ .reconnect }}
{{ .terminalFrame }}
{{ . | jsonify (dict "indent" " ") }}{{ end }}
{{ range .parameters }}
Location: {{ .in }}. Required: {{ if .required }}yes{{ else }}no{{ end }}.
{{ partial "api-reference/description.html" (dict "text" .description "api" $api) }}
{{ . | jsonify (dict "indent" " ") }}{{ end }}
{{ range .variants }}
{{ partial "api-reference/description.html" (dict "text" .description "api" $api) }} {{ if not .media }} No response content is declared. {{ end }} {{ if isset . "schema" }} Schema:
{{ .schema | jsonify (dict "indent" " ") }}{{ end }} {{ if isset . "itemSchema" }} Stream item schema:
{{ .itemSchema | jsonify (dict "indent" " ") }}{{ end }} {{ with .headers }} Headers:
{{ . | jsonify (dict "indent" " ") }}{{ end }} {{ $variant := . }} {{ range $key := slice "encoding" "itemEncoding" "prefixEncoding" }} {{ with index $variant $key }} {{ $key }}:
{{ . | jsonify (dict "indent" " ") }}{{ end }}{{ end }} {{ range .examples }} {{ .name }}:
{{ .text }}
{{ end }} {{ end }}
{{ .raw | jsonify (dict "indent" " ") }}{{ range .references }}
- {{ if .url }}[{{ .ref }}]({{ .url }}){{ else }}
{{ .ref }}{{ end }} {{ end }} {{ end }}{{ end }} {{ else if eq .Params.view "schema" }} {{ range$api.schemas }}{{ if eq .name $ .Params.schemaName }} Schema constraints and annotations:
{{ .schema | jsonify (dict "indent" " ") }}{{ end }}{{ end }} {{ end }} {{ end }}