Class: Aws::Schemas::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::Schemas::Client
- Includes:
- ClientStubs
- Defined in:
- 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](/sdk-for-ruby/v3/developer-guide/setup-config.html).
See #initialize for a full list of supported configuration options.
Class Attribute Summary collapse
- .identifier ⇒ Object readonly private
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.
Class Method Summary collapse
- .errors_module ⇒ Object private
Instance Method Summary collapse
- #build_request(operation_name, params = {}) ⇒ Object private
-
#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.
- #waiter_names ⇒ Object deprecated private Deprecated.
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
467 468 469 |
# File 'lib/aws-sdk-schemas/client.rb', line 467 def initialize(*args) super end |
Class Attribute Details
.identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1791 1792 1793 |
# File 'lib/aws-sdk-schemas/client.rb', line 1791 def identifier @identifier end |
Class Method Details
.errors_module ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1794 1795 1796 |
# File 'lib/aws-sdk-schemas/client.rb', line 1794 def errors_module Errors end |
Instance Method Details
#build_request(operation_name, params = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 |
# File 'lib/aws-sdk-schemas/client.rb', line 1651 def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) tracer = config.telemetry_provider.tracer_provider.tracer( Aws::Telemetry.module_to_tracer_name('Aws::Schemas') ) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, config: config, tracer: tracer ) context[:gem_name] = 'aws-sdk-schemas' context[:gem_version] = '1.49.0' Seahorse::Client::Request.new(handlers, context) end |
#create_discoverer(params = {}) ⇒ Types::CreateDiscovererResponse
Creates a discoverer.
520 521 522 523 |
# File 'lib/aws-sdk-schemas/client.rb', line 520 def create_discoverer(params = {}, = {}) req = build_request(:create_discoverer, params) req.send_request() end |
#create_registry(params = {}) ⇒ Types::CreateRegistryResponse
Creates a registry.
563 564 565 566 |
# File 'lib/aws-sdk-schemas/client.rb', line 563 def create_registry(params = {}, = {}) req = build_request(:create_registry, params) req.send_request() end |
#create_schema(params = {}) ⇒ Types::CreateSchemaResponse
Creates a schema definition.
<note markdown=“1”>Inactive schemas will be deleted after two years.
</note>
627 628 629 630 |
# File 'lib/aws-sdk-schemas/client.rb', line 627 def create_schema(params = {}, = {}) req = build_request(:create_schema, params) req.send_request() end |
#delete_discoverer(params = {}) ⇒ Struct
Deletes a discoverer.
648 649 650 651 |
# File 'lib/aws-sdk-schemas/client.rb', line 648 def delete_discoverer(params = {}, = {}) req = build_request(:delete_discoverer, params) req.send_request() end |
#delete_registry(params = {}) ⇒ Struct
Deletes a Registry.
669 670 671 672 |
# File 'lib/aws-sdk-schemas/client.rb', line 669 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.
690 691 692 693 |
# File 'lib/aws-sdk-schemas/client.rb', line 690 def delete_resource_policy(params = {}, = {}) req = build_request(:delete_resource_policy, params) req.send_request() end |
#delete_schema(params = {}) ⇒ Struct
Delete a schema definition.
714 715 716 717 |
# File 'lib/aws-sdk-schemas/client.rb', line 714 def delete_schema(params = {}, = {}) req = build_request(:delete_schema, params) req.send_request() end |
#delete_schema_version(params = {}) ⇒ Struct
Delete the schema version definition
741 742 743 744 |
# File 'lib/aws-sdk-schemas/client.rb', line 741 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
788 789 790 791 |
# File 'lib/aws-sdk-schemas/client.rb', line 788 def describe_code_binding(params = {}, = {}) req = build_request(:describe_code_binding, params) req.send_request() end |
#describe_discoverer(params = {}) ⇒ Types::DescribeDiscovererResponse
Describes the discoverer.
828 829 830 831 |
# File 'lib/aws-sdk-schemas/client.rb', line 828 def describe_discoverer(params = {}, = {}) req = build_request(:describe_discoverer, params) req.send_request() end |
#describe_registry(params = {}) ⇒ Types::DescribeRegistryResponse
Describes the registry.
862 863 864 865 |
# File 'lib/aws-sdk-schemas/client.rb', line 862 def describe_registry(params = {}, = {}) req = build_request(:describe_registry, params) req.send_request() end |
#describe_schema(params = {}) ⇒ Types::DescribeSchemaResponse
Retrieve the schema definition.
912 913 914 915 |
# File 'lib/aws-sdk-schemas/client.rb', line 912 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.
1642 1643 1644 1645 |
# File 'lib/aws-sdk-schemas/client.rb', line 1642 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.
948 949 950 951 |
# File 'lib/aws-sdk-schemas/client.rb', line 948 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.
978 979 980 981 |
# File 'lib/aws-sdk-schemas/client.rb', line 978 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.
1007 1008 1009 1010 |
# File 'lib/aws-sdk-schemas/client.rb', line 1007 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.
1054 1055 1056 1057 |
# File 'lib/aws-sdk-schemas/client.rb', line 1054 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.
1098 1099 1100 1101 |
# File 'lib/aws-sdk-schemas/client.rb', line 1098 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.
1142 1143 1144 1145 |
# File 'lib/aws-sdk-schemas/client.rb', line 1142 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.
1188 1189 1190 1191 |
# File 'lib/aws-sdk-schemas/client.rb', line 1188 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.
1216 1217 1218 1219 |
# File 'lib/aws-sdk-schemas/client.rb', line 1216 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#put_code_binding(params = {}) ⇒ Types::PutCodeBindingResponse
Put code binding URI
1258 1259 1260 1261 |
# File 'lib/aws-sdk-schemas/client.rb', line 1258 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.
1296 1297 1298 1299 |
# File 'lib/aws-sdk-schemas/client.rb', line 1296 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.
1343 1344 1345 1346 |
# File 'lib/aws-sdk-schemas/client.rb', line 1343 def search_schemas(params = {}, = {}) req = build_request(:search_schemas, params) req.send_request() end |
#start_discoverer(params = {}) ⇒ Types::StartDiscovererResponse
Starts the discoverer
1372 1373 1374 1375 |
# File 'lib/aws-sdk-schemas/client.rb', line 1372 def start_discoverer(params = {}, = {}) req = build_request(:start_discoverer, params) req.send_request() end |
#stop_discoverer(params = {}) ⇒ Types::StopDiscovererResponse
Stops the discoverer
1401 1402 1403 1404 |
# File 'lib/aws-sdk-schemas/client.rb', line 1401 def stop_discoverer(params = {}, = {}) req = build_request(:stop_discoverer, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Add tags to a resource.
1428 1429 1430 1431 |
# File 'lib/aws-sdk-schemas/client.rb', line 1428 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes tags from a resource.
1452 1453 1454 1455 |
# File 'lib/aws-sdk-schemas/client.rb', line 1452 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_discoverer(params = {}) ⇒ Types::UpdateDiscovererResponse
Updates the discoverer
1498 1499 1500 1501 |
# File 'lib/aws-sdk-schemas/client.rb', line 1498 def update_discoverer(params = {}, = {}) req = build_request(:update_discoverer, params) req.send_request() end |
#update_registry(params = {}) ⇒ Types::UpdateRegistryResponse
Updates a registry.
1535 1536 1537 1538 |
# File 'lib/aws-sdk-schemas/client.rb', line 1535 def update_registry(params = {}, = {}) req = build_request(:update_registry, params) req.send_request() end |
#update_schema(params = {}) ⇒ Types::UpdateSchemaResponse
Updates the schema definition
<note markdown=“1”>Inactive schemas will be deleted after two years.
</note>
1598 1599 1600 1601 |
# File 'lib/aws-sdk-schemas/client.rb', line 1598 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 |
1757 1758 1759 1760 1761 |
# File 'lib/aws-sdk-schemas/client.rb', line 1757 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |
#waiter_names ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1765 1766 1767 |
# File 'lib/aws-sdk-schemas/client.rb', line 1765 def waiter_names waiters.keys end |