Skip to content

Latest commit

 

History

History
242 lines (164 loc) · 6 KB

SecretApi.md

File metadata and controls

242 lines (164 loc) · 6 KB

DockerEngineApi.SecretApi

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

Method HTTP request Description
secretCreate POST /secrets/create Create a secret
secretDelete DELETE /secrets/{id} Delete a secret
secretInspect GET /secrets/{id} Inspect a secret
secretList GET /secrets List secrets
secretUpdate POST /secrets/{id}/update Update a Secret

secretCreate

IdResponse secretCreate(opts)

Create a secret

Example

var DockerEngineApi = require('docker_engine_api');

var apiInstance = new DockerEngineApi.SecretApi();

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.secretCreate(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

secretDelete

secretDelete(id)

Delete a secret

Example

var DockerEngineApi = require('docker_engine_api');

var apiInstance = new DockerEngineApi.SecretApi();

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


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

Parameters

Name Type Description Notes
id String ID of the secret

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

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

secretInspect

Secret secretInspect(id)

Inspect a secret

Example

var DockerEngineApi = require('docker_engine_api');

var apiInstance = new DockerEngineApi.SecretApi();

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


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

Parameters

Name Type Description Notes
id String ID of the secret

Return type

Secret

Authorization

No authorization required

HTTP request headers

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

secretList

[Secret] secretList(opts)

List secrets

Example

var DockerEngineApi = require('docker_engine_api');

var apiInstance = new DockerEngineApi.SecretApi();

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

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

Parameters

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

Return type

[Secret]

Authorization

No authorization required

HTTP request headers

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

secretUpdate

secretUpdate(id, version, opts)

Update a Secret

Example

var DockerEngineApi = require('docker_engine_api');

var apiInstance = new DockerEngineApi.SecretApi();

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

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

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

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

Parameters

Name Type Description Notes
id String The ID or name of the secret
version Number The version number of the secret object being updated. This is required to avoid conflicting writes.
body SecretSpec The spec of the secret to update. Currently, only the Labels field can be updated. All other fields must remain unchanged from the SecretInspect 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