diff --git a/Gemfile.lock b/Gemfile.lock index ce0ef2b..b8be097 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - dockerapi (0.21.0) + dockerapi (0.22.0) base64 excon (>= 0.97, < 2) diff --git a/README.md b/README.md index ef34a6d..11e5c35 100644 --- a/README.md +++ b/README.md @@ -359,7 +359,7 @@ node.update("node-id", {version: "version"}, {Role: "worker", Availability: "act node.update("node-id", {version: "version"}, {Role: "manager", Availability: "active" }) # Delete node -node.delete("node-id") +node.remove("node-id") ``` ### Service @@ -389,7 +389,7 @@ service.logs("nginx-service", stdout: true) service.details("nginx-service") # Delete service -service.delete("nginx-service") +service.remove("nginx-service") ``` ### Task @@ -427,7 +427,7 @@ spec = secret.details("secret-name").json["Spec"] secret.update("secret-name", {version: version}, spec.merge!({ Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" })) # Delete secret -secret.delete("secret-name") +secret.remove("secret-name") ``` ### Config @@ -450,7 +450,7 @@ spec = config.details("config-name").json["Spec"] config.update("config-name", {version: version}, spec.merge!({ Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" })) # Delete config -config.delete("config-name") +config.remove("config-name") ``` ### Plugin diff --git a/lib/docker/api/config.rb b/lib/docker/api/config.rb index 9e4682b..996529a 100644 --- a/lib/docker/api/config.rb +++ b/lib/docker/api/config.rb @@ -60,7 +60,7 @@ def update name, params = {}, body = {} # @see https://docs.docker.com/engine/api/v1.40/#operation/ConfigDelete # # @param name [String]: The ID or name of the config. - def delete name + def remove name @connection.delete("/v#{Docker::API::API_VERSION}/configs/#{name}") end end \ No newline at end of file diff --git a/lib/docker/api/node.rb b/lib/docker/api/node.rb index e7d389b..597013e 100644 --- a/lib/docker/api/node.rb +++ b/lib/docker/api/node.rb @@ -36,7 +36,7 @@ def update name, params = {}, body = {} # # @param name [String]: The ID or name of the node. # @param params [Hash]: Parameters that are appended to the URL. - def delete name, params = {} + def remove name, params = {} @connection.delete(build_path("/nodes/#{name}", params)) end diff --git a/lib/docker/api/secret.rb b/lib/docker/api/secret.rb index fd29430..a46eee6 100644 --- a/lib/docker/api/secret.rb +++ b/lib/docker/api/secret.rb @@ -52,7 +52,7 @@ def update name, params = {}, body = {} # @see https://docs.docker.com/engine/api/v1.40/#operation/SecretDelete # # @param name [String]: The ID or name of the secret. - def delete name + def remove name @connection.delete(build_path("/secrets/#{name}")) end end \ No newline at end of file diff --git a/lib/docker/api/service.rb b/lib/docker/api/service.rb index 13529e9..48a6a6d 100644 --- a/lib/docker/api/service.rb +++ b/lib/docker/api/service.rb @@ -71,7 +71,7 @@ def logs name, params = {} # @see https://docs.docker.com/engine/api/v1.40/#operation/ServiceDelete # # @param name [String]: The ID or name of the service. - def delete name + def remove name @connection.delete(build_path("/services/#{name}")) end end diff --git a/lib/docker/api/version.rb b/lib/docker/api/version.rb index ee69118..4e671eb 100644 --- a/lib/docker/api/version.rb +++ b/lib/docker/api/version.rb @@ -1,6 +1,6 @@ module Docker module API - GEM_VERSION = "0.21.0" + GEM_VERSION = "0.22.0" API_VERSION = "1.43" diff --git a/spec/endpoints/config_spec.rb b/spec/endpoints/config_spec.rb index b9be511..7ea1de7 100644 --- a/spec/endpoints/config_spec.rb +++ b/spec/endpoints/config_spec.rb @@ -7,7 +7,7 @@ it { is_expected.to respond_to(:create) } it { is_expected.to respond_to(:details) } it { is_expected.to respond_to(:update) } - it { is_expected.to respond_to(:delete) } + it { is_expected.to respond_to(:remove) } context "with stubs" do before(:all) do @@ -50,9 +50,9 @@ it { expect{subject.update("rspec-config", {version: version}, {invalid: true})}.not_to raise_error } end - describe ".delete" do - it { expect(subject.delete("rspec-config").request_params[:path]).to eq('/v1.43/configs/rspec-config') } - it { expect(subject.delete("rspec-config").request_params[:method]).to eq(:delete) } + describe ".remove" do + it { expect(subject.remove("rspec-config").request_params[:path]).to eq('/v1.43/configs/rspec-config') } + it { expect(subject.remove("rspec-config").request_params[:method]).to eq(:delete) } end end end \ No newline at end of file diff --git a/spec/endpoints/node_spec.rb b/spec/endpoints/node_spec.rb index 956fe3d..cb351de 100644 --- a/spec/endpoints/node_spec.rb +++ b/spec/endpoints/node_spec.rb @@ -3,7 +3,7 @@ it { is_expected.to respond_to(:list) } it { is_expected.to respond_to(:details) } - it { is_expected.to respond_to(:delete) } + it { is_expected.to respond_to(:remove) } it { is_expected.to respond_to(:update) } context "with stubs" do @@ -37,11 +37,11 @@ it { expect{subject.update("id", {version: "version"}, {invalid: true})}.not_to raise_error } end - describe ".delete" do - it { expect(subject.delete("id").request_params[:path]).to eq("/v#{Docker::API::API_VERSION}/nodes/id") } - it { expect(subject.delete("id").request_params[:method]).to eq(:delete) } - it { expect(subject.delete("id", force: true).request_params[:path]).to eq("/v#{Docker::API::API_VERSION}/nodes/id?force=true") } - it { expect{subject.delete("id", invalid: true)}.not_to raise_error } + describe ".remove" do + it { expect(subject.remove("id").request_params[:path]).to eq("/v#{Docker::API::API_VERSION}/nodes/id") } + it { expect(subject.remove("id").request_params[:method]).to eq(:delete) } + it { expect(subject.remove("id", force: true).request_params[:path]).to eq("/v#{Docker::API::API_VERSION}/nodes/id?force=true") } + it { expect{subject.remove("id", invalid: true)}.not_to raise_error } end end diff --git a/spec/endpoints/secret_spec.rb b/spec/endpoints/secret_spec.rb index 3c65e97..2e09c03 100644 --- a/spec/endpoints/secret_spec.rb +++ b/spec/endpoints/secret_spec.rb @@ -5,7 +5,7 @@ it { is_expected.to respond_to(:create) } it { is_expected.to respond_to(:details) } it { is_expected.to respond_to(:update) } - it { is_expected.to respond_to(:delete) } + it { is_expected.to respond_to(:remove) } context "with stubs" do before(:all) {Excon.stub({ :scheme => 'http', :host => '127.0.0.1', :port => 2375 }, { }) } @@ -43,9 +43,9 @@ it { expect{subject.update("secret", {version: "version"}, {invalid: true})}.not_to raise_error } end - describe ".delete" do - it { expect(subject.delete("secret").request_params[:path]).to eq("/v#{Docker::API::API_VERSION}/secrets/secret") } - it { expect(subject.delete("secret").request_params[:method]).to eq(:delete) } + describe ".remove" do + it { expect(subject.remove("secret").request_params[:path]).to eq("/v#{Docker::API::API_VERSION}/secrets/secret") } + it { expect(subject.remove("secret").request_params[:method]).to eq(:delete) } end end end \ No newline at end of file diff --git a/spec/endpoints/service_spec.rb b/spec/endpoints/service_spec.rb index 752aab1..d5174be 100644 --- a/spec/endpoints/service_spec.rb +++ b/spec/endpoints/service_spec.rb @@ -4,7 +4,7 @@ it { is_expected.to respond_to(:list) } it { is_expected.to respond_to(:details) } it { is_expected.to respond_to(:create) } - it { is_expected.to respond_to(:delete) } + it { is_expected.to respond_to(:remove) } it { is_expected.to respond_to(:update) } it { is_expected.to respond_to(:logs) } @@ -60,9 +60,9 @@ it { expect{subject.update("dockerapi", {version: "version"}, { invalid: true })}.not_to raise_error } end - describe ".delete" do - it { expect(subject.delete("dockerapi").request_params[:path]).to eq("/v#{Docker::API::API_VERSION}/services/dockerapi") } - it { expect(subject.delete("dockerapi").request_params[:method]).to eq(:delete) } + describe ".remove" do + it { expect(subject.remove("dockerapi").request_params[:path]).to eq("/v#{Docker::API::API_VERSION}/services/dockerapi") } + it { expect(subject.remove("dockerapi").request_params[:method]).to eq(:delete) } end end