IoTSiteWise / Client / create_asset
create_asset#
- IoTSiteWise.Client.create_asset(**kwargs)#
Creates an asset from an existing asset model. For more information, see Creating assets in the IoT SiteWise User Guide.
See also: AWS API Documentation
Request Syntax
response = client.create_asset( assetName='string', assetModelId='string', clientToken='string', tags={ 'string': 'string' }, assetDescription='string', assetId='string', assetExternalId='string' )
- Parameters:
assetName (string) –
[REQUIRED]
A friendly name for the asset.
assetModelId (string) –
[REQUIRED]
The ID of the asset model from which to create the asset. This can be either the actual ID in UUID format, or else
externalId:
followed by the external ID, if it has one. For more information, see Referencing objects with external IDs in the IoT SiteWise User Guide.clientToken (string) –
A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don’t reuse this client token if a new idempotent request is required.
This field is autopopulated if not provided.
tags (dict) –
A list of key-value pairs that contain metadata for the asset. For more information, see Tagging your IoT SiteWise resources in the IoT SiteWise User Guide.
(string) –
(string) –
assetDescription (string) – A description for the asset.
assetId (string) – The ID to assign to the asset, if desired. IoT SiteWise automatically generates a unique ID for you, so this parameter is never required. However, if you prefer to supply your own ID instead, you can specify it here in UUID format. If you specify your own ID, it must be globally unique.
assetExternalId (string) – An external ID to assign to the asset. The external ID must be unique within your Amazon Web Services account. For more information, see Using external IDs in the IoT SiteWise User Guide.
- Return type:
dict
- Returns:
Response Syntax
{ 'assetId': 'string', 'assetArn': 'string', 'assetStatus': { 'state': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'FAILED', 'error': { 'code': 'VALIDATION_ERROR'|'INTERNAL_FAILURE', 'message': 'string', 'details': [ { 'code': 'INCOMPATIBLE_COMPUTE_LOCATION'|'INCOMPATIBLE_FORWARDING_CONFIGURATION', 'message': 'string' }, ] } } }
Response Structure
(dict) –
assetId (string) –
The ID of the asset, in UUID format. This ID uniquely identifies the asset within IoT SiteWise and can be used with other IoT SiteWise API operations.
assetArn (string) –
The ARN of the asset, which has the following format.
arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId}
assetStatus (dict) –
The status of the asset, which contains a state (
CREATING
after successfully calling this operation) and any error message.state (string) –
The current status of the asset.
error (dict) –
Contains associated error information, if any.
code (string) –
The error code.
message (string) –
The error message.
details (list) –
A list of detailed errors.
(dict) –
Contains detailed error information.
code (string) –
The error code.
message (string) –
The error message.
Exceptions
IoTSiteWise.Client.exceptions.InvalidRequestException
IoTSiteWise.Client.exceptions.ResourceAlreadyExistsException
IoTSiteWise.Client.exceptions.ResourceNotFoundException
IoTSiteWise.Client.exceptions.InternalFailureException
IoTSiteWise.Client.exceptions.ThrottlingException
IoTSiteWise.Client.exceptions.LimitExceededException
IoTSiteWise.Client.exceptions.ConflictingOperationException