Skip to content

get_asset_property_aggregates async

get_asset_property_aggregates(
    aggregate_types: AggregateTypes,
    resolution: Resolution,
    start_date: Timestamp,
    end_date: Timestamp,
    *,
    config_overrides: Optional[AsyncIoTSiteWiseClientConfig] = None,
    asset_id: Optional[ID] = None,
    property_id: Optional[ID] = None,
    property_alias: Optional[AssetPropertyAlias] = None,
    qualities: Optional[Qualities] = None,
    time_ordering: Optional[TimeOrdering] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[GetAssetPropertyValueAggregatesMaxResults] = None,
) -> GetAssetPropertyAggregatesResponse

Gets aggregated values for an asset property. For more information, see Querying aggregates 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.

  • aggregate_types (AggregateTypes) –

    The data aggregating function.

  • resolution (Resolution) –

    The time interval over which to aggregate data.

  • qualities (Optional[Qualities], default: None ) –

    The quality by which to filter asset data.

  • start_date (Timestamp) –

    The exclusive start of the range from which to query historical data, expressed in seconds in Unix epoch time.

  • end_date (Timestamp) –

    The inclusive end of the range from which to query historical data, expressed in seconds in Unix epoch time.

  • time_ordering (Optional[TimeOrdering], default: None ) –

    The chronological sorting order of the requested information.

    Default: ASCENDING

  • next_token (Optional[NextToken], default: None ) –

    The token to be used for the next set of paginated results.

  • max_results (Optional[GetAssetPropertyValueAggregatesMaxResults], default: None ) –

    The maximum number of results to return for each paginated request. A result set is returned in the two cases, whichever occurs first.

    • The size of the result set is equal to 1 MB.

    • The number of data points in the result set is equal to the value of maxResults. The maximum value of maxResults is 2500.

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_aggregates(
    self,
    aggregate_types: "capo_iotsitewise.types.aggregate_types.AggregateTypes",
    resolution: "capo_iotsitewise.types.resolution.Resolution",
    start_date: "capo_iotsitewise.types.timestamp.Timestamp",
    end_date: "capo_iotsitewise.types.timestamp.Timestamp",
    *,
    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,
    qualities: Optional["capo_iotsitewise.types.qualities.Qualities"] = None,
    time_ordering: Optional[
        "capo_iotsitewise.types.time_ordering.TimeOrdering"
    ] = None,
    next_token: Optional["capo_iotsitewise.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_iotsitewise.types.get_asset_property_value_aggregates_max_results.GetAssetPropertyValueAggregatesMaxResults"
    ] = None,
) -> "capo_iotsitewise.types.get_asset_property_aggregates_response.GetAssetPropertyAggregatesResponse":
    """<p>Gets aggregated values for an asset property. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/query-industrial-data.html#aggregates">Querying aggregates</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>
        aggregate_types: <p>The data aggregating function.</p>
        resolution: <p>The time interval over which to aggregate data.</p>
        qualities: <p>The quality by which to filter asset data.</p>
        start_date: <p>The exclusive start of the range from which to query historical data, expressed in seconds in Unix epoch time.</p>
        end_date: <p>The inclusive end of the range from which to query historical data, expressed in seconds in Unix epoch time.</p>
        time_ordering: <p>The chronological sorting order of the requested information.</p> <p>Default: <code>ASCENDING</code> </p>
        next_token: <p>The token to be used for the next set of paginated results.</p>
        max_results: <p>The maximum number of results to return for each paginated request. A result set is returned in the two cases, whichever occurs first.</p> <ul> <li> <p>The size of the result set is equal to 1 MB.</p> </li> <li> <p>The number of data points in the result set is equal to the value of <code>maxResults</code>. The maximum value of <code>maxResults</code> is 2500.</p> </li> </ul>

    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_aggregates_request.GetAssetPropertyAggregatesRequest]",
    ) -> AsyncOperationResponse[
        "capo_iotsitewise.types.get_asset_property_aggregates_response.GetAssetPropertyAggregatesResponse"
    ]:
        import capo_iotsitewise._operations.aws_io_t_site_wise.get_asset_property_aggregates

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetAssetPropertyAggregates")
    )
    input_: capo_iotsitewise.types.get_asset_property_aggregates_request.GetAssetPropertyAggregatesRequest = {
        "aggregate_types": aggregate_types,
        "resolution": resolution,
        "start_date": start_date,
        "end_date": end_date,
    }
    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
    if qualities is not None:
        input_["qualities"] = qualities
    if time_ordering is not None:
        input_["time_ordering"] = time_ordering
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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