Class: DockerEngineAPI::Resources::Secrets

Inherits:
Object
  • Object
show all
Defined in:
lib/docker_engine_api/resources/secrets.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Secrets

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Secrets.

Parameters:



125
126
127
# File 'lib/docker_engine_api/resources/secrets.rb', line 125

def initialize(client:)
  @client = client
end

Instance Method Details

#create(spec: nil, request_options: {}) ⇒ DockerEngineAPI::Models::SecretCreateResponse

Create a secret



16
17
18
19
20
21
22
23
24
25
# File 'lib/docker_engine_api/resources/secrets.rb', line 16

def create(params = {})
  parsed, options = DockerEngineAPI::SecretCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "secrets/create",
    body: parsed[:spec],
    model: DockerEngineAPI::Models::SecretCreateResponse,
    options: options
  )
end

#delete(id, request_options: {}) ⇒ nil

Delete a secret

Parameters:

Returns:

  • (nil)

See Also:



93
94
95
96
97
98
99
100
# File 'lib/docker_engine_api/resources/secrets.rb', line 93

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["secrets/%1$s", id],
    model: NilClass,
    options: params[:request_options]
  )
end

#inspect_(id, request_options: {}) ⇒ DockerEngineAPI::Models::Secret

Inspect a secret

Parameters:

Returns:

See Also:



113
114
115
116
117
118
119
120
# File 'lib/docker_engine_api/resources/secrets.rb', line 113

def inspect_(id, params = {})
  @client.request(
    method: :get,
    path: ["secrets/%1$s", id],
    model: DockerEngineAPI::Secret,
    options: params[:request_options]
  )
end

#list(filters: nil, request_options: {}) ⇒ Array<DockerEngineAPI::Models::Secret>

Some parameter documentations has been truncated, see Models::SecretListParams for more details.

List secrets

Parameters:

  • filters (String)

    A JSON encoded value of the filters (a map[string][]string) to

  • request_options (DockerEngineAPI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



71
72
73
74
75
76
77
78
79
80
# File 'lib/docker_engine_api/resources/secrets.rb', line 71

def list(params = {})
  parsed, options = DockerEngineAPI::SecretListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "secrets",
    query: parsed,
    model: DockerEngineAPI::Internal::Type::ArrayOf[DockerEngineAPI::Secret],
    options: options
  )
end

#update(id, version:, spec: nil, request_options: {}) ⇒ nil

Some parameter documentations has been truncated, see Models::SecretUpdateParams for more details.

Update a Secret

Parameters:

Returns:

  • (nil)

See Also:



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/docker_engine_api/resources/secrets.rb', line 45

def update(id, params)
  parsed, options = DockerEngineAPI::SecretUpdateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["secrets/%1$s/update", id],
    query: parsed.except(:spec),
    body: parsed[:spec],
    model: NilClass,
    options: options
  )
end