use of software.amazon.awssdk.services.ecr.model.GetAuthorizationTokenRequest in project aws-greengrass-provisioner by awslabs.
the class OfficialGreengrassImageDockerClientProvider method getAuthorizationData.
@Override
public AuthorizationData getAuthorizationData() {
Optional<List<String>> optionalRegistryIds = Optional.of(Arrays.asList(ggConstants.getOfficialGreengrassAccountId()));
GetAuthorizationTokenRequest.Builder getAuthorizationTokenRequestBuilder = GetAuthorizationTokenRequest.builder();
optionalRegistryIds.ifPresent(getAuthorizationTokenRequestBuilder::registryIds);
GetAuthorizationTokenRequest getAuthorizationTokenRequest = getAuthorizationTokenRequestBuilder.build();
GetAuthorizationTokenResponse getAuthorizationTokenResponse = getEcrClient().getAuthorizationToken(getAuthorizationTokenRequest);
List<AuthorizationData> authorizationDataList = getAuthorizationTokenResponse.authorizationData();
return authorizationDataList.get(0);
}
use of software.amazon.awssdk.services.ecr.model.GetAuthorizationTokenRequest in project aws-greengrass-provisioner by awslabs.
the class EcrDockerClientProvider method getAuthorizationData.
@Override
public AuthorizationData getAuthorizationData() {
GetAuthorizationTokenRequest getAuthorizationTokenRequest = GetAuthorizationTokenRequest.builder().build();
GetAuthorizationTokenResponse getAuthorizationTokenResponse = ecrClient.getAuthorizationToken(getAuthorizationTokenRequest);
List<AuthorizationData> authorizationDataList = getAuthorizationTokenResponse.authorizationData();
return authorizationDataList.get(0);
}
Aggregations