AWS Doc SDK ExamplesWord
기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
an AWS SDKImportMigrationTask
와 함께 사용
다음 코드 예시에서는 ImportMigrationTask
을 사용하는 방법을 보여 줍니다.
- Java
-
- Java 2.x용 SDK
-
참고
더 많은 on GitHub가 있습니다. AWS 코드 예시 리포지토리
에서 전체 예시를 찾고 설정 및 실행하는 방법을 배워보세요. import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.migrationhub.MigrationHubClient; import software.amazon.awssdk.services.migrationhub.model.CreateProgressUpdateStreamRequest; import software.amazon.awssdk.services.migrationhub.model.ImportMigrationTaskRequest; 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 ImportMigrationTask { public static void main(String[] args) { final String usage = """ Usage: <migrationTask> <progressStream>\s Where: migrationTask - the name of a migration task.\s progressStream - the name of a progress stream.\s """; if (args.length != 2) { System.out.println(usage); System.exit(1); } String migrationTask = args[0]; String progressStream = args[1]; Region region = Region.US_WEST_2; MigrationHubClient migrationClient = MigrationHubClient.builder() .region(region) .build(); importMigrTask(migrationClient, migrationTask, progressStream); migrationClient.close(); } public static void importMigrTask(MigrationHubClient migrationClient, String migrationTask, String progressStream) { try { CreateProgressUpdateStreamRequest progressUpdateStreamRequest = CreateProgressUpdateStreamRequest.builder() .progressUpdateStreamName(progressStream) .dryRun(false) .build(); migrationClient.createProgressUpdateStream(progressUpdateStreamRequest); ImportMigrationTaskRequest migrationTaskRequest = ImportMigrationTaskRequest.builder() .migrationTaskName(migrationTask) .progressUpdateStream(progressStream) .dryRun(false) .build(); migrationClient.importMigrationTask(migrationTaskRequest); } catch (MigrationHubException e) { System.out.println(e.getMessage()); System.exit(1); } } }
-
API 세부 정보는 ImportMigrationTask AWS SDK for Java 2.x 참조의 API를 참조하세요.
-
DescribeMigrationTask
ListApplications