Method: Wavefront::Validators#wf_monitoredcluster_id?

Defined in:
lib/wavefront-sdk/validators.rb

#wf_monitoredcluster_id?(id) ⇒ Boolean

Ensure the given argument is a valid monitored cluster ID

Parameters:

Returns:

  • (Boolean)

Raises:

  • Wavefront::Exception::InvalidMonitoredClusterId if the ID is not valid



605
606
607
608
609
# File 'lib/wavefront-sdk/validators.rb', line 605

def wf_monitoredcluster_id?(id)
  return true if id.is_a?(String) && id.size < 256 && id =~ /^[a-z0-9\-_]+$/

  raise Wavefront::Exception::InvalidMonitoredClusterId, id
end