kosa8 0.5.2 → 0.6.0
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/README.md +98 -15
- data/lib/kosa8/cloud.rb +52 -18
- data/lib/kosa8/cloud_features.rb +45 -13
- data/lib/kosa8/cloud_more.rb +1009 -0
- data/lib/kosa8/errors.rb +7 -1
- data/lib/kosa8/version.rb +1 -1
- data/lib/kosa8.rb +1 -0
- metadata +2 -1
data/lib/kosa8/errors.rb
CHANGED
|
@@ -29,6 +29,9 @@ module Kosa8
|
|
|
29
29
|
@path = path
|
|
30
30
|
@body = body
|
|
31
31
|
@code = code
|
|
32
|
+
@detail = nil
|
|
33
|
+
@retry_after = nil
|
|
34
|
+
@request_id = nil
|
|
32
35
|
end
|
|
33
36
|
|
|
34
37
|
# The message: the server's own sentence (or the SDK's), followed for a
|
|
@@ -164,7 +167,7 @@ module Kosa8
|
|
|
164
167
|
FAILURE_CLASSES = %w[ok exit_nonzero timeout oom infra quota client].freeze
|
|
165
168
|
INFRA_CODES = %w[host_failed not_ready no_capacity host_unreachable host_unavailable host_busy host_restarting
|
|
166
169
|
wake_failed try_again internal kernel_failed egress_failed dns_unreachable host_lost host_removed
|
|
167
|
-
insufficient_storage starting].freeze
|
|
170
|
+
insufficient_storage starting database_busy].freeze
|
|
168
171
|
RATE_CODES = %w[rate_limited slow_down too_soon].freeze
|
|
169
172
|
QUOTA_CODES = %w[quota_exceeded running_limit plan_required plan_limit plan_feature payment_required payment_declined
|
|
170
173
|
spending_cap_reached snapshot_limit org_frozen org_suspended too_many_runs].freeze
|
|
@@ -177,6 +180,9 @@ module Kosa8
|
|
|
177
180
|
c = code.is_a?(String) ? code : ""
|
|
178
181
|
return ["ok", false] if status < 400
|
|
179
182
|
return ["timeout", false] if c == "exec_timeout"
|
|
183
|
+
return ["infra", true] if c == IDEMPOTENCY_IN_PROGRESS || c == "template_building"
|
|
184
|
+
# A bad parameter is the caller's to fix, whatever it names (invalid_timeout).
|
|
185
|
+
return ["client", false] if status < 500 && /\A(invalid|bad|missing|unknown)_/.match?(c)
|
|
180
186
|
return ["timeout", true] if c.include?("timeout")
|
|
181
187
|
return ["quota", true] if RATE_CODES.include?(c)
|
|
182
188
|
return ["quota", false] if QUOTA_CODES.include?(c) || status == 402 || status == 423
|
data/lib/kosa8/version.rb
CHANGED
data/lib/kosa8.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kosa8
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- kosa8
|
|
@@ -25,6 +25,7 @@ files:
|
|
|
25
25
|
- lib/kosa8/client.rb
|
|
26
26
|
- lib/kosa8/cloud.rb
|
|
27
27
|
- lib/kosa8/cloud_features.rb
|
|
28
|
+
- lib/kosa8/cloud_more.rb
|
|
28
29
|
- lib/kosa8/cloud_rl.rb
|
|
29
30
|
- lib/kosa8/errors.rb
|
|
30
31
|
- lib/kosa8/fork_map.rb
|