Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
AWS IoT TwinMaker konektor data
Konektor memerlukan akses ke penyimpanan data dasar Anda untuk menyelesaikan kueri yang dikirim dan mengembalikan hasil atau kesalahan.
Untuk mempelajari tentang konektor yang tersedia, antarmuka permintaan mereka, dan antarmuka responsnya, lihat topik berikut.
Untuk informasi selengkapnya tentang properti yang digunakan dalam antarmuka konektor, lihat tindakan GetPropertyValueHistory API.
catatan
Beberapa konektor memiliki dua bidang stempel waktu di antarmuka permintaan dan respons untuk properti waktu mulai dan waktu akhir. K startDateTime edu endDateTime anya dan gunakan angka panjang untuk mewakili zaman kedua, yang tidak lagi didukung. Untuk mempertahankan kompatibilitas mundur, kami masih mengirim nilai stempel waktu ke bidang tersebut, tetapi kami sarankan menggunakan endTime bidang startTime dan yang konsisten dengan format stempel waktu API kami.
Topik
Konektor penginisialisasi skema
Anda dapat menggunakan penginisialisasi skema dalam tipe komponen atau siklus hidup entitas untuk mengambil jenis komponen atau properti komponen dari sumber data yang mendasarinya. Penginisialisasi skema secara otomatis mengimpor tipe komponen atau properti komponen tanpa secara eksplisit memanggil tindakan API untuk disiapkanproperties.
SchemaInitializer antarmuka permintaan
{ "workspaceId": "string", "entityId": "string", "componentName": "string", "properties": { // property name as key, // value is of type PropertyRequest "string": "PropertyRequest" } }
catatan
Peta properti dalam antarmuka permintaan ini adalah aPropertyRequest. Untuk informasi selengkapnya, lihat PropertyRequest.
SchemaInitializer antarmuka respons
{ "properties": { // property name as key, // value is of type PropertyResponse "string": "PropertyResponse" } }
catatan
Peta properti dalam antarmuka permintaan ini adalah aPropertyResponse. Untuk informasi selengkapnya, lihat PropertyResponse.
DataReaderByEntity
DataReaderByEntity adalah konektor bidang data yang digunakan untuk mendapatkan nilai deret waktu properti dalam satu komponen.
Untuk informasi tentang jenis properti, sintaks, dan format konektor ini, lihat tindakan GetPropertyValueHistory API.
DataReaderByEntity antarmuka permintaan
{ "startDateTime": long, // In epoch sec, deprecated "startTime": "string", // ISO-8601 timestamp format "endDateTime": long, // In epoch sec, deprecated "endTime": "string", // ISO-8601 timestamp format "properties": { // A map of properties as in the get-entity API response // property name as key, // value is of type PropertyResponse "string": "PropertyResponse" }, "workspaceId": "string", "selectedProperties": List:"string", "propertyFilters": List:PropertyFilter, "entityId": "string", "componentName": "string", "componentTypeId": "string", "interpolation": InterpolationParameters, "nextToken": "string", "maxResults": int, "orderByTime": "string" }
DataReaderByEntity antarmuka respons
{ "propertyValues": [ { "entityPropertyReference": EntityPropertyReference, // The same as EntityPropertyReference "values": [ { "timestamp": long, // Epoch sec, deprecated "time": "string", // ISO-8601 timestamp format "value": DataValue // The same as DataValue } ] } ], "nextToken": "string" }
DataReaderByComponentType
Untuk mendapatkan nilai deret waktu dari properti umum yang berasal dari tipe komponen yang sama, gunakan konektor DataReaderByEntity bidang data. Misalnya, jika Anda menentukan properti deret waktu dalam tipe komponen dan Anda memiliki beberapa komponen menggunakan tipe komponen tersebut, maka Anda dapat menanyakan properti tersebut di semua komponen dalam rentang waktu tertentu. Kasus penggunaan umum untuk ini adalah ketika Anda ingin menanyakan status alarm beberapa komponen untuk tampilan global entitas Anda.
Untuk informasi tentang jenis properti, sintaks, dan format konektor ini, lihat tindakan GetPropertyValueHistory API.
DataReaderByComponentType antarmuka permintaan
{ "startDateTime": long, // In epoch sec, deprecated "startTime": "string", // ISO-8601 timestamp format "endDateTime": long, // In epoch sec, deprecated "endTime": "string", // ISO-8601 timestamp format "properties": { // A map of properties as in the get-entity API response // property name as key, // value is of type PropertyResponse "string": "PropertyResponse" }, "workspaceId": "string", "selectedProperties": List:"string", "propertyFilters": List:PropertyFilter, "componentTypeId": "string", "interpolation": InterpolationParameters, "nextToken": "string", "maxResults": int, "orderByTime": "string" }
DataReaderByComponentType antarmuka respons
{ "propertyValues": [ { "entityPropertyReference": EntityPropertyReference, // The same as EntityPropertyReference "entityId": "string", "componentName": "string", "values": [ { "timestamp": long, // Epoch sec, deprecated "time": "string", // ISO-8601 timestamp format "value": DataValue // The same as DataValue } ] } ], "nextToken": "string" }
DataReader
DataReader adalah konektor bidang data yang dapat menangani kasus DataReaderByEntity dan DataReaderByComponentType.
Untuk informasi tentang jenis properti, sintaks, dan format konektor ini, lihat tindakan GetPropertyValueHistory API.
DataReader antarmuka permintaan
Yang EntityId dan componentName bersifat opsional.
{ "startDateTime": long, // In epoch sec, deprecated "startTime": "string", // ISO-8601 timestamp format "endDateTime": long, // In epoch sec, deprecated "endTime": "string", // ISO-8601 timestamp format "properties": { // A map of properties as in the get-entity API response // property name as key, // value is of type PropertyRequest "string": "PropertyRequest" }, "workspaceId": "string", "selectedProperties": List:"string", "propertyFilters": List:PropertyFilter, "entityId": "string", "componentName": "string", "componentTypeId": "string", "interpolation": InterpolationParameters, "nextToken": "string", "maxResults": int, "orderByTime": "string" }
DataReader antarmuka respons
{ "propertyValues": [ { "entityPropertyReference": EntityPropertyReference, // The same as EntityPropertyReference "values": [ { "timestamp": long, // Epoch sec, deprecated "time": "string", // ISO-8601 timestamp format "value": DataValue // The same as DataValue } ] } ], "nextToken": "string" }
AttributePropertyValueReaderByEntity
AttributePropertyValueReaderByEntity adalah konektor bidang data yang dapat Anda gunakan untuk mengambil nilai properti statis dalam satu entitas.
Untuk informasi tentang jenis properti, sintaks, dan format konektor ini, lihat tindakan GetPropertyValue API.
AttributePropertyValueReaderByEntity antarmuka permintaan
{ "properties": { // property name as key, // value is of type PropertyResponse "string": "PropertyResponse" } "workspaceId": "string", "entityId": "string", "componentName": "string", "selectedProperties": List:"string", }
AttributePropertyValueReaderByEntity antarmuka respons
{ "propertyValues": { "string": { // property name as key "propertyReference": EntityPropertyReference, // The same as EntityPropertyReference "propertyValue": DataValue // The same as DataValue } }
DataWriter
DataWriter adalah konektor bidang data yang dapat Anda gunakan untuk menulis titik data deret waktu kembali ke penyimpanan data yang mendasarinya untuk properti dalam satu komponen.
Untuk informasi tentang jenis properti, sintaks, dan format konektor ini, lihat tindakan BatchPutPropertyValues API.
DataWriter antarmuka permintaan
{ "workspaceId": "string", "properties": { // entity id as key "String": { // property name as key, // value is of type PropertyResponse "string": PropertyResponse } }, "entries": [ { "entryId": "string", "entityPropertyReference": EntityPropertyReference, // The same as EntityPropertyReference "propertyValues": [ { "timestamp": long, // Epoch sec, deprecated "time": "string", // ISO-8601 timestamp format "value": DataValue // The same as DataValue } ] } ] }
DataWriter antarmuka respons
{ "errorEntries": [ { "errors": List:BatchPutPropertyError // The value is a list of type BatchPutPropertyError } ] }
Contoh
Contoh JSON berikut adalah contoh sintaks respons dan permintaan untuk beberapa konektor.
-
SchemaInitializer:
Contoh berikut menunjukkan penginisialisasi skema dalam siklus hidup tipe komponen.
Permohon an:
{ "workspaceId": "myWorkspace", "properties": { "modelId": { "definition": { "dataType": { "type": "STRING" }, "isExternalId": true, "isFinal": true, "isImported": false, "isInherited": false, "isRequiredInEntity": true, "isStoredExternally": false, "isTimeSeries": false, "defaultValue": { "stringValue": "myModelId" } }, "value": { "stringValue": "myModelId" } }, "tableName": { "definition": { "dataType": { "type": "STRING" }, "isExternalId": false, "isFinal": false, "isImported": false, "isInherited": false, "isRequiredInEntity": false, "isStoredExternally": false, "isTimeSeries": false, "defaultValue": { "stringValue": "myTableName" } }, "value": { "stringValue": "myTableName" } } } }Tanggapan:
{ "properties": { "myProperty1": { "definition": { "dataType": { "type": "DOUBLE", "unitOfMeasure": "%" }, "configuration": { "myProperty1Id": "idValue" }, "isTimeSeries": true } }, "myProperty2": { "definition": { "dataType": { "type": "STRING" }, "isTimeSeries": false, "defaultValue": { "stringValue": "property2Value" } } } } } -
Penginisialisasi skema dalam siklus hidup entitas:
Permohon an:
{ "workspaceId": "myWorkspace", "entityId": "myEntity", "componentName": "myComponent", "properties": { "assetId": { "definition": { "dataType": { "type": "STRING" }, "isExternalId": true, "isFinal": true, "isImported": false, "isInherited": false, "isRequiredInEntity": true, "isStoredExternally": false, "isTimeSeries": false }, "value": { "stringValue": "myAssetId" } }, "tableName": { "definition": { "dataType": { "type": "STRING" }, "isExternalId": false, "isFinal": false, "isImported": false, "isInherited": false, "isRequiredInEntity": false, "isStoredExternally": false, "isTimeSeries": false }, "value": { "stringValue": "myTableName" } } } }Tanggapan:
{ "properties": { "myProperty1": { "definition": { "dataType": { "type": "DOUBLE", "unitOfMeasure": "%" }, "configuration": { "myProperty1Id": "idValue" }, "isTimeSeries": true } }, "myProperty2": { "definition": { "dataType": { "type": "STRING" }, "isTimeSeries": false }, "value": { "stringValue": "property2Value" } } } } -
DataReaderByEntity dan DataReader:
Permohon an:
{ "workspaceId": "myWorkspace", "entityId": "myEntity", "componentName": "myComponent", "selectedProperties": [ "Temperature", "Pressure" ], "startTime": "2022-04-07T04:04:42Z", "endTime": "2022-04-07T04:04:45Z", "maxResults": 4, "orderByTime": "ASCENDING", "properties": { "assetId": { "definition": { "dataType": { "type": "STRING" }, "isExternalId": true, "isFinal": true, "isImported": false, "isInherited": false, "isRequiredInEntity": true, "isStoredExternally": false, "isTimeSeries": false }, "value": { "stringValue": "myAssetId" } }, "Temperature": { "definition": { "configuration": { "temperatureId": "xyz123" }, "dataType": { "type": "DOUBLE", "unitOfMeasure": "DEGC" }, "isExternalId": false, "isFinal": false, "isImported": true, "isInherited": false, "isRequiredInEntity": false, "isStoredExternally": false, "isTimeSeries": true } }, "Pressure": { "definition": { "configuration": { "pressureId": "xyz456" }, "dataType": { "type": "DOUBLE", "unitOfMeasure": "MPA" }, "isExternalId": false, "isFinal": false, "isImported": true, "isInherited": false, "isRequiredInEntity": false, "isStoredExternally": false, "isTimeSeries": true } } } }Tanggapan:
{ "propertyValues": [ { "entityPropertyReference": { "entityId": "myEntity", "componentName": "myComponent", "propertyName": "Temperature" }, "values": [ { "time": "2022-04-07T04:04:42Z", "value": { "doubleValue": 588.168 } }, { "time": "2022-04-07T04:04:43Z", "value": { "doubleValue": 592.4224 } } ] } ], "nextToken": "qwertyuiop" } -
AttributePropertyValueReaderByEntity:
Permohon an:
{ "workspaceId": "myWorkspace", "entityId": "myEntity", "componentName": "myComponent", "selectedProperties": [ "manufacturer", ], "properties": { "assetId": { "definition": { "dataType": { "type": "STRING" }, "isExternalId": true, "isFinal": true, "isImported": false, "isInherited": false, "isRequiredInEntity": true, "isStoredExternally": false, "isTimeSeries": false }, "value": { "stringValue": "myAssetId" } }, "manufacturer": { "definition": { "dataType": { "type": "STRING" }, "configuration": { "manufacturerPropId": "M001" }, "isExternalId": false, "isFinal": false, "isImported": false, "isInherited": false, "isRequiredInEntity": false, "isStoredExternally": true, "isTimeSeries": false } } } }Tanggapan:
{ "propertyValues": { "manufacturer": { "propertyReference": { "propertyName": "manufacturer", "entityId": "myEntity", "componentName": "myComponent" }, "propertyValue": { "stringValue": "Amazon" } } } } -
DataWriter:
Permohon an:
{ "workspaceId": "myWorkspaceId", "properties": { "myEntity": { "Temperature": { "definition": { "configuration": { "temperatureId": "xyz123" }, "dataType": { "type": "DOUBLE", "unitOfMeasure": "DEGC" }, "isExternalId": false, "isFinal": false, "isImported": true, "isInherited": false, "isRequiredInEntity": false, "isStoredExternally": false, "isTimeSeries": true } } } }, "entries": [ { "entryId": "myEntity", "entityPropertyReference": { "entityId": "myEntity", "componentName": "myComponent", "propertyName": "Temperature" }, "propertyValues": [ { "timestamp": 1626201120, "value": { "doubleValue": 95.6958 } }, { "timestamp": 1626201132, "value": { "doubleValue": 80.6959 } } ] } ] }Tanggapan:
{ "errorEntries": [ { "errors": [ { "errorCode": "409", "errorMessage": "Conflict value at same timestamp", "entry": { "entryId": "myEntity", "entityPropertyReference": { "entityId": "myEntity", "componentName": "myComponent", "propertyName": "Temperature" }, "propertyValues": [ "time": "2022-04-07T04:04:42Z", "value": { "doubleValue": 95.6958 } ] } } ] } ] }