use of software.amazon.awssdk.services.s3.model.CreateBucketResponse in project edison-microservice by otto-de.
the class S3TogglzRepositoryIntegrationTest method setup.
@BeforeEach
void setup() throws InterruptedException {
// final Integer mappedPort = localstackContainer.getMappedPort(TEST_PORT_S3);
s3Client = new LocalS3Client();
testBucket = "test-togglz" + UUID.randomUUID().toString();
final CreateBucketRequest createBucketRequest = CreateBucketRequest.builder().bucket(testBucket).acl(BucketCannedACL.PUBLIC_READ_WRITE).build();
CreateBucketResponse bucket = s3Client.createBucket(createBucketRequest);
togglzProperties = new TogglzProperties();
togglzProperties.getS3().setBucketName(testBucket);
featureStateConverter = new FeatureStateConverter(s3Client, togglzProperties);
repository = new S3TogglzRepository(featureStateConverter);
}
use of software.amazon.awssdk.services.s3.model.CreateBucketResponse in project newrelic-java-agent by newrelic.
the class S3AsyncClient_Instrumentation method createBucket.
public CompletableFuture<CreateBucketResponse> createBucket(CreateBucketRequest createBucketRequest) {
String uri = "s3://" + createBucketRequest.bucket();
Segment segment = NewRelic.getAgent().getTransaction().startSegment("S3", "createBucket");
AgentBridge.getAgent().getTracedMethod().setTrackChildThreads(false);
CompletableFuture<CreateBucketResponse> result = Weaver.callOriginal();
return result.whenComplete(new S3ResponseResultWrapper<>(segment, uri, "createBucket"));
}
use of software.amazon.awssdk.services.s3.model.CreateBucketResponse in project newrelic-java-agent by newrelic.
the class S3Client_Instrumentation method createBucket.
@Trace
public CreateBucketResponse createBucket(CreateBucketRequest createBucketRequest) {
String uri = "s3://" + createBucketRequest.bucket();
try {
CreateBucketResponse createBucketResponse = Weaver.callOriginal();
S3MetricUtil.reportExternalMetrics(NewRelic.getAgent().getTracedMethod(), uri, createBucketResponse, "createBucket");
return createBucketResponse;
} catch (Exception e) {
S3MetricUtil.reportExternalMetrics(NewRelic.getAgent().getTracedMethod(), uri, "createBucket");
throw e;
}
}
use of software.amazon.awssdk.services.s3.model.CreateBucketResponse in project aws-sdk-java-v2 by aws.
the class S3TestRunner method runTests.
@Override
public void runTests() {
logger.info("starting to run S3 tests");
CreateBucketResponse bucketResponse = null;
try {
bucketResponse = s3UrlConnectionHttpClient.createBucket(b -> b.bucket(BUCKET_NAME));
s3UrlConnectionHttpClient.waiter().waitUntilBucketExists(b -> b.bucket(BUCKET_NAME));
RequestBody requestBody = RequestBody.fromBytes("helloworld".getBytes(StandardCharsets.UTF_8));
s3ApacheHttpClient.putObject(b -> b.bucket(BUCKET_NAME).key(KEY), requestBody);
s3NettyClient.getObject(b -> b.bucket(BUCKET_NAME).key(KEY), AsyncResponseTransformer.toBytes()).join();
} finally {
if (bucketResponse != null) {
s3NettyClient.deleteObject(b -> b.bucket(BUCKET_NAME).key(KEY)).join();
s3NettyClient.deleteBucket(b -> b.bucket(BUCKET_NAME)).join();
}
}
}
Aggregations