建立 Amazon Kinesis 使用流量服務API的來源連線
本教學課程將逐步引導您完成連線的步驟 Amazon Kinesis (以下稱「Kinesis")至Experience Platform,使用 Flow Service API.
快速入門
本指南需要您深入了解下列 Adobe Experience Platform 元件:
以下小節提供成功連線所需瞭解的其他資訊 Kinesis 至平台,使用 Flow Service API。
收集必要的認證
為了 Flow Service 以連線至您的 Amazon Kinesis 帳戶,您必須提供下列連線屬性的值:
accessKeyId
secretKey
region
connectionSpec.id
86043421-563b-46ec-8e6c-e23184711bf6
.如需詳細資訊,請參閱 Kinesis 存取金鑰以及如何產生金鑰,請參閱本 AWS IAM使用者存取金鑰管理指南.
使用平台API
如需如何成功呼叫Platform API的詳細資訊,請參閱以下指南: Platform API快速入門.
建立基礎連線
建立來源連線的第一個步驟是驗證您的 Kinesis 來源並產生基本連線ID。 基礎連線ID可讓您從來源內部探索及導覽檔案,並識別您要擷取的特定專案,包括其資料型別和格式的資訊。
若要建立基本連線ID,請向以下連線ID發出POST請求: /connections
端點,同時提供 Kinesis 要求引數中的驗證認證。
API格式
POST /connections
要求
curl -X POST \
'https://platform.adobe.io/data/foundation/flowservice/connections' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'Content-Type: application/json' \
-d '{
"name": "Amazon Kinesis connection",
"description": "Connector for Amazon Kinesis",
"providerId": "521eee4d-8cbe-4906-bb48-fb6bd4450033",
"auth": {
"specName": "Aws Kinesis authentication credentials",
"params": {
"accessKeyId": "{ACCESS_KEY_ID}",
"secretKey": "{SECRET_KEY}",
"region": "{REGION}"
}
},
"connectionSpec": {
"id": "86043421-563b-46ec-8e6c-e23184711bf6",
"version": "1.0"
}
}'
auth.params.accessKeyId
auth.params.secretKey
auth.params.region
connectionSpec.id
86043421-563b-46ec-8e6c-e23184711bf6
回應
成功的回應會傳回新建立的基本連線的詳細資料,包括其唯一識別碼(id
)。 建立來源連線的下一個步驟需要此ID。
{
"id": "4cb0c374-d3bb-4557-b139-5712880adc55",
"etag": "\"6507cfd8-0000-0200-0000-5e18fc600000\""
}
建立來源連線 source
來源連線會建立和管理與擷取資料的外部來源的連線。 來源連線包含資料來源、資料格式以及建立資料流所需的來源連線ID等資訊。 租使用者和組織專屬的來源連線例項。
POST若要建立來源連線,請向 /sourceConnections
的端點 Flow Service API。
API格式
POST /sourceConnections
要求
curl -X POST \
'https://platform.adobe.io/data/foundation/flowservice/sourceConnections' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'Content-Type: application/json' \
-d '{
"name": "AWS Kinesis source connection",
"description": "A source connection for AWS Kinesis",
"baseConnectionId": "4cb0c374-d3bb-4557-b139-5712880adc55",
"connectionSpec": {
"id": "86043421-563b-46ec-8e6c-e23184711bf6",
"version": "1.0"
},
"data": {
"format": "json"
},
"params": {
"stream": "{STREAM}",
"dataType": "raw",
"reset": "latest"
}
}'
name
description
baseConnectionId
connectionSpec.id
86043421-563b-46ec-8e6c-e23184711bf6
data.format
json
.params.stream
params.dataType
raw
和 xdm
.params.reset
latest
以開始讀取最近的資料,並使用 earliest
以開始讀取資料流中的第一個可用資料。回應
成功的回應會傳回唯一識別碼(id
)。 在下一個教學課程中,需要此ID才能建立資料流。
{
"id": "e96d6135-4b50-446e-922c-6dd66672b6b2",
"etag": "\"66013508-0000-0200-0000-5f6e2ae70000\""
}
後續步驟
依照本教學課程,您已建立 Kinesis 來源連線使用 Flow Service API。 您可以在下一個教學課程中使用此來源連線ID: 使用建立串流資料流 Flow Service API.