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.
444 445 446 |
# File 'lib/aws-sdk-schemas/client.rb', line 444 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.
1768 1769 1770 |
# File 'lib/aws-sdk-schemas/client.rb', line 1768 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.
1771 1772 1773 |
# File 'lib/aws-sdk-schemas/client.rb', line 1771 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.
1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 |
# File 'lib/aws-sdk-schemas/client.rb', line 1628 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.47.0' Seahorse::Client::Request.new(handlers, context) end |
#create_discoverer(params = {}) ⇒ Types::CreateDiscovererResponse
Creates a discoverer.
497 498 499 500 |
# File 'lib/aws-sdk-schemas/client.rb', line 497 def create_discoverer(params = {}, = {}) req = build_request(:create_discoverer, params) req.send_request() end |
#create_registry(params = {}) ⇒ Types::CreateRegistryResponse
Creates a registry.
540 541 542 543 |
# File 'lib/aws-sdk-schemas/client.rb', line 540 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>
604 605 606 607 |
# File 'lib/aws-sdk-schemas/client.rb', line 604 def create_schema(params = {}, = {}) req = build_request(:create_schema, params) req.send_request() end |
#delete_discoverer(params = {}) ⇒ Struct
Deletes a discoverer.
625 626 627 628 |
# File 'lib/aws-sdk-schemas/client.rb', line 625 def delete_discoverer(params = {}, = {}) req = build_request(:delete_discoverer, params) req.send_request() end |
#delete_registry(params = {}) ⇒ Struct
Deletes a Registry.
646 647 648 649 |
# File 'lib/aws-sdk-schemas/client.rb', line 646 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.
667 668 669 670 |
# File 'lib/aws-sdk-schemas/client.rb', line 667 def delete_resource_policy(params = {}, = {}) req = build_request(:delete_resource_policy, params) req.send_request() end |
#delete_schema(params = {}) ⇒ Struct
Delete a schema definition.
691 692 693 694 |
# File 'lib/aws-sdk-schemas/client.rb', line 691 def delete_schema(params = {}, = {}) req = build_request(:delete_schema, params) req.send_request() end |
#delete_schema_version(params = {}) ⇒ Struct
Delete the schema version definition
718 719 720 721 |
# File 'lib/aws-sdk-schemas/client.rb', line 718 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
765 766 767 768 |
# File 'lib/aws-sdk-schemas/client.rb', line 765 def describe_code_binding(params = {}, = {}) req = build_request(:describe_code_binding, params) req.send_request() end |
#describe_discoverer(params = {}) ⇒ Types::DescribeDiscovererResponse
Describes the discoverer.
805 806 807 808 |
# File 'lib/aws-sdk-schemas/client.rb', line 805 def describe_discoverer(params = {}, = {}) req = build_request(:describe_discoverer, params) req.send_request() end |
#describe_registry(params = {}) ⇒ Types::DescribeRegistryResponse
Describes the registry.
839 840 841 842 |
# File 'lib/aws-sdk-schemas/client.rb', line 839 def describe_registry(params = {}, = {}) req = build_request(:describe_registry, params) req.send_request() end |
#describe_schema(params = {}) ⇒ Types::DescribeSchemaResponse
Retrieve the schema definition.
889 890 891 892 |
# File 'lib/aws-sdk-schemas/client.rb', line 889 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.
1619 1620 1621 1622 |
# File 'lib/aws-sdk-schemas/client.rb', line 1619 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.
925 926 927 928 |
# File 'lib/aws-sdk-schemas/client.rb', line 925 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.
955 956 957 958 |
# File 'lib/aws-sdk-schemas/client.rb', line 955 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.
984 985 986 987 |
# File 'lib/aws-sdk-schemas/client.rb', line 984 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.
1031 1032 1033 1034 |
# File 'lib/aws-sdk-schemas/client.rb', line 1031 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.
1075 1076 1077 1078 |
# File 'lib/aws-sdk-schemas/client.rb', line 1075 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.
1119 1120 1121 1122 |
# File 'lib/aws-sdk-schemas/client.rb', line 1119 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.
1165 1166 1167 1168 |
# File 'lib/aws-sdk-schemas/client.rb', line 1165 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.
1193 1194 1195 1196 |
# File 'lib/aws-sdk-schemas/client.rb', line 1193 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#put_code_binding(params = {}) ⇒ Types::PutCodeBindingResponse
Put code binding URI
1235 1236 1237 1238 |
# File 'lib/aws-sdk-schemas/client.rb', line 1235 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.
1273 1274 1275 1276 |
# File 'lib/aws-sdk-schemas/client.rb', line 1273 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.
1320 1321 1322 1323 |
# File 'lib/aws-sdk-schemas/client.rb', line 1320 def search_schemas(params = {}, = {}) req = build_request(:search_schemas, params) req.send_request() end |
#start_discoverer(params = {}) ⇒ Types::StartDiscovererResponse
Starts the discoverer
1349 1350 1351 1352 |
# File 'lib/aws-sdk-schemas/client.rb', line 1349 def start_discoverer(params = {}, = {}) req = build_request(:start_discoverer, params) req.send_request() end |
#stop_discoverer(params = {}) ⇒ Types::StopDiscovererResponse
Stops the discoverer
1378 1379 1380 1381 |
# File 'lib/aws-sdk-schemas/client.rb', line 1378 def stop_discoverer(params = {}, = {}) req = build_request(:stop_discoverer, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Add tags to a resource.
1405 1406 1407 1408 |
# File 'lib/aws-sdk-schemas/client.rb', line 1405 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes tags from a resource.
1429 1430 1431 1432 |
# File 'lib/aws-sdk-schemas/client.rb', line 1429 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_discoverer(params = {}) ⇒ Types::UpdateDiscovererResponse
Updates the discoverer
1475 1476 1477 1478 |
# File 'lib/aws-sdk-schemas/client.rb', line 1475 def update_discoverer(params = {}, = {}) req = build_request(:update_discoverer, params) req.send_request() end |
#update_registry(params = {}) ⇒ Types::UpdateRegistryResponse
Updates a registry.
1512 1513 1514 1515 |
# File 'lib/aws-sdk-schemas/client.rb', line 1512 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>
1575 1576 1577 1578 |
# File 'lib/aws-sdk-schemas/client.rb', line 1575 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 |
1734 1735 1736 1737 1738 |
# File 'lib/aws-sdk-schemas/client.rb', line 1734 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.
1742 1743 1744 |
# File 'lib/aws-sdk-schemas/client.rb', line 1742 def waiter_names waiters.keys end |