docker_client 1.0.0-dev.1
docker_client: ^1.0.0-dev.1 copied to clipboard

Dart native js
Flutter Android iOS web

Docker Engine API client

Docker Engine API Client #

This library is automatically generated by openapi-generator, based on the specification that can be downloaded from this page, with various handcoded fixes and improvements.

Use this library at your own risk. It was automatically generated, and I did not write unit tests for it.

The default base URL used for the docker engine is http://localhost:2375/v1.40. You can explicitly initialize the ApiClient class with another basePath.

The docker engine normally listens on a unix domain socket. Due to dart's lack of support for HTTP over unix sockets, this library uses HTTP over TCP. This being so, you need to set your docker engine to listen on TCP.

Docker Engine API #

The Engine API is an HTTP 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.

Errors #

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:

{
  \"message\": \"page not found\"
}

Versioning #

The API is usually changed in each release, so API calls are versioned to ensure that clients don't break. To lock to a specific version of the API, you prefix the URL with its version, for example, call /v1.30/info to use the v1.30 version of the /info endpoint. If the API version specified in the URL is not supported by the daemon, a HTTP 400 Bad Request error message is returned.

If you omit the version-prefix, the current version of the API (v1.40) is used. For example, calling /info is the same as calling /v1.40/info. Using the API without a version-prefix is deprecated and will be removed in a future release.

Engine releases in the near future should support this version of the API, so your client will continue to work even if it is talking to a newer Engine.

The API uses an open schema model, which means server may add extra properties to responses. Likewise, the server will ignore any extra query parameters and request body properties. When you write clients, you need to ignore additional properties in responses to ensure they do not break when talking to newer daemons.

Authentication #

Authentication for registries is handled client side. The client has to send authentication details to various endpoints that need to communicate with registries, such as POST /images/(name)/push. These are sent as X-Registry-Auth header as a base64url encoded (JSON) string with the following structure:

{
  \"username\": \"string\",
  \"password\": \"string\",
  \"email\": \"string\",
  \"serveraddress\": \"string\"
}

The serveraddress is a domain/IP without a protocol. Throughout this structure, double quotes are required.

If you have already got an identity token from the /auth endpoint, you can just pass this instead of credentials:

{
  \"identitytoken\": \"9cbaf023786cd7...\"
}

This Dart package is automatically generated by the OpenAPI Generator project:

  • API version: 1.40
  • Build package: org.openapitools.codegen.languages.DartClientCodegen

Requirements #

Dart 2.0 or later

Installation & Usage #

Github #

If this Dart package is published to Github, add the following dependency to your pubspec.yaml

dependencies:
  openapi:
    git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git

Local #

To use the package in your local drive, add the following dependency to your pubspec.yaml

dependencies:
  openapi:
    path: /path/to/openapi

Tests #

TODO

Getting Started #

Please follow the installation procedure and then run the following:

import 'package:docker_client/api.dart';


var api_instance = ConfigApi();
var body = ConfigSpec(); // Object |

try {
    var result = api_instance.configCreate(body);
    print(result);
} catch (e) {
    print("Exception when calling ConfigApi->configCreate: $e\n");
}

Documentation for API Endpoints #

All URIs are relative to http://localhost/v1.40

ClassMethodHTTP requestDescription
ConfigApiconfigCreatePOST /configs/createCreate a config
ConfigApiconfigDeleteDELETE /configs/{id}Delete a config
ConfigApiconfigInspectGET /configs/{id}Inspect a config
ConfigApiconfigListGET /configsList configs
ConfigApiconfigUpdatePOST /configs/{id}/updateUpdate a Config
ContainerApicontainerArchiveGET /containers/{id}/archiveGet an archive of a filesystem resource in a container
ContainerApicontainerArchiveInfoHEAD /containers/{id}/archiveGet information about files in a container
ContainerApicontainerAttachPOST /containers/{id}/attachAttach to a container
ContainerApicontainerAttachWebsocketGET /containers/{id}/attach/wsAttach to a container via a websocket
ContainerApicontainerChangesGET /containers/{id}/changesGet changes on a container’s filesystem
ContainerApicontainerCreatePOST /containers/createCreate a container
ContainerApicontainerDeleteDELETE /containers/{id}Remove a container
ContainerApicontainerExportGET /containers/{id}/exportExport a container
ContainerApicontainerInspectGET /containers/{id}/jsonInspect a container
ContainerApicontainerKillPOST /containers/{id}/killKill a container
ContainerApicontainerListGET /containers/jsonList containers
ContainerApicontainerLogsGET /containers/{id}/logsGet container logs
ContainerApicontainerPausePOST /containers/{id}/pausePause a container
ContainerApicontainerPrunePOST /containers/pruneDelete stopped containers
ContainerApicontainerRenamePOST /containers/{id}/renameRename a container
ContainerApicontainerResizePOST /containers/{id}/resizeResize a container TTY
ContainerApicontainerRestartPOST /containers/{id}/restartRestart a container
ContainerApicontainerStartPOST /containers/{id}/startStart a container
ContainerApicontainerStatsGET /containers/{id}/statsGet container stats based on resource usage
ContainerApicontainerStopPOST /containers/{id}/stopStop a container
ContainerApicontainerTopGET /containers/{id}/topList processes running inside a container
ContainerApicontainerUnpausePOST /containers/{id}/unpauseUnpause a container
ContainerApicontainerUpdatePOST /containers/{id}/updateUpdate a container
ContainerApicontainerWaitPOST /containers/{id}/waitWait for a container
ContainerApiputContainerArchivePUT /containers/{id}/archiveExtract an archive of files or folders to a directory in a container
DistributionApidistributionInspectGET /distribution/{name}/jsonGet image information from the registry
ExecApicontainerExecPOST /containers/{id}/execCreate an exec instance
ExecApiexecInspectGET /exec/{id}/jsonInspect an exec instance
ExecApiexecResizePOST /exec/{id}/resizeResize an exec instance
ExecApiexecStartPOST /exec/{id}/startStart an exec instance
ImageApibuildPrunePOST /build/pruneDelete builder cache
ImageApiimageBuildPOST /buildBuild an image
ImageApiimageCommitPOST /commitCreate a new image from a container
ImageApiimageCreatePOST /images/createCreate an image
ImageApiimageDeleteDELETE /images/{name}Remove an image
ImageApiimageGetGET /images/{name}/getExport an image
ImageApiimageGetAllGET /images/getExport several images
ImageApiimageHistoryGET /images/{name}/historyGet the history of an image
ImageApiimageInspectGET /images/{name}/jsonInspect an image
ImageApiimageListGET /images/jsonList Images
ImageApiimageLoadPOST /images/loadImport images
ImageApiimagePrunePOST /images/pruneDelete unused images
ImageApiimagePushPOST /images/{name}/pushPush an image
ImageApiimageSearchGET /images/searchSearch images
ImageApiimageTagPOST /images/{name}/tagTag an image
NetworkApinetworkConnectPOST /networks/{id}/connectConnect a container to a network
NetworkApinetworkCreatePOST /networks/createCreate a network
NetworkApinetworkDeleteDELETE /networks/{id}Remove a network
NetworkApinetworkDisconnectPOST /networks/{id}/disconnectDisconnect a container from a network
NetworkApinetworkInspectGET /networks/{id}Inspect a network
NetworkApinetworkListGET /networksList networks
NetworkApinetworkPrunePOST /networks/pruneDelete unused networks
NodeApinodeDeleteDELETE /nodes/{id}Delete a node
NodeApinodeInspectGET /nodes/{id}Inspect a node
NodeApinodeListGET /nodesList nodes
NodeApinodeUpdatePOST /nodes/{id}/updateUpdate a node
PluginApigetPluginPrivilegesGET /plugins/privilegesGet plugin privileges
PluginApipluginCreatePOST /plugins/createCreate a plugin
PluginApipluginDeleteDELETE /plugins/{name}Remove a plugin
PluginApipluginDisablePOST /plugins/{name}/disableDisable a plugin
PluginApipluginEnablePOST /plugins/{name}/enableEnable a plugin
PluginApipluginInspectGET /plugins/{name}/jsonInspect a plugin
PluginApipluginListGET /pluginsList plugins
PluginApipluginPullPOST /plugins/pullInstall a plugin
PluginApipluginPushPOST /plugins/{name}/pushPush a plugin
PluginApipluginSetPOST /plugins/{name}/setConfigure a plugin
PluginApipluginUpgradePOST /plugins/{name}/upgradeUpgrade a plugin
SecretApisecretCreatePOST /secrets/createCreate a secret
SecretApisecretDeleteDELETE /secrets/{id}Delete a secret
SecretApisecretInspectGET /secrets/{id}Inspect a secret
SecretApisecretListGET /secretsList secrets
SecretApisecretUpdatePOST /secrets/{id}/updateUpdate a Secret
ServiceApiserviceCreatePOST /services/createCreate a service
ServiceApiserviceDeleteDELETE /services/{id}Delete a service
ServiceApiserviceInspectGET /services/{id}Inspect a service
ServiceApiserviceListGET /servicesList services
ServiceApiserviceLogsGET /services/{id}/logsGet service logs
ServiceApiserviceUpdatePOST /services/{id}/updateUpdate a service
SessionApisessionPOST /sessionInitialize interactive session
SwarmApiswarmInitPOST /swarm/initInitialize a new swarm
SwarmApiswarmInspectGET /swarmInspect swarm
SwarmApiswarmJoinPOST /swarm/joinJoin an existing swarm
SwarmApiswarmLeavePOST /swarm/leaveLeave a swarm
SwarmApiswarmUnlockPOST /swarm/unlockUnlock a locked manager
SwarmApiswarmUnlockkeyGET /swarm/unlockkeyGet the unlock key
SwarmApiswarmUpdatePOST /swarm/updateUpdate a swarm
SystemApisystemAuthPOST /authCheck auth configuration
SystemApisystemDataUsageGET /system/dfGet data usage information
SystemApisystemEventsGET /eventsMonitor events
SystemApisystemInfoGET /infoGet system information
SystemApisystemPingGET /_pingPing
SystemApisystemPingHeadHEAD /_pingPing
SystemApisystemVersionGET /versionGet version
TaskApitaskInspectGET /tasks/{id}Inspect a task
TaskApitaskListGET /tasksList tasks
TaskApitaskLogsGET /tasks/{id}/logsGet task logs
VolumeApivolumeCreatePOST /volumes/createCreate a volume
VolumeApivolumeDeleteDELETE /volumes/{name}Remove a volume
VolumeApivolumeInspectGET /volumes/{name}Inspect a volume
VolumeApivolumeListGET /volumesList volumes
VolumeApivolumePrunePOST /volumes/pruneDelete unused volumes

Documentation For Models #

Documentation For Authorization #

All endpoints do not require authorization.

Author #