Class: Aws::LambdaWeb::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::LambdaWeb::Client
- Includes:
- ClientStubs
- Defined in:
- gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb
Overview
An API client for LambdaWeb. To construct a client, you need to configure a :region and :credentials.
client = Aws::LambdaWeb::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_web_function(params = {}) ⇒ Types::CreateWebFunctionResponse
Creates a web function with an initial revision and endpoint.
-
#create_web_function_endpoint(params = {}) ⇒ Types::CreateWebFunctionEndpointResponse
Creates an endpoint for a web function.
-
#create_web_function_revision(params = {}) ⇒ Types::CreateWebFunctionRevisionResponse
Creates an immutable revision for a web function.
-
#delete_resource_policy(params = {}) ⇒ Struct
Removes the resource-based policy from a web function.
-
#delete_web_function(params = {}) ⇒ Struct
Deletes a web function and all of its associated revisions and endpoints.
-
#delete_web_function_endpoint(params = {}) ⇒ Struct
Deletes a web function endpoint.
-
#delete_web_function_revision(params = {}) ⇒ Struct
Deletes a web function revision.
-
#get_resource_policy(params = {}) ⇒ Types::GetResourcePolicyResponse
Retrieves the resource-based policy attached to a web function.
-
#get_web_account_settings(params = {}) ⇒ Types::GetWebAccountSettingsResponse
Retrieves details about your AWS Lambda Web Functions account settings for the current AWS Region, including the quotas that apply to web functions and your current usage.
-
#get_web_function(params = {}) ⇒ Types::GetWebFunctionResponse
Retrieves details about a web function, including its current state and configuration.
-
#get_web_function_endpoint(params = {}) ⇒ Types::GetWebFunctionEndpointResponse
Retrieves details about a web function endpoint, including its current state, configuration, and domain name.
-
#get_web_function_revision(params = {}) ⇒ Types::GetWebFunctionRevisionResponse
Retrieves details about a web function revision, including its state and configuration.
-
#list_tags(params = {}) ⇒ Types::ListTagsResponse
Returns a list of tags applied to a web function.
-
#list_web_function_endpoints(params = {}) ⇒ Types::ListWebFunctionEndpointsResponse
Lists endpoints for a web function.
-
#list_web_function_revisions(params = {}) ⇒ Types::ListWebFunctionRevisionsResponse
Lists revisions for a web function.
-
#list_web_functions(params = {}) ⇒ Types::ListWebFunctionsResponse
Lists web functions in your account.
-
#put_resource_policy(params = {}) ⇒ Types::PutResourcePolicyResponse
Adds or updates a resource-based policy on a web function.
-
#tag_resource(params = {}) ⇒ Struct
Adds tags to a web function.
-
#untag_resource(params = {}) ⇒ Struct
Removes tags from a web function.
-
#update_web_function_endpoint(params = {}) ⇒ Types::UpdateWebFunctionEndpointResponse
Updates the configuration of a web function endpoint.
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.
471 472 473 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 471 def initialize(*args) super end |
Instance Method Details
#create_web_function(params = {}) ⇒ Types::CreateWebFunctionResponse
Creates a web function with an initial revision and endpoint. To create a web function, you provide the function name, revision configuration (code and service settings), and endpoint configuration.
To use this operation, you must have the CreateWebFunction
permission on the web function. You don't need separate permissions
for the initial revision or endpoint.
614 615 616 617 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 614 def create_web_function(params = {}, = {}) req = build_request(:create_web_function, params) req.send_request() end |
#create_web_function_endpoint(params = {}) ⇒ Types::CreateWebFunctionEndpointResponse
Creates an endpoint for a web function. An endpoint exposes the web function over HTTPS and routes traffic to one or more revisions.
To use this operation, you must have the CreateWebFunctionEndpoint
permission on the web function, not on the endpoint being created.
768 769 770 771 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 768 def create_web_function_endpoint(params = {}, = {}) req = build_request(:create_web_function_endpoint, params) req.send_request() end |
#create_web_function_revision(params = {}) ⇒ Types::CreateWebFunctionRevisionResponse
Creates an immutable revision for a web function. A revision represents a specific version of the function code and configuration.
To use this operation, you must have the CreateWebFunctionRevision
permission on the web function, not on the revision being created.
886 887 888 889 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 886 def create_web_function_revision(params = {}, = {}) req = build_request(:create_web_function_revision, params) req.send_request() end |
#delete_resource_policy(params = {}) ⇒ Struct
Removes the resource-based policy from a web function.
920 921 922 923 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 920 def delete_resource_policy(params = {}, = {}) req = build_request(:delete_resource_policy, params) req.send_request() end |
#delete_web_function(params = {}) ⇒ Struct
Deletes a web function and all of its associated revisions and endpoints.
To use this operation, you must have the DeleteWebFunction
permission on the web function. You don't need the
DeleteWebFunctionRevision or DeleteWebFunctionEndpoint permission.
955 956 957 958 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 955 def delete_web_function(params = {}, = {}) req = build_request(:delete_web_function, params) req.send_request() end |
#delete_web_function_endpoint(params = {}) ⇒ Struct
Deletes a web function endpoint.
992 993 994 995 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 992 def delete_web_function_endpoint(params = {}, = {}) req = build_request(:delete_web_function_endpoint, params) req.send_request() end |
#delete_web_function_revision(params = {}) ⇒ Struct
Deletes a web function revision. You cannot delete a revision that is currently serving traffic on an endpoint.
1029 1030 1031 1032 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1029 def delete_web_function_revision(params = {}, = {}) req = build_request(:delete_web_function_revision, params) req.send_request() end |
#get_resource_policy(params = {}) ⇒ Types::GetResourcePolicyResponse
Retrieves the resource-based policy attached to a web function.
1064 1065 1066 1067 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1064 def get_resource_policy(params = {}, = {}) req = build_request(:get_resource_policy, params) req.send_request() end |
#get_web_account_settings(params = {}) ⇒ Types::GetWebAccountSettingsResponse
Retrieves details about your AWS Lambda Web Functions account settings for the current AWS Region, including the quotas that apply to web functions and your current usage.
1095 1096 1097 1098 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1095 def get_web_account_settings(params = {}, = {}) req = build_request(:get_web_account_settings, params) req.send_request() end |
#get_web_function(params = {}) ⇒ Types::GetWebFunctionResponse
Retrieves details about a web function, including its current state and configuration.
The following waiters are defined for this operation (see #wait_until for detailed usage):
- web_function_active
- web_function_deleted
1148 1149 1150 1151 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1148 def get_web_function(params = {}, = {}) req = build_request(:get_web_function, params) req.send_request() end |
#get_web_function_endpoint(params = {}) ⇒ Types::GetWebFunctionEndpointResponse
Retrieves details about a web function endpoint, including its current state, configuration, and domain name.
The following waiters are defined for this operation (see #wait_until for detailed usage):
- web_function_endpoint_active
- web_function_endpoint_deleted
- web_function_endpoint_updated
1249 1250 1251 1252 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1249 def get_web_function_endpoint(params = {}, = {}) req = build_request(:get_web_function_endpoint, params) req.send_request() end |
#get_web_function_revision(params = {}) ⇒ Types::GetWebFunctionRevisionResponse
Retrieves details about a web function revision, including its state and configuration.
The following waiters are defined for this operation (see #wait_until for detailed usage):
- web_function_revision_active
1330 1331 1332 1333 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1330 def get_web_function_revision(params = {}, = {}) req = build_request(:get_web_function_revision, params) req.send_request() end |
#list_tags(params = {}) ⇒ Types::ListTagsResponse
Returns a list of tags applied to a web function.
1364 1365 1366 1367 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1364 def (params = {}, = {}) req = build_request(:list_tags, params) req.send_request() end |
#list_web_function_endpoints(params = {}) ⇒ Types::ListWebFunctionEndpointsResponse
Lists endpoints for a web function. We recommend using pagination to ensure that the operation returns quickly and successfully.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1446 1447 1448 1449 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1446 def list_web_function_endpoints(params = {}, = {}) req = build_request(:list_web_function_endpoints, params) req.send_request() end |
#list_web_function_revisions(params = {}) ⇒ Types::ListWebFunctionRevisionsResponse
Lists revisions for a web function. We recommend using pagination to ensure that the operation returns quickly and successfully.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1513 1514 1515 1516 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1513 def list_web_function_revisions(params = {}, = {}) req = build_request(:list_web_function_revisions, params) req.send_request() end |
#list_web_functions(params = {}) ⇒ Types::ListWebFunctionsResponse
Lists web functions in your account. We recommend using pagination to ensure that the operation returns quickly and successfully.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1573 1574 1575 1576 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1573 def list_web_functions(params = {}, = {}) req = build_request(:list_web_functions, params) req.send_request() end |
#put_resource_policy(params = {}) ⇒ Types::PutResourcePolicyResponse
Adds or updates a resource-based policy on a web function. A resource-based policy grants permissions to other AWS accounts or services to perform actions on the web function.
1621 1622 1623 1624 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1621 def put_resource_policy(params = {}, = {}) req = build_request(:put_resource_policy, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Adds tags to a web function. If a tag key already exists, the existing value is overwritten with the new value.
1655 1656 1657 1658 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1655 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes tags from a web function.
1686 1687 1688 1689 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1686 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_web_function_endpoint(params = {}) ⇒ Types::UpdateWebFunctionEndpointResponse
Updates the configuration of a web function endpoint. You can modify the authorization type, auto-deployment mode, revision weights, scaling, and throttling settings.
1819 1820 1821 1822 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1819 def update_web_function_endpoint(params = {}, = {}) req = build_request(:update_web_function_endpoint, 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 |
|---|---|---|---|
| web_function_active | #get_web_function | 1 | 300 |
| web_function_deleted | #get_web_function | 1 | 300 |
| web_function_endpoint_active | #get_web_function_endpoint | 1 | 300 |
| web_function_endpoint_deleted | #get_web_function_endpoint | 1 | 300 |
| web_function_endpoint_updated | #get_web_function_endpoint | 1 | 300 |
| web_function_revision_active | #get_web_function_revision | 1 | 300 |
1939 1940 1941 1942 1943 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1939 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |