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.
434 435 436 |
# File 'lib/aws-sdk-schemas/client.rb', line 434 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.
1758 1759 1760 |
# File 'lib/aws-sdk-schemas/client.rb', line 1758 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.
1761 1762 1763 |
# File 'lib/aws-sdk-schemas/client.rb', line 1761 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.
1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 |
# File 'lib/aws-sdk-schemas/client.rb', line 1618 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.42.0' Seahorse::Client::Request.new(handlers, context) end |
#create_discoverer(params = {}) ⇒ Types::CreateDiscovererResponse
Creates a discoverer.
487 488 489 490 |
# File 'lib/aws-sdk-schemas/client.rb', line 487 def create_discoverer(params = {}, = {}) req = build_request(:create_discoverer, params) req.send_request() end |
#create_registry(params = {}) ⇒ Types::CreateRegistryResponse
Creates a registry.
530 531 532 533 |
# File 'lib/aws-sdk-schemas/client.rb', line 530 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>
594 595 596 597 |
# File 'lib/aws-sdk-schemas/client.rb', line 594 def create_schema(params = {}, = {}) req = build_request(:create_schema, params) req.send_request() end |
#delete_discoverer(params = {}) ⇒ Struct
Deletes a discoverer.
615 616 617 618 |
# File 'lib/aws-sdk-schemas/client.rb', line 615 def delete_discoverer(params = {}, = {}) req = build_request(:delete_discoverer, params) req.send_request() end |
#delete_registry(params = {}) ⇒ Struct
Deletes a Registry.
636 637 638 639 |
# File 'lib/aws-sdk-schemas/client.rb', line 636 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.
657 658 659 660 |
# File 'lib/aws-sdk-schemas/client.rb', line 657 def delete_resource_policy(params = {}, = {}) req = build_request(:delete_resource_policy, params) req.send_request() end |
#delete_schema(params = {}) ⇒ Struct
Delete a schema definition.
681 682 683 684 |
# File 'lib/aws-sdk-schemas/client.rb', line 681 def delete_schema(params = {}, = {}) req = build_request(:delete_schema, params) req.send_request() end |
#delete_schema_version(params = {}) ⇒ Struct
Delete the schema version definition
708 709 710 711 |
# File 'lib/aws-sdk-schemas/client.rb', line 708 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
755 756 757 758 |
# File 'lib/aws-sdk-schemas/client.rb', line 755 def describe_code_binding(params = {}, = {}) req = build_request(:describe_code_binding, params) req.send_request() end |
#describe_discoverer(params = {}) ⇒ Types::DescribeDiscovererResponse
Describes the discoverer.
795 796 797 798 |
# File 'lib/aws-sdk-schemas/client.rb', line 795 def describe_discoverer(params = {}, = {}) req = build_request(:describe_discoverer, params) req.send_request() end |
#describe_registry(params = {}) ⇒ Types::DescribeRegistryResponse
Describes the registry.
829 830 831 832 |
# File 'lib/aws-sdk-schemas/client.rb', line 829 def describe_registry(params = {}, = {}) req = build_request(:describe_registry, params) req.send_request() end |
#describe_schema(params = {}) ⇒ Types::DescribeSchemaResponse
Retrieve the schema definition.
879 880 881 882 |
# File 'lib/aws-sdk-schemas/client.rb', line 879 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.
1609 1610 1611 1612 |
# File 'lib/aws-sdk-schemas/client.rb', line 1609 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.
915 916 917 918 |
# File 'lib/aws-sdk-schemas/client.rb', line 915 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.
945 946 947 948 |
# File 'lib/aws-sdk-schemas/client.rb', line 945 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.
974 975 976 977 |
# File 'lib/aws-sdk-schemas/client.rb', line 974 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.
1021 1022 1023 1024 |
# File 'lib/aws-sdk-schemas/client.rb', line 1021 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.
1065 1066 1067 1068 |
# File 'lib/aws-sdk-schemas/client.rb', line 1065 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.
1109 1110 1111 1112 |
# File 'lib/aws-sdk-schemas/client.rb', line 1109 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.
1155 1156 1157 1158 |
# File 'lib/aws-sdk-schemas/client.rb', line 1155 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.
1183 1184 1185 1186 |
# File 'lib/aws-sdk-schemas/client.rb', line 1183 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#put_code_binding(params = {}) ⇒ Types::PutCodeBindingResponse
Put code binding URI
1225 1226 1227 1228 |
# File 'lib/aws-sdk-schemas/client.rb', line 1225 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.
1263 1264 1265 1266 |
# File 'lib/aws-sdk-schemas/client.rb', line 1263 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.
1310 1311 1312 1313 |
# File 'lib/aws-sdk-schemas/client.rb', line 1310 def search_schemas(params = {}, = {}) req = build_request(:search_schemas, params) req.send_request() end |
#start_discoverer(params = {}) ⇒ Types::StartDiscovererResponse
Starts the discoverer
1339 1340 1341 1342 |
# File 'lib/aws-sdk-schemas/client.rb', line 1339 def start_discoverer(params = {}, = {}) req = build_request(:start_discoverer, params) req.send_request() end |
#stop_discoverer(params = {}) ⇒ Types::StopDiscovererResponse
Stops the discoverer
1368 1369 1370 1371 |
# File 'lib/aws-sdk-schemas/client.rb', line 1368 def stop_discoverer(params = {}, = {}) req = build_request(:stop_discoverer, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Add tags to a resource.
1395 1396 1397 1398 |
# File 'lib/aws-sdk-schemas/client.rb', line 1395 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes tags from a resource.
1419 1420 1421 1422 |
# File 'lib/aws-sdk-schemas/client.rb', line 1419 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_discoverer(params = {}) ⇒ Types::UpdateDiscovererResponse
Updates the discoverer
1465 1466 1467 1468 |
# File 'lib/aws-sdk-schemas/client.rb', line 1465 def update_discoverer(params = {}, = {}) req = build_request(:update_discoverer, params) req.send_request() end |
#update_registry(params = {}) ⇒ Types::UpdateRegistryResponse
Updates a registry.
1502 1503 1504 1505 |
# File 'lib/aws-sdk-schemas/client.rb', line 1502 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>
1565 1566 1567 1568 |
# File 'lib/aws-sdk-schemas/client.rb', line 1565 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 |
1724 1725 1726 1727 1728 |
# File 'lib/aws-sdk-schemas/client.rb', line 1724 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.
1732 1733 1734 |
# File 'lib/aws-sdk-schemas/client.rb', line 1732 def waiter_names waiters.keys end |