Class: AwsCloudwatch::V3

Inherits:
Integration
  • Object
show all
Defined in:
app/models/pager_tree/integrations/aws_cloudwatch/v3.rb

Constant Summary collapse

OPTIONS =
[]

Instance Method Summary collapse

Instance Method Details

#adapter_actionObject



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

Returns:

  • (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_createObject



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_otherObject



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

Returns:

  • (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

Returns:

  • (Boolean)


6
7
8
# File 'app/models/pager_tree/integrations/aws_cloudwatch/v3.rb', line 6

def adapter_supports_incoming?
  true
end

#adapter_thirdparty_idObject



18
19
20
# File 'app/models/pager_tree/integrations/aws_cloudwatch/v3.rb', line 18

def adapter_thirdparty_id
  _thirdparty_id
end