class_docstr: This hook allows you to post alerts to Opsgenie.
  
  Accepts a connection that has an Opsgenie API key as the connection's password.
  This hook sets the domain to conn_id.host, and if not set will default
  to ``https://api.opsgenie.com``.
  
  Each Opsgenie API key can be pre-configured to a team integration.
  You can override these defaults in this hook.
  
  :param opsgenie_conn_id: The name of the Opsgenie connection to use
class_docstr_tok: ["This","hook","allows","you","to","post","alerts","to","Opsgenie",".","Accepts","a","connection","that","has","an","Opsgenie","API","key","as","the","connection","'s","password",".","This","hook","sets","the","domain","to","conn_id.host",",","and","if","not","set","will","default","to","``","https",":","\/\/api.opsgenie.com","``",".","Each","Opsgenie","API","key","can","be","pre-configured","to","a","team","integration",".","You","can","override","these","defaults","in","this","hook",".",":","param","opsgenie_conn_id",":","The","name","of","the","Opsgenie","connection","to","use"]
docstr: Create an alert on Opsgenie.
  
  :param payload: Opsgenie API Create Alert payload values
      See https://docs.opsgenie.com/docs/alert-api#section-create-alert
  :return: api response
docstr_tok: ["Create","an","alert","on","Opsgenie",".",":","param","payload",":","Opsgenie","API","Create","Alert","payload","values","See","https",":","\/\/docs.opsgenie.com\/docs\/alert-api","#","section-create-alert",":","return",":","api","response"]
code: def create_alert(
      self, payload: dict | None = None
  ) -> SuccessResponse:
      """
      Create an alert on Opsgenie.
  
      :param payload: Opsgenie API Create Alert payload values
          See https://docs.opsgenie.com/docs/alert-api#section-create-alert
      :return: api response
      """
      payload = payload or {}
  
      try:
          create_alert_payload = CreateAlertPayload(**payload)
          api_response = self.alert_api_instance.create_alert(
              create_alert_payload
          )
          return api_response
      except OpenApiException as e:
          self.log.exception(
              "Exception when sending alert to opsgenie with payload: %s",
              payload,
          )
          raise e
  
file_path: airflow/airflow/providers/opsgenie/hooks/opsgenie.py
imports: from __future__ import annotations
  from typing import Any
  from opsgenie_sdk import AlertApi, ApiClient, CloseAlertPayload, Configuration, CreateAlertPayload, OpenApiException, SuccessResponse
  from airflow.hooks.base import BaseHook
label_desc: Use image node_id 4 for calling the OpsgenieAlertHook obj's underlying member method code with example usage: obj.create_alert(payload) and returns: api_response