Class: DockerEngineAPI::Resources::Secrets
- Inherits:
-
Object
- Object
- DockerEngineAPI::Resources::Secrets
- Defined in:
- lib/docker_engine_api/resources/secrets.rb
Instance Method Summary collapse
-
#create(spec: nil, request_options: {}) ⇒ DockerEngineAPI::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: {}) ⇒ DockerEngineAPI::Models::Secret
Inspect a secret.
-
#list(filters: nil, request_options: {}) ⇒ Array<DockerEngineAPI::Models::Secret>
Some parameter documentations has been truncated, see Models::SecretListParams for more details.
-
#update(id, version:, spec: nil, request_options: {}) ⇒ nil
Some parameter documentations has been truncated, see Models::SecretUpdateParams for more details.
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.
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, = DockerEngineAPI::SecretCreateParams.dump_request(params) @client.request( method: :post, path: "secrets/create", body: parsed[:spec], model: DockerEngineAPI::Models::SecretCreateResponse, options: ) end |
#delete(id, request_options: {}) ⇒ nil
Delete a secret
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
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
71 72 73 74 75 76 77 78 79 80 |
# File 'lib/docker_engine_api/resources/secrets.rb', line 71 def list(params = {}) parsed, = DockerEngineAPI::SecretListParams.dump_request(params) @client.request( method: :get, path: "secrets", query: parsed, model: DockerEngineAPI::Internal::Type::ArrayOf[DockerEngineAPI::Secret], 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
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, = 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: ) end |