Skip to content

Commit c6ee5ad

Browse files
scmacdonrlhagerm
authored andcommitted
removed outdated calls
1 parent 59404bb commit c6ee5ad

File tree

4 files changed

+9
-245
lines changed

4 files changed

+9
-245
lines changed

.doc_gen/metadata/iot_sitewise_metadata.yaml

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -119,35 +119,6 @@ iotsitewise_CreateGateway:
119119
- iotsitewise.JavaScript.Basics.createGateway
120120
services:
121121
iotsitewise: {CreateGateway}
122-
iotsitewise_DescribePortal:
123-
languages:
124-
Java:
125-
versions:
126-
- sdk_version: 2
127-
github: javav2/example_code/iotsitewise
128-
excerpts:
129-
- description:
130-
snippet_tags:
131-
- sitewise.java2.describe.portal.main
132-
Python:
133-
versions:
134-
- sdk_version: 3
135-
github: python/example_code/iotsitewise
136-
excerpts:
137-
- description:
138-
snippet_tags:
139-
- python.example_code.iotsitewise.IoTSitewiseWrapper.decl
140-
- python.example_code.iotsitewise.CreateGateway
141-
JavaScript:
142-
versions:
143-
- sdk_version: 3
144-
github: javascriptv3/example_code/iotsitewise
145-
excerpts:
146-
- description:
147-
snippet_tags:
148-
- iotsitewise.JavaScript.Basics.describePortal
149-
services:
150-
iotsitewise: {DescribePortal}
151122
iotsitewise_ListAssetModels:
152123
languages:
153124
Java:
@@ -177,64 +148,6 @@ iotsitewise_ListAssetModels:
177148
- iotsitewise.JavaScript.Basics.listAssetModels
178149
services:
179150
iotsitewise: {ListAssetModels}
180-
iotsitewise_DeletePortal:
181-
languages:
182-
Java:
183-
versions:
184-
- sdk_version: 2
185-
github: javav2/example_code/iotsitewise
186-
excerpts:
187-
- description:
188-
snippet_tags:
189-
- sitewise.java2.delete.portal.main
190-
Python:
191-
versions:
192-
- sdk_version: 3
193-
github: python/example_code/iotsitewise
194-
excerpts:
195-
- description:
196-
snippet_tags:
197-
- python.example_code.iotsitewise.IoTSitewiseWrapper.decl
198-
- python.example_code.iotsitewise.DeletePortal
199-
JavaScript:
200-
versions:
201-
- sdk_version: 3
202-
github: javascriptv3/example_code/iotsitewise
203-
excerpts:
204-
- description:
205-
snippet_tags:
206-
- iotsitewise.JavaScript.Basics.deletePortal
207-
services:
208-
iotsitewise: {DeletePortal}
209-
iotsitewise_CreatePortal:
210-
languages:
211-
Java:
212-
versions:
213-
- sdk_version: 2
214-
github: javav2/example_code/iotsitewise
215-
excerpts:
216-
- description:
217-
snippet_tags:
218-
- sitewise.java2.create.portal.main
219-
Python:
220-
versions:
221-
- sdk_version: 3
222-
github: python/example_code/iotsitewise
223-
excerpts:
224-
- description:
225-
snippet_tags:
226-
- python.example_code.iotsitewise.IoTSitewiseWrapper.decl
227-
- python.example_code.iotsitewise.CreatePortal
228-
JavaScript:
229-
versions:
230-
- sdk_version: 3
231-
github: javascriptv3/example_code/iotsitewise
232-
excerpts:
233-
- description:
234-
snippet_tags:
235-
- iotsitewise.JavaScript.Basics.createPortal
236-
services:
237-
iotsitewise: {CreatePortal}
238151
iotsitewise_DeleteAssetModel:
239152
languages:
240153
Java:

javav2/example_code/iotsitewise/src/main/java/com/example/iotsitewise/scenario/SitewiseScenario.java

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -219,53 +219,7 @@ public static void runScenario(String assetModelName, String assetName, String
219219
logger.info(DASHES);
220220

221221
logger.info(DASHES);
222-
logger.info("6. Create an IoT SiteWise Portal");
223-
logger.info("""
224-
An IoT SiteWise Portal allows you to aggregate data from multiple industrial sources,
225-
such as sensors, equipment, and control systems, into a centralized platform.
226-
""");
227-
waitForInputToContinue(scanner);
228-
String portalId;
229-
try {
230-
portalId = sitewiseActions.createPortalAsync(portalName, iamRole, contactEmail).join();
231-
logger.info("Portal created successfully. Portal ID {}", portalId);
232-
} catch (CompletionException ce) {
233-
Throwable cause = ce.getCause();
234-
if (cause instanceof IoTSiteWiseException siteWiseEx) {
235-
logger.error("IoT SiteWise error occurred: Error message: {}, Error code {}",
236-
siteWiseEx.getMessage(), siteWiseEx.awsErrorDetails().errorCode(), siteWiseEx);
237-
} else {
238-
logger.error("An unexpected error occurred: {}", cause.getMessage());
239-
}
240-
return;
241-
}
242-
waitForInputToContinue(scanner);
243-
logger.info(DASHES);
244-
245-
logger.info(DASHES);
246-
logger.info("7. Describe the Portal");
247-
logger.info("""
248-
In this step, we get a description of the portal and display the portal URL.
249-
""");
250-
waitForInputToContinue(scanner);
251-
try {
252-
String portalUrl = sitewiseActions.describePortalAsync(portalId).join();
253-
logger.info("Portal URL: {}", portalUrl);
254-
} catch (CompletionException ce) {
255-
Throwable cause = ce.getCause();
256-
if (cause instanceof ResourceNotFoundException notFoundException) {
257-
logger.error("A ResourceNotFoundException occurred: Error message: {}, Error code {}",
258-
notFoundException.getMessage(), notFoundException.awsErrorDetails().errorCode(), notFoundException);
259-
} else {
260-
logger.error("An unexpected error occurred: {}", cause.getMessage());
261-
}
262-
return;
263-
}
264-
waitForInputToContinue(scanner);
265-
logger.info(DASHES);
266-
267-
logger.info(DASHES);
268-
logger.info("8. Create an IoT SiteWise Gateway");
222+
logger.info("6. Create an IoT SiteWise Gateway");
269223
logger.info(
270224
"""
271225
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
292246
logger.info(DASHES);
293247
logger.info(DASHES);
294248

295-
logger.info("9. Describe the IoT SiteWise Gateway");
249+
logger.info("7. Describe the IoT SiteWise Gateway");
296250
waitForInputToContinue(scanner);
297251
try {
298252
sitewiseActions.describeGatewayAsync(gatewayId)
@@ -315,7 +269,7 @@ public static void runScenario(String assetModelName, String assetName, String
315269
logger.info(DASHES);
316270

317271
logger.info(DASHES);
318-
logger.info("10. Delete the AWS IoT SiteWise Assets");
272+
logger.info("8. Delete the AWS IoT SiteWise Assets");
319273
logger.info(
320274
"""
321275
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
325279
String delAns = scanner.nextLine().trim();
326280
if (delAns.equalsIgnoreCase("y")) {
327281
logger.info("You selected to delete the SiteWise assets.");
328-
waitForInputToContinue(scanner);
329-
try {
330-
sitewiseActions.deletePortalAsync(portalId).join();
331-
logger.info("Portal {} was deleted successfully.", portalId);
332-
333-
} catch (CompletionException ce) {
334-
Throwable cause = ce.getCause();
335-
if (cause instanceof ResourceNotFoundException notFoundException) {
336-
logger.error("A ResourceNotFoundException occurred: Error message: {}, Error code {}",
337-
notFoundException.getMessage(), notFoundException.awsErrorDetails().errorCode(), notFoundException);
338-
} else {
339-
logger.error("An unexpected error occurred: {}", cause.getMessage());
340-
}
341-
}
342282

343283
try {
344284
sitewiseActions.deleteGatewayAsync(gatewayId).join();

javav2/example_code/iotsitewise/src/test/java/SitewiseTests.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -151,27 +151,6 @@ public void testGETHumValue() {
151151
logger.info("Test 6 passed");
152152
}
153153

154-
@Test
155-
@Tag("IntegrationTest")
156-
@Order(7)
157-
public void testCreatePortal() {
158-
assertDoesNotThrow(() -> {
159-
portalId = sitewiseActions.createPortalAsync(portalName, iamRole, contactEmail).join();
160-
assertNotNull(portalId);
161-
});
162-
logger.info("Test 7 passed");
163-
}
164-
165-
@Test
166-
@Tag("IntegrationTest")
167-
@Order(8)
168-
public void testDescribePortal() {
169-
assertDoesNotThrow(() -> {
170-
String portalUrl = sitewiseActions.describePortalAsync(portalId).join();
171-
assertNotNull(portalUrl);
172-
});
173-
logger.info("Test 8 passed");
174-
}
175154

176155
@Test
177156
@Tag("IntegrationTest")
@@ -194,17 +173,6 @@ public void testDescribeGateway() {
194173
logger.info("Test 10 passed");
195174
}
196175

197-
@Test
198-
@Tag("IntegrationTest")
199-
@Order(11)
200-
public void testDeletePortal() throws InterruptedException {
201-
Thread.sleep(30000);
202-
assertDoesNotThrow(() -> {
203-
sitewiseActions.deletePortalAsync(portalId).join();
204-
});
205-
logger.info("Test 11 passed");
206-
}
207-
208176
@Test
209177
@Tag("IntegrationTest")
210178
@Order(12)

scenarios/basics/sitewise/SPECIFICATION.md

Lines changed: 6 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -45,27 +45,17 @@ The AWS IoT SiteWise Basics scenario executes the following operations.
4545
- This step uses the method `getAssetPropertyValue`.
4646
- Exception Handling: Check to see if a `ResourceNotFoundException` is thrown. If so, display the message and end the program.
4747

48-
6. **Create an IoT SiteWise Portal**:
49-
- Description: This operation creates an IoT SiteWise portal.
50-
- The method `createPortal` is called.
51-
- Exception Handling: Check to see if an `IoTSiteWiseException` is thrown. If so, display the message and end the program.
52-
53-
7. **Describe the Portal**:
54-
- Description: This operation describes the portal and returns a URL for the portal.
55-
- The method `describePortal` is called and returns the URL.
56-
- Exception Handling: Check to see if a `ResourceNotFoundException` is thrown. If so, display the message and end the program.
57-
58-
8. **Create an IoT SiteWise Gateway**:
48+
6. **Create an IoT SiteWise Gateway**:
5949
- Description: This operation creates an IoT SiteWise Gateway.
6050
- The method `createGateway` is called.
6151
- Exception Handling: Check to see if an `IoTSiteWiseException` is thrown. If so, display the message and end the program.
6252

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

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

@@ -204,41 +194,8 @@ Continuing with the program...
204194
205195
--------------------------------------------------------------------------------
206196
--------------------------------------------------------------------------------
207-
6. Create an IoT SiteWise Portal
208-
An IoT SiteWise Portal allows you to aggregate data from multiple industrial sources,
209-
such as sensors, equipment, and control systems, into a centralized platform.
210-
211-
212-
Enter 'c' followed by <ENTER> to continue:
213-
c
214-
Continuing with the program...
215-
216-
Portal created successfully. Portal ID 63e65729-b7a1-410a-aa36-94145fe92153
217-
The portal Id is 63e65729-b7a1-410a-aa36-94145fe92153
218-
219-
Enter 'c' followed by <ENTER> to continue:
220-
c
221-
Continuing with the program...
222-
223-
--------------------------------------------------------------------------------
224-
--------------------------------------------------------------------------------
225-
7. Describe the Portal
226-
In this step, we will describe the step and provide the portal URL.
227-
228197
229-
Enter 'c' followed by <ENTER> to continue:
230-
c
231-
Continuing with the program...
232-
233-
Portal URL: https://p-fy9qnrqy.app.iotsitewise.aws
234-
235-
Enter 'c' followed by <ENTER> to continue:
236-
c
237-
Continuing with the program...
238-
239-
--------------------------------------------------------------------------------
240-
--------------------------------------------------------------------------------
241-
8. Create an IoTSitewise Gateway
198+
6 Create an IoTSitewise Gateway
242199
IoTSitewise Gateway serves as the bridge between industrial equipment, sensors, and the
243200
cloud-based IoTSitewise service. It is responsible for securely collecting, processing, and
244201
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
254211
Gateway creation completed successfully. id is 50320670-1d88-4a7e-9013-1d7e8a3af832
255212
--------------------------------------------------------------------------------
256213
--------------------------------------------------------------------------------
257-
9. Describe the IoTSitewise Gateway
214+
7. Describe the IoTSitewise Gateway
258215
259216
Enter 'c' followed by <ENTER> to continue:
260217
c
@@ -266,7 +223,7 @@ Gateway Platform: GatewayPlatform(GreengrassV2=GreengrassV2(CoreDeviceThingName=
266223
Gateway Creation Date: 2024-09-18T20:34:13.117Z
267224
--------------------------------------------------------------------------------
268225
--------------------------------------------------------------------------------
269-
10. Delete the AWS IoT SiteWise Assets
226+
8. Delete the AWS IoT SiteWise Assets
270227
Before you can delete the Asset Model, you must delete the assets.
271228
272229
@@ -278,17 +235,6 @@ Enter 'c' followed by <ENTER> to continue:
278235
c
279236
Continuing with the program...
280237
281-
Portal 63e65729-b7a1-410a-aa36-94145fe92153 was deleted successfully.
282-
An unexpected error occurred: Cannot invoke "java.util.concurrent.CompletableFuture.join()" because "future" is null
283-
Asset deleted successfully.
284-
Lets wait 1 min for the asset to be deleted
285-
01:00The Gateway was deleted successfully
286-
00:00Countdown complete!
287-
288-
Enter 'c' followed by <ENTER> to continue:
289-
c
290-
Continuing with the program...
291-
292238
Delete the AWS IoT SiteWise Asset Model
293239
Asset model deleted successfully.
294240
@@ -316,10 +262,7 @@ The following table describes the metadata used in this Basics Scenario.
316262
| `describeGateway` | iot_sitewise_metadata.yaml | iotsitewise_DescribeGateway |
317263
| `deleteGateway ` | iot_sitewise_metadata.yaml | iotsitewise_DeleteGateway |
318264
| `createGateway ` | iot_sitewise_metadata.yaml | iotsitewise_CreateGateway |
319-
| `describePortal` | iot_sitewise_metadata.yaml | iotsitewise_DescribePortal |
320265
| `listAssetModels` | iot_sitewise_metadata.yaml | iotsitewise_ListAssetModels |
321-
| `deletePortal` | iot_sitewise_metadata.yaml | iotsitewise_DeletePortal |
322-
| `createPortal` | iot_sitewise_metadata.yaml | iotsitewise_CreatePortal |
323266
| `deleteAssetModel` | iot_sitewise_metadata.yaml | iotsitewise_DeleteAssetModel |
324267
| `deleteAsset` | iot_sitewise_metadata.yaml | iotsitewise_DeleteAsset |
325268
| `describeAssetModel` | iot_sitewise_metadata.yaml | iotsitewise_DescribeAssetModel |

0 commit comments

Comments
 (0)