Class: Proxy::Monitoring::Api

Inherits:
Sinatra::Base
  • Object
show all
Extended by:
DependencyInjection
Includes:
Log
Defined in:
lib/smart_proxy_monitoring/monitoring_api.rb

Instance Method Summary collapse

Methods included from DependencyInjection

container_instance

Instance Method Details

#strip_domain(name) ⇒ Object



71
72
73
74
75
# File 'lib/smart_proxy_monitoring/monitoring_api.rb', line 71

def strip_domain(name)
  domain = Proxy::Monitoring::Plugin.settings.strip_domain
  name.slice!(domain) unless domain.nil?
  name
end

#validate_dns_name!(name) ⇒ Object



67
68
69
# File 'lib/smart_proxy_monitoring/monitoring_api.rb', line 67

def validate_dns_name!(name)
  raise Proxy::Monitoring::Error.new("Invalid DNS name #{name}") unless name =~ /^([a-zA-Z0-9]([-a-zA-Z0-9]+)?\.?)+$/
end