use of software.amazon.awssdk.services.greengrassv2data.model.GetDeploymentConfigurationRequest in project aws-greengrass-nucleus by aws-greengrass.
the class DeploymentDocumentDownloader method getDeploymentConfiguration.
private GetDeploymentConfigurationResponse getDeploymentConfiguration(String deploymentId) throws RetryableDeploymentDocumentDownloadException {
String thingName = Coerce.toString(deviceConfiguration.getThingName());
GetDeploymentConfigurationRequest getDeploymentConfigurationRequest = GetDeploymentConfigurationRequest.builder().deploymentId(deploymentId).coreDeviceThingName(thingName).build();
GetDeploymentConfigurationResponse deploymentConfiguration;
try {
logger.atInfo().kv("DeploymentId", deploymentId).kv("ThingName", thingName).log("Calling Greengrass cloud to get full deployment configuration.");
deploymentConfiguration = greengrassServiceClientFactory.getGreengrassV2DataClient().getDeploymentConfiguration(getDeploymentConfigurationRequest);
} catch (AwsServiceException e) {
throw new RetryableDeploymentDocumentDownloadException("Greengrass Cloud Service returned an error when getting full deployment configuration.", e);
} catch (SdkClientException e) {
throw new RetryableDeploymentDocumentDownloadException("Failed to contact Greengrass cloud or unable to parse response.", e);
}
return deploymentConfiguration;
}
Aggregations