Browse Source
* submit redshift auth mode * add front end * add doc and fix frontend Co-authored-by: devosend <devosend@gmail.com>3.2.0-release
Tq
2 years ago
committed by
GitHub
21 changed files with 413 additions and 29 deletions
@ -0,0 +1,36 @@
|
||||
# Amazon Redshift |
||||
|
||||
## 数据源参数 |
||||
|
||||
使用数据库服务器的用户名和密码验证。 |
||||
- 数据源:选择 AZURE Redshift |
||||
- 数据源名称:输入数据源的名称 |
||||
- 描述:输入数据源的描述 |
||||
- IP 主机名:输入连接 Redshift 的 HOST 或 IP ,例如:cluster-name.xxx.region.redshift.amazonaws.com.cn |
||||
- 端口:输入连接 Redshift 的端口,默认5439 |
||||
- 验证模式:输入 Redshift 的连接模式,目前支持:Password,IAM-accessKey |
||||
- 用户名:设置连接 Redshift 的用户名 |
||||
- 密码:设置连接 Redshift 的密码 |
||||
- 数据库名:输入连接 Redshift 的数据库名称 |
||||
- Jdbc 连接参数:用于 Redshift 连接的参数设置,以 JSON 形式填写 |
||||
- AccessKeyID:IAM-accessKey模式下的access key ID |
||||
- SecretAccessKey:IAM-accessKey模式下的secret access key |
||||
|
||||
### 验证: Password |
||||
|
||||
![password](../../../../img/new_ui/dev/datasource/redshift-password.png) |
||||
|
||||
使用Redshift数据库的用户名和密码验证。 |
||||
|
||||
### 验证: IAM-accessKey |
||||
|
||||
![IAM1](../../../../img/new_ui/dev/datasource/redshift-iam1.png) |
||||
![IAM2](../../../../img/new_ui/dev/datasource/redshift-iam2.png) |
||||
|
||||
使用 cluster ID, AWS Region, port(可选) and IAM信息来登录。 |
||||
|
||||
## 是否原生支持 |
||||
|
||||
是,数据源不需要任务附加操作即可使用。 |
||||
|
||||
参考更多关于Redshift相关的JDBC文档[校验模式](https://docs.aws.amazon.com/redshift/latest/mgmt/generating-iam-credentials-configure-jdbc-odbc.html) |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 82 KiB |
@ -0,0 +1,65 @@
|
||||
/* |
||||
* 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. |
||||
*/ |
||||
|
||||
package org.apache.dolphinscheduler.plugin.datasource.redshift.param; |
||||
|
||||
import static java.util.stream.Collectors.toMap; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.Map; |
||||
import java.util.NoSuchElementException; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue; |
||||
import com.google.common.base.Functions; |
||||
|
||||
public enum RedshiftAuthMode { |
||||
|
||||
PASSWORD(0, "password"), |
||||
IAM_ACCESS_KEY(1, "IAM-accessKey"), |
||||
; |
||||
|
||||
private static final Map<Integer, RedshiftAuthMode> AUTH_TYPE_MAP = |
||||
Arrays.stream(RedshiftAuthMode.values()).collect(toMap(RedshiftAuthMode::getCode, Functions.identity())); |
||||
private final int code; |
||||
@JsonValue |
||||
private final String descp; |
||||
|
||||
RedshiftAuthMode(int code, String descp) { |
||||
this.code = code; |
||||
this.descp = descp; |
||||
} |
||||
|
||||
public static RedshiftAuthMode of(int type) { |
||||
if (AUTH_TYPE_MAP.containsKey(type)) { |
||||
return AUTH_TYPE_MAP.get(type); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public static RedshiftAuthMode ofName(String name) { |
||||
return Arrays.stream(RedshiftAuthMode.values()).filter(e -> e.name().equals(name)).findFirst() |
||||
.orElseThrow(() -> new NoSuchElementException("no such auth type")); |
||||
} |
||||
|
||||
public int getCode() { |
||||
return code; |
||||
} |
||||
|
||||
public String getDescp() { |
||||
return descp; |
||||
} |
||||
} |
Loading…
Reference in new issue