CreateEntity - AWS IoT TwinMaker (original) (raw)
Creates an entity.
Request Syntax
POST /workspaces/workspaceId/entities HTTP/1.1
Content-type: application/json
{
"components": {
"string" : {
"componentTypeId": "string",
"description": "string",
"properties": {
"string" : {
"definition": {
"configuration": {
"string" : "string"
},
"dataType": {
"allowedValues": [
{
"booleanValue": boolean,
"doubleValue": number,
"expression": "string",
"integerValue": number,
"listValue": [
"DataValue"
],
"longValue": number,
"mapValue": {
"string" : "DataValue"
},
"relationshipValue": {
"targetComponentName": "string",
"targetEntityId": "string"
},
"stringValue": "string"
}
],
"nestedType": "DataType",
"relationship": {
"relationshipType": "string",
"targetComponentTypeId": "string"
},
"type": "string",
"unitOfMeasure": "string"
},
"defaultValue": {
"booleanValue": boolean,
"doubleValue": number,
"expression": "string",
"integerValue": number,
"listValue": [
"DataValue"
],
"longValue": number,
"mapValue": {
"string" : "DataValue"
},
"relationshipValue": {
"targetComponentName": "string",
"targetEntityId": "string"
},
"stringValue": "string"
},
"displayName": "string",
"isExternalId": boolean,
"isRequiredInEntity": boolean,
"isStoredExternally": boolean,
"isTimeSeries": boolean
},
"updateType": "string",
"value": {
"booleanValue": boolean,
"doubleValue": number,
"expression": "string",
"integerValue": number,
"listValue": [
"DataValue"
],
"longValue": number,
"mapValue": {
"string" : "DataValue"
},
"relationshipValue": {
"targetComponentName": "string",
"targetEntityId": "string"
},
"stringValue": "string"
}
}
},
"propertyGroups": {
"string" : {
"groupType": "string",
"propertyNames": [ "string" ],
"updateType": "string"
}
}
}
},
"compositeComponents": {
"string" : {
"description": "string",
"properties": {
"string" : {
"definition": {
"configuration": {
"string" : "string"
},
"dataType": {
"allowedValues": [
{
"booleanValue": boolean,
"doubleValue": number,
"expression": "string",
"integerValue": number,
"listValue": [
"DataValue"
],
"longValue": number,
"mapValue": {
"string" : "DataValue"
},
"relationshipValue": {
"targetComponentName": "string",
"targetEntityId": "string"
},
"stringValue": "string"
}
],
"nestedType": "DataType",
"relationship": {
"relationshipType": "string",
"targetComponentTypeId": "string"
},
"type": "string",
"unitOfMeasure": "string"
},
"defaultValue": {
"booleanValue": boolean,
"doubleValue": number,
"expression": "string",
"integerValue": number,
"listValue": [
"DataValue"
],
"longValue": number,
"mapValue": {
"string" : "DataValue"
},
"relationshipValue": {
"targetComponentName": "string",
"targetEntityId": "string"
},
"stringValue": "string"
},
"displayName": "string",
"isExternalId": boolean,
"isRequiredInEntity": boolean,
"isStoredExternally": boolean,
"isTimeSeries": boolean
},
"updateType": "string",
"value": {
"booleanValue": boolean,
"doubleValue": number,
"expression": "string",
"integerValue": number,
"listValue": [
"DataValue"
],
"longValue": number,
"mapValue": {
"string" : "DataValue"
},
"relationshipValue": {
"targetComponentName": "string",
"targetEntityId": "string"
},
"stringValue": "string"
}
}
},
"propertyGroups": {
"string" : {
"groupType": "string",
"propertyNames": [ "string" ],
"updateType": "string"
}
}
}
},
"description": "string",
"entityId": "string",
"entityName": "string",
"parentEntityId": "string",
"tags": {
"string" : "string"
}
}
URI Request Parameters
The request uses the following URI parameters.
The ID of the workspace that contains the entity.
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern: [a-zA-Z_0-9][a-zA-Z_\-0-9]*[a-zA-Z0-9]+
Required: Yes
Request Body
The request accepts the following data in JSON format.
An object that maps strings to the components in the entity. Each string in the mapping must be unique to this object.
Type: String to ComponentRequest object map
Key Length Constraints: Minimum length of 1. Maximum length of 256.
Key Pattern: [a-zA-Z_\-0-9]+
Required: No
This is an object that maps strings to compositeComponent
updates in the request. Each key of the map represents the componentPath
of the compositeComponent
.
Type: String to CompositeComponentRequest object map
Key Length Constraints: Minimum length of 1. Maximum length of 2048.
Key Pattern: [a-zA-Z_\-0-9/]+
Required: No
The description of the entity.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 2048.
Pattern: .*
Required: No
The ID of the entity.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 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]+
Required: No
The name of the entity.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Pattern: [^\u0000-\u001F\u007F]+
Required: Yes
The ID of the entity's parent entity.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 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]+
Required: No
Metadata that you can use to manage the entity.
Type: String to string map
Map Entries: Minimum number of 0 items. Maximum number of 50 items.
Key Length Constraints: Minimum length of 1. Maximum length of 128.
Key Pattern: ([\p{L}\p{Z}\p{N}_.:/=+\-@]*)
Value Length Constraints: Minimum length of 1. Maximum length of 256.
Value Pattern: .*
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"arn": "string",
"creationDateTime": number,
"entityId": "string",
"state": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
The ARN of the entity.
Type: String
Length Constraints: Minimum length of 20. Maximum length of 2048.
Pattern: arn:((aws)|(aws-cn)|(aws-us-gov)):iottwinmaker:[a-z0-9-]+:[0-9]{12}:[\/a-zA-Z0-9_\-\.:]+
The date and time when the entity was created.
Type: Timestamp
The ID of the entity.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 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]+
The current state of the entity.
Type: String
Valid Values: CREATING | UPDATING | DELETING | ACTIVE | ERROR
Errors
For information about the errors that are common to all actions, see Common Errors.
AccessDeniedException
Access is denied.
HTTP Status Code: 403
ConflictException
A conflict occurred.
HTTP Status Code: 409
InternalServerException
An unexpected error has occurred.
HTTP Status Code: 500
ServiceQuotaExceededException
The service quota was exceeded.
HTTP Status Code: 402
ThrottlingException
The rate exceeds the limit.
HTTP Status Code: 429
ValidationException
Failed
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: