Skip to content

update_data_integration_flow

update_data_integration_flow(
    instance_id: UUID,
    name: DataIntegrationFlowName,
    *,
    config_overrides: Optional[SupplyChainClientConfig] = None,
    sources: Optional[DataIntegrationFlowSourceList] = None,
    transformation: Optional[DataIntegrationFlowTransformation] = None,
    target: Optional[DataIntegrationFlowTarget] = None,
) -> UpdateDataIntegrationFlowResponse

Enables you to programmatically update an existing data pipeline to ingest data from the 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:

Raises:

Examples:

Successful UpdateDataIntegrationFlow for s3 to dataset flow to update SQL transformation

>>> client.update_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 connection_id, bukrs AS id, txtmd AS description FROM testSourceName WHERE langu = 'E'"}}, target={'targetType': 'DATASET', 'datasetTarget': {'datasetIdentifier': 'arn:aws:scn:us-east-1:123456789012:instance/8850c54e-e187-4fa7-89d4-6370f165174d/namespaces/default/datasets/my_staging_dataset'}})
Successful UpdateDataIntegrationFlow for dataset to dataset flow to update sources
>>> client.update_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_updated'}}], 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': 'ASC'}]}}}}})
Source code in docs_src/capo_supplychain/_services/supply_chain.py
def update_data_integration_flow(
    self,
    instance_id: "capo_supplychain.types.uuid.UUID",
    name: "capo_supplychain.types.data_integration_flow_name.DataIntegrationFlowName",
    *,
    config_overrides: Optional[SupplyChainClientConfig] = None,
    sources: Optional[
        "capo_supplychain.types.data_integration_flow_source_list.DataIntegrationFlowSourceList"
    ] = None,
    transformation: Optional[
        "capo_supplychain.types.data_integration_flow_transformation.DataIntegrationFlowTransformation"
    ] = None,
    target: Optional[
        "capo_supplychain.types.data_integration_flow_target.DataIntegrationFlowTarget"
    ] = None,
) -> "capo_supplychain.types.update_data_integration_flow_response.UpdateDataIntegrationFlowResponse":
    """<p>Enables you to programmatically update an existing data pipeline to ingest data from the 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.</p>

    Args:
        instance_id: <p>The Amazon Web Services Supply Chain instance identifier.</p>
        name: <p>The name of the DataIntegrationFlow to be updated.</p>
        sources: <p>The new source configurations for the DataIntegrationFlow.</p>
        transformation: <p>The new transformation configurations for the DataIntegrationFlow.</p>
        target: <p>The new target configurations for the DataIntegrationFlow.</p>

    Raises:
        capo_supplychain.errors.access_denied_exception.AccessDeniedException: <p>You do not have the required privileges to perform this action.</p>
        capo_supplychain.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_supplychain.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_supplychain.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_supplychain.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Request would cause a service quota to be exceeded.</p>
        capo_supplychain.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_supplychain.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by an AWS service.</p>
        capo_supplychain.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Successful UpdateDataIntegrationFlow for s3 to dataset flow to update SQL transformation

        >>> client.update_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 connection_id, bukrs AS id, txtmd AS description FROM testSourceName WHERE langu = 'E'"}}, target={'targetType': 'DATASET', 'datasetTarget': {'datasetIdentifier': 'arn:aws:scn:us-east-1:123456789012:instance/8850c54e-e187-4fa7-89d4-6370f165174d/namespaces/default/datasets/my_staging_dataset'}})
        Successful UpdateDataIntegrationFlow for dataset to dataset flow to update sources

        >>> client.update_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_updated'}}], 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': 'ASC'}]}}}}})
    """

    def _handler(
        req: "OperationRequest[capo_supplychain.types.update_data_integration_flow_request.UpdateDataIntegrationFlowRequest]",
    ) -> OperationResponse[
        "capo_supplychain.types.update_data_integration_flow_response.UpdateDataIntegrationFlowResponse"
    ]:
        import capo_supplychain._operations.galaxy_public_api_gateway.update_data_integration_flow

        output, http_response = (
            capo_supplychain._operations.galaxy_public_api_gateway.update_data_integration_flow.update_data_integration_flow(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_supplychain.types.update_data_integration_flow_request.UpdateDataIntegrationFlowRequest",
    ) -> dict[str, Any]:
        import capo_supplychain.types.update_data_integration_flow_request

        return capo_supplychain.types.update_data_integration_flow_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_supplychain.types.update_data_integration_flow_response.UpdateDataIntegrationFlowResponse",
    ) -> dict[str, Any]:
        import capo_supplychain.types.update_data_integration_flow_response

        return capo_supplychain.types.update_data_integration_flow_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateDataIntegrationFlow",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_supplychain.types.update_data_integration_flow_request.UpdateDataIntegrationFlowRequest = {
        "instance_id": instance_id,
        "name": name,
    }
    if sources is not None:
        input_["sources"] = sources
    if transformation is not None:
        input_["transformation"] = transformation
    if target is not None:
        input_["target"] = target

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output