Class: AwsCloudwatch::V3
- Inherits:
-
Integration
- Object
- Integration
- AwsCloudwatch::V3
- Defined in:
- app/models/pager_tree/integrations/aws_cloudwatch/v3.rb
Constant Summary collapse
- OPTIONS =
[]
Instance Method Summary collapse
- #adapter_action ⇒ Object
- #adapter_incoming_can_defer? ⇒ Boolean
- #adapter_process_create ⇒ Object
- #adapter_process_other ⇒ Object
- #adapter_should_block_incoming?(request) ⇒ Boolean
- #adapter_supports_incoming? ⇒ Boolean
- #adapter_thirdparty_id ⇒ Object
Instance Method Details
#adapter_action ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'app/models/pager_tree/integrations/aws_cloudwatch/v3.rb', line 22 def adapter_action if _is_create? :create elsif _is_resolve? :resolve else :other end end |
#adapter_incoming_can_defer? ⇒ Boolean
10 11 12 |
# File 'app/models/pager_tree/integrations/aws_cloudwatch/v3.rb', line 10 def adapter_incoming_can_defer? true end |
#adapter_process_create ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'app/models/pager_tree/integrations/aws_cloudwatch/v3.rb', line 32 def adapter_process_create Alert.new( title: _title, description: _description, thirdparty_id: _thirdparty_id, dedup_keys: [], additional_data: _additional_datums ) end |
#adapter_process_other ⇒ Object
42 43 44 45 46 47 |
# File 'app/models/pager_tree/integrations/aws_cloudwatch/v3.rb', line 42 def adapter_process_other if _type == "SubscriptionConfirmation" || _type == "UnsubscribeConfirmation" url = adapter_incoming_request_params.dig("SubscribeURL") HTTParty.get(url) if url end end |
#adapter_should_block_incoming?(request) ⇒ Boolean
14 15 16 |
# File 'app/models/pager_tree/integrations/aws_cloudwatch/v3.rb', line 14 def adapter_should_block_incoming?(request) !Aws::SNS::MessageVerifier.new.authentic?(request.params) end |
#adapter_supports_incoming? ⇒ Boolean
6 7 8 |
# File 'app/models/pager_tree/integrations/aws_cloudwatch/v3.rb', line 6 def adapter_supports_incoming? true end |
#adapter_thirdparty_id ⇒ Object
18 19 20 |
# File 'app/models/pager_tree/integrations/aws_cloudwatch/v3.rb', line 18 def adapter_thirdparty_id _thirdparty_id end |