Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 128 additions & 0 deletions .doc_gen/metadata/iot_sitewise_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ iotsitewise_Hello:
- description:
snippet_tags:
- python.example_code.iotsitewise.Hello
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.hello
services:
iotsitewise: {ListAssetModels}
iotsitewise_DescribeGateway:
Expand All @@ -43,6 +51,14 @@ iotsitewise_DescribeGateway:
snippet_tags:
- python.example_code.iotsitewise.IoTSitewiseWrapper.decl
- python.example_code.iotsitewise.DescribeGateway
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.describeGateway
services:
iotsitewise: {DescribeGateway}
iotsitewise_DeleteGateway:
Expand All @@ -64,6 +80,14 @@ iotsitewise_DeleteGateway:
snippet_tags:
- python.example_code.iotsitewise.IoTSitewiseWrapper.decl
- python.example_code.iotsitewise.DeleteGateway
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.deleteGateway
services:
iotsitewise: {DeleteGateway}
iotsitewise_CreateGateway:
Expand All @@ -85,6 +109,14 @@ iotsitewise_CreateGateway:
snippet_tags:
- python.example_code.iotsitewise.IoTSitewiseWrapper.decl
- python.example_code.iotsitewise.CreateGateway
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.createGateway
services:
iotsitewise: {CreateGateway}
iotsitewise_DescribePortal:
Expand All @@ -106,6 +138,14 @@ iotsitewise_DescribePortal:
snippet_tags:
- python.example_code.iotsitewise.IoTSitewiseWrapper.decl
- python.example_code.iotsitewise.CreateGateway
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.describePortal
services:
iotsitewise: {DescribePortal}
iotsitewise_ListAssetModels:
Expand All @@ -127,6 +167,14 @@ iotsitewise_ListAssetModels:
snippet_tags:
- python.example_code.iotsitewise.IoTSitewiseWrapper.decl
- python.example_code.iotsitewise.ListAssetModels
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.listAssetModels
services:
iotsitewise: {ListAssetModels}
iotsitewise_DeletePortal:
Expand All @@ -148,6 +196,14 @@ iotsitewise_DeletePortal:
snippet_tags:
- python.example_code.iotsitewise.IoTSitewiseWrapper.decl
- python.example_code.iotsitewise.DeletePortal
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.deletePortal
services:
iotsitewise: {DeletePortal}
iotsitewise_CreatePortal:
Expand All @@ -169,6 +225,14 @@ iotsitewise_CreatePortal:
snippet_tags:
- python.example_code.iotsitewise.IoTSitewiseWrapper.decl
- python.example_code.iotsitewise.CreatePortal
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.createPortal
services:
iotsitewise: {CreatePortal}
iotsitewise_DeleteAssetModel:
Expand All @@ -190,6 +254,14 @@ iotsitewise_DeleteAssetModel:
snippet_tags:
- python.example_code.iotsitewise.IoTSitewiseWrapper.decl
- python.example_code.iotsitewise.DeleteAssetModel
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.deleteAssetModel
services:
iotsitewise: {DeleteAssetModel}
iotsitewise_DeleteAsset:
Expand All @@ -211,6 +283,14 @@ iotsitewise_DeleteAsset:
snippet_tags:
- python.example_code.iotsitewise.IoTSitewiseWrapper.decl
- python.example_code.iotsitewise.DeleteAsset
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.deleteAsset
services:
iotsitewise: {DeleteAsset}
iotsitewise_DescribeAssetModel:
Expand All @@ -223,6 +303,14 @@ iotsitewise_DescribeAssetModel:
- description:
snippet_tags:
- sitewise.java2.describe.asset.model.main
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.describeAssetModel
services:
iotsitewise: {DescribeAssetModel}
iotsitewise_GetAssetPropertyValue:
Expand All @@ -244,6 +332,14 @@ iotsitewise_GetAssetPropertyValue:
snippet_tags:
- python.example_code.iotsitewise.IoTSitewiseWrapper.decl
- python.example_code.iotsitewise.GetAssetPropertyValue
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.getAssetPropertyValue
services:
iotsitewise: {GetAssetPropertyValue}
iotsitewise_BatchPutAssetPropertyValue:
Expand Down Expand Up @@ -275,6 +371,14 @@ iotsitewise_BatchPutAssetPropertyValue:
function.
snippet_tags:
- python.example_code.iotsitewise.BatchPutAssetPropertyValue.values
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.batchPutAssetPropertyValue
services:
iotsitewise: {BatchPutAssetPropertyValue}
iotsitewise_CreateAsset:
Expand All @@ -296,6 +400,14 @@ iotsitewise_CreateAsset:
snippet_tags:
- python.example_code.iotsitewise.IoTSitewiseWrapper.decl
- python.example_code.iotsitewise.CreateAsset
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.createAsset
services:
iotsitewise: {CreateAsset}
iotsitewise_CreateAssetModel:
Expand All @@ -321,6 +433,14 @@ iotsitewise_CreateAssetModel:
Here is an example of a properties list to pass to the function.
snippet_tags:
- python.example_code.iotsitewise.CreateAssetModel.properties
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.createAssetModel
services:
iotsitewise: {CreateAssetModel}
iotsitewise_Scenario:
Expand Down Expand Up @@ -353,5 +473,13 @@ iotsitewise_Scenario:
genai: some
snippet_tags:
- python.example_code.iotsitewise.IoTSitewiseWrapper.class
JavaScript:
versions:
- sdk_version: 3
github: javascriptv3/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- iotsitewise.JavaScript.Basics.scenario
services:
iotsitewise: {}
147 changes: 147 additions & 0 deletions javascriptv3/example_code/iotsitewise/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# AWS IoT SiteWise code examples for the SDK for JavaScript (v3)

## Overview

Shows how to use the AWS SDK for JavaScript (v3) to work with AWS IoT SiteWise.

<!--custom.overview.start-->
<!--custom.overview.end-->

_AWS IoT SiteWise _

## ⚠ Important

* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/).
* Running the tests might result in charges to your AWS account.
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).

<!--custom.important.start-->
<!--custom.important.end-->

## Code examples

### Prerequisites

For prerequisites, see the [README](../../README.md#Prerequisites) in the `javascriptv3` folder.


<!--custom.prerequisites.start-->
<!--custom.prerequisites.end-->

### Get started

- [Hello AWS IoT SiteWise](hello.js#L4) (`ListAssetModels`)


### Basics

Code examples that show you how to perform the essential operations within a service.

- [Learn the basics](scenarios/iotsitewise-basics.js)


### Single actions

Code excerpts that show you how to call individual service functions.

- [BatchPutAssetPropertyValue](actions/batch-put-asset-property-value.js#L4)
- [CreateAsset](actions/create-asset.js#L4)
- [CreateAssetModel](actions/create-asset-model.js#L4)
- [CreateGateway](actions/create-gateway.js#L4)
- [CreatePortal](actions/create-portal.js#L4)
- [DeleteAsset](actions/delete-asset.js#L4)
- [DeleteAssetModel](actions/delete-asset-model.js#L4)
- [DeleteGateway](actions/delete-gateway.js#L4)
- [DeletePortal](actions/delete-portal.js#L4)
- [DescribeAssetModel](actions/describe-asset-model.js#L4)
- [DescribeGateway](actions/describe-gateway.js#L4)
- [DescribePortal](actions/describe-portal.js#L4)
- [GetAssetPropertyValue](actions/get-asset-property-value.js#L4)
- [ListAssetModels](actions/list-asset-models.js#L4)


<!--custom.examples.start-->
<!--custom.examples.end-->

## Run the examples

### Instructions

**Note**: All code examples are written in ECMAscript 6 (ES6). For guidelines on converting to CommonJS, see
[JavaScript ES6/CommonJS syntax](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/sdk-examples-javascript-syntax.html).

**Run a single action**

```bash
node ./actions/<fileName>
```

**Run a scenario**

Most scenarios can be run with the following command:
```bash
node ./scenarios/<fileName>
```

**Run with options**

Some actions and scenarios can be run with options from the command line:
```bash
node ./scenarios/<fileName> --option1 --option2
```
[util.parseArgs](https://nodejs.org/api/util.html#utilparseargsconfig) is used to configure
these options. For the specific options available to each script, see the `parseArgs` usage
for that file.

<!--custom.instructions.start-->
<!--custom.instructions.end-->

#### Hello AWS IoT SiteWise

This example shows you how to get started using AWS IoT SiteWise.

```bash
node ./hello.js
```

#### Learn the basics

This example shows you how to learn core operations for AWS IoT SiteWise using an AWS SDK.


<!--custom.basic_prereqs.iotsitewise_Scenario.start-->
<!--custom.basic_prereqs.iotsitewise_Scenario.end-->


<!--custom.basics.iotsitewise_Scenario.start-->
<!--custom.basics.iotsitewise_Scenario.end-->


### Tests

⚠ Running tests might result in charges to your AWS account.


To find instructions for running these tests, see the [README](../../README.md#Tests)
in the `javascriptv3` folder.



<!--custom.tests.start-->
<!--custom.tests.end-->

## Additional resources

- [AWS IoT SiteWise Developer Guide](https://docs.aws.amazon.com/iot-sitewise/latest/userguide/what-is-sitewise.html)
- [AWS IoT SiteWise API Reference](https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/Welcome.html)
- [SDK for JavaScript (v3) AWS IoT SiteWise reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/iotsitewise)

<!--custom.resources.start-->
<!--custom.resources.end-->

---

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
Loading
Loading