class_docstr: A class to load, modify, and display the StreamAlertCLI Config
docstr: Add a metric alarm that corresponds to a predefined metrics globally
  
  Args:
      alarm_info (dict): All the necessary values needed to add a CloudWatch
          metric alarm
docstr_tok: ["Add","a","metric","alarm","that","corresponds","to","a","predefined","metrics","globally","Args",":","alarm_info","(","dict",")",":","All","the","necessary","values","needed","to","add","a","CloudWatch","metric","alarm"]
code: def _add_global_metric_alarm(self, alarm_info):
      """Add a metric alarm that corresponds to a predefined metrics globally
  
      Args:
          alarm_info (dict): All the necessary values needed to add a CloudWatch
              metric alarm
      """
      function_name = alarm_info["function"]
  
      func_config_name = "{}_config".format(function_name)
  
      # Check if metrics are not enabled, and ask the user if they would like to enable them
      if func_config_name not in self.config["lambda"]:
          self.config["lambda"][func_config_name] = {}
  
      function_config = self.config["lambda"][func_config_name]
  
      if function_name in CLUSTERED_FUNCTIONS:
          if not self._clusters_with_metrics_enabled(function_name):
              prompt = (
                  "Metrics are not currently enabled for the '{}' function "
                  "within any cluster. Creating an alarm will have no effect "
                  "until metrics are enabled for this function in at least one "
                  "cluster. Would you still like to continue?".format(
                      function_name
                  )
              )
              if not continue_prompt(message=prompt):
                  return False
  
      else:
          if not function_config.get("enable_custom_metrics"):
              prompt = (
                  "Metrics are not currently enabled for the '{}' function. "
                  "Would you like to enable metrics for this function?"
              ).format(function_name)
  
              if continue_prompt(message=prompt):
                  self.toggle_metrics(function_name, enabled=True)
  
              elif not continue_prompt(
                  message="Would you still like to add this alarm "
                  "even though metrics are disabled?"
              ):
                  return False
  
      metric_alarms = function_config.get("custom_metric_alarms", {})
  
      # Format the metric name for the aggregate metric
      alarm_settings = alarm_info.copy()
      alarm_settings["metric_name"] = "{}-{}".format(
          metrics.FUNC_PREFIXES[function_name],
          alarm_settings["metric_name"],
      )
  
      function_config[
          "custom_metric_alarms"
      ] = self._add_metric_alarm_config(alarm_settings, metric_alarms)
      LOGGER.info(
          "Successfully added '%s' metric alarm to "
          "'conf/lambda.json'.",
          alarm_settings["alarm_name"],
      )
  
      return True
  
imports: import json
  import os
  import re
  import shutil
  import string
  import tempfile
  from streamalert.apps import StreamAlertApp
  from streamalert.shared import CLUSTERED_FUNCTIONS, config, metrics
  from streamalert.shared.logger import get_logger
  from streamalert_cli.terraform import TERRAFORM_FILES_PATH
  from streamalert_cli.apps.helpers import save_app_auth_info
  from streamalert_cli.helpers import continue_prompt
label_desc: Use image node_id 19 for calling the CLIConfig obj's underlying member method code with example usage: obj._add_global_metric_alarm(alarm_info) and returns: True, False, False