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.
488 489 490 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 488 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.
572 573 574 575 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 572 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.
660 661 662 663 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 660 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.
899 900 901 902 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 899 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.
923 924 925 926 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 923 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.
949 950 951 952 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 949 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.
999 1000 1001 1002 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 999 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.
1021 1022 1023 1024 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1021 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
1072 1073 1074 1075 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1072 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.
1126 1127 1128 1129 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1126 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.
1243 1244 1245 1246 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1243 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.
1290 1291 1292 1293 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1290 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.
1352 1353 1354 1355 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1352 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.
1413 1414 1415 1416 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1413 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.
1458 1459 1460 1461 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1458 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.
1517 1518 1519 1520 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1517 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.
1547 1548 1549 1550 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1547 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.
1605 1606 1607 1608 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1605 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.
1675 1676 1677 1678 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1675 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.
1746 1747 1748 1749 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1746 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.
1780 1781 1782 1783 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1780 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.
1809 1810 1811 1812 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1809 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.
1836 1837 1838 1839 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1836 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.
1898 1899 1900 1901 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1898 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.
1965 1966 1967 1968 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 1965 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.
2170 2171 2172 2173 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 2170 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 |
2286 2287 2288 2289 2290 |
# File 'gems/aws-sdk-eventbridgev2/lib/aws-sdk-eventbridgev2/client.rb', line 2286 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |