Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
dockerapi (0.21.0)
dockerapi (0.22.0)
base64
excon (>= 0.97, < 2)

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/docker/api/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/docker/api/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/docker/api/secret.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/docker/api/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/docker/api/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Docker
module API
GEM_VERSION = "0.21.0"
GEM_VERSION = "0.22.0"

API_VERSION = "1.43"

Expand Down
8 changes: 4 additions & 4 deletions spec/endpoints/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
12 changes: 6 additions & 6 deletions spec/endpoints/node_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions spec/endpoints/secret_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }, { }) }
Expand Down Expand Up @@ -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
8 changes: 4 additions & 4 deletions spec/endpoints/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }

Expand Down Expand Up @@ -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
Expand Down