Skip to content
Open
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
87 changes: 0 additions & 87 deletions .doc_gen/metadata/iot_sitewise_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,35 +119,6 @@ iotsitewise_CreateGateway:
- iotsitewise.JavaScript.Basics.createGateway
services:
iotsitewise: {CreateGateway}
iotsitewise_DescribePortal:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- sitewise.java2.describe.portal.main
Python:
versions:
- sdk_version: 3
github: python/example_code/iotsitewise
excerpts:
- description:
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:
languages:
Java:
Expand Down Expand Up @@ -177,64 +148,6 @@ iotsitewise_ListAssetModels:
- iotsitewise.JavaScript.Basics.listAssetModels
services:
iotsitewise: {ListAssetModels}
iotsitewise_DeletePortal:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- sitewise.java2.delete.portal.main
Python:
versions:
- sdk_version: 3
github: python/example_code/iotsitewise
excerpts:
- description:
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:
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/iotsitewise
excerpts:
- description:
snippet_tags:
- sitewise.java2.create.portal.main
Python:
versions:
- sdk_version: 3
github: python/example_code/iotsitewise
excerpts:
- description:
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:
languages:
Java:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,53 +219,7 @@ public static void runScenario(String assetModelName, String assetName, String
logger.info(DASHES);

logger.info(DASHES);
logger.info("6. Create an IoT SiteWise Portal");
logger.info("""
An IoT SiteWise Portal allows you to aggregate data from multiple industrial sources,
such as sensors, equipment, and control systems, into a centralized platform.
""");
waitForInputToContinue(scanner);
String portalId;
try {
portalId = sitewiseActions.createPortalAsync(portalName, iamRole, contactEmail).join();
logger.info("Portal created successfully. Portal ID {}", portalId);
} catch (CompletionException ce) {
Throwable cause = ce.getCause();
if (cause instanceof IoTSiteWiseException siteWiseEx) {
logger.error("IoT SiteWise error occurred: Error message: {}, Error code {}",
siteWiseEx.getMessage(), siteWiseEx.awsErrorDetails().errorCode(), siteWiseEx);
} else {
logger.error("An unexpected error occurred: {}", cause.getMessage());
}
return;
}
waitForInputToContinue(scanner);
logger.info(DASHES);

logger.info(DASHES);
logger.info("7. Describe the Portal");
logger.info("""
In this step, we get a description of the portal and display the portal URL.
""");
waitForInputToContinue(scanner);
try {
String portalUrl = sitewiseActions.describePortalAsync(portalId).join();
logger.info("Portal URL: {}", portalUrl);
} catch (CompletionException ce) {
Throwable cause = ce.getCause();
if (cause instanceof ResourceNotFoundException notFoundException) {
logger.error("A ResourceNotFoundException occurred: Error message: {}, Error code {}",
notFoundException.getMessage(), notFoundException.awsErrorDetails().errorCode(), notFoundException);
} else {
logger.error("An unexpected error occurred: {}", cause.getMessage());
}
return;
}
waitForInputToContinue(scanner);
logger.info(DASHES);

logger.info(DASHES);
logger.info("8. Create an IoT SiteWise Gateway");
logger.info("6. Create an IoT SiteWise Gateway");
logger.info(
"""
IoT SiteWise Gateway serves as the bridge between industrial equipment, sensors, and the
Expand All @@ -292,7 +246,7 @@ public static void runScenario(String assetModelName, String assetName, String
logger.info(DASHES);
logger.info(DASHES);

logger.info("9. Describe the IoT SiteWise Gateway");
logger.info("7. Describe the IoT SiteWise Gateway");
waitForInputToContinue(scanner);
try {
sitewiseActions.describeGatewayAsync(gatewayId)
Expand All @@ -315,7 +269,7 @@ public static void runScenario(String assetModelName, String assetName, String
logger.info(DASHES);

logger.info(DASHES);
logger.info("10. Delete the AWS IoT SiteWise Assets");
logger.info("8. Delete the AWS IoT SiteWise Assets");
logger.info(
"""
Before you can delete the Asset Model, you must delete the assets.
Expand All @@ -325,20 +279,6 @@ public static void runScenario(String assetModelName, String assetName, String
String delAns = scanner.nextLine().trim();
if (delAns.equalsIgnoreCase("y")) {
logger.info("You selected to delete the SiteWise assets.");
waitForInputToContinue(scanner);
try {
sitewiseActions.deletePortalAsync(portalId).join();
logger.info("Portal {} was deleted successfully.", portalId);

} catch (CompletionException ce) {
Throwable cause = ce.getCause();
if (cause instanceof ResourceNotFoundException notFoundException) {
logger.error("A ResourceNotFoundException occurred: Error message: {}, Error code {}",
notFoundException.getMessage(), notFoundException.awsErrorDetails().errorCode(), notFoundException);
} else {
logger.error("An unexpected error occurred: {}", cause.getMessage());
}
}

try {
sitewiseActions.deleteGatewayAsync(gatewayId).join();
Expand Down
32 changes: 0 additions & 32 deletions javav2/example_code/iotsitewise/src/test/java/SitewiseTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,27 +151,6 @@ public void testGETHumValue() {
logger.info("Test 6 passed");
}

@Test
@Tag("IntegrationTest")
@Order(7)
public void testCreatePortal() {
assertDoesNotThrow(() -> {
portalId = sitewiseActions.createPortalAsync(portalName, iamRole, contactEmail).join();
assertNotNull(portalId);
});
logger.info("Test 7 passed");
}

@Test
@Tag("IntegrationTest")
@Order(8)
public void testDescribePortal() {
assertDoesNotThrow(() -> {
String portalUrl = sitewiseActions.describePortalAsync(portalId).join();
assertNotNull(portalUrl);
});
logger.info("Test 8 passed");
}

@Test
@Tag("IntegrationTest")
Expand All @@ -194,17 +173,6 @@ public void testDescribeGateway() {
logger.info("Test 10 passed");
}

@Test
@Tag("IntegrationTest")
@Order(11)
public void testDeletePortal() throws InterruptedException {
Thread.sleep(30000);
assertDoesNotThrow(() -> {
sitewiseActions.deletePortalAsync(portalId).join();
});
logger.info("Test 11 passed");
}

@Test
@Tag("IntegrationTest")
@Order(12)
Expand Down
69 changes: 6 additions & 63 deletions scenarios/basics/sitewise/SPECIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,17 @@ The AWS IoT SiteWise Basics scenario executes the following operations.
- This step uses the method `getAssetPropertyValue`.
- Exception Handling: Check to see if a `ResourceNotFoundException` is thrown. If so, display the message and end the program.

6. **Create an IoT SiteWise Portal**:
- Description: This operation creates an IoT SiteWise portal.
- The method `createPortal` is called.
- Exception Handling: Check to see if an `IoTSiteWiseException` is thrown. If so, display the message and end the program.

7. **Describe the Portal**:
- Description: This operation describes the portal and returns a URL for the portal.
- The method `describePortal` is called and returns the URL.
- Exception Handling: Check to see if a `ResourceNotFoundException` is thrown. If so, display the message and end the program.

8. **Create an IoT SiteWise Gateway**:
6. **Create an IoT SiteWise Gateway**:
- Description: This operation creates an IoT SiteWise Gateway.
- The method `createGateway` is called.
- Exception Handling: Check to see if an `IoTSiteWiseException` is thrown. If so, display the message and end the program.

9. **Describe the IoT SiteWise Gateway**:
7. **Describe the IoT SiteWise Gateway**:
- Description: This operation describes the Gateway.
- The method `describeGateway` is called.
- Exception Handling: Check to see if a `ResourceNotFoundException` is thrown. If so, display the message and end the program.

10. **Delete the AWS IoT SiteWise Assets**:
8. **Delete the AWS IoT SiteWise Assets**:
- The `delete` methods are called to clean up the resources.
- Exception Handling: Check to see if a `ResourceNotFoundException` is thrown. If so, display the message and end the program."

Expand Down Expand Up @@ -204,41 +194,8 @@ Continuing with the program...

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
6. Create an IoT SiteWise Portal
An IoT SiteWise Portal allows you to aggregate data from multiple industrial sources,
such as sensors, equipment, and control systems, into a centralized platform.


Enter 'c' followed by <ENTER> to continue:
c
Continuing with the program...

Portal created successfully. Portal ID 63e65729-b7a1-410a-aa36-94145fe92153
The portal Id is 63e65729-b7a1-410a-aa36-94145fe92153

Enter 'c' followed by <ENTER> to continue:
c
Continuing with the program...

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
7. Describe the Portal
In this step, we will describe the step and provide the portal URL.


Enter 'c' followed by <ENTER> to continue:
c
Continuing with the program...

Portal URL: https://p-fy9qnrqy.app.iotsitewise.aws

Enter 'c' followed by <ENTER> to continue:
c
Continuing with the program...

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
8. Create an IoTSitewise Gateway
6 Create an IoTSitewise Gateway
IoTSitewise Gateway serves as the bridge between industrial equipment, sensors, and the
cloud-based IoTSitewise service. It is responsible for securely collecting, processing, and
transmitting data from various industrial assets to the IoTSitewise platform,
Expand All @@ -254,7 +211,7 @@ The ARN of the gateway is arn:aws:iotsitewise:us-east-1:814548047983:gateway/503
Gateway creation completed successfully. id is 50320670-1d88-4a7e-9013-1d7e8a3af832
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
9. Describe the IoTSitewise Gateway
7. Describe the IoTSitewise Gateway

Enter 'c' followed by <ENTER> to continue:
c
Expand All @@ -266,7 +223,7 @@ Gateway Platform: GatewayPlatform(GreengrassV2=GreengrassV2(CoreDeviceThingName=
Gateway Creation Date: 2024-09-18T20:34:13.117Z
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
10. Delete the AWS IoT SiteWise Assets
8. Delete the AWS IoT SiteWise Assets
Before you can delete the Asset Model, you must delete the assets.


Expand All @@ -278,17 +235,6 @@ Enter 'c' followed by <ENTER> to continue:
c
Continuing with the program...

Portal 63e65729-b7a1-410a-aa36-94145fe92153 was deleted successfully.
An unexpected error occurred: Cannot invoke "java.util.concurrent.CompletableFuture.join()" because "future" is null
Asset deleted successfully.
Lets wait 1 min for the asset to be deleted
01:00The Gateway was deleted successfully
00:00Countdown complete!

Enter 'c' followed by <ENTER> to continue:
c
Continuing with the program...

Delete the AWS IoT SiteWise Asset Model
Asset model deleted successfully.

Expand Down Expand Up @@ -316,10 +262,7 @@ The following table describes the metadata used in this Basics Scenario.
| `describeGateway` | iot_sitewise_metadata.yaml | iotsitewise_DescribeGateway |
| `deleteGateway ` | iot_sitewise_metadata.yaml | iotsitewise_DeleteGateway |
| `createGateway ` | iot_sitewise_metadata.yaml | iotsitewise_CreateGateway |
| `describePortal` | iot_sitewise_metadata.yaml | iotsitewise_DescribePortal |
| `listAssetModels` | iot_sitewise_metadata.yaml | iotsitewise_ListAssetModels |
| `deletePortal` | iot_sitewise_metadata.yaml | iotsitewise_DeletePortal |
| `createPortal` | iot_sitewise_metadata.yaml | iotsitewise_CreatePortal |
| `deleteAssetModel` | iot_sitewise_metadata.yaml | iotsitewise_DeleteAssetModel |
| `deleteAsset` | iot_sitewise_metadata.yaml | iotsitewise_DeleteAsset |
| `describeAssetModel` | iot_sitewise_metadata.yaml | iotsitewise_DescribeAssetModel |
Expand Down
Loading