Sends a list of asset property values to IoT SiteWise. Each value is a timestamp-quality-value (TQV) data point. For more information, see Ingesting data using the API in the IoT SiteWise User Guide.
To identify an asset property, you must specify one of the following:
-
The assetId and propertyId of an asset property.
-
A propertyAlias, which is a data stream alias (for example, /company/windfarm/3/turbine/7/temperature). To define an asset property's alias, see UpdateAssetProperty.
With respect to Unix epoch time, IoT SiteWise accepts only TQVs that have a timestamp of no more than 7 days in the past and no more than 10 minutes in the future. IoT SiteWise rejects timestamps outside of the inclusive range of [-7 days, +10 minutes] and returns a TimestampOutOfRangeException error.
For each asset property, IoT SiteWise overwrites TQVs with duplicate timestamps unless the newer TQV has a different quality. For example, if you store a TQV {T1, GOOD, V1}, then storing {T1, GOOD, V2} replaces the existing TQV.
IoT SiteWise authorizes access to each BatchPutAssetPropertyValue entry individually. For more information, see BatchPutAssetPropertyValue authorization in the IoT SiteWise User Guide.
Parameters:
-
enable_partial_entry_processing
(Optional[BooleanValue], default:
None
)
–
This setting enables partial ingestion at entry-level. If set to true, we ingest all TQVs not resulting in an error. If set to false, an invalid TQV fails ingestion of the entire entry that contains it.
-
entries
(PutAssetPropertyValueEntries)
–
The list of asset property value entries for the batch put request. You can specify up to 10 entries per request.
Raises:
-
ConflictingOperationException
–
Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.
-
InternalFailureException
–
IoT SiteWise can't process your request right now. Try again later.
-
InvalidRequestException
–
The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters. Check your request and try again.
-
LimitExceededException
–
You've reached the quota for a resource. For example, this can occur if you're trying to associate more than the allowed number of child assets or attempting to create more than the allowed number of properties for an asset model.
For more information, see Quotas in the IoT SiteWise User Guide.
-
ResourceNotFoundException
–
The requested resource can't be found.
-
ServiceUnavailableException
–
The requested service is unavailable.
-
ThrottlingException
–
Your request exceeded a rate limit. For example, you might have exceeded the number of IoT SiteWise assets that can be created per second, the allowed number of messages per second, and so on.
For more information, see Quotas in the IoT SiteWise User Guide.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_iotsitewise/_services/io_t_site_wise.py
| def batch_put_asset_property_value(
self,
entries: "capo_iotsitewise.types.put_asset_property_value_entries.PutAssetPropertyValueEntries",
*,
config_overrides: Optional[IoTSiteWiseClientConfig] = None,
enable_partial_entry_processing: Optional[
"capo_iotsitewise.types.boolean_value.BooleanValue"
] = None,
) -> "capo_iotsitewise.types.batch_put_asset_property_value_response.BatchPutAssetPropertyValueResponse":
"""<p>Sends a list of asset property values to IoT SiteWise. Each value is a timestamp-quality-value (TQV) data point. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/ingest-api.html">Ingesting data using the API</a> in the <i>IoT SiteWise User Guide</i>.</p> <p>To identify an asset property, you must specify one of the following:</p> <ul> <li> <p>The <code>assetId</code> and <code>propertyId</code> of an asset property.</p> </li> <li> <p>A <code>propertyAlias</code>, which is a data stream alias (for example, <code>/company/windfarm/3/turbine/7/temperature</code>). To define an asset property's alias, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetProperty.html">UpdateAssetProperty</a>.</p> </li> </ul> <important> <p>With respect to Unix epoch time, IoT SiteWise accepts only TQVs that have a timestamp of no more than 7 days in the past and no more than 10 minutes in the future. IoT SiteWise rejects timestamps outside of the inclusive range of [-7 days, +10 minutes] and returns a <code>TimestampOutOfRangeException</code> error.</p> <p>For each asset property, IoT SiteWise overwrites TQVs with duplicate timestamps unless the newer TQV has a different quality. For example, if you store a TQV <code>{T1, GOOD, V1}</code>, then storing <code>{T1, GOOD, V2}</code> replaces the existing TQV.</p> </important> <p>IoT SiteWise authorizes access to each <code>BatchPutAssetPropertyValue</code> entry individually. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies-batchputassetpropertyvalue-action">BatchPutAssetPropertyValue authorization</a> in the <i>IoT SiteWise User Guide</i>.</p>
Args:
enable_partial_entry_processing: <p>This setting enables partial ingestion at entry-level. If set to <code>true</code>, we ingest all TQVs not resulting in an error. If set to <code>false</code>, an invalid TQV fails ingestion of the entire entry that contains it.</p>
entries: <p>The list of asset property value entries for the batch put request. You can specify up to 10 entries per request.</p>
Raises:
capo_iotsitewise.errors.conflicting_operation_exception.ConflictingOperationException: <p>Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.</p>
capo_iotsitewise.errors.internal_failure_exception.InternalFailureException: <p>IoT SiteWise can't process your request right now. Try again later.</p>
capo_iotsitewise.errors.invalid_request_exception.InvalidRequestException: <p>The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters. Check your request and try again.</p>
capo_iotsitewise.errors.limit_exceeded_exception.LimitExceededException: <p>You've reached the quota for a resource. For example, this can occur if you're trying to associate more than the allowed number of child assets or attempting to create more than the allowed number of properties for an asset model.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html">Quotas</a> in the <i>IoT SiteWise User Guide</i>.</p>
capo_iotsitewise.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource can't be found.</p>
capo_iotsitewise.errors.service_unavailable_exception.ServiceUnavailableException: <p>The requested service is unavailable.</p>
capo_iotsitewise.errors.throttling_exception.ThrottlingException: <p>Your request exceeded a rate limit. For example, you might have exceeded the number of IoT SiteWise assets that can be created per second, the allowed number of messages per second, and so on.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html">Quotas</a> in the <i>IoT SiteWise User Guide</i>.</p>
capo_iotsitewise.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_iotsitewise.types.batch_put_asset_property_value_request.BatchPutAssetPropertyValueRequest]",
) -> OperationResponse[
"capo_iotsitewise.types.batch_put_asset_property_value_response.BatchPutAssetPropertyValueResponse"
]:
import capo_iotsitewise._operations.aws_io_t_site_wise.batch_put_asset_property_value
output, http_response = (
capo_iotsitewise._operations.aws_io_t_site_wise.batch_put_asset_property_value.batch_put_asset_property_value(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("BatchPutAssetPropertyValue")
)
input_: capo_iotsitewise.types.batch_put_asset_property_value_request.BatchPutAssetPropertyValueRequest = {
"entries": entries
}
if enable_partial_entry_processing is not None:
input_["enable_partial_entry_processing"] = enable_partial_entry_processing
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|