These examples demonstrate how to perform several AWS IoT SiteWise operations using the developer preview version of the AWS SDK for Rust.
AWS IoT SiteWise is a managed service that simplifies collecting, organizing, and analyzing industrial equipment data.
- List assets (ListAssets)
- Running this code might result in charges to your AWS account.
- We recommend that you grant this code least privilege, or at most the minimum permissions required to perform the task. For more information, see Grant least privilege in the AWS Identity and Access Management User Guide.
- This code has not been tested in all AWS Regions. Some AWS services are available only in specific Regions.
You must have an AWS account with your default credentials and AWS Region configured as described in https://github.com/awslabs/aws-sdk-rust.
This example lists AWS IoT SiteWise assets in the Region.
cargo run --bin list-assets -- -f FILTER [-a ASSET-MODEL-ID] [-r REGION] [-v]
- FILTER is the type of filter. It must be one of the following:
- ALL - The list includes all assets for a given asset model ID. The ASSET-MODEL-ID parameter is required if you filter by ALL.
- TOP_LEVEL - The list includes only top-level assets in the asset hierarchy tree.
- ASSET-MODEL-ID The ID of the asset model by which to filter the list of assets. This parameter is required if you choose ALL for FILTER.
- REGION The Region in which the client is created. If not supplied, uses the value of the AWS_REGION environment variable. If the environment variable is not set, defaults to us-west-2.
- -v displays additional information.
If the example succeeds, it displays the Amazon Resource Name (ARN) of the new role.
This example list AWS IoT SiteWise asset models in the Region.
cargo run --bin list-asset-models -- [-r REGION] [-v]
- REGION The Region in which the client is created. If not supplied, uses the value of the AWS_REGION environment variable. If the environment variable is not set, defaults to us-west-2.
- -v displays additional information.
This example list AWS IoT SiteWise portals in the Region.
cargo run --bin list-portals -- [-r REGION] [-v]
- REGION The Region in which the client is created. If not supplied, uses the value of the AWS_REGION environment variable. If the environment variable is not set, defaults to us-west-2.
- -v displays additional information.
This example describe an AWS IoT SiteWise asset in the Region.
cargo run --bin describe-asset -- -a ASSET-ID [-r REGION] [-v]
- ASSET-ID The ID of the asset by which to filter the list of assets.
- REGION The Region in which the client is created. If not supplied, uses the value of the AWS_REGION environment variable. If the environment variable is not set, defaults to us-west-2.
- -v displays additional information.
To propose a new code example to the AWS documentation team, see CONTRIBUTING.md. The team prefers to create code examples that show broad scenarios rather than individual API calls.
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0