Amazon IoT TwinMaker metadata transfer job schema
metadataTransferJob import schema: Use this Amazon IoT TwinMaker metadata schema to validate your data when you upload it to an Amazon S3 bucket:
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "IoTTwinMaker", "description": "Metadata transfer job resource schema for IoTTwinMaker", "definitions": { "ExternalId": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "[a-zA-Z0-9][a-zA-Z_\\-0-9.:]*[a-zA-Z0-9]+" }, "Description": { "type": "string", "minLength": 0, "maxLength": 512 }, "DescriptionWithDefault": { "type": "string", "minLength": 0, "maxLength": 512, "default": "" }, "ComponentTypeName": { "description": "A friendly name for the component type.", "type": "string", "pattern": ".*[^\\u0000-\\u001F\\u007F]*.*", "minLength": 1, "maxLength": 256 }, "ComponentTypeId": { "description": "The ID of the component type.", "type": "string", "pattern": "[a-zA-Z_.\\-0-9:]+", "minLength": 1, "maxLength": 256 }, "ComponentName": { "description": "The name of the component.", "type": "string", "pattern": "[a-zA-Z_\\-0-9]+", "minLength": 1, "maxLength": 256 }, "EntityId": { "description": "The ID of the entity.", "type": "string", "minLength": 1, "maxLength": 128, "pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|^[a-zA-Z0-9][a-zA-Z_\\-0-9.:]*[a-zA-Z0-9]+" }, "EntityName": { "description": "The name of the entity.", "type": "string", "minLength": 1, "maxLength": 256, "pattern": "[a-zA-Z_0-9-.][a-zA-Z_0-9-. ]*[a-zA-Z0-9]+" }, "ParentEntityId": { "description": "The ID of the parent entity.", "type": "string", "minLength": 1, "maxLength": 128, "pattern": "\\$ROOT|^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|^[a-zA-Z0-9][a-zA-Z_\\-0-9.:]*[a-zA-Z0-9]+", "default": "$ROOT" }, "DisplayName": { "description": "A friendly name for the property.", "type": "string", "pattern": ".*[^\\u0000-\\u001F\\u007F]*.*", "minLength": 0, "maxLength": 256 }, "Tags": { "description": "Metadata that you can use to manage the entity / componentType", "patternProperties": { "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$": { "type": "string", "minLength": 1, "maxLength": 256 } }, "existingJavaType": "java.util.Map<String,String>", "minProperties": 0, "maxProperties": 50 }, "Relationship": { "description": "The type of the relationship.", "type": "object", "properties": { "relationshipType": { "description": "The type of the relationship.", "type": "string", "pattern": ".*", "minLength": 1, "maxLength": 256 }, "targetComponentTypeId": { "description": "The ID of the target component type associated with this relationship.", "$ref": "#/definitions/ComponentTypeId" } }, "additionalProperties": false }, "DataValue": { "description": "An object that specifies a value for a property.", "type": "object", "properties": { "booleanValue": { "description": "A Boolean value.", "type": "boolean" }, "doubleValue": { "description": "A double value.", "type": "number" }, "expression": { "description": "An expression that produces the value.", "type": "string", "pattern": "(^\\$\\{Parameters\\.[a-zA-z]+([a-zA-z_0-9]*)}$)", "minLength": 1, "maxLength": 316 }, "integerValue": { "description": "An integer value.", "type": "integer" }, "listValue": { "description": "A list of multiple values.", "type": "array", "minItems": 0, "maxItems": 50, "uniqueItems": false, "insertionOrder": false, "items": { "$ref": "#/definitions/DataValue" }, "default": null }, "longValue": { "description": "A long value.", "type": "integer", "existingJavaType": "java.lang.Long" }, "stringValue": { "description": "A string value.", "type": "string", "pattern": ".*", "minLength": 1, "maxLength": 256 }, "mapValue": { "description": "An object that maps strings to multiple DataValue objects.", "type": "object", "patternProperties": { "[a-zA-Z_\\-0-9]+": { "$ref": "#/definitions/DataValue" } }, "additionalProperties": { "$ref": "#/definitions/DataValue" } }, "relationshipValue": { "description": "A value that relates a component to another component.", "type": "object", "properties": { "TargetComponentName": { "type": "string", "pattern": "[a-zA-Z_\\-0-9]+", "minLength": 1, "maxLength": 256 }, "TargetEntityId": { "type": "string", "pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|^[a-zA-Z0-9][a-zA-Z_\\-0-9.:]*[a-zA-Z0-9]+", "minLength": 1, "maxLength": 128 } }, "additionalProperties": false } }, "additionalProperties": false }, "DataType": { "description": "An object that specifies the data type of a property.", "type": "object", "properties": { "allowedValues": { "description": "The allowed values for this data type.", "type": "array", "minItems": 0, "maxItems": 50, "uniqueItems": false, "insertionOrder": false, "items": { "$ref": "#/definitions/DataValue" }, "default": null }, "nestedType": { "description": "The nested type in the data type.", "$ref": "#/definitions/DataType" }, "relationship": { "description": "A relationship that associates a component with another component.", "$ref": "#/definitions/Relationship" }, "type": { "description": "The underlying type of the data type.", "type": "string", "enum": [ "RELATIONSHIP", "STRING", "LONG", "BOOLEAN", "INTEGER", "DOUBLE", "LIST", "MAP" ] }, "unitOfMeasure": { "description": "The unit of measure used in this data type.", "type": "string", "pattern": ".*", "minLength": 1, "maxLength": 256 } }, "required": [ "type" ], "additionalProperties": false }, "PropertyDefinition": { "description": "An object that specifies information about a property.", "type": "object", "properties": { "configuration": { "description": "An object that specifies information about a property.", "patternProperties": { "[a-zA-Z_\\-0-9]+": { "type": "string", "pattern": "[a-zA-Z_\\-0-9]+", "minLength": 1, "maxLength": 256 } }, "existingJavaType": "java.util.Map<String,String>" }, "dataType": { "description": "An object that contains information about the data type.", "$ref": "#/definitions/DataType" }, "defaultValue": { "description": "An object that contains the default value.", "$ref": "#/definitions/DataValue" }, "displayName": { "description": "An object that contains the default value.", "$ref": "#/definitions/DisplayName" }, "isExternalId": { "description": "A Boolean value that specifies whether the property ID comes from an external data store.", "type": "boolean", "default": null }, "isRequiredInEntity": { "description": "A Boolean value that specifies whether the property is required.", "type": "boolean", "default": null }, "isStoredExternally": { "description": "A Boolean value that specifies whether the property is stored externally.", "type": "boolean", "default": null }, "isTimeSeries": { "description": "A Boolean value that specifies whether the property consists of time series data.", "type": "boolean", "default": null } }, "additionalProperties": false }, "PropertyDefinitions": { "type": "object", "patternProperties": { "[a-zA-Z_\\-0-9]+": { "$ref": "#/definitions/PropertyDefinition" } }, "additionalProperties": { "$ref": "#/definitions/PropertyDefinition" } }, "Property": { "type": "object", "properties": { "definition": { "description": "The definition of the property", "$ref": "#/definitions/PropertyDefinition" }, "value": { "description": "The value of the property.", "$ref": "#/definitions/DataValue" } }, "additionalProperties": false }, "Properties": { "type": "object", "patternProperties": { "[a-zA-Z_\\-0-9]+": { "$ref": "#/definitions/Property" } }, "additionalProperties": { "$ref": "#/definitions/Property" } }, "PropertyName": { "type": "string", "pattern": "[a-zA-Z_\\-0-9]+" }, "PropertyGroup": { "description": "An object that specifies information about a property group.", "type": "object", "properties": { "groupType": { "description": "The type of property group.", "type": "string", "enum": [ "TABULAR" ] }, "propertyNames": { "description": "The list of property names in the property group.", "type": "array", "minItems": 1, "maxItems": 256, "uniqueItems": true, "insertionOrder": false, "items": { "$ref": "#/definitions/PropertyName" }, "default": null } }, "additionalProperties": false }, "PropertyGroups": { "type": "object", "patternProperties": { "[a-zA-Z_\\-0-9]+": { "$ref": "#/definitions/PropertyGroup" } }, "additionalProperties": { "$ref": "#/definitions/PropertyGroup" } }, "Component": { "type": "object", "properties": { "componentTypeId": { "$ref": "#/definitions/ComponentTypeId" }, "description": { "$ref": "#/definitions/Description" }, "properties": { "description": "An object that maps strings to the properties to set in the component type. Each string in the mapping must be unique to this object.", "$ref": "#/definitions/Properties" }, "propertyGroups": { "description": "An object that maps strings to the property groups to set in the entity component. Each string in the mapping must be unique to this object.", "$ref": "#/definitions/PropertyGroups" } }, "required": [ "componentTypeId" ], "additionalProperties": false }, "RequiredProperty": { "type": "string", "pattern": "[a-zA-Z_\\-0-9]+" }, "LambdaFunction": { "type": "object", "properties": { "arn": { "type": "string", "pattern": "arn:((aws)|(aws-cn)|(aws-us-gov)|(\\${partition})):lambda:(([a-z0-9-]+)|(\\${region})):([0-9]{12}|(\\${accountId})):function:[/a-zA-Z0-9_-]+", "minLength": 1, "maxLength": 128 } }, "additionalProperties": false, "required": [ "arn" ] }, "DataConnector": { "description": "The data connector.", "type": "object", "properties": { "isNative": { "description": "A Boolean value that specifies whether the data connector is native to IoT TwinMaker.", "type": "boolean" }, "lambda": { "description": "The Lambda function associated with this data connector.", "$ref": "#/definitions/LambdaFunction" } }, "additionalProperties": false }, "Function": { "description": "The function of component type.", "type": "object", "properties": { "implementedBy": { "description": "The data connector.", "$ref": "#/definitions/DataConnector" }, "requiredProperties": { "description": "The required properties of the function.", "type": "array", "minItems": 1, "maxItems": 256, "uniqueItems": true, "insertionOrder": false, "items": { "$ref": "#/definitions/RequiredProperty" }, "default": null }, "scope": { "description": "The scope of the function.", "type": "string", "enum": [ "ENTITY", "WORKSPACE" ] } }, "additionalProperties": false }, "Entity": { "type": "object", "properties": { "description": { "description": "The description of the entity.", "$ref": "#/definitions/DescriptionWithDefault" }, "entityId": { "$ref": "#/definitions/EntityId" }, "entityExternalId": { "description": "The external ID of the entity.", "$ref": "#/definitions/ExternalId" }, "entityName": { "$ref": "#/definitions/EntityName" }, "parentEntityId": { "$ref": "#/definitions/ParentEntityId" }, "tags": { "$ref": "#/definitions/Tags" }, "components": { "description": "A map that sets information about a component.", "type": "object", "patternProperties": { "[a-zA-Z_\\-0-9]+": { "$ref": "#/definitions/Component" } }, "additionalProperties": { "$ref": "#/definitions/Component" } } }, "required": [ "entityId", "entityName" ], "additionalProperties": false }, "ComponentType": { "type": "object", "properties": { "description": { "description": "The description of the component type.", "$ref": "#/definitions/DescriptionWithDefault" }, "componentTypeId": { "$ref": "#/definitions/ComponentTypeId" }, "componentTypeExternalId": { "description": "The external ID of the component type.", "$ref": "#/definitions/ExternalId" }, "componentTypeName": { "$ref": "#/definitions/ComponentTypeName" }, "extendsFrom": { "description": "Specifies the parent component type to extend.", "type": "array", "minItems": 1, "maxItems": 256, "uniqueItems": true, "insertionOrder": false, "items": { "$ref": "#/definitions/ComponentTypeId" }, "default": null }, "functions": { "description": "a Map of functions in the component type. Each function's key must be unique to this map.", "type": "object", "patternProperties": { "[a-zA-Z_\\-0-9]+": { "$ref": "#/definitions/Function" } }, "additionalProperties": { "$ref": "#/definitions/Function" } }, "isSingleton": { "description": "A Boolean value that specifies whether an entity can have more than one component of this type.", "type": "boolean", "default": false }, "propertyDefinitions": { "description": "An map of the property definitions in the component type. Each property definition's key must be unique to this map.", "$ref": "#/definitions/PropertyDefinitions" }, "propertyGroups": { "description": "An object that maps strings to the property groups to set in the component type. Each string in the mapping must be unique to this object.", "$ref": "#/definitions/PropertyGroups" }, "tags": { "$ref": "#/definitions/Tags" } }, "required": [ "componentTypeId" ], "additionalProperties": false }, "EntityComponent": { "type": "object", "properties": { "entityId": { "$ref": "#/definitions/EntityId" }, "componentName": { "$ref": "#/definitions/ComponentName" }, "componentExternalId": { "description": "The external ID of the component.", "$ref": "#/definitions/ExternalId" }, "componentTypeId": { "$ref": "#/definitions/ComponentTypeId" }, "description": { "description": "The description of the component.", "$ref": "#/definitions/Description" }, "properties": { "description": "An object that maps strings to the properties to set in the component. Each string in the mapping must be unique to this object.", "$ref": "#/definitions/Properties" }, "propertyGroups": { "description": "An object that maps strings to the property groups to set in the component. Each string in the mapping must be unique to this object.", "$ref": "#/definitions/PropertyGroups" } }, "required": [ "entityId", "componentTypeId", "componentName" ], "additionalProperties": false } }, "additionalProperties": false, "properties": { "entities": { "type": "array", "uniqueItems": false, "items": { "$ref": "#/definitions/Entity" } }, "componentTypes": { "type": "array", "uniqueItems": false, "items": { "$ref": "#/definitions/ComponentType" } }, "entityComponents": { "type": "array", "uniqueItems": false, "items": { "$ref": "#/definitions/EntityComponent" }, "default": null } } }
Here is an example that creates a new componentType called
component.type.intial
and creates an entity called initial
:
{ "componentTypes": [ { "componentTypeId": "component.type.initial", "tags": { "key": "value" } } ], "entities": [ { "entityName": "initial", "entityId": "initial" } ] }
Here is an example that updates existing entities:
{ "componentTypes": [ { "componentTypeId": "component.type.initial", "description": "updated" } ], "entities": [ { "entityName": "parent", "entityId": "parent" }, { "entityName": "child", "entityId": "child", "components": { "testComponent": { "componentTypeId": "component.type.initial", "properties": { "testProperty": { "definition": { "configuration": { "alias": "property" }, "dataType": { "relationship": { "relationshipType": "parent", "targetComponentTypeId": "test" }, "type": "STRING", "unitOfMeasure": "t" }, "displayName": "displayName" } } } } }, "parentEntityId": "parent" } ], "entityComponents": [ { "entityId": "initial", "componentTypeId": "component.type.initial", "componentName": "entityComponent", "description": "additionalDescription", "properties": { "additionalProperty": { "definition": { "configuration": { "alias": "additionalProperty" }, "dataType": { "type": "STRING" }, "displayName": "additionalDisplayName" }, "value": { "stringValue": "test" } } } } ] }