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.
479 480 481 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 479 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.
617 618 619 620 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 617 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.
796 797 798 799 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 796 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.
917 918 919 920 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 917 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.
946 947 948 949 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 946 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.
982 983 984 985 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 982 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.
1026 1027 1028 1029 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1026 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.
1070 1071 1072 1073 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1070 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.
1100 1101 1102 1103 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1100 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.
1126 1127 1128 1129 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1126 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
1180 1181 1182 1183 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1180 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
1288 1289 1290 1291 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1288 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
1377 1378 1379 1380 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1377 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.
1406 1407 1408 1409 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1406 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. Use 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.
1490 1491 1492 1493 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1490 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. Use 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.
1559 1560 1561 1562 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1559 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. Use 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.
1615 1616 1617 1618 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1615 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.
1658 1659 1660 1661 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1658 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.
1687 1688 1689 1690 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1687 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes tags from a web function.
1713 1714 1715 1716 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1713 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.
1870 1871 1872 1873 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1870 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 |
1990 1991 1992 1993 1994 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1990 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |