Class: Aws::Schemas::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::Schemas::Client
- Includes:
- ClientStubs
- Defined in:
- gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb
Overview
An API client for Schemas. To construct a client, you need to configure a :region
and :credentials
.
client = Aws::Schemas::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_discoverer(params = {}) ⇒ Types::CreateDiscovererResponse
Creates a discoverer.
-
#create_registry(params = {}) ⇒ Types::CreateRegistryResponse
Creates a registry.
-
#create_schema(params = {}) ⇒ Types::CreateSchemaResponse
Creates a schema definition.
-
#delete_discoverer(params = {}) ⇒ Struct
Deletes a discoverer.
-
#delete_registry(params = {}) ⇒ Struct
Deletes a Registry.
-
#delete_resource_policy(params = {}) ⇒ Struct
Delete the resource-based policy attached to the specified registry.
-
#delete_schema(params = {}) ⇒ Struct
Delete a schema definition.
-
#delete_schema_version(params = {}) ⇒ Struct
Delete the schema version definition.
-
#describe_code_binding(params = {}) ⇒ Types::DescribeCodeBindingResponse
Describe the code binding URI.
-
#describe_discoverer(params = {}) ⇒ Types::DescribeDiscovererResponse
Describes the discoverer.
-
#describe_registry(params = {}) ⇒ Types::DescribeRegistryResponse
Describes the registry.
-
#describe_schema(params = {}) ⇒ Types::DescribeSchemaResponse
Retrieve the schema definition.
-
#export_schema(params = {}) ⇒ Types::ExportSchemaResponse
Exports a schema to a different specification.
-
#get_code_binding_source(params = {}) ⇒ Types::GetCodeBindingSourceResponse
Get the code binding source URI.
-
#get_discovered_schema(params = {}) ⇒ Types::GetDiscoveredSchemaResponse
Get the discovered schema that was generated based on sampled events.
-
#get_resource_policy(params = {}) ⇒ Types::GetResourcePolicyResponse
Retrieves the resource-based policy attached to a given registry.
-
#list_discoverers(params = {}) ⇒ Types::ListDiscoverersResponse
List the discoverers.
-
#list_registries(params = {}) ⇒ Types::ListRegistriesResponse
List the registries.
-
#list_schema_versions(params = {}) ⇒ Types::ListSchemaVersionsResponse
Provides a list of the schema versions and related information.
-
#list_schemas(params = {}) ⇒ Types::ListSchemasResponse
List the schemas.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Get tags for resource.
-
#put_code_binding(params = {}) ⇒ Types::PutCodeBindingResponse
Put code binding URI.
-
#put_resource_policy(params = {}) ⇒ Types::PutResourcePolicyResponse
The name of the policy.
-
#search_schemas(params = {}) ⇒ Types::SearchSchemasResponse
Search the schemas.
-
#start_discoverer(params = {}) ⇒ Types::StartDiscovererResponse
Starts the discoverer.
-
#stop_discoverer(params = {}) ⇒ Types::StopDiscovererResponse
Stops the discoverer.
-
#tag_resource(params = {}) ⇒ Struct
Add tags to a resource.
-
#untag_resource(params = {}) ⇒ Struct
Removes tags from a resource.
-
#update_discoverer(params = {}) ⇒ Types::UpdateDiscovererResponse
Updates the discoverer.
-
#update_registry(params = {}) ⇒ Types::UpdateRegistryResponse
Updates a registry.
-
#update_schema(params = {}) ⇒ Types::UpdateSchemaResponse
Updates the schema definition.
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.
440 441 442 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 440 def initialize(*args) super end |
Instance Method Details
#create_discoverer(params = {}) ⇒ Types::CreateDiscovererResponse
Creates a discoverer.
493 494 495 496 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 493 def create_discoverer(params = {}, = {}) req = build_request(:create_discoverer, params) req.send_request() end |
#create_registry(params = {}) ⇒ Types::CreateRegistryResponse
Creates a registry.
536 537 538 539 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 536 def create_registry(params = {}, = {}) req = build_request(:create_registry, params) req.send_request() end |
#create_schema(params = {}) ⇒ Types::CreateSchemaResponse
Creates a schema definition.
600 601 602 603 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 600 def create_schema(params = {}, = {}) req = build_request(:create_schema, params) req.send_request() end |
#delete_discoverer(params = {}) ⇒ Struct
Deletes a discoverer.
621 622 623 624 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 621 def delete_discoverer(params = {}, = {}) req = build_request(:delete_discoverer, params) req.send_request() end |
#delete_registry(params = {}) ⇒ Struct
Deletes a Registry.
642 643 644 645 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 642 def delete_registry(params = {}, = {}) req = build_request(:delete_registry, params) req.send_request() end |
#delete_resource_policy(params = {}) ⇒ Struct
Delete the resource-based policy attached to the specified registry.
663 664 665 666 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 663 def delete_resource_policy(params = {}, = {}) req = build_request(:delete_resource_policy, params) req.send_request() end |
#delete_schema(params = {}) ⇒ Struct
Delete a schema definition.
687 688 689 690 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 687 def delete_schema(params = {}, = {}) req = build_request(:delete_schema, params) req.send_request() end |
#delete_schema_version(params = {}) ⇒ Struct
Delete the schema version definition
714 715 716 717 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 714 def delete_schema_version(params = {}, = {}) req = build_request(:delete_schema_version, params) req.send_request() end |
#describe_code_binding(params = {}) ⇒ Types::DescribeCodeBindingResponse
Describe the code binding URI.
The following waiters are defined for this operation (see #wait_until for detailed usage):
- code_binding_exists
761 762 763 764 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 761 def describe_code_binding(params = {}, = {}) req = build_request(:describe_code_binding, params) req.send_request() end |
#describe_discoverer(params = {}) ⇒ Types::DescribeDiscovererResponse
Describes the discoverer.
801 802 803 804 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 801 def describe_discoverer(params = {}, = {}) req = build_request(:describe_discoverer, params) req.send_request() end |
#describe_registry(params = {}) ⇒ Types::DescribeRegistryResponse
Describes the registry.
835 836 837 838 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 835 def describe_registry(params = {}, = {}) req = build_request(:describe_registry, params) req.send_request() end |
#describe_schema(params = {}) ⇒ Types::DescribeSchemaResponse
Retrieve the schema definition.
885 886 887 888 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 885 def describe_schema(params = {}, = {}) req = build_request(:describe_schema, params) req.send_request() end |
#export_schema(params = {}) ⇒ Types::ExportSchemaResponse
Exports a schema to a different specification.
1615 1616 1617 1618 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1615 def export_schema(params = {}, = {}) req = build_request(:export_schema, params) req.send_request() end |
#get_code_binding_source(params = {}) ⇒ Types::GetCodeBindingSourceResponse
Get the code binding source URI.
921 922 923 924 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 921 def get_code_binding_source(params = {}, = {}, &block) req = build_request(:get_code_binding_source, params) req.send_request(, &block) end |
#get_discovered_schema(params = {}) ⇒ Types::GetDiscoveredSchemaResponse
Get the discovered schema that was generated based on sampled events.
951 952 953 954 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 951 def get_discovered_schema(params = {}, = {}) req = build_request(:get_discovered_schema, params) req.send_request() end |
#get_resource_policy(params = {}) ⇒ Types::GetResourcePolicyResponse
Retrieves the resource-based policy attached to a given registry.
980 981 982 983 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 980 def get_resource_policy(params = {}, = {}) req = build_request(:get_resource_policy, params) req.send_request() end |
#list_discoverers(params = {}) ⇒ Types::ListDiscoverersResponse
List the discoverers.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1027 1028 1029 1030 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1027 def list_discoverers(params = {}, = {}) req = build_request(:list_discoverers, params) req.send_request() end |
#list_registries(params = {}) ⇒ Types::ListRegistriesResponse
List the registries.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1071 1072 1073 1074 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1071 def list_registries(params = {}, = {}) req = build_request(:list_registries, params) req.send_request() end |
#list_schema_versions(params = {}) ⇒ Types::ListSchemaVersionsResponse
Provides a list of the schema versions and related information.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1115 1116 1117 1118 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1115 def list_schema_versions(params = {}, = {}) req = build_request(:list_schema_versions, params) req.send_request() end |
#list_schemas(params = {}) ⇒ Types::ListSchemasResponse
List the schemas.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1161 1162 1163 1164 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1161 def list_schemas(params = {}, = {}) req = build_request(:list_schemas, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Get tags for resource.
1189 1190 1191 1192 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1189 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#put_code_binding(params = {}) ⇒ Types::PutCodeBindingResponse
Put code binding URI
1231 1232 1233 1234 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1231 def put_code_binding(params = {}, = {}) req = build_request(:put_code_binding, params) req.send_request() end |
#put_resource_policy(params = {}) ⇒ Types::PutResourcePolicyResponse
The name of the policy.
1269 1270 1271 1272 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1269 def put_resource_policy(params = {}, = {}) req = build_request(:put_resource_policy, params) req.send_request() end |
#search_schemas(params = {}) ⇒ Types::SearchSchemasResponse
Search the schemas
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1316 1317 1318 1319 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1316 def search_schemas(params = {}, = {}) req = build_request(:search_schemas, params) req.send_request() end |
#start_discoverer(params = {}) ⇒ Types::StartDiscovererResponse
Starts the discoverer
1345 1346 1347 1348 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1345 def start_discoverer(params = {}, = {}) req = build_request(:start_discoverer, params) req.send_request() end |
#stop_discoverer(params = {}) ⇒ Types::StopDiscovererResponse
Stops the discoverer
1374 1375 1376 1377 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1374 def stop_discoverer(params = {}, = {}) req = build_request(:stop_discoverer, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Add tags to a resource.
1401 1402 1403 1404 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1401 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes tags from a resource.
1425 1426 1427 1428 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1425 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_discoverer(params = {}) ⇒ Types::UpdateDiscovererResponse
Updates the discoverer
1471 1472 1473 1474 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1471 def update_discoverer(params = {}, = {}) req = build_request(:update_discoverer, params) req.send_request() end |
#update_registry(params = {}) ⇒ Types::UpdateRegistryResponse
Updates a registry.
1508 1509 1510 1511 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1508 def update_registry(params = {}, = {}) req = build_request(:update_registry, params) req.send_request() end |
#update_schema(params = {}) ⇒ Types::UpdateSchemaResponse
Updates the schema definition
1571 1572 1573 1574 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1571 def update_schema(params = {}, = {}) req = build_request(:update_schema, 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 |
---|---|---|---|
code_binding_exists | #describe_code_binding | 2 | 30 |
1730 1731 1732 1733 1734 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1730 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |