Module: Google::Cloud::Monitoring::AlertPolicy
- Defined in:
- lib/google/cloud/monitoring.rb
Class Method Summary collapse
-
.new(version: , credentials: , scopes: , client_config: , timeout: ) ⇒ Object
The AlertPolicyService API is used to manage (list, create, delete, edit) alert policies in Stackdriver Monitoring.
Class Method Details
.new(version: , credentials: , scopes: , client_config: , timeout: ) ⇒ Object
The AlertPolicyService API is used to manage (list, create, delete, edit) alert policies in Stackdriver Monitoring. An alerting policy is a description of the conditions under which some aspect of your system is considered to be "unhealthy" and the ways to notify people or services about this state. In addition to using this API, alert policies can also be managed through Stackdriver Monitoring, which can be reached by clicking the "Monitoring" tab in Cloud Console.
157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/google/cloud/monitoring.rb', line 157 def self.new(*args, version: :v3, **kwargs) unless AVAILABLE_VERSIONS.include?(version.to_s.downcase) raise "The version: #{version} is not available. The available versions " \ "are: [#{AVAILABLE_VERSIONS.join(", ")}]" end require "#{FILE_DIR}/#{version.to_s.downcase}" version_module = Google::Cloud::Monitoring .constants .select {|sym| sym.to_s.downcase == version.to_s.downcase} .first Google::Cloud::Monitoring.const_get(version_module)::AlertPolicy.new(*args, **kwargs) end |