diff --git a/airflow/providers/apache/kylin/hooks/kylin.py b/airflow/providers/apache/kylin/hooks/kylin.py index a8865bcaf1413..cfc2021f66069 100644 --- a/airflow/providers/apache/kylin/hooks/kylin.py +++ b/airflow/providers/apache/kylin/hooks/kylin.py @@ -32,9 +32,14 @@ class KylinHook(BaseHook): :param dsn: dsn """ + conn_name_attr = "kylin_conn_id" + default_conn_name = "kylin_default" + conn_type = "kylin" + hook_name = "Apache Kylin" + def __init__( self, - kylin_conn_id: str = "kylin_default", + kylin_conn_id: str = default_conn_name, project: str | None = None, dsn: str | None = None, ): diff --git a/airflow/providers/apache/kylin/provider.yaml b/airflow/providers/apache/kylin/provider.yaml index 459f0ef5895e7..114fd01ae4cba 100644 --- a/airflow/providers/apache/kylin/provider.yaml +++ b/airflow/providers/apache/kylin/provider.yaml @@ -57,3 +57,7 @@ hooks: - integration-name: Apache Kylin python-modules: - airflow.providers.apache.kylin.hooks.kylin + +connection-types: + - hook-class-name: airflow.providers.apache.kylin.hooks.kylin.KylinHook + connection-type: kylin diff --git a/docs/apache-airflow-providers-apache-kylin/connections.rst b/docs/apache-airflow-providers-apache-kylin/connections.rst new file mode 100644 index 0000000000000..9d66003996030 --- /dev/null +++ b/docs/apache-airflow-providers-apache-kylin/connections.rst @@ -0,0 +1,47 @@ + .. 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. + +Apache Kylin Connection +======================= + +The Apache Kylin connection type enables connection to Apache Kylin. + +Default Connection IDs +---------------------- + +Kylin Hook uses parameter ``kylin_conn_id`` for Connection IDs and the value of the +parameter as ``kylin_default`` by default. + +Configuring the Connection +-------------------------- +Host + The host of the Kylin cluster (should be without scheme). + +Port + Specify the port to use for connecting the Kylin cluster. + +Schema + The default Kylin project that will be used, if not specified. + +Login + The user that will be used for authentication against the Kylin cluster. + +Password + The password of the user that will be used for authentication against the Kylin cluster. + +Extra (optional, connection parameters) + Specify the extra parameters (as json dictionary) that can be used in Kylin connection. diff --git a/docs/apache-airflow-providers-apache-kylin/index.rst b/docs/apache-airflow-providers-apache-kylin/index.rst index 938779057ffc5..1275b43a5ddb8 100644 --- a/docs/apache-airflow-providers-apache-kylin/index.rst +++ b/docs/apache-airflow-providers-apache-kylin/index.rst @@ -29,6 +29,13 @@ Changelog Security +.. toctree:: + :hidden: + :maxdepth: 1 + :caption: Guides + + Connection types + .. toctree:: :hidden: :maxdepth: 1