toxiproxy 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/start-toxiproxy.sh +1 -1
- data/lib/toxiproxy.rb +5 -0
- data/lib/toxiproxy/toxic.rb +2 -1
- data/lib/toxiproxy/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd7714ade2b3e653fabba43c36dc025fd36a6377
|
4
|
+
data.tar.gz: bc0fa5de828b70a14da8797ce672245bfd91c760
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0247200fb5ee43f9d46d3a73af053ba4b5bddd5ce238eec0d8cc6e32415363f14c6053abafc52b42d46bddc51ff0f6c74d0a0b4a86261e43c58ffc44d8f62ffe
|
7
|
+
data.tar.gz: c08a860ae38e8e375478df95d891b351614bf766dca25d582a076f8a55b871a1b2630d5cbe2678555f2a9b17d532ec8dcdb4cf22fafff57dd30b3d12a07eb67e
|
data/bin/start-toxiproxy.sh
CHANGED
data/lib/toxiproxy.rb
CHANGED
@@ -31,6 +31,8 @@ class Toxiproxy
|
|
31
31
|
# Re-enables all proxies and disables all toxics.
|
32
32
|
def self.reset
|
33
33
|
request = Net::HTTP::Post.new("/reset")
|
34
|
+
request["Content-Type"] = "application/json"
|
35
|
+
|
34
36
|
response = http_request(request)
|
35
37
|
assert_response(response)
|
36
38
|
self
|
@@ -144,6 +146,7 @@ class Toxiproxy
|
|
144
146
|
# Disables a Toxiproxy. This will drop all active connections and stop the proxy from listening.
|
145
147
|
def disable
|
146
148
|
request = Net::HTTP::Post.new("/proxies/#{name}")
|
149
|
+
request["Content-Type"] = "application/json"
|
147
150
|
|
148
151
|
hash = {enabled: false}
|
149
152
|
request.body = hash.to_json
|
@@ -156,6 +159,7 @@ class Toxiproxy
|
|
156
159
|
# Enables a Toxiproxy. This will cause the proxy to start listening again.
|
157
160
|
def enable
|
158
161
|
request = Net::HTTP::Post.new("/proxies/#{name}")
|
162
|
+
request["Content-Type"] = "application/json"
|
159
163
|
|
160
164
|
hash = {enabled: true}
|
161
165
|
request.body = hash.to_json
|
@@ -170,6 +174,7 @@ class Toxiproxy
|
|
170
174
|
# of this connection.
|
171
175
|
def create
|
172
176
|
request = Net::HTTP::Post.new("/proxies")
|
177
|
+
request["Content-Type"] = "application/json"
|
173
178
|
|
174
179
|
hash = {upstream: upstream, name: name, listen: listen, enabled: enabled}
|
175
180
|
request.body = hash.to_json
|
data/lib/toxiproxy/toxic.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Toxiproxy
|
2
2
|
class Toxic
|
3
|
-
attr_reader :name, :type, :
|
3
|
+
attr_reader :name, :type, :stream, :proxy
|
4
4
|
attr_accessor :attributes, :toxicity
|
5
5
|
|
6
6
|
def initialize(attrs)
|
@@ -15,6 +15,7 @@ class Toxiproxy
|
|
15
15
|
|
16
16
|
def save
|
17
17
|
request = Net::HTTP::Post.new("/proxies/#{proxy.name}/toxics")
|
18
|
+
request["Content-Type"] = "application/json"
|
18
19
|
|
19
20
|
request.body = as_json
|
20
21
|
|
data/lib/toxiproxy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toxiproxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Eskildsen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-07-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
111
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.
|
112
|
+
rubygems_version: 2.6.14
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
115
|
summary: Ruby library for Toxiproxy
|