You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::ApiGatewayV2::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::ApiGatewayV2::Client
- Defined in:
- (unknown)
Overview
An API client for AmazonApiGatewayV2. To construct a client, you need to configure a :region
and :credentials
.
apigatewayv2 = Aws::ApiGatewayV2::Client.new(
region: region_name,
credentials: credentials,
# ...
)
See #initialize for a full list of supported configuration options.
Region
You can configure a default region in the following locations:
ENV['AWS_REGION']
Aws.config[:region]
Go here for a list of supported regions.
Credentials
Default credentials are loaded automatically from the following locations:
ENV['AWS_ACCESS_KEY_ID']
andENV['AWS_SECRET_ACCESS_KEY']
Aws.config[:credentials]
- The shared credentials ini file at
~/.aws/credentials
(more information) - From an instance profile when running on EC2
You can also construct a credentials object from one of the following classes:
Alternatively, you configure credentials with :access_key_id
and
:secret_access_key
:
# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))
Aws::ApiGatewayV2::Client.new(
access_key_id: creds['access_key_id'],
secret_access_key: creds['secret_access_key']
)
Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
Constructor collapse
-
#initialize(options = {}) ⇒ Aws::ApiGatewayV2::Client
constructor
Constructs an API client.
API Operations collapse
-
#create_api(options = {}) ⇒ Types::CreateApiResponse
Creates an Api resource.
.
-
#create_api_mapping(options = {}) ⇒ Types::CreateApiMappingResponse
Creates an API mapping.
.
-
#create_authorizer(options = {}) ⇒ Types::CreateAuthorizerResponse
Creates an Authorizer for an API.
.
-
#create_deployment(options = {}) ⇒ Types::CreateDeploymentResponse
Creates a Deployment for an API.
.
-
#create_domain_name(options = {}) ⇒ Types::CreateDomainNameResponse
Creates a domain name.
.
-
#create_integration(options = {}) ⇒ Types::CreateIntegrationResult
Creates an Integration.
.
-
#create_integration_response(options = {}) ⇒ Types::CreateIntegrationResponseResponse
Creates an IntegrationResponses.
.
-
#create_model(options = {}) ⇒ Types::CreateModelResponse
Creates a Model for an API.
.
-
#create_route(options = {}) ⇒ Types::CreateRouteResult
Creates a Route for an API.
.
-
#create_route_response(options = {}) ⇒ Types::CreateRouteResponseResponse
Creates a RouteResponse for a Route.
.
-
#create_stage(options = {}) ⇒ Types::CreateStageResponse
Creates a Stage for an API.
.
-
#create_vpc_link(options = {}) ⇒ Types::CreateVpcLinkResponse
Creates a VPC link.
.
-
#delete_access_log_settings(options = {}) ⇒ Struct
Deletes the AccessLogSettings for a Stage.
-
#delete_api(options = {}) ⇒ Struct
Deletes an Api resource.
.
-
#delete_api_mapping(options = {}) ⇒ Struct
Deletes an API mapping.
.
-
#delete_authorizer(options = {}) ⇒ Struct
Deletes an Authorizer.
.
-
#delete_cors_configuration(options = {}) ⇒ Struct
Deletes a CORS configuration.
.
-
#delete_deployment(options = {}) ⇒ Struct
Deletes a Deployment.
.
-
#delete_domain_name(options = {}) ⇒ Struct
Deletes a domain name.
.
-
#delete_integration(options = {}) ⇒ Struct
Deletes an Integration.
.
-
#delete_integration_response(options = {}) ⇒ Struct
Deletes an IntegrationResponses.
.
-
#delete_model(options = {}) ⇒ Struct
Deletes a Model.
.
-
#delete_route(options = {}) ⇒ Struct
Deletes a Route.
.
-
#delete_route_request_parameter(options = {}) ⇒ Struct
Deletes a route request parameter.
.
-
#delete_route_response(options = {}) ⇒ Struct
Deletes a RouteResponse.
.
-
#delete_route_settings(options = {}) ⇒ Struct
Deletes the RouteSettings for a stage.
.
-
#delete_stage(options = {}) ⇒ Struct
Deletes a Stage.
.
-
#delete_vpc_link(options = {}) ⇒ Struct
Deletes a VPC link.
.
-
#export_api(options = {}) ⇒ Types::ExportApiResponse
Exports a definition of an API in a particular output format and specification.
.
-
#get_api(options = {}) ⇒ Types::GetApiResponse
Gets an Api resource.
.
-
#get_api_mapping(options = {}) ⇒ Types::GetApiMappingResponse
Gets an API mapping.
.
-
#get_api_mappings(options = {}) ⇒ Types::GetApiMappingsResponse
Gets API mappings.
.
-
#get_apis(options = {}) ⇒ Types::GetApisResponse
Gets a collection of Api resources.
.
-
#get_authorizer(options = {}) ⇒ Types::GetAuthorizerResponse
Gets an Authorizer.
.
-
#get_authorizers(options = {}) ⇒ Types::GetAuthorizersResponse
Gets the Authorizers for an API.
.
-
#get_deployment(options = {}) ⇒ Types::GetDeploymentResponse
Gets a Deployment.
.
-
#get_deployments(options = {}) ⇒ Types::GetDeploymentsResponse
Gets the Deployments for an API.
.
-
#get_domain_name(options = {}) ⇒ Types::GetDomainNameResponse
Gets a domain name.
.
-
#get_domain_names(options = {}) ⇒ Types::GetDomainNamesResponse
Gets the domain names for an AWS account.
.
-
#get_integration(options = {}) ⇒ Types::GetIntegrationResult
Gets an Integration.
.
-
#get_integration_response(options = {}) ⇒ Types::GetIntegrationResponseResponse
Gets an IntegrationResponses.
.
-
#get_integration_responses(options = {}) ⇒ Types::GetIntegrationResponsesResponse
Gets the IntegrationResponses for an Integration.
.
-
#get_integrations(options = {}) ⇒ Types::GetIntegrationsResponse
Gets the Integrations for an API.
.
-
#get_model(options = {}) ⇒ Types::GetModelResponse
Gets a Model.
.
-
#get_model_template(options = {}) ⇒ Types::GetModelTemplateResponse
Gets a model template.
.
-
#get_models(options = {}) ⇒ Types::GetModelsResponse
Gets the Models for an API.
.
-
#get_route(options = {}) ⇒ Types::GetRouteResult
Gets a Route.
.
-
#get_route_response(options = {}) ⇒ Types::GetRouteResponseResponse
Gets a RouteResponse.
.
-
#get_route_responses(options = {}) ⇒ Types::GetRouteResponsesResponse
Gets the RouteResponses for a Route.
.
-
#get_routes(options = {}) ⇒ Types::GetRoutesResponse
Gets the Routes for an API.
.
-
#get_stage(options = {}) ⇒ Types::GetStageResponse
Gets a Stage.
.
-
#get_stages(options = {}) ⇒ Types::GetStagesResponse
Gets the Stages for an API.
.
-
#get_tags(options = {}) ⇒ Types::GetTagsResponse
Gets a collection of Tag resources.
.
-
#get_vpc_link(options = {}) ⇒ Types::GetVpcLinkResponse
Gets a VPC link.
.
-
#get_vpc_links(options = {}) ⇒ Types::GetVpcLinksResponse
Gets a collection of VPC links.
.
-
#import_api(options = {}) ⇒ Types::ImportApiResponse
Imports an API.
.
-
#reimport_api(options = {}) ⇒ Types::ReimportApiResponse
Puts an Api resource.
.
-
#reset_authorizers_cache(options = {}) ⇒ Struct
Resets all authorizer cache entries for the specified stage.
-
#tag_resource(options = {}) ⇒ Struct
Creates a new Tag resource to represent a tag.
.
-
#untag_resource(options = {}) ⇒ Struct
Deletes a Tag.
.
-
#update_api(options = {}) ⇒ Types::UpdateApiResponse
Updates an Api resource.
.
-
#update_api_mapping(options = {}) ⇒ Types::UpdateApiMappingResponse
The API mapping.
.
-
#update_authorizer(options = {}) ⇒ Types::UpdateAuthorizerResponse
Updates an Authorizer.
.
-
#update_deployment(options = {}) ⇒ Types::UpdateDeploymentResponse
Updates a Deployment.
.
-
#update_domain_name(options = {}) ⇒ Types::UpdateDomainNameResponse
Updates a domain name.
.
-
#update_integration(options = {}) ⇒ Types::UpdateIntegrationResult
Updates an Integration.
.
-
#update_integration_response(options = {}) ⇒ Types::UpdateIntegrationResponseResponse
Updates an IntegrationResponses.
.
-
#update_model(options = {}) ⇒ Types::UpdateModelResponse
Updates a Model.
.
-
#update_route(options = {}) ⇒ Types::UpdateRouteResult
Updates a Route.
.
-
#update_route_response(options = {}) ⇒ Types::UpdateRouteResponseResponse
Updates a RouteResponse.
.
-
#update_stage(options = {}) ⇒ Types::UpdateStageResponse
Updates a Stage.
.
-
#update_vpc_link(options = {}) ⇒ Types::UpdateVpcLinkResponse
Updates a VPC link.
.
Instance Method Summary collapse
-
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
-
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters.
Methods inherited from Seahorse::Client::Base
add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options = {}) ⇒ Aws::ApiGatewayV2::Client
Constructs an API client.
Instance Method Details
#create_api(options = {}) ⇒ Types::CreateApiResponse
Creates an Api resource.
#create_api_mapping(options = {}) ⇒ Types::CreateApiMappingResponse
Creates an API mapping.
#create_authorizer(options = {}) ⇒ Types::CreateAuthorizerResponse
Creates an Authorizer for an API.
#create_deployment(options = {}) ⇒ Types::CreateDeploymentResponse
Creates a Deployment for an API.
#create_domain_name(options = {}) ⇒ Types::CreateDomainNameResponse
Creates a domain name.
#create_integration(options = {}) ⇒ Types::CreateIntegrationResult
Creates an Integration.
#create_integration_response(options = {}) ⇒ Types::CreateIntegrationResponseResponse
Creates an IntegrationResponses.
#create_model(options = {}) ⇒ Types::CreateModelResponse
Creates a Model for an API.
#create_route(options = {}) ⇒ Types::CreateRouteResult
Creates a Route for an API.
#create_route_response(options = {}) ⇒ Types::CreateRouteResponseResponse
Creates a RouteResponse for a Route.
#create_stage(options = {}) ⇒ Types::CreateStageResponse
Creates a Stage for an API.
#create_vpc_link(options = {}) ⇒ Types::CreateVpcLinkResponse
Creates a VPC link.
#delete_access_log_settings(options = {}) ⇒ Struct
Deletes the AccessLogSettings for a Stage. To disable access logging for a Stage, delete its AccessLogSettings.
#delete_api(options = {}) ⇒ Struct
Deletes an Api resource.
#delete_api_mapping(options = {}) ⇒ Struct
Deletes an API mapping.
#delete_authorizer(options = {}) ⇒ Struct
Deletes an Authorizer.
#delete_cors_configuration(options = {}) ⇒ Struct
Deletes a CORS configuration.
#delete_deployment(options = {}) ⇒ Struct
Deletes a Deployment.
#delete_domain_name(options = {}) ⇒ Struct
Deletes a domain name.
#delete_integration(options = {}) ⇒ Struct
Deletes an Integration.
#delete_integration_response(options = {}) ⇒ Struct
Deletes an IntegrationResponses.
#delete_model(options = {}) ⇒ Struct
Deletes a Model.
#delete_route(options = {}) ⇒ Struct
Deletes a Route.
#delete_route_request_parameter(options = {}) ⇒ Struct
Deletes a route request parameter.
#delete_route_response(options = {}) ⇒ Struct
Deletes a RouteResponse.
#delete_route_settings(options = {}) ⇒ Struct
Deletes the RouteSettings for a stage.
#delete_stage(options = {}) ⇒ Struct
Deletes a Stage.
#delete_vpc_link(options = {}) ⇒ Struct
Deletes a VPC link.
#export_api(options = {}) ⇒ Types::ExportApiResponse
Exports a definition of an API in a particular output format and specification.
#get_api(options = {}) ⇒ Types::GetApiResponse
Gets an Api resource.
#get_api_mapping(options = {}) ⇒ Types::GetApiMappingResponse
Gets an API mapping.
#get_api_mappings(options = {}) ⇒ Types::GetApiMappingsResponse
Gets API mappings.
#get_apis(options = {}) ⇒ Types::GetApisResponse
Gets a collection of Api resources.
#get_authorizer(options = {}) ⇒ Types::GetAuthorizerResponse
Gets an Authorizer.
#get_authorizers(options = {}) ⇒ Types::GetAuthorizersResponse
Gets the Authorizers for an API.
#get_deployment(options = {}) ⇒ Types::GetDeploymentResponse
Gets a Deployment.
#get_deployments(options = {}) ⇒ Types::GetDeploymentsResponse
Gets the Deployments for an API.
#get_domain_name(options = {}) ⇒ Types::GetDomainNameResponse
Gets a domain name.
#get_domain_names(options = {}) ⇒ Types::GetDomainNamesResponse
Gets the domain names for an AWS account.
#get_integration(options = {}) ⇒ Types::GetIntegrationResult
Gets an Integration.
#get_integration_response(options = {}) ⇒ Types::GetIntegrationResponseResponse
Gets an IntegrationResponses.
#get_integration_responses(options = {}) ⇒ Types::GetIntegrationResponsesResponse
Gets the IntegrationResponses for an Integration.
#get_integrations(options = {}) ⇒ Types::GetIntegrationsResponse
Gets the Integrations for an API.
#get_model(options = {}) ⇒ Types::GetModelResponse
Gets a Model.
#get_model_template(options = {}) ⇒ Types::GetModelTemplateResponse
Gets a model template.
#get_models(options = {}) ⇒ Types::GetModelsResponse
Gets the Models for an API.
#get_route(options = {}) ⇒ Types::GetRouteResult
Gets a Route.
#get_route_response(options = {}) ⇒ Types::GetRouteResponseResponse
Gets a RouteResponse.
#get_route_responses(options = {}) ⇒ Types::GetRouteResponsesResponse
Gets the RouteResponses for a Route.
#get_routes(options = {}) ⇒ Types::GetRoutesResponse
Gets the Routes for an API.
#get_stage(options = {}) ⇒ Types::GetStageResponse
Gets a Stage.
#get_stages(options = {}) ⇒ Types::GetStagesResponse
Gets the Stages for an API.
#get_tags(options = {}) ⇒ Types::GetTagsResponse
Gets a collection of Tag resources.
#get_vpc_link(options = {}) ⇒ Types::GetVpcLinkResponse
Gets a VPC link.
#get_vpc_links(options = {}) ⇒ Types::GetVpcLinksResponse
Gets a collection of VPC links.
#import_api(options = {}) ⇒ Types::ImportApiResponse
Imports an API.
#reimport_api(options = {}) ⇒ Types::ReimportApiResponse
Puts an Api resource.
#reset_authorizers_cache(options = {}) ⇒ Struct
Resets all authorizer cache entries for the specified stage. Supported only for HTTP API Lambda authorizers.
#tag_resource(options = {}) ⇒ Struct
Creates a new Tag resource to represent a tag.
#untag_resource(options = {}) ⇒ Struct
Deletes a Tag.
#update_api(options = {}) ⇒ Types::UpdateApiResponse
Updates an Api resource.
#update_api_mapping(options = {}) ⇒ Types::UpdateApiMappingResponse
The API mapping.
#update_authorizer(options = {}) ⇒ Types::UpdateAuthorizerResponse
Updates an Authorizer.
#update_deployment(options = {}) ⇒ Types::UpdateDeploymentResponse
Updates a Deployment.
#update_domain_name(options = {}) ⇒ Types::UpdateDomainNameResponse
Updates a domain name.
#update_integration(options = {}) ⇒ Types::UpdateIntegrationResult
Updates an Integration.
#update_integration_response(options = {}) ⇒ Types::UpdateIntegrationResponseResponse
Updates an IntegrationResponses.
#update_model(options = {}) ⇒ Types::UpdateModelResponse
Updates a Model.
#update_route(options = {}) ⇒ Types::UpdateRouteResult
Updates a Route.
#update_route_response(options = {}) ⇒ Types::UpdateRouteResponseResponse
Updates a RouteResponse.
#update_stage(options = {}) ⇒ Types::UpdateStageResponse
Updates a Stage.
#update_vpc_link(options = {}) ⇒ Types::UpdateVpcLinkResponse
Updates a VPC link.
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
Basic Usage
Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:
# poll for ~25 seconds
client.wait_until(...) do |w|
w.max_attempts = 5
w.delay = 5
end
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(...) do |w|
# disable max attempts
w.max_attempts = nil
# poll for 1 hour, instead of a number of attempts
w.before_wait do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
end
Handling Errors
When a waiter is successful, it returns true
. When a waiter
fails, it raises an error. All errors raised extend from
Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:
Waiter Name | Client Method | Default Delay: | Default Max Attempts: |
---|