Há mais exemplos de AWS SDK disponíveis no repositório AWS Doc SDK Examples
As traduções são geradas por tradução automática. Em caso de conflito entre o conteúdo da tradução e da versão original em inglês, a versão em inglês prevalecerá.
Use createFleet com um AWS SDK
Os exemplos de código a seguir mostram como usar o createFleet.
- Java
- 
            - SDK para Java 2.x
- 
notaTem mais sobre GitHub. Encontre o exemplo completo e saiba como configurar e executar no AWS Code Examples Repository . /** * Creates a new fleet. * * @param catARN the Amazon Resource Name (ARN) of the signal catalog to associate with the fleet * @param fleetId the unique identifier for the fleet * @return a {@link CompletableFuture} that completes with the ID of the created fleet */ public CompletableFuture<String> createFleetAsync(String catARN, String fleetId) { CreateFleetRequest fleetRequest = CreateFleetRequest.builder() .fleetId(fleetId) .signalCatalogArn(catARN) .description("Built using the AWS For Java V2") .build(); CompletableFuture<String> result = new CompletableFuture<>(); getAsyncClient().createFleet(fleetRequest) .whenComplete((response, exception) -> { if (exception != null) { Throwable cause = exception.getCause() != null ? exception.getCause() : exception; if (cause instanceof ResourceNotFoundException) { result.completeExceptionally(cause); } else { result.completeExceptionally(new RuntimeException("An unexpected error occurred", cause)); } } else { result.complete(response.id()); } }); return result; }- 
                    Para obter detalhes da API, consulte CreateFleet na Referência da API.AWS SDK for Java 2.x 
 
- 
                    
 
- Kotlin
- 
            - SDK para Kotlin
- 
notaTem mais sobre GitHub. Encontre o exemplo completo e saiba como configurar e executar no AWS Code Examples Repository . /** * Creates a new fleet. * * @param catARN the Amazon Resource Name (ARN) of the signal catalog to associate with the fleet * @param fleetId the unique identifier for the fleet * @return the ID of the created fleet */ suspend fun createFleet(catARN: String, fleetIdVal: String): String { val fleetRequest = CreateFleetRequest { fleetId = fleetIdVal signalCatalogArn = catARN description = "Built using the AWS For Kotlin" } IotFleetWiseClient.fromEnvironment { region = "us-east-1" }.use { fleetwiseClient -> val response = fleetwiseClient.createFleet(fleetRequest) return response.id } }- 
                    Para obter detalhes da API, consulte CreateFleet no AWS SDK para referência da API Kotlin. 
 
- 
                    
 
createDecoderManifest
createModelManifest