From c41cca66316adb6253f9116b24bb7bdd21e9c110 Mon Sep 17 00:00:00 2001 From: Macdonald Date: Mon, 10 Nov 2025 13:13:53 -0500 Subject: [PATCH] removed outdated calls --- .doc_gen/metadata/iot_sitewise_metadata.yaml | 87 ------------------- .../scenario/SitewiseScenario.java | 66 +------------- .../src/test/java/SitewiseTests.java | 32 ------- scenarios/basics/sitewise/SPECIFICATION.md | 69 ++------------- 4 files changed, 9 insertions(+), 245 deletions(-) diff --git a/.doc_gen/metadata/iot_sitewise_metadata.yaml b/.doc_gen/metadata/iot_sitewise_metadata.yaml index d6dd34950e5..e6edf773a33 100644 --- a/.doc_gen/metadata/iot_sitewise_metadata.yaml +++ b/.doc_gen/metadata/iot_sitewise_metadata.yaml @@ -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: @@ -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: diff --git a/javav2/example_code/iotsitewise/src/main/java/com/example/iotsitewise/scenario/SitewiseScenario.java b/javav2/example_code/iotsitewise/src/main/java/com/example/iotsitewise/scenario/SitewiseScenario.java index 2f313697f90..1fe7b52bc60 100644 --- a/javav2/example_code/iotsitewise/src/main/java/com/example/iotsitewise/scenario/SitewiseScenario.java +++ b/javav2/example_code/iotsitewise/src/main/java/com/example/iotsitewise/scenario/SitewiseScenario.java @@ -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 @@ -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) @@ -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. @@ -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(); diff --git a/javav2/example_code/iotsitewise/src/test/java/SitewiseTests.java b/javav2/example_code/iotsitewise/src/test/java/SitewiseTests.java index 0f8efe85353..9d65faf8f3e 100644 --- a/javav2/example_code/iotsitewise/src/test/java/SitewiseTests.java +++ b/javav2/example_code/iotsitewise/src/test/java/SitewiseTests.java @@ -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") @@ -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) diff --git a/scenarios/basics/sitewise/SPECIFICATION.md b/scenarios/basics/sitewise/SPECIFICATION.md index 71208af7df0..ae9e534679b 100644 --- a/scenarios/basics/sitewise/SPECIFICATION.md +++ b/scenarios/basics/sitewise/SPECIFICATION.md @@ -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." @@ -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 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 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 to continue: -c -Continuing with the program... - -Portal URL: https://p-fy9qnrqy.app.iotsitewise.aws - -Enter 'c' followed by 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, @@ -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 to continue: c @@ -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. @@ -278,17 +235,6 @@ Enter 'c' followed by 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 to continue: -c -Continuing with the program... - Delete the AWS IoT SiteWise Asset Model Asset model deleted successfully. @@ -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 |