Class: DockerEngineRuby::Resources::Secrets
- Inherits:
-
Object
- Object
- DockerEngineRuby::Resources::Secrets
- Defined in:
- lib/docker_engine_ruby/resources/secrets.rb
Instance Method Summary collapse
-
#create(spec:, request_options: {}) ⇒ DockerEngineRuby::Models::SecretCreateResponse
Create a secret.
-
#delete(id, request_options: {}) ⇒ nil
Delete a secret.
-
#initialize(client:) ⇒ Secrets
constructor
private
A new instance of Secrets.
-
#inspect_(id, request_options: {}) ⇒ DockerEngineRuby::Models::Secret
Inspect a secret.
-
#list(filters: nil, request_options: {}) ⇒ Array<DockerEngineRuby::Models::Secret>
List secrets.
-
#update(id, version:, spec:, request_options: {}) ⇒ nil
Update a Secret.
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.
116 117 118 |
# File 'lib/docker_engine_ruby/resources/secrets.rb', line 116 def initialize(client:) @client = client end |
Instance Method Details
#create(spec:, request_options: {}) ⇒ DockerEngineRuby::Models::SecretCreateResponse
Create a secret
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/docker_engine_ruby/resources/secrets.rb', line 16 def create(params) parsed, = DockerEngineRuby::SecretCreateParams.dump_request(params) @client.request( method: :post, path: "secrets/create", body: parsed[:spec], model: DockerEngineRuby::Models::SecretCreateResponse, options: ) end |
#delete(id, request_options: {}) ⇒ nil
Delete a secret
85 86 87 88 89 90 91 92 |
# File 'lib/docker_engine_ruby/resources/secrets.rb', line 85 def delete(id, params = {}) @client.request( method: :delete, path: ["secrets/%1$s", id], model: NilClass, options: params[:request_options] ) end |
#inspect_(id, request_options: {}) ⇒ DockerEngineRuby::Models::Secret
Inspect a secret
104 105 106 107 108 109 110 111 |
# File 'lib/docker_engine_ruby/resources/secrets.rb', line 104 def inspect_(id, params = {}) @client.request( method: :get, path: ["secrets/%1$s", id], model: DockerEngineRuby::Secret, options: params[:request_options] ) end |
#list(filters: nil, request_options: {}) ⇒ Array<DockerEngineRuby::Models::Secret>
List secrets
64 65 66 67 68 69 70 71 72 73 |
# File 'lib/docker_engine_ruby/resources/secrets.rb', line 64 def list(params = {}) parsed, = DockerEngineRuby::SecretListParams.dump_request(params) @client.request( method: :get, path: "secrets", query: parsed, model: DockerEngineRuby::Internal::Type::ArrayOf[DockerEngineRuby::Secret], options: ) end |
#update(id, version:, spec:, request_options: {}) ⇒ nil
Update a Secret
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/docker_engine_ruby/resources/secrets.rb', line 42 def update(id, params) parsed, = DockerEngineRuby::SecretUpdateParams.dump_request(params) @client.request( method: :post, path: ["secrets/%1$s/update", id], query: parsed.except(:spec), body: parsed[:spec], model: NilClass, options: ) end |