oppex_sdk 1.0.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 +7 -0
- data/LICENSE +201 -0
- data/README.md +166 -0
- data/lib/oppex_sdk/endpoint.rb +6 -0
- data/lib/oppex_sdk/errors.rb +44 -0
- data/lib/oppex_sdk/incident_client.rb +187 -0
- data/lib/oppex_sdk/incident_request.rb +82 -0
- data/lib/oppex_sdk/incident_response.rb +14 -0
- data/lib/oppex_sdk/internal/async_dispatcher.rb +135 -0
- data/lib/oppex_sdk/internal/http_executor.rb +106 -0
- data/lib/oppex_sdk/internal/interrupt.rb +56 -0
- data/lib/oppex_sdk/internal/rate_limited_drop_logger.rb +40 -0
- data/lib/oppex_sdk/internal/retry_executor.rb +56 -0
- data/lib/oppex_sdk/internal/wire_codec.rb +89 -0
- data/lib/oppex_sdk/logging.rb +24 -0
- data/lib/oppex_sdk/severity.rb +49 -0
- data/lib/oppex_sdk/version.rb +6 -0
- data/lib/oppex_sdk.rb +32 -0
- metadata +60 -0
data/lib/oppex_sdk.rb
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Post incidents to the Oppex incident API.
|
|
4
|
+
#
|
|
5
|
+
# POST https://api.oppex.ai/api/v1/incident/post
|
|
6
|
+
#
|
|
7
|
+
# client = Oppex::IncidentClient.new(api_key: "api-key", service_key: "service-key")
|
|
8
|
+
# request = Oppex::IncidentRequest.new(
|
|
9
|
+
# title: "Checkout latency breached the SLO",
|
|
10
|
+
# source: "checkout-api",
|
|
11
|
+
# severity: Oppex::Severity::HIGH
|
|
12
|
+
# )
|
|
13
|
+
# response = client.post(request)
|
|
14
|
+
# client.close
|
|
15
|
+
#
|
|
16
|
+
# The service key is optional. A client built with only an +api_key+ posts with
|
|
17
|
+
# IncidentClient#post_with_service_routing, which omits +serviceKey+ from the
|
|
18
|
+
# payload so the API resolves the target service itself.
|
|
19
|
+
#
|
|
20
|
+
# Create one client per application, share it across threads, and close it during
|
|
21
|
+
# application shutdown.
|
|
22
|
+
module Oppex
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
require_relative "oppex_sdk/version"
|
|
26
|
+
require_relative "oppex_sdk/endpoint"
|
|
27
|
+
require_relative "oppex_sdk/errors"
|
|
28
|
+
require_relative "oppex_sdk/logging"
|
|
29
|
+
require_relative "oppex_sdk/severity"
|
|
30
|
+
require_relative "oppex_sdk/incident_request"
|
|
31
|
+
require_relative "oppex_sdk/incident_response"
|
|
32
|
+
require_relative "oppex_sdk/incident_client"
|
metadata
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: oppex_sdk
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Oppex
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
12
|
+
description: Post incidents to the Oppex incident API. Standard library only, thread
|
|
13
|
+
safe, with synchronous and best-effort asynchronous delivery.
|
|
14
|
+
executables: []
|
|
15
|
+
extensions: []
|
|
16
|
+
extra_rdoc_files: []
|
|
17
|
+
files:
|
|
18
|
+
- LICENSE
|
|
19
|
+
- README.md
|
|
20
|
+
- lib/oppex_sdk.rb
|
|
21
|
+
- lib/oppex_sdk/endpoint.rb
|
|
22
|
+
- lib/oppex_sdk/errors.rb
|
|
23
|
+
- lib/oppex_sdk/incident_client.rb
|
|
24
|
+
- lib/oppex_sdk/incident_request.rb
|
|
25
|
+
- lib/oppex_sdk/incident_response.rb
|
|
26
|
+
- lib/oppex_sdk/internal/async_dispatcher.rb
|
|
27
|
+
- lib/oppex_sdk/internal/http_executor.rb
|
|
28
|
+
- lib/oppex_sdk/internal/interrupt.rb
|
|
29
|
+
- lib/oppex_sdk/internal/rate_limited_drop_logger.rb
|
|
30
|
+
- lib/oppex_sdk/internal/retry_executor.rb
|
|
31
|
+
- lib/oppex_sdk/internal/wire_codec.rb
|
|
32
|
+
- lib/oppex_sdk/logging.rb
|
|
33
|
+
- lib/oppex_sdk/severity.rb
|
|
34
|
+
- lib/oppex_sdk/version.rb
|
|
35
|
+
homepage: https://github.com/Oppex-AI/oppex-integration
|
|
36
|
+
licenses:
|
|
37
|
+
- Apache-2.0
|
|
38
|
+
metadata:
|
|
39
|
+
source_code_uri: https://github.com/Oppex-AI/oppex-integration/tree/master/ruby
|
|
40
|
+
documentation_uri: https://github.com/Oppex-AI/oppex-integration/blob/master/ruby/README.md
|
|
41
|
+
bug_tracker_uri: https://github.com/Oppex-AI/oppex-integration/issues
|
|
42
|
+
rubygems_mfa_required: 'true'
|
|
43
|
+
rdoc_options: []
|
|
44
|
+
require_paths:
|
|
45
|
+
- lib
|
|
46
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
47
|
+
requirements:
|
|
48
|
+
- - ">="
|
|
49
|
+
- !ruby/object:Gem::Version
|
|
50
|
+
version: '3.2'
|
|
51
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
|
+
requirements:
|
|
53
|
+
- - ">="
|
|
54
|
+
- !ruby/object:Gem::Version
|
|
55
|
+
version: '0'
|
|
56
|
+
requirements: []
|
|
57
|
+
rubygems_version: 4.0.20
|
|
58
|
+
specification_version: 4
|
|
59
|
+
summary: Oppex incident API client
|
|
60
|
+
test_files: []
|