create_data_integration_flow
¶
create_data_integration_flow(
instance_id: UUID,
name: DataIntegrationFlowName,
sources: DataIntegrationFlowSourceList,
transformation: DataIntegrationFlowTransformation,
target: DataIntegrationFlowTarget,
*,
config_overrides: Optional[SupplyChainClientConfig] = None,
tags: Optional[TagMap] = None,
) -> CreateDataIntegrationFlowResponse
Enables you to programmatically create a data pipeline to ingest data from source systems such as Amazon S3 buckets, to a predefined Amazon Web Services Supply Chain dataset (product, inbound_order) or a temporary dataset along with the data transformation query provided with the API.
Parameters:
-
instance_id(UUID) –The Amazon Web Services Supply Chain instance identifier.
-
name(DataIntegrationFlowName) –Name of the DataIntegrationFlow.
-
sources(DataIntegrationFlowSourceList) –The source configurations for DataIntegrationFlow.
-
transformation(DataIntegrationFlowTransformation) –The transformation configurations for DataIntegrationFlow.
-
target(DataIntegrationFlowTarget) –The target configurations for DataIntegrationFlow.
-
tags(Optional[TagMap], default:None) –The tags of the DataIntegrationFlow to be created
Raises:
-
AccessDeniedException–You do not have the required privileges to perform this action.
-
ConflictException–Updating or deleting a resource can cause an inconsistent state.
-
InternalServerException–Unexpected error during processing of request.
-
ResourceNotFoundException–Request references a resource which does not exist.
-
ServiceQuotaExceededException–Request would cause a service quota to be exceeded.
-
ThrottlingException–Request was denied due to request throttling.
-
ValidationException–The input does not satisfy the constraints specified by an AWS service.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Successful CreateDataIntegrationFlow for s3 to dataset flow
>>> client.create_data_integration_flow(instance_id='8850c54e-e187-4fa7-89d4-6370f165174d', name='testStagingFlow', sources=[{'sourceType': 'S3', 'sourceName': 'testSourceName', 's3Source': {'bucketName': 'aws-supply-chain-data-b8c7bb28-a576-4334-b481-6d6e8e47371f', 'prefix': 'example-prefix'}}], transformation={'transformationType': 'SQL', 'sqlTransformation': {'query': 'SELECT * FROM testSourceName'}}, target={'targetType': 'DATASET', 'datasetTarget': {'datasetIdentifier': 'arn:aws:scn:us-east-1:123456789012:instance/8850c54e-e187-4fa7-89d4-6370f165174d/namespaces/default/datasets/my_staging_dataset'}}, tags={'tagKey1': 'tagValue1'})
Successful CreateDataIntegrationFlow for dataset to dataset flow
>>> client.create_data_integration_flow(instance_id='8850c54e-e187-4fa7-89d4-6370f165174d', name='trading-partner', sources=[{'sourceType': 'DATASET', 'sourceName': 'testSourceName1', 'datasetSource': {'datasetIdentifier': 'arn:aws:scn:us-east-1:123456789012:instance/8850c54e-e187-4fa7-89d4-6370f165174d/namespaces/default/datasets/my_staging_dataset1'}}, {'sourceType': 'DATASET', 'sourceName': 'testSourceName2', 'datasetSource': {'datasetIdentifier': 'arn:aws:scn:us-east-1:123456789012:instance/8850c54e-e187-4fa7-89d4-6370f165174d/namespaces/default/datasets/my_staging_dataset2'}}], transformation={'transformationType': 'SQL', 'sqlTransformation': {'query': 'SELECT S1.id AS id, S1.poc_org_unit_description AS description, S1.company_id AS company_id, S1.tpartner_type AS tpartner_type, S1.geo_id AS geo_id, S1.eff_start_date AS eff_start_date, S1.eff_end_date AS eff_end_date FROM testSourceName1 AS S1 LEFT JOIN testSourceName2 as S2 ON S1.id=S2.id'}}, target={'targetType': 'DATASET', 'datasetTarget': {'datasetIdentifier': 'arn:aws:scn:us-east-1:123456789012:instance/8850c54e-e187-4fa7-89d4-6370f165174d/namespaces/asc/datasets/trading_partner', 'options': {'loadType': 'REPLACE', 'dedupeRecords': True, 'dedupeStrategy': {'type': 'FIELD_PRIORITY', 'fieldPriority': {'fields': [{'name': 'eff_start_date', 'sortOrder': 'DESC'}]}}}}}, tags={'tagKey1': 'tagValue1'})
Source code in docs_src/capo_supplychain/_services/supply_chain.py
1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 | |