Skip to content

get_asset_property_value async

get_asset_property_value(
    *,
    config_overrides: Optional[AsyncIoTSiteWiseClientConfig] = None,
    asset_id: Optional[ID] = None,
    property_id: Optional[ID] = None,
    property_alias: Optional[AssetPropertyAlias] = None,
) -> GetAssetPropertyValueResponse

Gets an asset property's current value. For more information, see Querying current values 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.

Parameters:

  • asset_id (Optional[ID], default: None ) –

    The ID of the asset, in UUID format.

  • property_id (Optional[ID], default: None ) –

    The ID of the asset property, in UUID format.

  • property_alias (Optional[AssetPropertyAlias], default: None ) –

    The alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature). For more information, see Mapping industrial data streams to asset properties in the IoT SiteWise User Guide.

Raises:

  • 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.

  • 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/async_io_t_site_wise.py
async def get_asset_property_value(
    self,
    *,
    config_overrides: Optional[AsyncIoTSiteWiseClientConfig] = None,
    asset_id: Optional["capo_iotsitewise.types.id.ID"] = None,
    property_id: Optional["capo_iotsitewise.types.id.ID"] = None,
    property_alias: Optional[
        "capo_iotsitewise.types.asset_property_alias.AssetPropertyAlias"
    ] = None,
) -> "capo_iotsitewise.types.get_asset_property_value_response.GetAssetPropertyValueResponse":
    """<p>Gets an asset property's current value. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/query-industrial-data.html#current-values">Querying current values</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>

    Args:
        asset_id: <p>The ID of the asset, in UUID format.</p>
        property_id: <p>The ID of the asset property, in UUID format.</p>
        property_alias: <p>The alias that identifies the property, such as an OPC-UA server data stream path (for example, <code>/company/windfarm/3/turbine/7/temperature</code>). For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html">Mapping industrial data streams to asset properties</a> in the <i>IoT SiteWise User Guide</i>.</p>

    Raises:
        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.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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iotsitewise.types.get_asset_property_value_request.GetAssetPropertyValueRequest]",
    ) -> AsyncOperationResponse[
        "capo_iotsitewise.types.get_asset_property_value_response.GetAssetPropertyValueResponse"
    ]:
        import capo_iotsitewise._operations.aws_io_t_site_wise.get_asset_property_value

        (
            output,
            http_response,
        ) = await capo_iotsitewise._operations.aws_io_t_site_wise.get_asset_property_value.async_get_asset_property_value(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetAssetPropertyValue")
    )
    input_: capo_iotsitewise.types.get_asset_property_value_request.GetAssetPropertyValueRequest = {}
    if asset_id is not None:
        input_["asset_id"] = asset_id
    if property_id is not None:
        input_["property_id"] = property_id
    if property_alias is not None:
        input_["property_alias"] = property_alias

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output