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.
409 410 411 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 409 def initialize(*args) super end |
Instance Method Details
#create_discoverer(params = {}) ⇒ Types::CreateDiscovererResponse
Creates a discoverer.
462 463 464 465 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 462 def create_discoverer(params = {}, = {}) req = build_request(:create_discoverer, params) req.send_request() end |
#create_registry(params = {}) ⇒ Types::CreateRegistryResponse
Creates a registry.
505 506 507 508 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 505 def create_registry(params = {}, = {}) req = build_request(:create_registry, params) req.send_request() end |
#create_schema(params = {}) ⇒ Types::CreateSchemaResponse
Creates a schema definition.
569 570 571 572 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 569 def create_schema(params = {}, = {}) req = build_request(:create_schema, params) req.send_request() end |
#delete_discoverer(params = {}) ⇒ Struct
Deletes a discoverer.
590 591 592 593 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 590 def delete_discoverer(params = {}, = {}) req = build_request(:delete_discoverer, params) req.send_request() end |
#delete_registry(params = {}) ⇒ Struct
Deletes a Registry.
611 612 613 614 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 611 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.
632 633 634 635 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 632 def delete_resource_policy(params = {}, = {}) req = build_request(:delete_resource_policy, params) req.send_request() end |
#delete_schema(params = {}) ⇒ Struct
Delete a schema definition.
656 657 658 659 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 656 def delete_schema(params = {}, = {}) req = build_request(:delete_schema, params) req.send_request() end |
#delete_schema_version(params = {}) ⇒ Struct
Delete the schema version definition
683 684 685 686 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 683 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
730 731 732 733 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 730 def describe_code_binding(params = {}, = {}) req = build_request(:describe_code_binding, params) req.send_request() end |
#describe_discoverer(params = {}) ⇒ Types::DescribeDiscovererResponse
Describes the discoverer.
770 771 772 773 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 770 def describe_discoverer(params = {}, = {}) req = build_request(:describe_discoverer, params) req.send_request() end |
#describe_registry(params = {}) ⇒ Types::DescribeRegistryResponse
Describes the registry.
804 805 806 807 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 804 def describe_registry(params = {}, = {}) req = build_request(:describe_registry, params) req.send_request() end |
#describe_schema(params = {}) ⇒ Types::DescribeSchemaResponse
Retrieve the schema definition.
854 855 856 857 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 854 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.
1584 1585 1586 1587 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1584 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.
890 891 892 893 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 890 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.
920 921 922 923 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 920 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.
949 950 951 952 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 949 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.
996 997 998 999 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 996 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.
1040 1041 1042 1043 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1040 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.
1084 1085 1086 1087 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1084 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.
1130 1131 1132 1133 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1130 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.
1158 1159 1160 1161 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1158 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#put_code_binding(params = {}) ⇒ Types::PutCodeBindingResponse
Put code binding URI
1200 1201 1202 1203 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1200 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.
1238 1239 1240 1241 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1238 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.
1285 1286 1287 1288 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1285 def search_schemas(params = {}, = {}) req = build_request(:search_schemas, params) req.send_request() end |
#start_discoverer(params = {}) ⇒ Types::StartDiscovererResponse
Starts the discoverer
1314 1315 1316 1317 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1314 def start_discoverer(params = {}, = {}) req = build_request(:start_discoverer, params) req.send_request() end |
#stop_discoverer(params = {}) ⇒ Types::StopDiscovererResponse
Stops the discoverer
1343 1344 1345 1346 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1343 def stop_discoverer(params = {}, = {}) req = build_request(:stop_discoverer, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Add tags to a resource.
1370 1371 1372 1373 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1370 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes tags from a resource.
1394 1395 1396 1397 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1394 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_discoverer(params = {}) ⇒ Types::UpdateDiscovererResponse
Updates the discoverer
1440 1441 1442 1443 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1440 def update_discoverer(params = {}, = {}) req = build_request(:update_discoverer, params) req.send_request() end |
#update_registry(params = {}) ⇒ Types::UpdateRegistryResponse
Updates a registry.
1477 1478 1479 1480 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1477 def update_registry(params = {}, = {}) req = build_request(:update_registry, params) req.send_request() end |
#update_schema(params = {}) ⇒ Types::UpdateSchemaResponse
Updates the schema definition
1540 1541 1542 1543 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1540 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 |
1694 1695 1696 1697 1698 |
# File 'gems/aws-sdk-schemas/lib/aws-sdk-schemas/client.rb', line 1694 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |