Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions airflow/providers/opsgenie/hooks/opsgenie.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# under the License.
from __future__ import annotations

from typing import Any

from opsgenie_sdk import (
AlertApi,
ApiClient,
Expand Down Expand Up @@ -156,3 +158,11 @@ def delete_alert(
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"},
}
35 changes: 35 additions & 0 deletions docs/apache-airflow-providers-opsgenie/connections.rst
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions docs/apache-airflow-providers-opsgenie/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
:maxdepth: 1
:caption: Guides

Connection types <connections>
Operators <operators/index>
Notifications <notifications/index>

Expand Down