send_data_integration_event
async
¶
send_data_integration_event(
instance_id: UUID,
event_type: DataIntegrationEventType,
data: DataIntegrationEventData,
event_group_id: DataIntegrationEventGroupId,
*,
config_overrides: Optional[AsyncSupplyChainClientConfig] = 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.
-
scn.data.dataset - Send data directly to any specified dataset.
-
scn.data.supplyplan - Send data to supply_plan dataset.
-
scn.data.shipmentstoporder - Send data to shipment_stop_order dataset.
-
scn.data.shipmentstop - Send data to shipment_stop dataset.
-
scn.data.shipment - Send data to shipment dataset.
-
scn.data.reservation - Send data to reservation dataset.
-
scn.data.processproduct - Send data to process_product dataset.
-
scn.data.processoperation - Send data to process_operation dataset.
-
scn.data.processheader - Send data to process_header dataset.
-
scn.data.forecast - Send data to forecast dataset.
-
scn.data.inventorylevel - Send data to inv_level dataset.
-
scn.data.inboundorder - Send data to inbound_order dataset.
-
scn.data.inboundorderline - Send data to inbound_order_line dataset.
-
scn.data.inboundorderlineschedule - Send data to inbound_order_line_schedule dataset.
-
scn.data.outboundorderline - Send data to outbound_order_line dataset.
-
scn.data.outboundshipment - Send data to outbound_shipment dataset.
-
-
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:
-
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 SendDataIntegrationEvent for inboundorder event type
>>> await 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
>>> await 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
>>> await 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
>>> await 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
>>> await 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
>>> await 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
>>> await 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
>>> await 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
>>> await 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
>>> await 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
>>> await 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
>>> await 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
>>> await 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
>>> await 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
>>> await 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
>>> await 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/async_supply_chain.py
665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 | |