Class: ESP::CustomSignature

Inherits:
Resource
  • Object
show all
Defined in:
lib/esp/resources/custom_signature.rb,
lib/esp/resources/custom_signature/result.rb,
lib/esp/resources/custom_signature/definition.rb,
lib/esp/resources/custom_signature/result/alert.rb

Defined Under Namespace

Classes: Definition, Result

Constant Summary

Constants inherited from Resource

Resource::PREDICATES

Instance Method Summary collapse

Methods inherited from Resource

arrange_options, filters, find, make_pageable, #serializable_hash, where

Instance Method Details

#organizationObject

The organization this custom signature belongs to.



8
# File 'lib/esp/resources/custom_signature.rb', line 8

belongs_to :organization, class_name: 'ESP::Organization'

#suppress(arguments = {}) ⇒ Object

Create a suppression for this custom signature.

Parameter

arguments | Required | A hash of signature suppression attributes

Valid Arguments

See API documentation for valid arguments

Example

suppress(regions: ['us_east_1'], external_account_ids: [5], reason: 'My very good reason for creating this suppression')


30
31
32
33
# File 'lib/esp/resources/custom_signature.rb', line 30

def suppress(arguments = {})
  arguments = arguments.with_indifferent_access
  ESP::Suppression::Signature.create(custom_signature_ids: [id], regions: Array(arguments[:regions]), external_account_ids: Array(arguments[:external_account_ids]), reason: arguments[:reason])
end

#teamsObject

The collection of teams that belong to the custom_signature.



13
14
15
16
# File 'lib/esp/resources/custom_signature.rb', line 13

def teams
  return attributes['teams'] if attributes['teams'].present?
  Team.where(custom_signatures_id_eq: id)
end