use of bio.terra.cloudres.common.ClientConfig in project terra-cloud-resource-lib by DataBiosphere.
the class AzureResourceCleanupRecorder method logRequest.
@Override
public Mono<Void> logRequest(ClientLogger logger, HttpRequestLoggingContext loggingOptions) {
final Context context = loggingOptions.getContext();
Optional.ofNullable(context).flatMap(c -> c.getData(CLOUD_RESOURCE_REQUEST_DATA_KEY)).ifPresent(data -> {
ResourceManagerRequestData requestData = (ResourceManagerRequestData) data;
requestData.resourceUidCreation().ifPresent(resourceUid -> CleanupRecorder.record(resourceUid, requestData.resourceCreationMetadata().orElse(null), clientConfig));
});
return Mono.empty();
}
Aggregations