Browse Source
* init data factory * add task-type-config.yaml * add data factory ui * submit doc * submit license --------- Co-authored-by: devosend <devosend@gmail.com>3.2.0-release
Tq
2 years ago
committed by
GitHub
74 changed files with 1874 additions and 16 deletions
@ -0,0 +1,70 @@ |
|||||||
|
# Azure DataFactory Node |
||||||
|
|
||||||
|
## Overview |
||||||
|
|
||||||
|
In the world of big data, raw, unorganized data is often stored in relational, non-relational, and other storage systems.[Azure DataFactory](https://learn.microsoft.com/en-us/azure/data-factory/introduction) is a managed cloud service that's built for these complex hybrid extract-transform-load (ETL), extract-load-transform (ELT), and data integration projects. |
||||||
|
|
||||||
|
DolphinScheduler DataFactory functions: |
||||||
|
|
||||||
|
- Create Azure DataFactory task enable DolphinScheduler to schedule DataFactory pipelines, keep query pipeline execution status until finish the execution. |
||||||
|
|
||||||
|
## Prerequisite |
||||||
|
|
||||||
|
- **ResourceGroup**: Azure owns a resource group |
||||||
|
- **DataFactory**: Azure owns a data factory under the resource group |
||||||
|
- **Pipeline**: Azure owns pipelines under the assigned resource group and data factory |
||||||
|
- **Application**: Azure owns an application has permission to visit data factory, enables using SDK to call data factory functions |
||||||
|
- **ApplicationClientSecret**: To apply for client secret under Application `Certificates & secrets` |
||||||
|
- **AZURE-CLI**: Install Azure auth application AZURE-CLI on machine, please refer to [Install the Azure CLI on Linux](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux) |
||||||
|
|
||||||
|
### Application Permission Setting |
||||||
|
|
||||||
|
First, visit the `Subcription` page and choose `Access control (IAM)`, then click `Add role assignment` to the authorization page. |
||||||
|
![Subcription-IAM](../../../../img/tasks/demo/datafactory_auth1.png) |
||||||
|
After that, select `Contributor` role which satisfy functions calls in data factory. Then click `Members` page, and click `Select members`. |
||||||
|
Search application name or application `Object ID` to assign `Contributor` role to application. |
||||||
|
![Subcription-Role](../../../../img/tasks/demo/datafactory_auth2.png) |
||||||
|
|
||||||
|
## Configurations |
||||||
|
|
||||||
|
Config Azure configurations, modify `azure` related configurations in `common.properties` |
||||||
|
- **resource.azure.client.id**: Azure Application Application (client) ID |
||||||
|
- **resource.azure.client.secret**: Azure Application client secret under `Certificates & secrets` |
||||||
|
- **resource.azure.subId**: Data factory subscription ID |
||||||
|
- **resource.azure.tenant.id**: Azure Active Directory tenant ID |
||||||
|
|
||||||
|
```yaml |
||||||
|
# The Azure client ID (Azure Application (client) ID) |
||||||
|
resource.azure.client.id=minioadmin |
||||||
|
# The Azure client secret in the Azure application |
||||||
|
resource.azure.client.secret=minioadmin |
||||||
|
# The Azure data factory subscription ID |
||||||
|
resource.azure.subId=minioadmin |
||||||
|
# The Azure tenant ID in the Azure Active Directory |
||||||
|
resource.azure.tenant.id=minioadmin |
||||||
|
|
||||||
|
``` |
||||||
|
|
||||||
|
## Create Task |
||||||
|
|
||||||
|
- Click `Project -> Management-Project -> Name-Workflow Definition`, and click the "Create Workflow" button to enter the |
||||||
|
DAG editing page. |
||||||
|
- Drag from the toolbar <img src="../../../../img/tasks/icons/datafactory.png" width="15"/> task node to canvas. |
||||||
|
|
||||||
|
## Task Example |
||||||
|
|
||||||
|
[//]: # (TODO: use the commented anchor below once our website template supports this syntax) |
||||||
|
[//]: # (- Please refer to [DolphinScheduler Task Parameters Appendix](appendix.md#default-task-parameters) `Default Task Parameters` section for default parameters.) |
||||||
|
|
||||||
|
- Please refer to [DolphinScheduler Task Parameters Appendix](appendix.md) `Default Task Parameters` section for default parameters. |
||||||
|
|
||||||
|
Here are some specific parameters for the DataFactory plugin: |
||||||
|
|
||||||
|
- **factoryName**: data factory name |
||||||
|
- **resourceGroupName**: resource group name of the data factory |
||||||
|
- **pipelineName**: pipeline name under the resource group and data factory |
||||||
|
|
||||||
|
The following shows the task plugin example: |
||||||
|
|
||||||
|
![data-factory](../../../../img/tasks/demo/datafactory.png) |
||||||
|
|
@ -0,0 +1,68 @@ |
|||||||
|
# Azure DataFactory 节点 |
||||||
|
|
||||||
|
## 综述 |
||||||
|
|
||||||
|
在大数据环境中,原始、散乱的数据通常存储在关系、非关系和其他存储系统中。[Azure DataFactory](https://learn.microsoft.com/en-us/azure/data-factory/introduction) 是为这些复杂的混合提取-转换-加载 (ETL)、提取-加载-转换 (ELT) 和数据集成项目而构建的托管云服务。 |
||||||
|
|
||||||
|
DolphinScheduler DataFactory 组件的功能: |
||||||
|
|
||||||
|
- 创建 Azure DataFactory 任务可以调度DataFactory中的pipeline,持续获取执行状态,直至任务执行完成。 |
||||||
|
|
||||||
|
## 前置条件 |
||||||
|
|
||||||
|
- **资源组**: 拥有一个资源组 |
||||||
|
- **数据工厂**: 拥有一个资源组下的数据工厂 |
||||||
|
- **Pipeline**: 拥有前两者对应的pipeline |
||||||
|
- **应用**: 拥有一个有数据工厂访问权限的应用,才能赋予SDK调用数据工厂 |
||||||
|
- **应用客户端密钥**: 在应用的`Certificates & secrets`申请客户端密钥 |
||||||
|
- **AZURE-CLI**: 在机器上安装了AZURE的鉴权应用AZURE-CLI,请参考[在LINUX上安装AZURE-CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux) |
||||||
|
|
||||||
|
### 应用权限设置 |
||||||
|
|
||||||
|
首先打开当前`Subcription`页面,点击`Access control (IAM)`,再点击`Add role assignment`进入授权页面。 |
||||||
|
![Subcription-IAM](../../../../img/tasks/demo/datafactory_auth1.png) |
||||||
|
首先选择`Contributor`角色足够满足调用数据工厂。然后选择`Members`页面,再选择`Select members`,检索APP名称或APP的`Object ID`并添加,从给指定APP添加权限. |
||||||
|
![Subcription-Role](../../../../img/tasks/demo/datafactory_auth2.png) |
||||||
|
|
||||||
|
## 环境配置 |
||||||
|
|
||||||
|
需要进行Azure的一些配置,修改`common.properties`中的`azure`相关配置信息 |
||||||
|
- **resource.azure.client.id**: Azure Application应用的Application (client) ID |
||||||
|
- **resource.azure.client.secret**: Azure Application应用的`Certificates & secrets`下的客户端密钥 |
||||||
|
- **resource.azure.subId**: 数据工厂的subscription ID |
||||||
|
- **resource.azure.tenant.id**: Azure Active Directory下的tenant ID |
||||||
|
|
||||||
|
```yaml |
||||||
|
# The Azure client ID (Azure Application (client) ID) |
||||||
|
resource.azure.client.id=minioadmin |
||||||
|
# The Azure client secret in the Azure application |
||||||
|
resource.azure.client.secret=minioadmin |
||||||
|
# The Azure data factory subscription ID |
||||||
|
resource.azure.subId=minioadmin |
||||||
|
# The Azure tenant ID in the Azure Active Directory |
||||||
|
resource.azure.tenant.id=minioadmin |
||||||
|
|
||||||
|
``` |
||||||
|
|
||||||
|
## 创建任务 |
||||||
|
|
||||||
|
- 点击项目管理-项目名称-工作流定义,点击“创建工作流”按钮,进入 DAG 编辑页面; |
||||||
|
- 拖动工具栏的 <img src="../../../../img/tasks/icons/datafactory.png" width="15"/> 任务节点到画板中。 |
||||||
|
|
||||||
|
## 任务样例 |
||||||
|
|
||||||
|
[//]: # (TODO: use the commented anchor below once our website template supports this syntax) |
||||||
|
[//]: # (- 默认参数说明请参考[DolphinScheduler任务参数附录](appendix.md#默认任务参数)`默认任务参数`一栏。) |
||||||
|
|
||||||
|
- 默认参数说明请参考[DolphinScheduler任务参数附录](appendix.md)`默认任务参数`一栏。 |
||||||
|
|
||||||
|
### 独有参数 |
||||||
|
|
||||||
|
- **factoryName**: 数据工厂名称 |
||||||
|
- **resourceGroupName**: 与数据工厂相关的资源组名称 |
||||||
|
- **pipelineName**: 选取数据工厂以及资源组下的对应pipeline名称 |
||||||
|
|
||||||
|
组件图示如下: |
||||||
|
|
||||||
|
![data-factory](../../../../img/tasks/demo/datafactory.png) |
||||||
|
|
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 3.6 KiB |
@ -0,0 +1,108 @@ |
|||||||
|
/* |
||||||
|
* 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.api.controller; |
||||||
|
|
||||||
|
import static org.apache.dolphinscheduler.api.enums.Status.LIST_AZURE_DATA_FACTORY_ERROR; |
||||||
|
import static org.apache.dolphinscheduler.api.enums.Status.LIST_AZURE_DATA_FACTORY_PIPELINE_ERROR; |
||||||
|
import static org.apache.dolphinscheduler.api.enums.Status.LIST_AZURE_RESOURCE_GROUP_ERROR; |
||||||
|
|
||||||
|
import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation; |
||||||
|
import org.apache.dolphinscheduler.api.enums.Status; |
||||||
|
import org.apache.dolphinscheduler.api.exceptions.ApiException; |
||||||
|
import org.apache.dolphinscheduler.api.service.CloudService; |
||||||
|
import org.apache.dolphinscheduler.api.utils.Result; |
||||||
|
import org.apache.dolphinscheduler.common.constants.Constants; |
||||||
|
import org.apache.dolphinscheduler.dao.entity.User; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
import javax.annotation.Resource; |
||||||
|
|
||||||
|
import org.springframework.http.HttpStatus; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestAttribute; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
import org.springframework.web.bind.annotation.ResponseStatus; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation; |
||||||
|
import io.swagger.v3.oas.annotations.Parameter; |
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag; |
||||||
|
|
||||||
|
/** |
||||||
|
* cloud controller |
||||||
|
*/ |
||||||
|
@Tag(name = "CLOUD_TAG") |
||||||
|
@RestController |
||||||
|
@RequestMapping("/cloud") |
||||||
|
public class CloudController extends BaseController { |
||||||
|
|
||||||
|
@Resource |
||||||
|
private CloudService cloudService; |
||||||
|
|
||||||
|
/** |
||||||
|
* get datafactory list |
||||||
|
* |
||||||
|
* @param loginUser login user |
||||||
|
* @return datafactory name list |
||||||
|
*/ |
||||||
|
@Operation(summary = "listDataFactory", description = "LIST_DATA_FACTORY") |
||||||
|
@GetMapping(value = "/azure/datafactory/factories") |
||||||
|
@ResponseStatus(HttpStatus.OK) |
||||||
|
@ApiException(LIST_AZURE_DATA_FACTORY_ERROR) |
||||||
|
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") |
||||||
|
public Result listDataFactory(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { |
||||||
|
List<String> factoryNames = cloudService.listDataFactory(loginUser); |
||||||
|
return success(Status.SUCCESS.getMsg(), factoryNames); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* get resourceGroup list |
||||||
|
* |
||||||
|
* @param loginUser login user |
||||||
|
* @return resourceGroup list |
||||||
|
*/ |
||||||
|
@Operation(summary = "listResourceGroup", description = "LIST_RESOURCE_GROUP") |
||||||
|
@GetMapping(value = "/azure/datafactory/resourceGroups") |
||||||
|
@ResponseStatus(HttpStatus.OK) |
||||||
|
@ApiException(LIST_AZURE_RESOURCE_GROUP_ERROR) |
||||||
|
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") |
||||||
|
public Result listResourceGroup(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) { |
||||||
|
List<String> resourceGroupNames = cloudService.listResourceGroup(loginUser); |
||||||
|
return success(Status.SUCCESS.getMsg(), resourceGroupNames); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* get resourceGroup list |
||||||
|
* |
||||||
|
* @param loginUser login user |
||||||
|
* @return resourceGroup list |
||||||
|
*/ |
||||||
|
@Operation(summary = "listPipeline", description = "LIST_PIPELINE") |
||||||
|
@GetMapping(value = "/azure/datafactory/pipelines") |
||||||
|
@ResponseStatus(HttpStatus.OK) |
||||||
|
@ApiException(LIST_AZURE_DATA_FACTORY_PIPELINE_ERROR) |
||||||
|
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") |
||||||
|
public Result listPipeline(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser, |
||||||
|
@RequestParam("factoryName") String factoryName, |
||||||
|
@RequestParam("resourceGroupName") String resourceGroupName) { |
||||||
|
List<String> pipelineNames = cloudService.listPipeline(loginUser, factoryName, resourceGroupName); |
||||||
|
return success(Status.SUCCESS.getMsg(), pipelineNames); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,31 @@ |
|||||||
|
/* |
||||||
|
* 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.api.service; |
||||||
|
|
||||||
|
import org.apache.dolphinscheduler.dao.entity.User; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public interface CloudService { |
||||||
|
|
||||||
|
List<String> listDataFactory(User loginUser); |
||||||
|
|
||||||
|
List<String> listResourceGroup(User loginUser); |
||||||
|
|
||||||
|
List<String> listPipeline(User loginUser, String factoryName, String resourceGroupName); |
||||||
|
} |
@ -0,0 +1,88 @@ |
|||||||
|
/* |
||||||
|
* 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.api.service.impl; |
||||||
|
|
||||||
|
import org.apache.dolphinscheduler.api.service.CloudService; |
||||||
|
import org.apache.dolphinscheduler.common.utils.PropertyUtils; |
||||||
|
import org.apache.dolphinscheduler.dao.entity.User; |
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.TaskConstants; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import com.azure.core.http.rest.PagedIterable; |
||||||
|
import com.azure.core.management.AzureEnvironment; |
||||||
|
import com.azure.core.management.profile.AzureProfile; |
||||||
|
import com.azure.identity.ClientSecretCredential; |
||||||
|
import com.azure.identity.ClientSecretCredentialBuilder; |
||||||
|
import com.azure.resourcemanager.AzureResourceManager; |
||||||
|
import com.azure.resourcemanager.datafactory.DataFactoryManager; |
||||||
|
import com.azure.resourcemanager.datafactory.models.Factories; |
||||||
|
import com.azure.resourcemanager.datafactory.models.PipelineResource; |
||||||
|
import com.azure.resourcemanager.resources.models.ResourceGroups; |
||||||
|
|
||||||
|
@Service |
||||||
|
public class CloudServiceImpl extends BaseServiceImpl implements CloudService { |
||||||
|
|
||||||
|
private static final String AZURE_CLIENT_ID = PropertyUtils.getString(TaskConstants.AZURE_CLIENT_ID); |
||||||
|
private static final String AZURE_CLIENT_SECRET = PropertyUtils.getString(TaskConstants.AZURE_CLIENT_SECRET); |
||||||
|
private static final String AZURE_ACCESS_SUB_ID = PropertyUtils.getString(TaskConstants.AZURE_ACCESS_SUB_ID); |
||||||
|
private static final String AZURE_SECRET_TENANT_ID = PropertyUtils.getString(TaskConstants.AZURE_SECRET_TENANT_ID); |
||||||
|
private static final AzureProfile profile = |
||||||
|
new AzureProfile(AZURE_SECRET_TENANT_ID, AZURE_ACCESS_SUB_ID, AzureEnvironment.AZURE); |
||||||
|
private static final ClientSecretCredential clientSecretCredential = new ClientSecretCredentialBuilder() |
||||||
|
.clientId(AZURE_CLIENT_ID) |
||||||
|
.clientSecret(AZURE_CLIENT_SECRET) |
||||||
|
.tenantId(AZURE_SECRET_TENANT_ID) |
||||||
|
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) |
||||||
|
.build(); |
||||||
|
private static final DataFactoryManager manager; |
||||||
|
private static final AzureResourceManager azure; |
||||||
|
|
||||||
|
static { |
||||||
|
manager = DataFactoryManager.authenticate(clientSecretCredential, profile); |
||||||
|
azure = AzureResourceManager.authenticate(clientSecretCredential, profile).withDefaultSubscription(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<String> listDataFactory(User loginUser) { |
||||||
|
Factories factories = manager.factories(); |
||||||
|
List<String> names = new ArrayList<>(); |
||||||
|
factories.list().stream().forEach(e -> names.add(e.name())); |
||||||
|
return names; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<String> listResourceGroup(User loginUser) { |
||||||
|
ResourceGroups resourceGroups = azure.resourceGroups(); |
||||||
|
List<String> names = new ArrayList<>(); |
||||||
|
resourceGroups.list().stream().forEach(e -> names.add(e.name())); |
||||||
|
return names; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<String> listPipeline(User loginUser, String factoryName, String resourceGroupName) { |
||||||
|
PagedIterable<PipelineResource> pipelineResources = |
||||||
|
manager.pipelines().listByFactory(resourceGroupName, factoryName); |
||||||
|
List<String> names = new ArrayList<>(); |
||||||
|
pipelineResources.stream().forEach(e -> names.add(e.name())); |
||||||
|
return names; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
LICENSE-msal4j.txtCopyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,14 @@ |
|||||||
|
Copyright(c) 2016 Microsoft Corporation |
||||||
|
All rights reserved. |
||||||
|
|
||||||
|
MIT License |
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), |
||||||
|
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||||
|
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
||||||
|
IN THE SOFTWARE. |
@ -0,0 +1,57 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<!-- |
||||||
|
~ 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. |
||||||
|
--> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
<parent> |
||||||
|
<groupId>org.apache.dolphinscheduler</groupId> |
||||||
|
<artifactId>dolphinscheduler-task-plugin</artifactId> |
||||||
|
<version>dev-SNAPSHOT</version> |
||||||
|
</parent> |
||||||
|
|
||||||
|
<artifactId>dolphinscheduler-task-datafactory</artifactId> |
||||||
|
<packaging>jar</packaging> |
||||||
|
|
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>org.apache.dolphinscheduler</groupId> |
||||||
|
<artifactId>dolphinscheduler-spi</artifactId> |
||||||
|
<scope>provided</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.apache.dolphinscheduler</groupId> |
||||||
|
<artifactId>dolphinscheduler-task-api</artifactId> |
||||||
|
<scope>provided</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.apache.dolphinscheduler</groupId> |
||||||
|
<artifactId>dolphinscheduler-common</artifactId> |
||||||
|
<scope>provided</scope> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>com.azure.resourcemanager</groupId> |
||||||
|
<artifactId>azure-resourcemanager-datafactory</artifactId> |
||||||
|
<version>1.0.0-beta.19</version> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>com.azure</groupId> |
||||||
|
<artifactId>azure-identity</artifactId> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
|
||||||
|
</project> |
@ -0,0 +1,148 @@ |
|||||||
|
/* |
||||||
|
* 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.task.datafactory; |
||||||
|
|
||||||
|
import org.apache.dolphinscheduler.common.utils.PropertyUtils; |
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.TaskConstants; |
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils; |
||||||
|
|
||||||
|
import java.util.Arrays; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
import lombok.SneakyThrows; |
||||||
|
|
||||||
|
import org.slf4j.Logger; |
||||||
|
import org.slf4j.LoggerFactory; |
||||||
|
|
||||||
|
import com.azure.core.management.AzureEnvironment; |
||||||
|
import com.azure.core.management.profile.AzureProfile; |
||||||
|
import com.azure.identity.ClientSecretCredential; |
||||||
|
import com.azure.identity.ClientSecretCredentialBuilder; |
||||||
|
import com.azure.resourcemanager.datafactory.DataFactoryManager; |
||||||
|
import com.azure.resourcemanager.datafactory.models.CreateRunResponse; |
||||||
|
import com.azure.resourcemanager.datafactory.models.PipelineResource; |
||||||
|
import com.azure.resourcemanager.datafactory.models.PipelineRun; |
||||||
|
import com.azure.resourcemanager.datafactory.models.PipelineRuns; |
||||||
|
|
||||||
|
@Data |
||||||
|
public class DatafactoryHook { |
||||||
|
|
||||||
|
public static DatafactoryStatus[] taskFinishFlags = |
||||||
|
{DatafactoryStatus.Failed, DatafactoryStatus.Succeeded, DatafactoryStatus.Cancelled}; |
||||||
|
protected final Logger logger = |
||||||
|
LoggerFactory.getLogger(String.format(TaskConstants.TASK_LOG_LOGGER_NAME_FORMAT, getClass())); |
||||||
|
private final int QUERY_INTERVAL = PropertyUtils.getInt(TaskConstants.QUERY_INTERVAL, 10000); |
||||||
|
private DataFactoryManager client; |
||||||
|
private static AzureProfile profile; |
||||||
|
private static ClientSecretCredential credential; |
||||||
|
private String runId; |
||||||
|
|
||||||
|
public DatafactoryHook() { |
||||||
|
logger.info("initDatafactoryClient ......"); |
||||||
|
client = createClient(); |
||||||
|
} |
||||||
|
|
||||||
|
protected static DataFactoryManager createClient() { |
||||||
|
final String AZURE_ACCESS_SUB_ID = PropertyUtils.getString(TaskConstants.AZURE_ACCESS_SUB_ID); |
||||||
|
final String AZURE_SECRET_TENANT_ID = PropertyUtils.getString(TaskConstants.AZURE_SECRET_TENANT_ID); |
||||||
|
final String AZURE_CLIENT_ID = PropertyUtils.getString(TaskConstants.AZURE_CLIENT_ID); |
||||||
|
final String AZURE_CLIENT_SECRET = PropertyUtils.getString(TaskConstants.AZURE_CLIENT_SECRET); |
||||||
|
profile = |
||||||
|
new AzureProfile(AZURE_SECRET_TENANT_ID, AZURE_ACCESS_SUB_ID, AzureEnvironment.AZURE); |
||||||
|
credential = new ClientSecretCredentialBuilder() |
||||||
|
.clientId(AZURE_CLIENT_ID) |
||||||
|
.clientSecret(AZURE_CLIENT_SECRET) |
||||||
|
.tenantId(AZURE_SECRET_TENANT_ID) |
||||||
|
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) |
||||||
|
.build(); |
||||||
|
return DataFactoryManager.authenticate(credential, profile); |
||||||
|
} |
||||||
|
|
||||||
|
public Boolean startDatafactoryTask(DatafactoryParameters parameters) { |
||||||
|
logger.info("initDatafactoryTask ......"); |
||||||
|
PipelineResource pipelineResource = getPipelineResource(parameters); |
||||||
|
if (pipelineResource == null) { |
||||||
|
return false; |
||||||
|
} |
||||||
|
logger.info("startDatafactoryTask ......"); |
||||||
|
CreateRunResponse run = pipelineResource.createRun(); |
||||||
|
if (StringUtils.isEmpty(run.runId())) { |
||||||
|
return false; |
||||||
|
} |
||||||
|
runId = run.runId(); |
||||||
|
parameters.setRunId(runId); |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
public Boolean cancelDatafactoryTask(DatafactoryParameters parameters) { |
||||||
|
logger.info("cancelTask ......"); |
||||||
|
PipelineRuns pipelineRuns = client.pipelineRuns(); |
||||||
|
try { |
||||||
|
pipelineRuns.cancel(parameters.getResourceGroupName(), parameters.getFactoryName(), runId); |
||||||
|
} catch (RuntimeException e) { |
||||||
|
logger.error("failed to cancel datafactory task: " + e.getMessage()); |
||||||
|
return false; |
||||||
|
} |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
public DatafactoryStatus queryDatafactoryTaskStatus(DatafactoryParameters parameters) { |
||||||
|
logger.info("queryDatafactoryTaskStatus ......"); |
||||||
|
|
||||||
|
PipelineRuns pipelineRuns = client.pipelineRuns(); |
||||||
|
PipelineRun pipelineRun = |
||||||
|
pipelineRuns.get(parameters.getResourceGroupName(), parameters.getFactoryName(), runId); |
||||||
|
|
||||||
|
if (pipelineRun != null) { |
||||||
|
logger.info("queryDatafactoryTaskStatus ......{}", pipelineRun.status()); |
||||||
|
return DatafactoryStatus.valueOf(pipelineRun.status()); |
||||||
|
} |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
private PipelineResource getPipelineResource(DatafactoryParameters parameters) { |
||||||
|
return client.pipelines().get(parameters.getResourceGroupName(), parameters.getFactoryName(), |
||||||
|
parameters.getPipelineName()); |
||||||
|
} |
||||||
|
|
||||||
|
@SneakyThrows |
||||||
|
public Boolean queryStatus(DatafactoryParameters parameters) { |
||||||
|
List<DatafactoryStatus> stopStatusSet = Arrays.asList(taskFinishFlags); |
||||||
|
int maxRetry = 5; |
||||||
|
while (maxRetry > 0) { |
||||||
|
DatafactoryStatus status = queryDatafactoryTaskStatus(parameters); |
||||||
|
|
||||||
|
if (status == null) { |
||||||
|
maxRetry--; |
||||||
|
continue; |
||||||
|
} |
||||||
|
|
||||||
|
if (stopStatusSet.contains(status)) { |
||||||
|
if (status.equals(DatafactoryStatus.Succeeded)) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
return false; |
||||||
|
} |
||||||
|
logger.debug("wait {}ms to recheck finish status....", QUERY_INTERVAL); |
||||||
|
Thread.sleep(QUERY_INTERVAL); |
||||||
|
} |
||||||
|
return false; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,45 @@ |
|||||||
|
/* |
||||||
|
* 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.task.datafactory; |
||||||
|
|
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters; |
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils; |
||||||
|
|
||||||
|
import lombok.Getter; |
||||||
|
import lombok.NoArgsConstructor; |
||||||
|
import lombok.Setter; |
||||||
|
import lombok.ToString; |
||||||
|
|
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
@NoArgsConstructor |
||||||
|
@ToString |
||||||
|
public class DatafactoryParameters extends AbstractParameters { |
||||||
|
|
||||||
|
private String factoryName; |
||||||
|
private String resourceGroupName; |
||||||
|
private String pipelineName; |
||||||
|
private String runId; |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean checkParameters() { |
||||||
|
return StringUtils.isNotEmpty(factoryName) && StringUtils.isNotEmpty(resourceGroupName) |
||||||
|
&& StringUtils.isNotEmpty(pipelineName); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,38 @@ |
|||||||
|
/* |
||||||
|
* 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.task.datafactory; |
||||||
|
|
||||||
|
public enum DatafactoryStatus { |
||||||
|
|
||||||
|
Queued, |
||||||
|
InProgress, |
||||||
|
Succeeded, |
||||||
|
Failed, |
||||||
|
Canceling, |
||||||
|
Cancelled, |
||||||
|
; |
||||||
|
|
||||||
|
/** |
||||||
|
* Gets the status property: The status of a pipeline run. Possible values: Queued, InProgress, Succeeded, Failed, |
||||||
|
* Canceling, Cancelled. |
||||||
|
* |
||||||
|
* @return the status value. |
||||||
|
*/ |
||||||
|
DatafactoryStatus() { |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,118 @@ |
|||||||
|
/* |
||||||
|
* 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.task.datafactory; |
||||||
|
|
||||||
|
import org.apache.dolphinscheduler.common.utils.JSONUtils; |
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.AbstractRemoteTask; |
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.TaskConstants; |
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.TaskException; |
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext; |
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils; |
||||||
|
|
||||||
|
import java.util.Collections; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class DatafactoryTask extends AbstractRemoteTask { |
||||||
|
|
||||||
|
private final TaskExecutionContext taskExecutionContext; |
||||||
|
private DatafactoryParameters parameters; |
||||||
|
private DatafactoryHook hook; |
||||||
|
|
||||||
|
public DatafactoryTask(TaskExecutionContext taskExecutionContext) { |
||||||
|
super(taskExecutionContext); |
||||||
|
this.taskExecutionContext = taskExecutionContext; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<String> getApplicationIds() throws TaskException { |
||||||
|
return Collections.emptyList(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void init() { |
||||||
|
parameters = JSONUtils.parseObject(taskExecutionContext.getTaskParams(), DatafactoryParameters.class); |
||||||
|
logger.info("Initialize Datafactory task params {}", JSONUtils.toPrettyJsonString(parameters)); |
||||||
|
hook = new DatafactoryHook(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void submitApplication() throws TaskException { |
||||||
|
try { |
||||||
|
// start task
|
||||||
|
exitStatusCode = startDatafactoryTask(); |
||||||
|
setExitStatusCode(exitStatusCode); |
||||||
|
} catch (Exception e) { |
||||||
|
setExitStatusCode(TaskConstants.EXIT_CODE_FAILURE); |
||||||
|
throw new TaskException("data factory start task error", e); |
||||||
|
} |
||||||
|
// set runId to the appIds if start success
|
||||||
|
setAppIds(parameters.getRunId()); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void cancelApplication() throws TaskException { |
||||||
|
checkApplicationId(); |
||||||
|
hook.cancelDatafactoryTask(parameters); |
||||||
|
exitStatusCode = TaskConstants.EXIT_CODE_KILL; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void trackApplicationStatus() throws TaskException { |
||||||
|
checkApplicationId(); |
||||||
|
Boolean isFinishedSuccessfully; |
||||||
|
isFinishedSuccessfully = hook.queryStatus(parameters); |
||||||
|
if (!isFinishedSuccessfully) { |
||||||
|
exitStatusCode = TaskConstants.EXIT_CODE_FAILURE; |
||||||
|
} else { |
||||||
|
exitStatusCode = TaskConstants.EXIT_CODE_SUCCESS; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* check datafactory applicationId or get it from appId |
||||||
|
*/ |
||||||
|
private void checkApplicationId() { |
||||||
|
String taskExecArn = hook.getRunId(); |
||||||
|
if (StringUtils.isEmpty(taskExecArn)) { |
||||||
|
if (StringUtils.isEmpty(getAppIds())) { |
||||||
|
throw new TaskException("datafactory runId is null, not created yet"); |
||||||
|
} |
||||||
|
hook.setRunId(getAppIds()); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public int startDatafactoryTask() { |
||||||
|
Boolean isStartSuccessfully = hook.startDatafactoryTask(parameters); |
||||||
|
if (!isStartSuccessfully) { |
||||||
|
return TaskConstants.EXIT_CODE_FAILURE; |
||||||
|
} |
||||||
|
return TaskConstants.EXIT_CODE_SUCCESS; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public DatafactoryParameters getParameters() { |
||||||
|
return parameters; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -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. |
||||||
|
*/ |
||||||
|
|
||||||
|
package org.apache.dolphinscheduler.plugin.task.datafactory; |
||||||
|
|
||||||
|
import org.apache.dolphinscheduler.common.utils.JSONUtils; |
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.TaskChannel; |
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext; |
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters; |
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode; |
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.parameters.resource.ResourceParametersHelper; |
||||||
|
|
||||||
|
public class DatafactoryTaskChannel implements TaskChannel { |
||||||
|
|
||||||
|
@Override |
||||||
|
public void cancelApplication(boolean status) { |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public DatafactoryTask createTask(TaskExecutionContext taskRequest) { |
||||||
|
return new DatafactoryTask(taskRequest); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public AbstractParameters parseParameters(ParametersNode parametersNode) { |
||||||
|
return JSONUtils.parseObject(parametersNode.getTaskParams(), DatafactoryParameters.class); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public ResourceParametersHelper getResources(String parameters) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,46 @@ |
|||||||
|
/* |
||||||
|
* 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.task.datafactory; |
||||||
|
|
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.TaskChannel; |
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.TaskChannelFactory; |
||||||
|
import org.apache.dolphinscheduler.spi.params.base.PluginParams; |
||||||
|
|
||||||
|
import java.util.Collections; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
import com.google.auto.service.AutoService; |
||||||
|
|
||||||
|
@AutoService(TaskChannelFactory.class) |
||||||
|
public class DatafactoryTaskChannelFactory implements TaskChannelFactory { |
||||||
|
|
||||||
|
@Override |
||||||
|
public TaskChannel create() { |
||||||
|
return new DatafactoryTaskChannel(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String getName() { |
||||||
|
return "DATA_FACTORY"; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<PluginParams> getParams() { |
||||||
|
return Collections.emptyList(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,120 @@ |
|||||||
|
/* |
||||||
|
* 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.task.datafactory; |
||||||
|
|
||||||
|
import static org.mockito.ArgumentMatchers.any; |
||||||
|
import static org.mockito.Mockito.mock; |
||||||
|
import static org.mockito.Mockito.mockStatic; |
||||||
|
import static org.mockito.Mockito.when; |
||||||
|
|
||||||
|
import org.apache.dolphinscheduler.common.utils.JSONUtils; |
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.TaskConstants; |
||||||
|
import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext; |
||||||
|
|
||||||
|
import org.junit.jupiter.api.Assertions; |
||||||
|
import org.junit.jupiter.api.BeforeEach; |
||||||
|
import org.junit.jupiter.api.Test; |
||||||
|
import org.junit.jupiter.api.extension.ExtendWith; |
||||||
|
import org.mockito.Mock; |
||||||
|
import org.mockito.MockedStatic; |
||||||
|
import org.mockito.Mockito; |
||||||
|
import org.mockito.junit.jupiter.MockitoExtension; |
||||||
|
|
||||||
|
import com.azure.resourcemanager.datafactory.DataFactoryManager; |
||||||
|
import com.azure.resourcemanager.datafactory.models.CreateRunResponse; |
||||||
|
import com.azure.resourcemanager.datafactory.models.PipelineResource; |
||||||
|
import com.azure.resourcemanager.datafactory.models.Pipelines; |
||||||
|
|
||||||
|
@ExtendWith(MockitoExtension.class) |
||||||
|
public class DatafactoryTaskTest { |
||||||
|
|
||||||
|
private static final String mockRunId = |
||||||
|
"3c7182f4-d107-43c7-af2a-8c7b3ed1d614"; |
||||||
|
|
||||||
|
DatafactoryTask datafactoryTask; |
||||||
|
|
||||||
|
@Mock |
||||||
|
DataFactoryManager client; |
||||||
|
MockedStatic<DatafactoryHook> datafactoryHookMockedStatic; |
||||||
|
|
||||||
|
@BeforeEach |
||||||
|
public void before() throws IllegalAccessException { |
||||||
|
client = mock(DataFactoryManager.class); |
||||||
|
datafactoryHookMockedStatic = mockStatic(DatafactoryHook.class); |
||||||
|
when(DatafactoryHook.createClient()).thenReturn(client); |
||||||
|
|
||||||
|
DatafactoryParameters datafactoryParameters = new DatafactoryParameters(); |
||||||
|
datafactoryTask = initTask(datafactoryParameters); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
public void testConvertParam() { |
||||||
|
DatafactoryParameters parameters = castParam(); |
||||||
|
Assertions.assertEquals("whale1", parameters.getFactoryName()); |
||||||
|
Assertions.assertEquals("factory1", parameters.getResourceGroupName()); |
||||||
|
Assertions.assertEquals("CopyPipeline_ps8", parameters.getPipelineName()); |
||||||
|
datafactoryHookMockedStatic.close(); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
public void testCheckCreateTask() { |
||||||
|
DatafactoryHook hook = new DatafactoryHook(); |
||||||
|
DataFactoryManager client1 = DatafactoryHook.createClient(); |
||||||
|
hook.setClient(client1); |
||||||
|
|
||||||
|
PipelineResource pipelineResource = mock(PipelineResource.class); |
||||||
|
Pipelines pipelines = mock(Pipelines.class); |
||||||
|
when(client1.pipelines()).thenReturn(pipelines); |
||||||
|
when(pipelines.get(any(), any(), any())).thenReturn(pipelineResource); |
||||||
|
|
||||||
|
CreateRunResponse response = mock(CreateRunResponse.class); |
||||||
|
when(pipelineResource.createRun()).thenReturn(response); |
||||||
|
when(response.runId()).thenReturn(mockRunId); |
||||||
|
hook.startDatafactoryTask(castParam()); |
||||||
|
Assertions.assertEquals(mockRunId, hook.getRunId()); |
||||||
|
datafactoryHookMockedStatic.close(); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
public void testCancelTask() { |
||||||
|
datafactoryTask.cancelApplication(); |
||||||
|
Assertions.assertEquals(datafactoryTask.getExitStatusCode(), TaskConstants.EXIT_CODE_KILL); |
||||||
|
datafactoryHookMockedStatic.close(); |
||||||
|
} |
||||||
|
|
||||||
|
private DatafactoryParameters castParam() { |
||||||
|
String input = |
||||||
|
"{\"localParams\":[],\"resourceList\":[],\"factoryName\":\"whale1\",\"resourceGroupName\":\"factory1\",\"pipelineName\":\"CopyPipeline_ps8\"}"; |
||||||
|
return JSONUtils.parseObject(input, DatafactoryParameters.class); |
||||||
|
} |
||||||
|
|
||||||
|
private DatafactoryTask initTask(DatafactoryParameters DatasyncParameters) { |
||||||
|
TaskExecutionContext taskExecutionContext = createContext(DatasyncParameters); |
||||||
|
DatafactoryTask task = new DatafactoryTask(taskExecutionContext); |
||||||
|
task.init(); |
||||||
|
task.getHook().setRunId(mockRunId); |
||||||
|
return task; |
||||||
|
} |
||||||
|
|
||||||
|
public TaskExecutionContext createContext(DatafactoryParameters datafactoryParameters) { |
||||||
|
String parameters = JSONUtils.toJsonString(datafactoryParameters); |
||||||
|
TaskExecutionContext taskExecutionContext = Mockito.mock(TaskExecutionContext.class); |
||||||
|
Mockito.when(taskExecutionContext.getTaskParams()).thenReturn(parameters); |
||||||
|
return taskExecutionContext; |
||||||
|
} |
||||||
|
} |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 3.6 KiB |
@ -0,0 +1,41 @@ |
|||||||
|
/* |
||||||
|
* 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. |
||||||
|
*/ |
||||||
|
|
||||||
|
import { axios } from '@/service/service' |
||||||
|
import { DataFactoryReq } from './types' |
||||||
|
|
||||||
|
export function queryDataFactoryFactories(): any { |
||||||
|
return axios({ |
||||||
|
url: '/cloud/azure/datafactory/factories', |
||||||
|
method: 'get' |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
export function queryDataFactoryResourceGroups(): any { |
||||||
|
return axios({ |
||||||
|
url: '/cloud/azure/datafactory/resourceGroups', |
||||||
|
method: 'get' |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
export function queryDataFactoryPipelines(params: DataFactoryReq): any { |
||||||
|
return axios({ |
||||||
|
url: '/cloud/azure/datafactory/pipelines', |
||||||
|
method: 'get', |
||||||
|
params |
||||||
|
}) |
||||||
|
} |
@ -0,0 +1,23 @@ |
|||||||
|
/* |
||||||
|
* 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. |
||||||
|
*/ |
||||||
|
|
||||||
|
interface DataFactoryReq { |
||||||
|
factoryName: string |
||||||
|
resourceGroupName: string |
||||||
|
} |
||||||
|
|
||||||
|
export { DataFactoryReq } |
@ -0,0 +1,152 @@ |
|||||||
|
/* |
||||||
|
* 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. |
||||||
|
*/ |
||||||
|
import { |
||||||
|
queryDataFactoryFactories, |
||||||
|
queryDataFactoryPipelines, |
||||||
|
queryDataFactoryResourceGroups |
||||||
|
} from '@/service/modules/azure' |
||||||
|
import { onMounted, ref, watch } from 'vue' |
||||||
|
import { useI18n } from 'vue-i18n' |
||||||
|
import { useCustomParams } from '.' |
||||||
|
import type { IJsonItem } from '../types' |
||||||
|
|
||||||
|
export function useDataFactory(model: { [field: string]: any }): IJsonItem[] { |
||||||
|
const { t } = useI18n() |
||||||
|
|
||||||
|
const factoryLoading = ref(false) |
||||||
|
const resourceGroupLoading = ref(false) |
||||||
|
const pipelineLoading = ref(false) |
||||||
|
|
||||||
|
const factoryOptions = ref([] as { label: string; value: number }[]) |
||||||
|
const resourceGroupOptions = ref([] as { label: string; value: number }[]) |
||||||
|
const pipelineOptions = ref([] as { label: string; value: number }[]) |
||||||
|
|
||||||
|
const getFactoryOptions = async () => { |
||||||
|
if (factoryLoading.value) return |
||||||
|
factoryLoading.value = true |
||||||
|
const factories = await queryDataFactoryFactories() |
||||||
|
factoryOptions.value = factories.map((factory: string) => ({ |
||||||
|
label: factory, |
||||||
|
value: factory |
||||||
|
})) |
||||||
|
factoryLoading.value = false |
||||||
|
} |
||||||
|
|
||||||
|
const getResourceGroupName = async () => { |
||||||
|
if (resourceGroupLoading.value) return |
||||||
|
resourceGroupLoading.value = true |
||||||
|
const groupNames = await queryDataFactoryResourceGroups() |
||||||
|
resourceGroupOptions.value = groupNames.map((groupName: string) => ({ |
||||||
|
label: groupName, |
||||||
|
value: groupName |
||||||
|
})) |
||||||
|
resourceGroupLoading.value = false |
||||||
|
} |
||||||
|
|
||||||
|
const getPipelineName = async ( |
||||||
|
factoryName: string, |
||||||
|
resourceGroupName: string |
||||||
|
) => { |
||||||
|
if (pipelineLoading.value) return |
||||||
|
pipelineLoading.value = true |
||||||
|
const pipelineNames = await queryDataFactoryPipelines({ |
||||||
|
factoryName, |
||||||
|
resourceGroupName |
||||||
|
}) |
||||||
|
pipelineOptions.value = pipelineNames.map((pipelineName: string) => ({ |
||||||
|
label: pipelineName, |
||||||
|
value: pipelineName |
||||||
|
})) |
||||||
|
pipelineLoading.value = false |
||||||
|
} |
||||||
|
|
||||||
|
const onChange = () => { |
||||||
|
model['pipelineName'] = '' |
||||||
|
if (model['factoryName'] && model['resourceGroupName']) { |
||||||
|
getPipelineName(model['factoryName'], model['resourceGroupName']) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
watch( |
||||||
|
() => model['pipelineName'], |
||||||
|
() => { |
||||||
|
if (model['pipelineName'] && pipelineOptions.value.length === 0) { |
||||||
|
getPipelineName(model['factoryName'], model['resourceGroupName']) |
||||||
|
} |
||||||
|
} |
||||||
|
) |
||||||
|
|
||||||
|
onMounted(() => { |
||||||
|
getFactoryOptions() |
||||||
|
getResourceGroupName() |
||||||
|
}) |
||||||
|
|
||||||
|
return [ |
||||||
|
{ |
||||||
|
type: 'select', |
||||||
|
field: 'factoryName', |
||||||
|
span: 24, |
||||||
|
name: t('project.node.factory_name'), |
||||||
|
options: factoryOptions, |
||||||
|
props: { |
||||||
|
'on-update:value': onChange, |
||||||
|
loading: factoryLoading |
||||||
|
}, |
||||||
|
validate: { |
||||||
|
trigger: ['input', 'trigger'], |
||||||
|
required: true, |
||||||
|
message: t('project.node.factory_tips') |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'select', |
||||||
|
field: 'resourceGroupName', |
||||||
|
span: 24, |
||||||
|
name: t('project.node.resource_group_name'), |
||||||
|
options: resourceGroupOptions, |
||||||
|
props: { |
||||||
|
'on-update:value': onChange, |
||||||
|
loading: resourceGroupLoading |
||||||
|
}, |
||||||
|
validate: { |
||||||
|
trigger: ['input', 'trigger'], |
||||||
|
required: true, |
||||||
|
message: t('project.node.resource_group_tips') |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'select', |
||||||
|
field: 'pipelineName', |
||||||
|
span: 24, |
||||||
|
name: t('project.node.pipeline_name'), |
||||||
|
options: pipelineOptions, |
||||||
|
props: { |
||||||
|
loading: pipelineLoading |
||||||
|
}, |
||||||
|
validate: { |
||||||
|
trigger: ['input', 'trigger'], |
||||||
|
required: true, |
||||||
|
message: t('project.node.pipeline_tips') |
||||||
|
} |
||||||
|
}, |
||||||
|
...useCustomParams({ |
||||||
|
model, |
||||||
|
field: 'localParams', |
||||||
|
isSimple: true |
||||||
|
}) |
||||||
|
] |
||||||
|
} |
@ -0,0 +1,72 @@ |
|||||||
|
/* |
||||||
|
* 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. |
||||||
|
*/ |
||||||
|
|
||||||
|
import { reactive } from 'vue' |
||||||
|
import * as Fields from '../fields/index' |
||||||
|
import type { IJsonItem, INodeData } from '../types' |
||||||
|
import { ITaskData } from '../types' |
||||||
|
|
||||||
|
export function useDataFactory({ |
||||||
|
projectCode, |
||||||
|
from = 0, |
||||||
|
readonly, |
||||||
|
data |
||||||
|
}: { |
||||||
|
projectCode: number |
||||||
|
from?: number |
||||||
|
readonly?: boolean |
||||||
|
data?: ITaskData |
||||||
|
}) { |
||||||
|
const model = reactive({ |
||||||
|
name: '', |
||||||
|
taskType: 'DATA_FACTORY', |
||||||
|
flag: 'YES', |
||||||
|
description: '', |
||||||
|
timeoutFlag: false, |
||||||
|
localParams: [], |
||||||
|
environmentCode: null, |
||||||
|
failRetryInterval: 1, |
||||||
|
failRetryTimes: 0, |
||||||
|
workerGroup: 'default', |
||||||
|
delayTime: 0, |
||||||
|
timeout: 30, |
||||||
|
timeoutNotifyStrategy: ['WARN'], |
||||||
|
factoryName: '', |
||||||
|
resourceGroupName: '', |
||||||
|
pipelineName: '' |
||||||
|
} as INodeData) |
||||||
|
|
||||||
|
return { |
||||||
|
json: [ |
||||||
|
Fields.useName(from), |
||||||
|
...Fields.useTaskDefinition({ projectCode, from, readonly, data, model }), |
||||||
|
Fields.useRunFlag(), |
||||||
|
Fields.useCache(), |
||||||
|
Fields.useDescription(), |
||||||
|
Fields.useTaskPriority(), |
||||||
|
Fields.useWorkerGroup(), |
||||||
|
Fields.useEnvironmentName(model, !data?.id), |
||||||
|
...Fields.useTaskGroup(model, projectCode), |
||||||
|
...Fields.useFailed(), |
||||||
|
Fields.useDelayTime(model), |
||||||
|
...Fields.useTimeoutAlarm(model), |
||||||
|
...Fields.useDataFactory(model), |
||||||
|
Fields.usePreTasks() |
||||||
|
] as IJsonItem[], |
||||||
|
model |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue