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.
609 610 611 612 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 609 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.
788 789 790 791 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 788 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.
909 910 911 912 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 909 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.
938 939 940 941 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 938 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.
974 975 976 977 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 974 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.
1018 1019 1020 1021 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1018 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.
1062 1063 1064 1065 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1062 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.
1092 1093 1094 1095 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1092 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.
1118 1119 1120 1121 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1118 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
1172 1173 1174 1175 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1172 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
1280 1281 1282 1283 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1280 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
1369 1370 1371 1372 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1369 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.
1398 1399 1400 1401 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1398 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.
1482 1483 1484 1485 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1482 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.
1551 1552 1553 1554 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1551 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.
1607 1608 1609 1610 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1607 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.
1650 1651 1652 1653 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1650 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.
1679 1680 1681 1682 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1679 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes tags from a web function.
1705 1706 1707 1708 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1705 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.
1862 1863 1864 1865 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1862 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 |
1982 1983 1984 1985 1986 |
# File 'gems/aws-sdk-lambdaweb/lib/aws-sdk-lambdaweb/client.rb', line 1982 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |