Skip to content

Latest commit

 

History

History
242 lines (164 loc) · 6 KB

ConfigApi.md

File metadata and controls

242 lines (164 loc) · 6 KB

DockerEngineApi.ConfigApi

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

Method HTTP request Description
configCreate POST /configs/create Create a config
configDelete DELETE /configs/{id} Delete a config
configInspect GET /configs/{id} Inspect a config
configList GET /configs List configs
configUpdate POST /configs/{id}/update Update a Config

configCreate

IdResponse configCreate(opts)

Create a config

Example

var DockerEngineApi = require('docker_engine_api');

var apiInstance = new DockerEngineApi.ConfigApi();

var opts = { 
  'body': new DockerEngineApi.object() // object | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.configCreate(opts, callback);

Parameters

Name Type Description Notes
body object [optional]

Return type

IdResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

configDelete

configDelete(id)

Delete a config

Example

var DockerEngineApi = require('docker_engine_api');

var apiInstance = new DockerEngineApi.ConfigApi();

var id = "id_example"; // String | ID of the config


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.configDelete(id, callback);

Parameters

Name Type Description Notes
id String ID of the config

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, text/plain
  • Accept: application/json

configInspect

Config configInspect(id)

Inspect a config

Example

var DockerEngineApi = require('docker_engine_api');

var apiInstance = new DockerEngineApi.ConfigApi();

var id = "id_example"; // String | ID of the config


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.configInspect(id, callback);

Parameters

Name Type Description Notes
id String ID of the config

Return type

Config

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, text/plain
  • Accept: application/json

configList

[Config] configList(opts)

List configs

Example

var DockerEngineApi = require('docker_engine_api');

var apiInstance = new DockerEngineApi.ConfigApi();

var opts = { 
  'filters': "filters_example" // String | A JSON encoded value of the filters (a `map[string][]string`) to process on the configs list.  Available filters:  - `id=<config id>` - `label=<key> or label=<key>=value` - `name=<config name>` - `names=<config name>` 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.configList(opts, callback);

Parameters

Name Type Description Notes
filters String A JSON encoded value of the filters (a map[string][]string) to process on the configs list. Available filters: - id=<config id> - label=<key> or label=<key>=value - name=<config name> - names=<config name> [optional]

Return type

[Config]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, text/plain
  • Accept: application/json

configUpdate

configUpdate(id, version, opts)

Update a Config

Example

var DockerEngineApi = require('docker_engine_api');

var apiInstance = new DockerEngineApi.ConfigApi();

var id = "id_example"; // String | The ID or name of the config

var version = 789; // Number | The version number of the config object being updated. This is required to avoid conflicting writes. 

var opts = { 
  'body': new DockerEngineApi.ConfigSpec() // ConfigSpec | The spec of the config to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the [ConfigInspect endpoint](#operation/ConfigInspect) response values. 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.configUpdate(id, version, opts, callback);

Parameters

Name Type Description Notes
id String The ID or name of the config
version Number The version number of the config object being updated. This is required to avoid conflicting writes.
body ConfigSpec The spec of the config to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the ConfigInspect endpoint response values. [optional]

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, text/plain
  • Accept: application/json, text/plain