-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE:TMA-1676 - Update process model to support sync across domain
- Loading branch information
Sang Truong
committed
Jul 22, 2020
1 parent
0652a3c
commit 23cf623
Showing
6 changed files
with
120 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.1.12 | ||
2.1.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.7.21 | ||
3.7.22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# encoding: UTF-8 | ||
# frozen_string_literal: true | ||
# | ||
# Copyright (c) 2010-2020 GoodData Corporation. All rights reserved. | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
# frozen_string_literal: false | ||
|
||
module GoodData | ||
module Helpers | ||
class << self | ||
# Get a data source information from server by id | ||
# | ||
# @param [String] data_source_id The data source ID | ||
# @param [Object] client The Rest Client object | ||
# @return [Hash] Returns Data source | ||
def get_data_source_by_id(data_source_id, client) | ||
unless data_source_id.blank? | ||
uri = "/gdc/dataload/dataSources/#{data_source_id}" | ||
client.get(uri) | ||
end | ||
end | ||
|
||
# Verify to see if the data source exists in the domain using its alias | ||
# | ||
# @param [String] ds_alias The data source's alias | ||
# @param [Object] client The Rest Client object | ||
# @return [String] Id of the data source or failed with the reason | ||
def verify_data_source_alias(ds_alias, client) | ||
domain = client.connection.server.url | ||
fail "The data source alias is empty, check your data source configuration." unless ds_alias | ||
|
||
uri = "/gdc/dataload/dataSources/internal/availableAlias?alias=#{ds_alias[:alias]}" | ||
res = client.get(uri) | ||
fail "Unable to get information about the Data Source '#{ds_alias[:alias]}' in the domain '#{domain}'" unless res | ||
fail "Unable to find the #{ds_alias[:type]} Data Source '#{ds_alias[:alias]}' in the domain '#{domain}'" if res['availableAlias']['available'] | ||
|
||
ds_type = res['availableAlias']['existingDataSource']['type'] | ||
if ds_type && ds_type != ds_alias[:type] | ||
fail "Wrong Data Source type - the '#{ds_type}' type is expected but the Data Source '#{ds_alias[:alias]}' in the domain '#{domain}' has the '#{ds_alias[:type]}' type" | ||
else | ||
res['availableAlias']['existingDataSource']['id'] | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters