Skip to content

send_data_integration_event

send_data_integration_event(
    instance_id: UUID,
    event_type: DataIntegrationEventType,
    data: DataIntegrationEventData,
    event_group_id: DataIntegrationEventGroupId,
    *,
    config_overrides: Optional[SupplyChainClientConfig] = None,
    event_timestamp: Optional[datetime] = None,
    client_token: Optional[ClientToken] = None,
    dataset_target: Optional[DataIntegrationEventDatasetTargetConfiguration] = None,
) -> SendDataIntegrationEventResponse

Send the data payload for the event with real-time data for analysis or monitoring. The real-time data events are stored in an Amazon Web Services service before being processed and stored in data lake.

Parameters:

  • instance_id (UUID) –

    The AWS Supply Chain instance identifier.

  • event_type (DataIntegrationEventType) –

    The data event type.

  • data (DataIntegrationEventData) –

    The data payload of the event, should follow the data schema of the target dataset, or see Data entities supported in AWS Supply Chain. To send single data record, use JsonObject format; to send multiple data records, use JsonArray format.

    Note that for AWS Supply Chain dataset under asc namespace, it has a connection_id internal field that is not allowed to be provided by client directly, they will be auto populated.

  • event_group_id (DataIntegrationEventGroupId) –

    Event identifier (for example, orderId for InboundOrder) used for data sharding or partitioning. Noted under one eventGroupId of same eventType and instanceId, events are processed sequentially in the order they are received by the server.

  • event_timestamp (Optional[datetime], default: None ) –

    The timestamp (in epoch seconds) associated with the event. If not provided, it will be assigned with current timestamp.

  • client_token (Optional[ClientToken], default: None ) –

    The idempotent client token. The token is active for 8 hours, and within its lifetime, it ensures the request completes only once upon retry with same client token. If omitted, the AWS SDK generates a unique value so that AWS SDK can safely retry the request upon network errors.

  • dataset_target (Optional[DataIntegrationEventDatasetTargetConfiguration], default: None ) –

    The target dataset configuration for scn.data.dataset event type.

Raises:

Examples:

Successful SendDataIntegrationEvent for inboundorder event type

>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.inboundorder', data='{"id": "inbound-order-id-test-123", "tpartner_id": "partner-id-test-123" }', event_group_id='inboundOrderId', event_timestamp=1515531081.123)
Successful SendDataIntegrationEvent for inboundorderline event type
>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.inboundorderline', data='{"id": "inbound-order-line-id-test-123", "order_id": "order-id-test-123", "tpartner_id": "partner-id-test-123", "product_id": "product-id-test-123", "quantity_submitted": "100.0" }', event_group_id='inboundOrderLineId', event_timestamp=1515531081.123)
Successful SendDataIntegrationEvent for inboundorderlineschedule event type
>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.inboundorderlineschedule', data='{"id": "inbound-order-line-schedule-id-test-123", "order_id": "order-id-test-123", "order_line_id": "order-line-id-test-123", "product_id": "product-id-test-123"}', event_group_id='inboundOrderLineScheduleId', event_timestamp=1515531081.123)
Successful SendDataIntegrationEvent for forecast event type
>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.forecast', data='{"snapshot_date": "1672470400000", "product_id": "product-id-test-123", "site_id": "site-id-test-123", "region_id": "region-id-test-123", "product_group_id": "product-group-id-test-123", "forecast_start_dttm": "1672470400000", "forecast_end_dttm": "1672470400000" }', event_group_id='forecastId', event_timestamp=1515531081.123)
Successful SendDataIntegrationEvent for inventorylevel event type
>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.inventorylevel', data='{"snapshot_date": "1672470400000", "site_id": "site-id-test-123", "product_id": "product-id-test-123", "on_hand_inventory": "100.0", "inv_condition": "good", "lot_number": "lot-number-test-123"}', event_group_id='inventoryLevelId', event_timestamp=1515531081.123)
Successful SendDataIntegrationEvent for outboundorderline event type
>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.outboundorderline', data='{"id": "outbound-orderline-id-test-123", "cust_order_id": "cust-order-id-test-123", "product_id": "product-id-test-123" }', event_group_id='outboundOrderLineId', event_timestamp=1515531081.123)
Successful SendDataIntegrationEvent for outboundshipment event type
>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.outboundshipment', data='{"id": "outbound-shipment-id-test-123", "cust_order_id": "cust-order-id-test-123", "cust_order_line_id": "cust-order-line-id-test-123", "product_id": "product-id-test-123" }', event_group_id='outboundShipmentId', event_timestamp=1515531081.123)
Successful SendDataIntegrationEvent for processheader event type
>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.processheader', data='{"process_id": "process-id-test-123" }', event_group_id='processHeaderId', event_timestamp=1515531081.123)
Successful SendDataIntegrationEvent for processoperation event type
>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.processoperation', data='{"process_operation_id": "process-operation-id-test-123", "process_id": "process-id-test-123" }', event_group_id='processOperationId', event_timestamp=1515531081.123)
Successful SendDataIntegrationEvent for processproduct event type
>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.processproduct', data='{"process_product_id": "process-product-id-test-123", "process_id": "process-id-test-123" }', event_group_id='processProductId', event_timestamp=1515531081.123)
Successful SendDataIntegrationEvent for reservation event type
>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.reservation', data='{"reservation_id": "reservation-id-test-123", "reservation_detail_id": "reservation-detail-id-test-123" }', event_group_id='reservationId', event_timestamp=1515531081.123)
Successful SendDataIntegrationEvent for shipment event type
>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.shipment', data='{"id": "shipment-id-test-123", "supplier_tpartner_id": "supplier-tpartner-id-test-123", "product_id": "product-id-test-123", "order_id": "order-id-test-123", "order_line_id": "order-line-id-test-123", "package_id": "package-id-test-123" }', event_group_id='shipmentId', event_timestamp=1515531081.123)
Successful SendDataIntegrationEvent for shipmentstop event type
>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.shipmentstop', data='{"shipment_stop_id": "shipment-stop-id-test-123", "shipment_id": "shipment-id-test-123" }', event_group_id='shipmentStopId', event_timestamp=1515531081.123)
Successful SendDataIntegrationEvent for shipmentstoporder event type
>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.shipmentstoporder', data='{"shipment_stop_order_id": "shipment-stop-order-id-test-123", "shipment_stop_id": "shipment-stop-id-test-123", "shipment_id": "shipment-id-test-123" }', event_group_id='shipmentStopOrderId', event_timestamp=1515531081.123)
Successful SendDataIntegrationEvent for supplyplan event type
>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.supplyplan', data='{"supply_plan_id": "supply-plan-id-test-123" }', event_group_id='supplyPlanId', event_timestamp=1515531081.123)
Successful SendDataIntegrationEvent for dataset event type
>>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.dataset', data='{"dataset_id": "datset-id-test-123" }', event_group_id='datasetId', event_timestamp=1515531081.123, dataset_target={'datasetIdentifier': 'arn:aws:scn:us-west-2:135808960812:instance/8928ae12-15e5-4441-825d-ec2184f0a43a/namespaces/asc/datasets/product', 'operationType': 'APPEND'})
Source code in docs_src/capo_supplychain/_services/supply_chain.py
def send_data_integration_event(
    self,
    instance_id: "capo_supplychain.types.uuid.UUID",
    event_type: "capo_supplychain.types.data_integration_event_type.DataIntegrationEventType",
    data: "capo_supplychain.types.data_integration_event_data.DataIntegrationEventData",
    event_group_id: "capo_supplychain.types.data_integration_event_group_id.DataIntegrationEventGroupId",
    *,
    config_overrides: Optional[SupplyChainClientConfig] = None,
    event_timestamp: Optional[datetime.datetime] = None,
    client_token: Optional[
        "capo_supplychain.types.client_token.ClientToken"
    ] = None,
    dataset_target: Optional[
        "capo_supplychain.types.data_integration_event_dataset_target_configuration.DataIntegrationEventDatasetTargetConfiguration"
    ] = None,
) -> "capo_supplychain.types.send_data_integration_event_response.SendDataIntegrationEventResponse":
    """<p>Send the data payload for the event with real-time data for analysis or monitoring. The real-time data events are stored in an Amazon Web Services service before being processed and stored in data lake.</p>

    Args:
        instance_id: <p>The AWS Supply Chain instance identifier.</p>
        event_type: <p>The data event type.</p> <ul> <li> <p> <b>scn.data.dataset</b> - Send data directly to any specified dataset.</p> </li> <li> <p> <b>scn.data.supplyplan</b> - Send data to <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/supply-plan-entity.html">supply_plan</a> dataset.</p> </li> <li> <p> <b>scn.data.shipmentstoporder</b> - Send data to <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/replenishment-shipment-stop-order-entity.html">shipment_stop_order</a> dataset.</p> </li> <li> <p> <b>scn.data.shipmentstop</b> - Send data to <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/replenishment-shipment-stop-entity.html">shipment_stop</a> dataset.</p> </li> <li> <p> <b>scn.data.shipment</b> - Send data to <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/replenishment-shipment-entity.html">shipment</a> dataset.</p> </li> <li> <p> <b>scn.data.reservation</b> - Send data to <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/planning-reservation-entity.html">reservation</a> dataset.</p> </li> <li> <p> <b>scn.data.processproduct</b> - Send data to <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/operation-process-product-entity.html">process_product</a> dataset.</p> </li> <li> <p> <b>scn.data.processoperation</b> - Send data to <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/operation-process-operation-entity.html">process_operation</a> dataset.</p> </li> <li> <p> <b>scn.data.processheader</b> - Send data to <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/operation-process-header-entity.html">process_header</a> dataset.</p> </li> <li> <p> <b>scn.data.forecast</b> - Send data to <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/forecast-forecast-entity.html">forecast</a> dataset.</p> </li> <li> <p> <b>scn.data.inventorylevel</b> - Send data to <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/inventory_mgmnt-inv-level-entity.html">inv_level</a> dataset.</p> </li> <li> <p> <b>scn.data.inboundorder</b> - Send data to <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/replenishment-inbound-order-entity.html">inbound_order</a> dataset.</p> </li> <li> <p> <b>scn.data.inboundorderline</b> - Send data to <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/replenishment-inbound-order-line-entity.html">inbound_order_line</a> dataset.</p> </li> <li> <p> <b>scn.data.inboundorderlineschedule</b> - Send data to <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/replenishment-inbound-order-line-schedule-entity.html">inbound_order_line_schedule</a> dataset.</p> </li> <li> <p> <b>scn.data.outboundorderline</b> - Send data to <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/outbound-fulfillment-order-line-entity.html">outbound_order_line</a> dataset.</p> </li> <li> <p> <b>scn.data.outboundshipment</b> - Send data to <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/outbound-fulfillment-shipment-entity.html">outbound_shipment</a> dataset.</p> </li> </ul>
        data: <p>The data payload of the event, should follow the data schema of the target dataset, or see <a href="https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/data-model-asc.html">Data entities supported in AWS Supply Chain</a>. To send single data record, use JsonObject format; to send multiple data records, use JsonArray format.</p> <p>Note that for AWS Supply Chain dataset under <b>asc</b> namespace, it has a connection_id internal field that is not allowed to be provided by client directly, they will be auto populated.</p>
        event_group_id: <p>Event identifier (for example, orderId for InboundOrder) used for data sharding or partitioning. Noted under one eventGroupId of same eventType and instanceId, events are processed sequentially in the order they are received by the server.</p>
        event_timestamp: <p>The timestamp (in epoch seconds) associated with the event. If not provided, it will be assigned with current timestamp.</p>
        client_token: <p>The idempotent client token. The token is active for 8 hours, and within its lifetime, it ensures the request completes only once upon retry with same client token. If omitted, the AWS SDK generates a unique value so that AWS SDK can safely retry the request upon network errors.</p>
        dataset_target: <p>The target dataset configuration for <b>scn.data.dataset</b> event type.</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 SendDataIntegrationEvent for inboundorder event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.inboundorder', data='{"id": "inbound-order-id-test-123", "tpartner_id": "partner-id-test-123" }', event_group_id='inboundOrderId', event_timestamp=1515531081.123)
        Successful SendDataIntegrationEvent for inboundorderline event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.inboundorderline', data='{"id": "inbound-order-line-id-test-123", "order_id": "order-id-test-123", "tpartner_id": "partner-id-test-123", "product_id": "product-id-test-123", "quantity_submitted": "100.0" }', event_group_id='inboundOrderLineId', event_timestamp=1515531081.123)
        Successful SendDataIntegrationEvent for inboundorderlineschedule event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.inboundorderlineschedule', data='{"id": "inbound-order-line-schedule-id-test-123", "order_id": "order-id-test-123", "order_line_id": "order-line-id-test-123", "product_id": "product-id-test-123"}', event_group_id='inboundOrderLineScheduleId', event_timestamp=1515531081.123)
        Successful SendDataIntegrationEvent for forecast event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.forecast', data='{"snapshot_date": "1672470400000", "product_id": "product-id-test-123", "site_id": "site-id-test-123", "region_id": "region-id-test-123", "product_group_id": "product-group-id-test-123", "forecast_start_dttm": "1672470400000", "forecast_end_dttm": "1672470400000" }', event_group_id='forecastId', event_timestamp=1515531081.123)
        Successful SendDataIntegrationEvent for inventorylevel event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.inventorylevel', data='{"snapshot_date": "1672470400000", "site_id": "site-id-test-123", "product_id": "product-id-test-123", "on_hand_inventory": "100.0", "inv_condition": "good", "lot_number": "lot-number-test-123"}', event_group_id='inventoryLevelId', event_timestamp=1515531081.123)
        Successful SendDataIntegrationEvent for outboundorderline event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.outboundorderline', data='{"id": "outbound-orderline-id-test-123", "cust_order_id": "cust-order-id-test-123", "product_id": "product-id-test-123" }', event_group_id='outboundOrderLineId', event_timestamp=1515531081.123)
        Successful SendDataIntegrationEvent for outboundshipment event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.outboundshipment', data='{"id": "outbound-shipment-id-test-123", "cust_order_id": "cust-order-id-test-123", "cust_order_line_id": "cust-order-line-id-test-123", "product_id": "product-id-test-123" }', event_group_id='outboundShipmentId', event_timestamp=1515531081.123)
        Successful SendDataIntegrationEvent for processheader event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.processheader', data='{"process_id": "process-id-test-123" }', event_group_id='processHeaderId', event_timestamp=1515531081.123)
        Successful SendDataIntegrationEvent for processoperation event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.processoperation', data='{"process_operation_id": "process-operation-id-test-123", "process_id": "process-id-test-123" }', event_group_id='processOperationId', event_timestamp=1515531081.123)
        Successful SendDataIntegrationEvent for processproduct event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.processproduct', data='{"process_product_id": "process-product-id-test-123", "process_id": "process-id-test-123" }', event_group_id='processProductId', event_timestamp=1515531081.123)
        Successful SendDataIntegrationEvent for reservation event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.reservation', data='{"reservation_id": "reservation-id-test-123", "reservation_detail_id": "reservation-detail-id-test-123" }', event_group_id='reservationId', event_timestamp=1515531081.123)
        Successful SendDataIntegrationEvent for shipment event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.shipment', data='{"id": "shipment-id-test-123", "supplier_tpartner_id": "supplier-tpartner-id-test-123", "product_id": "product-id-test-123", "order_id": "order-id-test-123", "order_line_id": "order-line-id-test-123", "package_id": "package-id-test-123" }', event_group_id='shipmentId', event_timestamp=1515531081.123)
        Successful SendDataIntegrationEvent for shipmentstop event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.shipmentstop', data='{"shipment_stop_id": "shipment-stop-id-test-123", "shipment_id": "shipment-id-test-123" }', event_group_id='shipmentStopId', event_timestamp=1515531081.123)
        Successful SendDataIntegrationEvent for shipmentstoporder event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.shipmentstoporder', data='{"shipment_stop_order_id": "shipment-stop-order-id-test-123", "shipment_stop_id": "shipment-stop-id-test-123", "shipment_id": "shipment-id-test-123" }', event_group_id='shipmentStopOrderId', event_timestamp=1515531081.123)
        Successful SendDataIntegrationEvent for supplyplan event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.supplyplan', data='{"supply_plan_id": "supply-plan-id-test-123" }', event_group_id='supplyPlanId', event_timestamp=1515531081.123)
        Successful SendDataIntegrationEvent for dataset event type

        >>> client.send_data_integration_event(instance_id='8928ae12-15e5-4441-825d-ec2184f0a43a', event_type='scn.data.dataset', data='{"dataset_id": "datset-id-test-123" }', event_group_id='datasetId', event_timestamp=1515531081.123, dataset_target={'datasetIdentifier': 'arn:aws:scn:us-west-2:135808960812:instance/8928ae12-15e5-4441-825d-ec2184f0a43a/namespaces/asc/datasets/product', 'operationType': 'APPEND'})
    """

    def _handler(
        req: "OperationRequest[capo_supplychain.types.send_data_integration_event_request.SendDataIntegrationEventRequest]",
    ) -> OperationResponse[
        "capo_supplychain.types.send_data_integration_event_response.SendDataIntegrationEventResponse"
    ]:
        import capo_supplychain._operations.galaxy_public_api_gateway.send_data_integration_event

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

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

        return capo_supplychain.types.send_data_integration_event_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("SendDataIntegrationEvent", redact_input=_redact_input),
    )
    input_: capo_supplychain.types.send_data_integration_event_request.SendDataIntegrationEventRequest = {
        "instance_id": instance_id,
        "event_type": event_type,
        "data": data,
        "event_group_id": event_group_id,
    }
    if event_timestamp is not None:
        input_["event_timestamp"] = event_timestamp
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if dataset_target is not None:
        input_["dataset_target"] = dataset_target

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