This is an automated email from the ASF dual-hosted git repository.

jscheffl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 326ae6bdc2 Add docs for opsgenie connection (#36519)
326ae6bdc2 is described below

commit 326ae6bdc258274ae8a0c653ca08ace9c3033c18
Author: shohamy7 <46799583+shoha...@users.noreply.github.com>
AuthorDate: Mon Jan 1 02:04:14 2024 +0200

    Add docs for opsgenie connection (#36519)
---
 airflow/providers/opsgenie/hooks/opsgenie.py       | 10 +++++++
 .../connections.rst                                | 35 ++++++++++++++++++++++
 docs/apache-airflow-providers-opsgenie/index.rst   |  1 +
 3 files changed, 46 insertions(+)

diff --git a/airflow/providers/opsgenie/hooks/opsgenie.py 
b/airflow/providers/opsgenie/hooks/opsgenie.py
index 239f67a7e2..8dab4e12e5 100644
--- a/airflow/providers/opsgenie/hooks/opsgenie.py
+++ b/airflow/providers/opsgenie/hooks/opsgenie.py
@@ -17,6 +17,8 @@
 # under the License.
 from __future__ import annotations
 
+from typing import Any
+
 from opsgenie_sdk import (
     AlertApi,
     ApiClient,
@@ -156,3 +158,11 @@ class OpsgenieAlertHook(BaseHook):
         except OpenApiException as e:
             self.log.exception("Exception when calling AlertApi->delete_alert: 
%s\n", e)
             raise e
+
+    @classmethod
+    def get_ui_field_behaviour(cls) -> dict[str, Any]:
+        """Returns custom field behaviour."""
+        return {
+            "hidden_fields": ["port", "schema", "login", "extra"],
+            "relabeling": {"password": "Opsgenie API Key"},
+        }
diff --git a/docs/apache-airflow-providers-opsgenie/connections.rst 
b/docs/apache-airflow-providers-opsgenie/connections.rst
new file mode 100644
index 0000000000..c021eafcd7
--- /dev/null
+++ b/docs/apache-airflow-providers-opsgenie/connections.rst
@@ -0,0 +1,35 @@
+ .. Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+ ..   http://www.apache.org/licenses/LICENSE-2.0
+
+ .. Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+Opsgenie Connection
+===================
+
+The Opsgenie connection type enables connection to Opsgenie.
+
+Default Connection IDs
+----------------------
+
+OpsgenieAlert Hook uses parameter ``opsgenie_conn_id`` for Connection IDs and 
the value of the
+parameter as ``opsgenie_default`` by default.
+
+Configuring the Connection
+--------------------------
+Host
+    The host of the Opsgenie (should be with scheme).
+
+Opsgenie API Key
+    The API key of the user that will be used for authentication against the 
Opsgenie API.
diff --git a/docs/apache-airflow-providers-opsgenie/index.rst 
b/docs/apache-airflow-providers-opsgenie/index.rst
index d2e10c2612..2440fd6899 100644
--- a/docs/apache-airflow-providers-opsgenie/index.rst
+++ b/docs/apache-airflow-providers-opsgenie/index.rst
@@ -34,6 +34,7 @@
     :maxdepth: 1
     :caption: Guides
 
+    Connection types <connections>
     Operators <operators/index>
     Notifications <notifications/index>
 

Reply via email to