|
| 1 | +```python Python SDK |
| 2 | +import os |
| 3 | + |
| 4 | +from unstructured_client import UnstructuredClient |
| 5 | +from unstructured_client.models.operations import CreateDestinationRequest |
| 6 | +from unstructured_client.models.shared import ( |
| 7 | + CreateDestinationConnector, |
| 8 | + DestinationConnectorType, |
| 9 | + IbmWatsonxDestinationConnectorConfigInput |
| 10 | +) |
| 11 | + |
| 12 | +with UnstructuredClient(api_key_auth=os.getenv("UNSTRUCTURED_API_KEY")) as client: |
| 13 | + response = client.destinations.create_destination( |
| 14 | + request=CreateDestinationRequest( |
| 15 | + create_destination_connector=CreateDestinationConnector( |
| 16 | + name="<name>", |
| 17 | + type=DestinationConnectorType.IBM_WATSONX_S3, |
| 18 | + config=IbmWatsonxDestinationConnectorConfigInput( |
| 19 | + iceberg_endpoint="<iceberg-endpoint>", |
| 20 | + object_storage_endpoint="<object-storage-endpoint>", |
| 21 | + object_storage_region="<object-storage-region>", |
| 22 | + iam_api_key="<iam-api-key>", |
| 23 | + access_key_id="<access-key-id>", |
| 24 | + secret_access_key="<secret-access-key>", |
| 25 | + catalog="<catalog>", |
| 26 | + namespace="<namespace>", |
| 27 | + table="<table>", |
| 28 | + max_retries=<max-retries>, |
| 29 | + record_id_key="<record-id-key>" |
| 30 | + ) |
| 31 | + ) |
| 32 | + ) |
| 33 | + ) |
| 34 | + |
| 35 | + print(response.destination_connector_information) |
| 36 | +``` |
0 commit comments