There are more AWS SDK examples available in the AWS Doc SDK Examples
Use DeleteProgressUpdateStream
with an AWS SDK
The following code example shows how to use DeleteProgressUpdateStream
.
- Java
-
- SDK for Java 2.x
-
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository
. import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.migrationhub.MigrationHubClient; import software.amazon.awssdk.services.migrationhub.model.DeleteProgressUpdateStreamRequest; import software.amazon.awssdk.services.migrationhub.model.MigrationHubException; /** * Before running this Java V2 code example, set up your development * environment, including your credentials. * * For more information, see the following documentation topic: * * https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html */ public class DeleteProgressStream { public static void main(String[] args) { final String usage = """ Usage: <progressStream>\s Where: progressStream - the name of a progress stream to delete.\s """; if (args.length != 1) { System.out.println(usage); System.exit(1); } String progressStream = args[0]; Region region = Region.US_WEST_2; MigrationHubClient migrationClient = MigrationHubClient.builder() .region(region) .build(); deleteStream(migrationClient, progressStream); migrationClient.close(); } public static void deleteStream(MigrationHubClient migrationClient, String streamName) { try { DeleteProgressUpdateStreamRequest deleteProgressUpdateStreamRequest = DeleteProgressUpdateStreamRequest .builder() .progressUpdateStreamName(streamName) .build(); migrationClient.deleteProgressUpdateStream(deleteProgressUpdateStreamRequest); System.out.println(streamName + " is deleted"); } catch (MigrationHubException e) { System.out.println(e.getMessage()); System.exit(1); } } }
-
For API details, see DeleteProgressUpdateStream in AWS SDK for Java 2.x API Reference.
-
Actions
DescribeApplicationState