Class: Aws::EventBridgeV2::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::EventBridgeV2::Client
- Includes:
- ClientStubs
- Defined in:
- gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb
Overview
An API client for EventBridgeV2. To construct a client, you need to configure a :region and :credentials.
client = Aws::EventBridgeV2::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the developer guide.
See #initialize for a full list of supported configuration options.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
API Operations collapse
-
#create_event_bus(params = {}) ⇒ Types::CreateEventBusResponse
Creates an event bus.
-
#create_event_source(params = {}) ⇒ Types::CreateEventSourceResponse
Creates an EventSource, which forwards events from an origin (an AWS service or another account) onto an event bus.
-
#create_subscriber(params = {}) ⇒ Types::CreateSubscriberResponse
Creates a subscriber on an event bus, which delivers matching events to the configured target.
-
#delete_event_bus(params = {}) ⇒ Struct
Deletes an event bus.
-
#delete_event_source(params = {}) ⇒ Struct
Deletes an EventSource.
-
#delete_resource_policy(params = {}) ⇒ Types::DeleteResourcePolicyResponse
Deletes the named resource policy attached to an event bus.
-
#delete_subscriber(params = {}) ⇒ Struct
Deletes a subscriber.
-
#describe_event_bus(params = {}) ⇒ Types::DescribeEventBusResponse
Returns the full configuration and lifecycle state of an event bus.
-
#describe_event_source(params = {}) ⇒ Types::DescribeEventSourceResponse
Returns the full configuration and lifecycle state of an EventSource.
-
#describe_subscriber(params = {}) ⇒ Types::DescribeSubscriberResponse
Returns the full configuration and state of a subscriber.
-
#get_resource_policy(params = {}) ⇒ Types::GetResourcePolicyResponse
Returns the named resource policy attached to an event bus.
-
#list_event_buses(params = {}) ⇒ Types::ListEventBusesResponse
Lists the event buses visible to the caller: buses the account owns and buses shared with it through AWS RAM.
-
#list_event_sources(params = {}) ⇒ Types::ListEventSourcesResponse
Lists EventSources as summaries.
-
#list_resource_policies(params = {}) ⇒ Types::ListResourcePoliciesResponse
Lists the resource policies attached to an event bus as summaries (policy name and revision ID).
-
#list_subscribers(params = {}) ⇒ Types::ListSubscribersResponse
Lists subscribers as summaries.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags on an event bus, subscriber, or event source.
-
#put_events(params = {}) ⇒ Types::PutEventsResponse
Publishes events to an event bus.
-
#put_raw_events(params = {}) ⇒ Types::PutRawEventsResponse
Publishes pre-shaped events to an event bus.
-
#put_resource_policy(params = {}) ⇒ Types::PutResourcePolicyResponse
Attaches a named resource policy to an event bus — the only resource type that supports policies; other resource ARNs are rejected.
-
#revoke_resource(params = {}) ⇒ Types::RevokeResourceResponse
Revokes a subscriber or an EventSource.
-
#tag_resource(params = {}) ⇒ Struct
Adds or replaces tags on an event bus, subscriber, or event source.
-
#untag_resource(params = {}) ⇒ Struct
Removes tags from an event bus, subscriber, or event source.
-
#update_event_bus(params = {}) ⇒ Types::UpdateEventBusResponse
Updates an event bus.
-
#update_event_source(params = {}) ⇒ Types::UpdateEventSourceResponse
Updates an EventSource.
-
#update_subscriber(params = {}) ⇒ Types::UpdateSubscriberResponse
Updates a subscriber.
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
-
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
Methods included from ClientStubs
#api_requests, #stub_data, #stub_responses
Methods inherited from Seahorse::Client::Base
add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
480 481 482 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 480 def initialize(*args) super end |
Instance Method Details
#create_event_bus(params = {}) ⇒ Types::CreateEventBusResponse
Creates an event bus. Provisioning is asynchronous: the bus is returned in the CREATING state and transitions to ACTIVE when ready (see the EventBusActive waiter). Retries carrying the same ClientToken are idempotent.
564 565 566 567 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 564 def create_event_bus(params = {}, = {}) req = build_request(:create_event_bus, params) req.send_request() end |
#create_event_source(params = {}) ⇒ Types::CreateEventSourceResponse
Creates an EventSource, which forwards events from an origin (an AWS service or another account) onto an event bus. The bus must be ACTIVE. Retries carrying the same ClientToken are idempotent.
652 653 654 655 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 652 def create_event_source(params = {}, = {}) req = build_request(:create_event_source, params) req.send_request() end |
#create_subscriber(params = {}) ⇒ Types::CreateSubscriberResponse
Creates a subscriber on an event bus, which delivers matching events to the configured target. The bus must be ACTIVE. Retries carrying the same ClientToken are idempotent.
891 892 893 894 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 891 def create_subscriber(params = {}, = {}) req = build_request(:create_subscriber, params) req.send_request() end |
#delete_event_bus(params = {}) ⇒ Struct
Deletes an event bus. Deletion is asynchronous: the bus moves to DELETING and disappears when complete (see the EventBusDeleted waiter). A bus with subscribers or event sources cannot be deleted.
915 916 917 918 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 915 def delete_event_bus(params = {}, = {}) req = build_request(:delete_event_bus, params) req.send_request() end |
#delete_event_source(params = {}) ⇒ Struct
Deletes an EventSource. Forwarding from its origin stops.
941 942 943 944 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 941 def delete_event_source(params = {}, = {}) req = build_request(:delete_event_source, params) req.send_request() end |
#delete_resource_policy(params = {}) ⇒ Types::DeleteResourcePolicyResponse
Deletes the named resource policy attached to an event bus.
991 992 993 994 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 991 def delete_resource_policy(params = {}, = {}) req = build_request(:delete_resource_policy, params) req.send_request() end |
#delete_subscriber(params = {}) ⇒ Struct
Deletes a subscriber. Events are no longer delivered to its target.
1013 1014 1015 1016 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1013 def delete_subscriber(params = {}, = {}) req = build_request(:delete_subscriber, params) req.send_request() end |
#describe_event_bus(params = {}) ⇒ Types::DescribeEventBusResponse
Returns the full configuration and lifecycle state of an event bus.
The following waiters are defined for this operation (see #wait_until for detailed usage):
- event_bus_active
- event_bus_deleted
1064 1065 1066 1067 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1064 def describe_event_bus(params = {}, = {}) req = build_request(:describe_event_bus, params) req.send_request() end |
#describe_event_source(params = {}) ⇒ Types::DescribeEventSourceResponse
Returns the full configuration and lifecycle state of an EventSource.
1118 1119 1120 1121 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1118 def describe_event_source(params = {}, = {}) req = build_request(:describe_event_source, params) req.send_request() end |
#describe_subscriber(params = {}) ⇒ Types::DescribeSubscriberResponse
Returns the full configuration and state of a subscriber.
1235 1236 1237 1238 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1235 def describe_subscriber(params = {}, = {}) req = build_request(:describe_subscriber, params) req.send_request() end |
#get_resource_policy(params = {}) ⇒ Types::GetResourcePolicyResponse
Returns the named resource policy attached to an event bus. Fails with ResourceNotFoundException when the event bus or the named policy does not exist.
1282 1283 1284 1285 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1282 def get_resource_policy(params = {}, = {}) req = build_request(:get_resource_policy, params) req.send_request() end |
#list_event_buses(params = {}) ⇒ Types::ListEventBusesResponse
Lists the event buses visible to the caller: buses the account owns and buses shared with it through AWS RAM. Shared entries carry identity fields only (Name, EventBusArn, EventBusAccountId); owned entries carry every summary field. Set EventBusAccountId to scope the list to one owner account.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1344 1345 1346 1347 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1344 def list_event_buses(params = {}, = {}) req = build_request(:list_event_buses, params) req.send_request() end |
#list_event_sources(params = {}) ⇒ Types::ListEventSourcesResponse
Lists EventSources as summaries. By default the list spans the EventSources the caller account owns; set EventBusArn to scope it to one bus. Use DescribeEventSource to retrieve full configuration.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1405 1406 1407 1408 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1405 def list_event_sources(params = {}, = {}) req = build_request(:list_event_sources, params) req.send_request() end |
#list_resource_policies(params = {}) ⇒ Types::ListResourcePoliciesResponse
Lists the resource policies attached to an event bus as summaries (policy name and revision ID). Use GetResourcePolicy to retrieve a policy document.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1450 1451 1452 1453 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1450 def list_resource_policies(params = {}, = {}) req = build_request(:list_resource_policies, params) req.send_request() end |
#list_subscribers(params = {}) ⇒ Types::ListSubscribersResponse
Lists subscribers as summaries. By default the list spans the subscribers the caller account owns across all buses; set EventBusArn to scope it to one bus. Use DescribeSubscriber to retrieve full configuration.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1509 1510 1511 1512 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1509 def list_subscribers(params = {}, = {}) req = build_request(:list_subscribers, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags on an event bus, subscriber, or event source.
1539 1540 1541 1542 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1539 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#put_events(params = {}) ⇒ Types::PutEventsResponse
Publishes events to an event bus.
1597 1598 1599 1600 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1597 def put_events(params = {}, = {}) req = build_request(:put_events, params) req.send_request() end |
#put_raw_events(params = {}) ⇒ Types::PutRawEventsResponse
Publishes pre-shaped events to an event bus.
1667 1668 1669 1670 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1667 def put_raw_events(params = {}, = {}) req = build_request(:put_raw_events, params) req.send_request() end |
#put_resource_policy(params = {}) ⇒ Types::PutResourcePolicyResponse
Attaches a named resource policy to an event bus — the only resource type that supports policies; other resource ARNs are rejected. Each bus holds two named policies: "default" (customer-managed, full IAM policy language including Deny) and "AWS_RAM" (written exclusively by AWS Resource Access Manager to reflect resource shares). Both policies are evaluated on cross-account authorization; an explicit Deny in either overrides an Allow in the other. Operations that omit PolicyName target "default". A "default" policy that would grant public access is rejected with PublicPolicyException and is not attached; this check is always on and cannot be disabled.
1738 1739 1740 1741 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1738 def put_resource_policy(params = {}, = {}) req = build_request(:put_resource_policy, params) req.send_request() end |
#revoke_resource(params = {}) ⇒ Types::RevokeResourceResponse
Revokes a subscriber or an EventSource. The bus owner calls this to withdraw a misbehaving resource attached to their bus. Revocation is terminal: there is no operation that clears it. A revoked resource refuses mutating operations with InvalidStateException; delete stays available for cleanup.
1772 1773 1774 1775 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1772 def revoke_resource(params = {}, = {}) req = build_request(:revoke_resource, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Adds or replaces tags on an event bus, subscriber, or event source.
1801 1802 1803 1804 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1801 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes tags from an event bus, subscriber, or event source.
1828 1829 1830 1831 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1828 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_event_bus(params = {}) ⇒ Types::UpdateEventBusResponse
Updates an event bus. The update is asynchronous: the bus moves to UPDATING and returns to ACTIVE when the change is applied. Fields omitted from the request are left unchanged.
1890 1891 1892 1893 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1890 def update_event_bus(params = {}, = {}) req = build_request(:update_event_bus, params) req.send_request() end |
#update_event_source(params = {}) ⇒ Types::UpdateEventSourceResponse
Updates an EventSource. Fields omitted from the request are left unchanged.
1957 1958 1959 1960 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1957 def update_event_source(params = {}, = {}) req = build_request(:update_event_source, params) req.send_request() end |
#update_subscriber(params = {}) ⇒ Types::UpdateSubscriberResponse
Updates a subscriber. Fields omitted from the request are left unchanged.
2162 2163 2164 2165 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 2162 def update_subscriber(params = {}, = {}) req = build_request(:update_subscriber, params) req.send_request() end |
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
Basic Usage
A waiter will call an API operation until:
- It is successful
- It enters a terminal state
- It makes the maximum number of attempts
In between attempts, the waiter will sleep.
# polls in a loop, sleeping between attempts
client.wait_until(waiter_name, params)
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You can pass configuration as the final arguments hash.
# poll for ~25 seconds
client.wait_until(waiter_name, params, {
max_attempts: 5,
delay: 5,
})
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success or :failure from these callbacks,
it will terminate the waiter.
started_at = Time.now
client.wait_until(waiter_name, params, {
# disable max attempts
max_attempts: nil,
# poll for 1 hour, instead of a number of attempts
before_wait: -> (attempts, response) do
throw :failure if Time.now - started_at > 3600
end
})
Handling Errors
When a waiter is unsuccessful, it will raise an error. All of the failure errors extend from Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
Valid Waiters
The following table lists the valid waiter names, the operations they call,
and the default :delay and :max_attempts values.
| waiter_name | params | :delay | :max_attempts |
|---|---|---|---|
| event_bus_active | #describe_event_bus | 2 | 60 |
| event_bus_deleted | #describe_event_bus | 2 | 60 |
2278 2279 2280 2281 2282 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 2278 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |