@Generated(value="software.amazon.awssdk:codegen") public interface CloudTrailAsyncClient extends SdkClient
builder()
method.
This is the CloudTrail API Reference. It provides descriptions of actions, data types, common parameters, and common errors for CloudTrail.
CloudTrail is a web service that records AWS API calls for your AWS account and delivers log files to an Amazon S3 bucket. The recorded information includes the identity of the user, the start time of the AWS API call, the source IP address, the request parameters, and the response elements returned by the service.
As an alternative to the API, you can use one of the AWS SDKs, which consist of libraries and sample code for various programming languages and platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient way to create programmatic access to AWSCloudTrail. For example, the SDKs take care of cryptographically signing requests, managing errors, and retrying requests automatically. For information about the AWS SDKs, including how to download and install them, see the Tools for Amazon Web Services page.
See the AWS CloudTrail User Guide for information about the data that is included with each AWS API call listed in the log files.
Modifier and Type | Field and Description |
---|---|
static String |
SERVICE_NAME |
Modifier and Type | Method and Description |
---|---|
default CompletableFuture<AddTagsResponse> |
addTags(AddTagsRequest addTagsRequest)
Adds one or more tags to a trail, up to a limit of 50.
|
default CompletableFuture<AddTagsResponse> |
addTags(Consumer<AddTagsRequest.Builder> addTagsRequest)
Adds one or more tags to a trail, up to a limit of 50.
|
static CloudTrailAsyncClientBuilder |
builder()
Create a builder that can be used to configure and create a
CloudTrailAsyncClient . |
static CloudTrailAsyncClient |
create()
Create a
CloudTrailAsyncClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider . |
default CompletableFuture<CreateTrailResponse> |
createTrail(Consumer<CreateTrailRequest.Builder> createTrailRequest)
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket.
|
default CompletableFuture<CreateTrailResponse> |
createTrail(CreateTrailRequest createTrailRequest)
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket.
|
default CompletableFuture<DeleteTrailResponse> |
deleteTrail(Consumer<DeleteTrailRequest.Builder> deleteTrailRequest)
Deletes a trail.
|
default CompletableFuture<DeleteTrailResponse> |
deleteTrail(DeleteTrailRequest deleteTrailRequest)
Deletes a trail.
|
default CompletableFuture<DescribeTrailsResponse> |
describeTrails()
Retrieves settings for the trail associated with the current region for your account.
|
default CompletableFuture<DescribeTrailsResponse> |
describeTrails(Consumer<DescribeTrailsRequest.Builder> describeTrailsRequest)
Retrieves settings for the trail associated with the current region for your account.
|
default CompletableFuture<DescribeTrailsResponse> |
describeTrails(DescribeTrailsRequest describeTrailsRequest)
Retrieves settings for the trail associated with the current region for your account.
|
default CompletableFuture<GetEventSelectorsResponse> |
getEventSelectors(Consumer<GetEventSelectorsRequest.Builder> getEventSelectorsRequest)
Describes the settings for the event selectors that you configured for your trail.
|
default CompletableFuture<GetEventSelectorsResponse> |
getEventSelectors(GetEventSelectorsRequest getEventSelectorsRequest)
Describes the settings for the event selectors that you configured for your trail.
|
default CompletableFuture<GetTrailStatusResponse> |
getTrailStatus(Consumer<GetTrailStatusRequest.Builder> getTrailStatusRequest)
Returns a JSON-formatted list of information about the specified trail.
|
default CompletableFuture<GetTrailStatusResponse> |
getTrailStatus(GetTrailStatusRequest getTrailStatusRequest)
Returns a JSON-formatted list of information about the specified trail.
|
default CompletableFuture<ListPublicKeysResponse> |
listPublicKeys()
Returns all public keys whose private keys were used to sign the digest files within the specified time range.
|
default CompletableFuture<ListPublicKeysResponse> |
listPublicKeys(Consumer<ListPublicKeysRequest.Builder> listPublicKeysRequest)
Returns all public keys whose private keys were used to sign the digest files within the specified time range.
|
default CompletableFuture<ListPublicKeysResponse> |
listPublicKeys(ListPublicKeysRequest listPublicKeysRequest)
Returns all public keys whose private keys were used to sign the digest files within the specified time range.
|
default CompletableFuture<ListTagsResponse> |
listTags(Consumer<ListTagsRequest.Builder> listTagsRequest)
Lists the tags for the trail in the current region.
|
default CompletableFuture<ListTagsResponse> |
listTags(ListTagsRequest listTagsRequest)
Lists the tags for the trail in the current region.
|
default CompletableFuture<LookupEventsResponse> |
lookupEvents()
Looks up management events captured by CloudTrail.
|
default CompletableFuture<LookupEventsResponse> |
lookupEvents(Consumer<LookupEventsRequest.Builder> lookupEventsRequest)
Looks up management events captured by CloudTrail.
|
default CompletableFuture<LookupEventsResponse> |
lookupEvents(LookupEventsRequest lookupEventsRequest)
Looks up management events captured by CloudTrail.
|
default LookupEventsPublisher |
lookupEventsPaginator()
Looks up management events captured by CloudTrail.
|
default LookupEventsPublisher |
lookupEventsPaginator(Consumer<LookupEventsRequest.Builder> lookupEventsRequest)
Looks up management events captured by CloudTrail.
|
default LookupEventsPublisher |
lookupEventsPaginator(LookupEventsRequest lookupEventsRequest)
Looks up management events captured by CloudTrail.
|
default CompletableFuture<PutEventSelectorsResponse> |
putEventSelectors(Consumer<PutEventSelectorsRequest.Builder> putEventSelectorsRequest)
Configures an event selector for your trail.
|
default CompletableFuture<PutEventSelectorsResponse> |
putEventSelectors(PutEventSelectorsRequest putEventSelectorsRequest)
Configures an event selector for your trail.
|
default CompletableFuture<RemoveTagsResponse> |
removeTags(Consumer<RemoveTagsRequest.Builder> removeTagsRequest)
Removes the specified tags from a trail.
|
default CompletableFuture<RemoveTagsResponse> |
removeTags(RemoveTagsRequest removeTagsRequest)
Removes the specified tags from a trail.
|
default CompletableFuture<StartLoggingResponse> |
startLogging(Consumer<StartLoggingRequest.Builder> startLoggingRequest)
Starts the recording of AWS API calls and log file delivery for a trail.
|
default CompletableFuture<StartLoggingResponse> |
startLogging(StartLoggingRequest startLoggingRequest)
Starts the recording of AWS API calls and log file delivery for a trail.
|
default CompletableFuture<StopLoggingResponse> |
stopLogging(Consumer<StopLoggingRequest.Builder> stopLoggingRequest)
Suspends the recording of AWS API calls and log file delivery for the specified trail.
|
default CompletableFuture<StopLoggingResponse> |
stopLogging(StopLoggingRequest stopLoggingRequest)
Suspends the recording of AWS API calls and log file delivery for the specified trail.
|
default CompletableFuture<UpdateTrailResponse> |
updateTrail(Consumer<UpdateTrailRequest.Builder> updateTrailRequest)
Updates the settings that specify delivery of log files.
|
default CompletableFuture<UpdateTrailResponse> |
updateTrail(UpdateTrailRequest updateTrailRequest)
Updates the settings that specify delivery of log files.
|
serviceName
close
static final String SERVICE_NAME
static CloudTrailAsyncClient create()
CloudTrailAsyncClient
with the region loaded from the
DefaultAwsRegionProviderChain
and credentials loaded from the
DefaultCredentialsProvider
.static CloudTrailAsyncClientBuilder builder()
CloudTrailAsyncClient
.default CompletableFuture<AddTagsResponse> addTags(AddTagsRequest addTagsRequest)
Adds one or more tags to a trail, up to a limit of 50. Tags must be unique per trail. Overwrites an existing tag's value when a new value is specified for an existing tag key. If you specify a key without a value, the tag will be created with the specified key and a value of null. You can tag a trail that applies to all regions only from the region in which the trail was created (that is, from its home region).
addTagsRequest
- Specifies the tags to add to a trail.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$
.default CompletableFuture<AddTagsResponse> addTags(Consumer<AddTagsRequest.Builder> addTagsRequest)
Adds one or more tags to a trail, up to a limit of 50. Tags must be unique per trail. Overwrites an existing tag's value when a new value is specified for an existing tag key. If you specify a key without a value, the tag will be created with the specified key and a value of null. You can tag a trail that applies to all regions only from the region in which the trail was created (that is, from its home region).
This is a convenience which creates an instance of the AddTagsRequest.Builder
avoiding the need to create
one manually via AddTagsRequest.builder()
addTagsRequest
- A Consumer
that will call methods on AddTagsRequest.Builder
to create a request. Specifies
the tags to add to a trail.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$
.default CompletableFuture<CreateTrailResponse> createTrail(CreateTrailRequest createTrailRequest)
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket. A maximum of five trails can exist in a region, irrespective of the region in which they were created.
createTrailRequest
- Specifies the settings for each trail.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<CreateTrailResponse> createTrail(Consumer<CreateTrailRequest.Builder> createTrailRequest)
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket. A maximum of five trails can exist in a region, irrespective of the region in which they were created.
This is a convenience which creates an instance of the CreateTrailRequest.Builder
avoiding the need to
create one manually via CreateTrailRequest.builder()
createTrailRequest
- A Consumer
that will call methods on CreateTrailRequest.Builder
to create a request.
Specifies the settings for each trail.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<DeleteTrailResponse> deleteTrail(DeleteTrailRequest deleteTrailRequest)
Deletes a trail. This operation must be called from the region in which the trail was created.
DeleteTrail
cannot be called on the shadow trails (replicated trails in other regions) of a trail
that is enabled in all regions.
deleteTrailRequest
- The request that specifies the name of a trail to delete.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<DeleteTrailResponse> deleteTrail(Consumer<DeleteTrailRequest.Builder> deleteTrailRequest)
Deletes a trail. This operation must be called from the region in which the trail was created.
DeleteTrail
cannot be called on the shadow trails (replicated trails in other regions) of a trail
that is enabled in all regions.
This is a convenience which creates an instance of the DeleteTrailRequest.Builder
avoiding the need to
create one manually via DeleteTrailRequest.builder()
deleteTrailRequest
- A Consumer
that will call methods on DeleteTrailRequest.Builder
to create a request. The
request that specifies the name of a trail to delete.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<DescribeTrailsResponse> describeTrails(DescribeTrailsRequest describeTrailsRequest)
Retrieves settings for the trail associated with the current region for your account.
describeTrailsRequest
- Returns information about the trail.default CompletableFuture<DescribeTrailsResponse> describeTrails(Consumer<DescribeTrailsRequest.Builder> describeTrailsRequest)
Retrieves settings for the trail associated with the current region for your account.
This is a convenience which creates an instance of the DescribeTrailsRequest.Builder
avoiding the need to
create one manually via DescribeTrailsRequest.builder()
describeTrailsRequest
- A Consumer
that will call methods on DescribeTrailsRequest.Builder
to create a request.
Returns information about the trail.default CompletableFuture<DescribeTrailsResponse> describeTrails()
Retrieves settings for the trail associated with the current region for your account.
default CompletableFuture<GetEventSelectorsResponse> getEventSelectors(GetEventSelectorsRequest getEventSelectorsRequest)
Describes the settings for the event selectors that you configured for your trail. The information returned for your event selectors includes the following:
If your event selector includes read-only events, write-only events, or all events. This applies to both management events and data events.
If your event selector includes management events.
If your event selector includes data events, the Amazon S3 objects or AWS Lambda functions that you are logging for data events.
For more information, see Logging Data and Management Events for Trails in the AWS CloudTrail User Guide.
getEventSelectorsRequest
- Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<GetEventSelectorsResponse> getEventSelectors(Consumer<GetEventSelectorsRequest.Builder> getEventSelectorsRequest)
Describes the settings for the event selectors that you configured for your trail. The information returned for your event selectors includes the following:
If your event selector includes read-only events, write-only events, or all events. This applies to both management events and data events.
If your event selector includes management events.
If your event selector includes data events, the Amazon S3 objects or AWS Lambda functions that you are logging for data events.
For more information, see Logging Data and Management Events for Trails in the AWS CloudTrail User Guide.
This is a convenience which creates an instance of the GetEventSelectorsRequest.Builder
avoiding the need
to create one manually via GetEventSelectorsRequest.builder()
getEventSelectorsRequest
- A Consumer
that will call methods on GetEventSelectorsRequest.Builder
to create a request.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<GetTrailStatusResponse> getTrailStatus(GetTrailStatusRequest getTrailStatusRequest)
Returns a JSON-formatted list of information about the specified trail. Fields include information on delivery errors, Amazon SNS and Amazon S3 errors, and start and stop logging times for each trail. This operation returns trail status from a single region. To return trail status from all regions, you must call the operation on each region.
getTrailStatusRequest
- The name of a trail about which you want the current status.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<GetTrailStatusResponse> getTrailStatus(Consumer<GetTrailStatusRequest.Builder> getTrailStatusRequest)
Returns a JSON-formatted list of information about the specified trail. Fields include information on delivery errors, Amazon SNS and Amazon S3 errors, and start and stop logging times for each trail. This operation returns trail status from a single region. To return trail status from all regions, you must call the operation on each region.
This is a convenience which creates an instance of the GetTrailStatusRequest.Builder
avoiding the need to
create one manually via GetTrailStatusRequest.builder()
getTrailStatusRequest
- A Consumer
that will call methods on GetTrailStatusRequest.Builder
to create a request.
The name of a trail about which you want the current status.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<ListPublicKeysResponse> listPublicKeys(ListPublicKeysRequest listPublicKeysRequest)
Returns all public keys whose private keys were used to sign the digest files within the specified time range. The public key is needed to validate digest files that were signed with its corresponding private key.
CloudTrail uses different private/public key pairs per region. Each digest file is signed with a private key unique to its region. Therefore, when you validate a digest file from a particular region, you must look in the same region for its corresponding public key.
listPublicKeysRequest
- Requests the public keys for a specified time range.default CompletableFuture<ListPublicKeysResponse> listPublicKeys(Consumer<ListPublicKeysRequest.Builder> listPublicKeysRequest)
Returns all public keys whose private keys were used to sign the digest files within the specified time range. The public key is needed to validate digest files that were signed with its corresponding private key.
CloudTrail uses different private/public key pairs per region. Each digest file is signed with a private key unique to its region. Therefore, when you validate a digest file from a particular region, you must look in the same region for its corresponding public key.
This is a convenience which creates an instance of the ListPublicKeysRequest.Builder
avoiding the need to
create one manually via ListPublicKeysRequest.builder()
listPublicKeysRequest
- A Consumer
that will call methods on ListPublicKeysRequest.Builder
to create a request.
Requests the public keys for a specified time range.default CompletableFuture<ListPublicKeysResponse> listPublicKeys()
Returns all public keys whose private keys were used to sign the digest files within the specified time range. The public key is needed to validate digest files that were signed with its corresponding private key.
CloudTrail uses different private/public key pairs per region. Each digest file is signed with a private key unique to its region. Therefore, when you validate a digest file from a particular region, you must look in the same region for its corresponding public key.
default CompletableFuture<ListTagsResponse> listTags(ListTagsRequest listTagsRequest)
Lists the tags for the trail in the current region.
listTagsRequest
- Specifies a list of trail tags to return.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<ListTagsResponse> listTags(Consumer<ListTagsRequest.Builder> listTagsRequest)
Lists the tags for the trail in the current region.
This is a convenience which creates an instance of the ListTagsRequest.Builder
avoiding the need to
create one manually via ListTagsRequest.builder()
listTagsRequest
- A Consumer
that will call methods on ListTagsRequest.Builder
to create a request.
Specifies a list of trail tags to return.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<LookupEventsResponse> lookupEvents(LookupEventsRequest lookupEventsRequest)
Looks up management events captured by CloudTrail. Events for a region can be looked up in that region during the last 90 days. Lookup supports the following attributes:
AWS access key
Event ID
Event name
Event source
Read only
Resource name
Resource type
User name
All attributes are optional. The default number of results returned is 50, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results.
The rate of lookup requests is limited to one per second per account. If this limit is exceeded, a throttling error occurs.
Events that occurred during the selected time range will not be available for lookup if CloudTrail logging was not enabled when the events occurred.
lookupEventsRequest
- Contains a request for LookupEvents.default CompletableFuture<LookupEventsResponse> lookupEvents(Consumer<LookupEventsRequest.Builder> lookupEventsRequest)
Looks up management events captured by CloudTrail. Events for a region can be looked up in that region during the last 90 days. Lookup supports the following attributes:
AWS access key
Event ID
Event name
Event source
Read only
Resource name
Resource type
User name
All attributes are optional. The default number of results returned is 50, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results.
The rate of lookup requests is limited to one per second per account. If this limit is exceeded, a throttling error occurs.
Events that occurred during the selected time range will not be available for lookup if CloudTrail logging was not enabled when the events occurred.
This is a convenience which creates an instance of the LookupEventsRequest.Builder
avoiding the need to
create one manually via LookupEventsRequest.builder()
lookupEventsRequest
- A Consumer
that will call methods on LookupEventsRequest.Builder
to create a request.
Contains a request for LookupEvents.default CompletableFuture<LookupEventsResponse> lookupEvents()
Looks up management events captured by CloudTrail. Events for a region can be looked up in that region during the last 90 days. Lookup supports the following attributes:
AWS access key
Event ID
Event name
Event source
Read only
Resource name
Resource type
User name
All attributes are optional. The default number of results returned is 50, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results.
The rate of lookup requests is limited to one per second per account. If this limit is exceeded, a throttling error occurs.
Events that occurred during the selected time range will not be available for lookup if CloudTrail logging was not enabled when the events occurred.
default LookupEventsPublisher lookupEventsPaginator()
Looks up management events captured by CloudTrail. Events for a region can be looked up in that region during the last 90 days. Lookup supports the following attributes:
AWS access key
Event ID
Event name
Event source
Read only
Resource name
Resource type
User name
All attributes are optional. The default number of results returned is 50, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results.
The rate of lookup requests is limited to one per second per account. If this limit is exceeded, a throttling error occurs.
Events that occurred during the selected time range will not be available for lookup if CloudTrail logging was not enabled when the events occurred.
This is a variant of lookupEvents(software.amazon.awssdk.services.cloudtrail.model.LookupEventsRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
SDK will internally handle making service calls for you.
When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
failures only after you start streaming the data. The subscribe method should be called as a request to start
streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe
method will result in a new Subscription
i.e., a new contract to stream data from the
starting request.
The following are few ways to use the response class:
1) Using the subscribe helper method
software.amazon.awssdk.services.cloudtrail.paginators.LookupEventsPublisher publisher = client.lookupEventsPaginator(request);
CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
future.get();
2) Using a custom subscriber
software.amazon.awssdk.services.cloudtrail.paginators.LookupEventsPublisher publisher = client.lookupEventsPaginator(request);
publisher.subscribe(new Subscriber<software.amazon.awssdk.services.cloudtrail.model.LookupEventsResponse>() {
public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
public void onNext(software.amazon.awssdk.services.cloudtrail.model.LookupEventsResponse response) { //... };
});
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
Note: If you prefer to have control on service calls, use the
lookupEvents(software.amazon.awssdk.services.cloudtrail.model.LookupEventsRequest)
operation.
default LookupEventsPublisher lookupEventsPaginator(LookupEventsRequest lookupEventsRequest)
Looks up management events captured by CloudTrail. Events for a region can be looked up in that region during the last 90 days. Lookup supports the following attributes:
AWS access key
Event ID
Event name
Event source
Read only
Resource name
Resource type
User name
All attributes are optional. The default number of results returned is 50, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results.
The rate of lookup requests is limited to one per second per account. If this limit is exceeded, a throttling error occurs.
Events that occurred during the selected time range will not be available for lookup if CloudTrail logging was not enabled when the events occurred.
This is a variant of lookupEvents(software.amazon.awssdk.services.cloudtrail.model.LookupEventsRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
SDK will internally handle making service calls for you.
When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
failures only after you start streaming the data. The subscribe method should be called as a request to start
streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe
method will result in a new Subscription
i.e., a new contract to stream data from the
starting request.
The following are few ways to use the response class:
1) Using the subscribe helper method
software.amazon.awssdk.services.cloudtrail.paginators.LookupEventsPublisher publisher = client.lookupEventsPaginator(request);
CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
future.get();
2) Using a custom subscriber
software.amazon.awssdk.services.cloudtrail.paginators.LookupEventsPublisher publisher = client.lookupEventsPaginator(request);
publisher.subscribe(new Subscriber<software.amazon.awssdk.services.cloudtrail.model.LookupEventsResponse>() {
public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
public void onNext(software.amazon.awssdk.services.cloudtrail.model.LookupEventsResponse response) { //... };
});
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
Note: If you prefer to have control on service calls, use the
lookupEvents(software.amazon.awssdk.services.cloudtrail.model.LookupEventsRequest)
operation.
lookupEventsRequest
- Contains a request for LookupEvents.default LookupEventsPublisher lookupEventsPaginator(Consumer<LookupEventsRequest.Builder> lookupEventsRequest)
Looks up management events captured by CloudTrail. Events for a region can be looked up in that region during the last 90 days. Lookup supports the following attributes:
AWS access key
Event ID
Event name
Event source
Read only
Resource name
Resource type
User name
All attributes are optional. The default number of results returned is 50, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results.
The rate of lookup requests is limited to one per second per account. If this limit is exceeded, a throttling error occurs.
Events that occurred during the selected time range will not be available for lookup if CloudTrail logging was not enabled when the events occurred.
This is a variant of lookupEvents(software.amazon.awssdk.services.cloudtrail.model.LookupEventsRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
SDK will internally handle making service calls for you.
When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
failures only after you start streaming the data. The subscribe method should be called as a request to start
streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe
method will result in a new Subscription
i.e., a new contract to stream data from the
starting request.
The following are few ways to use the response class:
1) Using the subscribe helper method
software.amazon.awssdk.services.cloudtrail.paginators.LookupEventsPublisher publisher = client.lookupEventsPaginator(request);
CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
future.get();
2) Using a custom subscriber
software.amazon.awssdk.services.cloudtrail.paginators.LookupEventsPublisher publisher = client.lookupEventsPaginator(request);
publisher.subscribe(new Subscriber<software.amazon.awssdk.services.cloudtrail.model.LookupEventsResponse>() {
public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
public void onNext(software.amazon.awssdk.services.cloudtrail.model.LookupEventsResponse response) { //... };
});
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
Note: If you prefer to have control on service calls, use the
lookupEvents(software.amazon.awssdk.services.cloudtrail.model.LookupEventsRequest)
operation.
This is a convenience which creates an instance of the LookupEventsRequest.Builder
avoiding the need to
create one manually via LookupEventsRequest.builder()
lookupEventsRequest
- A Consumer
that will call methods on LookupEventsRequest.Builder
to create a request.
Contains a request for LookupEvents.default CompletableFuture<PutEventSelectorsResponse> putEventSelectors(PutEventSelectorsRequest putEventSelectorsRequest)
Configures an event selector for your trail. Use event selectors to further specify the management and data event settings for your trail. By default, trails created without specific event selectors will be configured to log all read and write management events, and no data events.
When an event occurs in your account, CloudTrail evaluates the event selectors in all trails. For each trail, if the event matches any event selector, the trail processes and logs the event. If the event doesn't match any event selector, the trail doesn't log the event.
Example
You create an event selector for a trail and specify that you want write-only events.
The EC2 GetConsoleOutput
and RunInstances
API operations occur in your account.
CloudTrail evaluates whether the events match your event selectors.
The RunInstances
is a write-only event and it matches your event selector. The trail logs the event.
The GetConsoleOutput
is a read-only event but it doesn't match your event selector. The trail
doesn't log the event.
The PutEventSelectors
operation must be called from the region in which the trail was created;
otherwise, an InvalidHomeRegionException
is thrown.
You can configure up to five event selectors for each trail. For more information, see Logging Data and Management Events for Trails and Limits in AWS CloudTrail in the AWS CloudTrail User Guide.
putEventSelectorsRequest
- Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
PutEventSelectors
operation is called with a number of event selectors or data resources that is not valid. The combination
of event selectors and data resources is not valid. A trail can have up to 5 event selectors. A trail is
limited to 250 data resources. These data resources can be distributed across event selectors, but the
overall total cannot exceed 250.
You can:
Specify a valid number of event selectors (1 to 5) for a trail.
Specify a valid number of data resources (1 to 250) for an event selector. The limit of number of resources on an individual event selector is configurable up to 250. However, this upper limit is allowed only if the total number of data resources does not exceed 250 across all event selectors for a trail.
Specify a valid value for a parameter. For example, specifying the ReadWriteType
parameter
with a value of read-only
is invalid.
default CompletableFuture<PutEventSelectorsResponse> putEventSelectors(Consumer<PutEventSelectorsRequest.Builder> putEventSelectorsRequest)
Configures an event selector for your trail. Use event selectors to further specify the management and data event settings for your trail. By default, trails created without specific event selectors will be configured to log all read and write management events, and no data events.
When an event occurs in your account, CloudTrail evaluates the event selectors in all trails. For each trail, if the event matches any event selector, the trail processes and logs the event. If the event doesn't match any event selector, the trail doesn't log the event.
Example
You create an event selector for a trail and specify that you want write-only events.
The EC2 GetConsoleOutput
and RunInstances
API operations occur in your account.
CloudTrail evaluates whether the events match your event selectors.
The RunInstances
is a write-only event and it matches your event selector. The trail logs the event.
The GetConsoleOutput
is a read-only event but it doesn't match your event selector. The trail
doesn't log the event.
The PutEventSelectors
operation must be called from the region in which the trail was created;
otherwise, an InvalidHomeRegionException
is thrown.
You can configure up to five event selectors for each trail. For more information, see Logging Data and Management Events for Trails and Limits in AWS CloudTrail in the AWS CloudTrail User Guide.
This is a convenience which creates an instance of the PutEventSelectorsRequest.Builder
avoiding the need
to create one manually via PutEventSelectorsRequest.builder()
putEventSelectorsRequest
- A Consumer
that will call methods on PutEventSelectorsRequest.Builder
to create a request.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
PutEventSelectors
operation is called with a number of event selectors or data resources that is not valid. The combination
of event selectors and data resources is not valid. A trail can have up to 5 event selectors. A trail is
limited to 250 data resources. These data resources can be distributed across event selectors, but the
overall total cannot exceed 250.
You can:
Specify a valid number of event selectors (1 to 5) for a trail.
Specify a valid number of data resources (1 to 250) for an event selector. The limit of number of resources on an individual event selector is configurable up to 250. However, this upper limit is allowed only if the total number of data resources does not exceed 250 across all event selectors for a trail.
Specify a valid value for a parameter. For example, specifying the ReadWriteType
parameter
with a value of read-only
is invalid.
default CompletableFuture<RemoveTagsResponse> removeTags(RemoveTagsRequest removeTagsRequest)
Removes the specified tags from a trail.
removeTagsRequest
- Specifies the tags to remove from a trail.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$
.default CompletableFuture<RemoveTagsResponse> removeTags(Consumer<RemoveTagsRequest.Builder> removeTagsRequest)
Removes the specified tags from a trail.
This is a convenience which creates an instance of the RemoveTagsRequest.Builder
avoiding the need to
create one manually via RemoveTagsRequest.builder()
removeTagsRequest
- A Consumer
that will call methods on RemoveTagsRequest.Builder
to create a request.
Specifies the tags to remove from a trail.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$
.default CompletableFuture<StartLoggingResponse> startLogging(StartLoggingRequest startLoggingRequest)
Starts the recording of AWS API calls and log file delivery for a trail. For a trail that is enabled in all regions, this operation must be called from the region in which the trail was created. This operation cannot be called on the shadow trails (replicated trails in other regions) of a trail that is enabled in all regions.
startLoggingRequest
- The request to CloudTrail to start logging AWS API calls for an account.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<StartLoggingResponse> startLogging(Consumer<StartLoggingRequest.Builder> startLoggingRequest)
Starts the recording of AWS API calls and log file delivery for a trail. For a trail that is enabled in all regions, this operation must be called from the region in which the trail was created. This operation cannot be called on the shadow trails (replicated trails in other regions) of a trail that is enabled in all regions.
This is a convenience which creates an instance of the StartLoggingRequest.Builder
avoiding the need to
create one manually via StartLoggingRequest.builder()
startLoggingRequest
- A Consumer
that will call methods on StartLoggingRequest.Builder
to create a request. The
request to CloudTrail to start logging AWS API calls for an account.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<StopLoggingResponse> stopLogging(StopLoggingRequest stopLoggingRequest)
Suspends the recording of AWS API calls and log file delivery for the specified trail. Under most circumstances,
there is no need to use this action. You can update a trail without stopping it first. This action is the only
way to stop recording. For a trail enabled in all regions, this operation must be called from the region in which
the trail was created, or an InvalidHomeRegionException
will occur. This operation cannot be called
on the shadow trails (replicated trails in other regions) of a trail enabled in all regions.
stopLoggingRequest
- Passes the request to CloudTrail to stop logging AWS API calls for the specified account.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<StopLoggingResponse> stopLogging(Consumer<StopLoggingRequest.Builder> stopLoggingRequest)
Suspends the recording of AWS API calls and log file delivery for the specified trail. Under most circumstances,
there is no need to use this action. You can update a trail without stopping it first. This action is the only
way to stop recording. For a trail enabled in all regions, this operation must be called from the region in which
the trail was created, or an InvalidHomeRegionException
will occur. This operation cannot be called
on the shadow trails (replicated trails in other regions) of a trail enabled in all regions.
This is a convenience which creates an instance of the StopLoggingRequest.Builder
avoiding the need to
create one manually via StopLoggingRequest.builder()
stopLoggingRequest
- A Consumer
that will call methods on StopLoggingRequest.Builder
to create a request.
Passes the request to CloudTrail to stop logging AWS API calls for the specified account.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<UpdateTrailResponse> updateTrail(UpdateTrailRequest updateTrailRequest)
Updates the settings that specify delivery of log files. Changes to a trail do not require stopping the
CloudTrail service. Use this action to designate an existing bucket for log delivery. If the existing bucket has
previously been a target for CloudTrail log files, an IAM policy exists for the bucket. UpdateTrail
must be called from the region in which the trail was created; otherwise, an
InvalidHomeRegionException
is thrown.
updateTrailRequest
- Specifies settings to update for the trail.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<UpdateTrailResponse> updateTrail(Consumer<UpdateTrailRequest.Builder> updateTrailRequest)
Updates the settings that specify delivery of log files. Changes to a trail do not require stopping the
CloudTrail service. Use this action to designate an existing bucket for log delivery. If the existing bucket has
previously been a target for CloudTrail log files, an IAM policy exists for the bucket. UpdateTrail
must be called from the region in which the trail was created; otherwise, an
InvalidHomeRegionException
is thrown.
This is a convenience which creates an instance of the UpdateTrailRequest.Builder
avoiding the need to
create one manually via UpdateTrailRequest.builder()
updateTrailRequest
- A Consumer
that will call methods on UpdateTrailRequest.Builder
to create a request.
Specifies settings to update for the trail.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.