capo-lambda-core 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- capo_lambda_core/__init__.py +71 -0
- capo_lambda_core/_async.py +25 -0
- capo_lambda_core/_auth/_identity.py +16 -0
- capo_lambda_core/_auth/_providers.py +886 -0
- capo_lambda_core/_auth/_signers.py +121 -0
- capo_lambda_core/_auth/_sigv4.py +579 -0
- capo_lambda_core/_auth/_zapros_handler.py +80 -0
- capo_lambda_core/_body.py +221 -0
- capo_lambda_core/_iter.py +113 -0
- capo_lambda_core/_operations/lambda_core_api_service/create_network_connector.py +166 -0
- capo_lambda_core/_operations/lambda_core_api_service/delete_network_connector.py +163 -0
- capo_lambda_core/_operations/lambda_core_api_service/get_network_connector.py +162 -0
- capo_lambda_core/_operations/lambda_core_api_service/list_network_connectors.py +166 -0
- capo_lambda_core/_operations/lambda_core_api_service/update_network_connector.py +169 -0
- capo_lambda_core/_pagination.py +21 -0
- capo_lambda_core/_protocol/__init__.py +1 -0
- capo_lambda_core/_protocol/errors.py +93 -0
- capo_lambda_core/_protocol/eventstream.py +240 -0
- capo_lambda_core/_protocol/serialize.py +47 -0
- capo_lambda_core/_protocol/xml.py +33 -0
- capo_lambda_core/_resources/lambda_core_api_service/network_connector.py +616 -0
- capo_lambda_core/_rule_engine/__init__.py +0 -0
- capo_lambda_core/_rule_engine/_aws_partition.py +160 -0
- capo_lambda_core/_rule_engine/_endpoint_rule_set.py +135 -0
- capo_lambda_core/_rule_engine/_endpoint_runtime.py +389 -0
- capo_lambda_core/_services/_aws_config.py +160 -0
- capo_lambda_core/_services/_pipeline.py +247 -0
- capo_lambda_core/_services/async_lambda_core.py +468 -0
- capo_lambda_core/_services/lambda_core.py +463 -0
- capo_lambda_core/errors/__init__.py +39 -0
- capo_lambda_core/errors/_base.py +94 -0
- capo_lambda_core/errors/invalid_parameter_value_exception.py +59 -0
- capo_lambda_core/errors/network_connector_limit_exceeded_exception.py +60 -0
- capo_lambda_core/errors/resource_conflict_exception.py +57 -0
- capo_lambda_core/errors/resource_not_found_exception.py +57 -0
- capo_lambda_core/errors/service_exception.py +55 -0
- capo_lambda_core/errors/too_many_requests_exception.py +74 -0
- capo_lambda_core/py.typed +0 -0
- capo_lambda_core/types/_prelude/blob.py +12 -0
- capo_lambda_core/types/_prelude/timestamp.py +17 -0
- capo_lambda_core/types/associated_compute_resource_types_list.py +31 -0
- capo_lambda_core/types/client_token_string.py +5 -0
- capo_lambda_core/types/compute_resource_type.py +14 -0
- capo_lambda_core/types/core_timestamp.py +20 -0
- capo_lambda_core/types/create_network_connector_request.py +88 -0
- capo_lambda_core/types/create_network_connector_response.py +93 -0
- capo_lambda_core/types/delete_network_connector_request.py +25 -0
- capo_lambda_core/types/delete_network_connector_response.py +93 -0
- capo_lambda_core/types/get_network_connector_request.py +25 -0
- capo_lambda_core/types/get_network_connector_response.py +196 -0
- capo_lambda_core/types/list_network_connectors_request.py +34 -0
- capo_lambda_core/types/list_network_connectors_response.py +54 -0
- capo_lambda_core/types/max_hundred_list_items.py +5 -0
- capo_lambda_core/types/network_connector_arn.py +5 -0
- capo_lambda_core/types/network_connector_configuration.py +48 -0
- capo_lambda_core/types/network_connector_id.py +6 -0
- capo_lambda_core/types/network_connector_identifier.py +6 -0
- capo_lambda_core/types/network_connector_last_update_status.py +18 -0
- capo_lambda_core/types/network_connector_last_update_status_reason.py +5 -0
- capo_lambda_core/types/network_connector_last_update_status_reason_code.py +22 -0
- capo_lambda_core/types/network_connector_name.py +5 -0
- capo_lambda_core/types/network_connector_role_arn.py +5 -0
- capo_lambda_core/types/network_connector_security_group_id.py +5 -0
- capo_lambda_core/types/network_connector_security_group_ids.py +19 -0
- capo_lambda_core/types/network_connector_state.py +21 -0
- capo_lambda_core/types/network_connector_state_reason_code.py +22 -0
- capo_lambda_core/types/network_connector_subnet_id.py +5 -0
- capo_lambda_core/types/network_connector_subnet_ids.py +19 -0
- capo_lambda_core/types/network_connector_summary.py +94 -0
- capo_lambda_core/types/network_connector_tag_key.py +5 -0
- capo_lambda_core/types/network_connector_tag_value.py +5 -0
- capo_lambda_core/types/network_connector_tags.py +29 -0
- capo_lambda_core/types/network_connector_type.py +14 -0
- capo_lambda_core/types/network_connector_version.py +5 -0
- capo_lambda_core/types/network_connector_vpc_egress_configuration.py +103 -0
- capo_lambda_core/types/network_connectors_list.py +35 -0
- capo_lambda_core/types/network_protocol.py +17 -0
- capo_lambda_core/types/string.py +5 -0
- capo_lambda_core/types/throttle_reason.py +21 -0
- capo_lambda_core/types/update_network_connector_request.py +64 -0
- capo_lambda_core/types/update_network_connector_response.py +138 -0
- capo_lambda_core-0.1.0.dist-info/METADATA +103 -0
- capo_lambda_core-0.1.0.dist-info/RECORD +86 -0
- capo_lambda_core-0.1.0.dist-info/WHEEL +5 -0
- capo_lambda_core-0.1.0.dist-info/licenses/LICENSE +21 -0
- capo_lambda_core-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.lambdacore#LambdaCoreApiService``."""
|
|
2
|
+
|
|
3
|
+
import uuid
|
|
4
|
+
import warnings
|
|
5
|
+
from collections.abc import AsyncIterator
|
|
6
|
+
from typing import TYPE_CHECKING, Any, Iterable, Optional
|
|
7
|
+
|
|
8
|
+
from typing_extensions import Self, TypedDict
|
|
9
|
+
from zapros import AsyncBaseHandler, AsyncClient
|
|
10
|
+
|
|
11
|
+
import capo_lambda_core._auth._signers
|
|
12
|
+
import capo_lambda_core._auth._sigv4
|
|
13
|
+
from capo_lambda_core._auth._identity import Credentials
|
|
14
|
+
from capo_lambda_core._auth._providers import (
|
|
15
|
+
CredentialsProvider,
|
|
16
|
+
IdentityProvider,
|
|
17
|
+
StaticAwsCredentialsProvider,
|
|
18
|
+
default_aws_credentials_chain,
|
|
19
|
+
)
|
|
20
|
+
from capo_lambda_core._auth._zapros_handler import AuthMiddleware
|
|
21
|
+
from capo_lambda_core._pagination import resolve_path as _resolve_path
|
|
22
|
+
from capo_lambda_core._resources.lambda_core_api_service.network_connector import (
|
|
23
|
+
AsyncNetworkConnector,
|
|
24
|
+
)
|
|
25
|
+
from capo_lambda_core._services._aws_config import aaws_config
|
|
26
|
+
from capo_lambda_core._services._pipeline import (
|
|
27
|
+
AsyncInterceptor,
|
|
28
|
+
AsyncOperationOptions,
|
|
29
|
+
AsyncOperationRequest,
|
|
30
|
+
AsyncOperationResponse,
|
|
31
|
+
aexecute_pipeline,
|
|
32
|
+
aretry,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
if TYPE_CHECKING:
|
|
36
|
+
import capo_lambda_core.types.client_token_string
|
|
37
|
+
import capo_lambda_core.types.create_network_connector_request
|
|
38
|
+
import capo_lambda_core.types.create_network_connector_response
|
|
39
|
+
import capo_lambda_core.types.delete_network_connector_request
|
|
40
|
+
import capo_lambda_core.types.delete_network_connector_response
|
|
41
|
+
import capo_lambda_core.types.get_network_connector_request
|
|
42
|
+
import capo_lambda_core.types.get_network_connector_response
|
|
43
|
+
import capo_lambda_core.types.list_network_connectors_request
|
|
44
|
+
import capo_lambda_core.types.list_network_connectors_response
|
|
45
|
+
import capo_lambda_core.types.max_hundred_list_items
|
|
46
|
+
import capo_lambda_core.types.network_connector_configuration
|
|
47
|
+
import capo_lambda_core.types.network_connector_identifier
|
|
48
|
+
import capo_lambda_core.types.network_connector_name
|
|
49
|
+
import capo_lambda_core.types.network_connector_role_arn
|
|
50
|
+
import capo_lambda_core.types.network_connector_state
|
|
51
|
+
import capo_lambda_core.types.network_connector_summary
|
|
52
|
+
import capo_lambda_core.types.network_connector_tags
|
|
53
|
+
import capo_lambda_core.types.string
|
|
54
|
+
import capo_lambda_core.types.update_network_connector_request
|
|
55
|
+
import capo_lambda_core.types.update_network_connector_response
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class AsyncLambdaCoreClientConfig(TypedDict, total=False, closed=True):
|
|
59
|
+
operation_interceptors: Iterable[AsyncInterceptor[Any, Any]]
|
|
60
|
+
retry_max_attempts: int | None
|
|
61
|
+
region: str | None
|
|
62
|
+
use_dual_stack: bool | None
|
|
63
|
+
use_fips: bool | None
|
|
64
|
+
endpoint: str | None
|
|
65
|
+
credentials_provider: IdentityProvider[Credentials] | None
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class AsyncLambdaCoreClient:
|
|
69
|
+
"""A client for the ``LambdaCore`` service.
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
http_handler: HTTP handler for sending requests. If not provided, creates a default handler.
|
|
73
|
+
operation_interceptors: Interceptors that wrap every operation call. If not provided, defaults to an empty list.
|
|
74
|
+
retry_max_attempts: Maximum number of times to retry a failed operation. Defaults to 3.
|
|
75
|
+
region: The value of the ``AWS::Region`` endpoint parameter.
|
|
76
|
+
use_dual_stack: The value of the ``AWS::UseDualStack`` endpoint parameter.
|
|
77
|
+
use_fips: The value of the ``AWS::UseFIPS`` endpoint parameter.
|
|
78
|
+
endpoint: The value of the ``SDK::Endpoint`` endpoint parameter.
|
|
79
|
+
credentials: AWS credentials for request signing.
|
|
80
|
+
credentials_provider: Provider that resolves AWS credentials. Takes precedence over ``credentials``.
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
def __init__(
|
|
84
|
+
self,
|
|
85
|
+
http_handler: AsyncBaseHandler | None = None,
|
|
86
|
+
operation_interceptors: Iterable[AsyncInterceptor[Any, Any]] | None = None,
|
|
87
|
+
retry_max_attempts: int | None = None,
|
|
88
|
+
region: str | None = None,
|
|
89
|
+
use_dual_stack: bool | None = None,
|
|
90
|
+
use_fips: bool | None = None,
|
|
91
|
+
endpoint: str | None = None,
|
|
92
|
+
credentials: Credentials | None = None,
|
|
93
|
+
credentials_provider: CredentialsProvider | None = None,
|
|
94
|
+
):
|
|
95
|
+
self._client = AsyncClient(http_handler).wrap_with_middleware(
|
|
96
|
+
lambda next: AuthMiddleware(next)
|
|
97
|
+
)
|
|
98
|
+
if credentials is not None and credentials_provider is not None:
|
|
99
|
+
warnings.warn(
|
|
100
|
+
"Both credentials and credentials_provider given; provider takes precedence"
|
|
101
|
+
)
|
|
102
|
+
resolved_credentials_provider: IdentityProvider[Credentials] | None = (
|
|
103
|
+
credentials_provider
|
|
104
|
+
)
|
|
105
|
+
if resolved_credentials_provider is None and credentials is not None:
|
|
106
|
+
resolved_credentials_provider = StaticAwsCredentialsProvider(credentials)
|
|
107
|
+
if resolved_credentials_provider is None and credentials is None:
|
|
108
|
+
resolved_credentials_provider = default_aws_credentials_chain(
|
|
109
|
+
AsyncClient(http_handler)
|
|
110
|
+
)
|
|
111
|
+
self._config = AsyncLambdaCoreClientConfig(
|
|
112
|
+
{
|
|
113
|
+
"operation_interceptors": operation_interceptors or [],
|
|
114
|
+
"retry_max_attempts": retry_max_attempts,
|
|
115
|
+
"region": region,
|
|
116
|
+
"use_dual_stack": use_dual_stack,
|
|
117
|
+
"use_fips": use_fips,
|
|
118
|
+
"endpoint": endpoint,
|
|
119
|
+
"credentials_provider": resolved_credentials_provider,
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
# resources
|
|
124
|
+
self.network_connector = AsyncNetworkConnector(self)
|
|
125
|
+
|
|
126
|
+
def operation_options(
|
|
127
|
+
self, config_overrides: Optional[AsyncLambdaCoreClientConfig] = None
|
|
128
|
+
) -> tuple[Iterable[AsyncInterceptor[Any, Any]], AsyncOperationOptions]:
|
|
129
|
+
overrides: AsyncLambdaCoreClientConfig = config_overrides or {}
|
|
130
|
+
interceptors_: list[AsyncInterceptor[Any, Any]] = [
|
|
131
|
+
*overrides.get(
|
|
132
|
+
"operation_interceptors", self._config.get("operation_interceptors", [])
|
|
133
|
+
),
|
|
134
|
+
aaws_config(),
|
|
135
|
+
aretry(),
|
|
136
|
+
]
|
|
137
|
+
options_: AsyncOperationOptions = AsyncOperationOptions(
|
|
138
|
+
client=self._client,
|
|
139
|
+
retry_max_attempts=overrides.get(
|
|
140
|
+
"retry_max_attempts", self._config.get("retry_max_attempts")
|
|
141
|
+
),
|
|
142
|
+
region=overrides.get("region", self._config.get("region")),
|
|
143
|
+
use_dual_stack=overrides.get(
|
|
144
|
+
"use_dual_stack", self._config.get("use_dual_stack")
|
|
145
|
+
),
|
|
146
|
+
use_fips=overrides.get("use_fips", self._config.get("use_fips")),
|
|
147
|
+
endpoint=overrides.get("endpoint", self._config.get("endpoint")),
|
|
148
|
+
credentials_provider=overrides.get(
|
|
149
|
+
"credentials_provider", self._config.get("credentials_provider")
|
|
150
|
+
),
|
|
151
|
+
)
|
|
152
|
+
return interceptors_, options_
|
|
153
|
+
|
|
154
|
+
async def create_network_connector(
|
|
155
|
+
self,
|
|
156
|
+
name: "capo_lambda_core.types.network_connector_name.NetworkConnectorName",
|
|
157
|
+
configuration: "capo_lambda_core.types.network_connector_configuration.NetworkConnectorConfiguration",
|
|
158
|
+
*,
|
|
159
|
+
config_overrides: Optional[AsyncLambdaCoreClientConfig] = None,
|
|
160
|
+
operator_role: Optional[
|
|
161
|
+
"capo_lambda_core.types.network_connector_role_arn.NetworkConnectorRoleArn"
|
|
162
|
+
] = None,
|
|
163
|
+
client_token: Optional[
|
|
164
|
+
"capo_lambda_core.types.client_token_string.ClientTokenString"
|
|
165
|
+
] = None,
|
|
166
|
+
tags: Optional[
|
|
167
|
+
"capo_lambda_core.types.network_connector_tags.NetworkConnectorTags"
|
|
168
|
+
] = None,
|
|
169
|
+
) -> "capo_lambda_core.types.create_network_connector_response.CreateNetworkConnectorResponse":
|
|
170
|
+
"""<p>Creates a network connector that enables Lambda compute resources to route outbound traffic through your Amazon VPC. The network connector provisions elastic network interfaces (ENIs) in the subnets you specify, providing a managed network path to private resources such as databases, caches, and internal APIs.</p> <p>This operation is asynchronous. The network connector starts in <code>PENDING</code> state while ENIs are provisioned in your VPC (provisioning typically takes up to 10 minutes). Use <code>GetNetworkConnector</code> to poll the connector state until it reaches <code>ACTIVE</code>. Once active, you can attach the connector to Lambda MicroVMs at run time using the <code>egressNetworkConnectors</code> parameter on <code>RunMicroVm</code>.</p> <p>This operation is idempotent when you provide a <code>ClientToken</code> — if you retry a request that completed successfully using the same client token, the operation returns the existing connector without creating a duplicate.</p>
|
|
171
|
+
|
|
172
|
+
Args:
|
|
173
|
+
name: <p>A unique name for the network connector within your account and Region. You can use the name to identify the connector in subsequent API calls.</p>
|
|
174
|
+
configuration: <p>The network configuration for the connector. Specify a <code>VpcEgressConfiguration</code> to enable outbound traffic routing through your VPC.</p>
|
|
175
|
+
operator_role: <p>The ARN of the IAM role that Lambda assumes to manage elastic network interfaces in your VPC. This role must have permissions for <code>ec2:CreateNetworkInterface</code>, <code>ec2:DeleteNetworkInterface</code>, and related describe operations.</p>
|
|
176
|
+
client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request with the same client token, the API returns the existing connector without creating a duplicate.</p>
|
|
177
|
+
tags: <p>A map of key-value pairs to associate with the network connector for organization, cost allocation, or access control.</p>
|
|
178
|
+
|
|
179
|
+
Raises:
|
|
180
|
+
capo_lambda_core.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One of the parameters in the request is not valid. Check the error message for details about which parameter failed validation.</p>
|
|
181
|
+
capo_lambda_core.errors.network_connector_limit_exceeded_exception.NetworkConnectorLimitExceededException: <p>The account has reached the maximum number of network connectors allowed. Delete unused connectors or request a limit increase through Service Quotas.</p>
|
|
182
|
+
capo_lambda_core.errors.resource_conflict_exception.ResourceConflictException: <p>The request could not be completed due to a conflict with the current state of the resource. For example, attempting to update a connector that is not in <code>ACTIVE</code> state.</p>
|
|
183
|
+
capo_lambda_core.errors.service_exception.ServiceException: <p>An internal service error occurred. Retry the request with exponential backoff.</p>
|
|
184
|
+
capo_lambda_core.errors.too_many_requests_exception.TooManyRequestsException: <p>The request was throttled due to exceeding the allowed request rate. Retry the request after a brief wait using exponential backoff.</p>
|
|
185
|
+
capo_lambda_core.errors.UnknownServiceError: The service returned an error code this client does not model.
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
async def _handler(
|
|
189
|
+
req: "AsyncOperationRequest[capo_lambda_core.types.create_network_connector_request.CreateNetworkConnectorRequest]",
|
|
190
|
+
) -> AsyncOperationResponse[
|
|
191
|
+
"capo_lambda_core.types.create_network_connector_response.CreateNetworkConnectorResponse"
|
|
192
|
+
]:
|
|
193
|
+
import capo_lambda_core._operations.lambda_core_api_service.create_network_connector
|
|
194
|
+
|
|
195
|
+
(
|
|
196
|
+
output,
|
|
197
|
+
http_response,
|
|
198
|
+
) = await capo_lambda_core._operations.lambda_core_api_service.create_network_connector.async_create_network_connector(
|
|
199
|
+
req.options, req.input
|
|
200
|
+
)
|
|
201
|
+
return AsyncOperationResponse(output=output, response=http_response)
|
|
202
|
+
|
|
203
|
+
interceptors_, options_ = self.operation_options(config_overrides)
|
|
204
|
+
input_: capo_lambda_core.types.create_network_connector_request.CreateNetworkConnectorRequest = {
|
|
205
|
+
"name": name,
|
|
206
|
+
"configuration": configuration,
|
|
207
|
+
}
|
|
208
|
+
if operator_role is not None:
|
|
209
|
+
input_["operator_role"] = operator_role
|
|
210
|
+
if client_token is None:
|
|
211
|
+
client_token = str(uuid.uuid4())
|
|
212
|
+
input_["client_token"] = client_token
|
|
213
|
+
if tags is not None:
|
|
214
|
+
input_["tags"] = tags
|
|
215
|
+
|
|
216
|
+
response = await aexecute_pipeline(
|
|
217
|
+
AsyncOperationRequest(input=input_, options=options_),
|
|
218
|
+
handler=_handler,
|
|
219
|
+
interceptors=list(interceptors_),
|
|
220
|
+
)
|
|
221
|
+
await response.response.aclose()
|
|
222
|
+
return response.output
|
|
223
|
+
|
|
224
|
+
async def get_network_connector(
|
|
225
|
+
self,
|
|
226
|
+
identifier: "capo_lambda_core.types.network_connector_identifier.NetworkConnectorIdentifier",
|
|
227
|
+
*,
|
|
228
|
+
config_overrides: Optional[AsyncLambdaCoreClientConfig] = None,
|
|
229
|
+
) -> "capo_lambda_core.types.get_network_connector_response.GetNetworkConnectorResponse":
|
|
230
|
+
"""<p>Retrieves the current configuration, state, and metadata of a network connector. The <code>Identifier</code> parameter accepts the connector ID, name, or full ARN. Use this operation to poll connector state after creation or update, or to inspect the current VPC configuration and any failure reasons.</p> <p>The response includes the full connector configuration, current state, and — if the connector has been updated — the <code>LastUpdateStatus</code> and <code>LastUpdateStatusReasonCode</code> fields that indicate whether the most recent update succeeded or failed.</p>
|
|
231
|
+
|
|
232
|
+
Raises:
|
|
233
|
+
capo_lambda_core.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One of the parameters in the request is not valid. Check the error message for details about which parameter failed validation.</p>
|
|
234
|
+
capo_lambda_core.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified network connector does not exist. Verify the identifier (ID, name, or ARN) and Region.</p>
|
|
235
|
+
capo_lambda_core.errors.service_exception.ServiceException: <p>An internal service error occurred. Retry the request with exponential backoff.</p>
|
|
236
|
+
capo_lambda_core.errors.too_many_requests_exception.TooManyRequestsException: <p>The request was throttled due to exceeding the allowed request rate. Retry the request after a brief wait using exponential backoff.</p>
|
|
237
|
+
capo_lambda_core.errors.UnknownServiceError: The service returned an error code this client does not model.
|
|
238
|
+
"""
|
|
239
|
+
|
|
240
|
+
async def _handler(
|
|
241
|
+
req: "AsyncOperationRequest[capo_lambda_core.types.get_network_connector_request.GetNetworkConnectorRequest]",
|
|
242
|
+
) -> AsyncOperationResponse[
|
|
243
|
+
"capo_lambda_core.types.get_network_connector_response.GetNetworkConnectorResponse"
|
|
244
|
+
]:
|
|
245
|
+
import capo_lambda_core._operations.lambda_core_api_service.get_network_connector
|
|
246
|
+
|
|
247
|
+
(
|
|
248
|
+
output,
|
|
249
|
+
http_response,
|
|
250
|
+
) = await capo_lambda_core._operations.lambda_core_api_service.get_network_connector.async_get_network_connector(
|
|
251
|
+
req.options, req.input
|
|
252
|
+
)
|
|
253
|
+
return AsyncOperationResponse(output=output, response=http_response)
|
|
254
|
+
|
|
255
|
+
interceptors_, options_ = self.operation_options(config_overrides)
|
|
256
|
+
input_: capo_lambda_core.types.get_network_connector_request.GetNetworkConnectorRequest = {
|
|
257
|
+
"identifier": identifier
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
response = await aexecute_pipeline(
|
|
261
|
+
AsyncOperationRequest(input=input_, options=options_),
|
|
262
|
+
handler=_handler,
|
|
263
|
+
interceptors=list(interceptors_),
|
|
264
|
+
)
|
|
265
|
+
await response.response.aclose()
|
|
266
|
+
return response.output
|
|
267
|
+
|
|
268
|
+
async def update_network_connector(
|
|
269
|
+
self,
|
|
270
|
+
identifier: "capo_lambda_core.types.network_connector_identifier.NetworkConnectorIdentifier",
|
|
271
|
+
*,
|
|
272
|
+
config_overrides: Optional[AsyncLambdaCoreClientConfig] = None,
|
|
273
|
+
configuration: Optional[
|
|
274
|
+
"capo_lambda_core.types.network_connector_configuration.NetworkConnectorConfiguration"
|
|
275
|
+
] = None,
|
|
276
|
+
operator_role: Optional[
|
|
277
|
+
"capo_lambda_core.types.network_connector_role_arn.NetworkConnectorRoleArn"
|
|
278
|
+
] = None,
|
|
279
|
+
client_token: Optional[
|
|
280
|
+
"capo_lambda_core.types.client_token_string.ClientTokenString"
|
|
281
|
+
] = None,
|
|
282
|
+
) -> "capo_lambda_core.types.update_network_connector_response.UpdateNetworkConnectorResponse":
|
|
283
|
+
"""<p>Updates the VPC configuration or operator role of an existing network connector. You can modify the subnet IDs, security group IDs, network protocol, or operator role. The connector must be in <code>ACTIVE</code> state to accept updates.</p> <p>This operation is asynchronous. The connector remains in <code>ACTIVE</code> state during the update — existing workloads that reference this connector are not disrupted. Use <code>GetNetworkConnector</code> to monitor the <code>LastUpdateStatus</code> field, which transitions through <code>InProgress</code> to <code>Successful</code> or <code>Failed</code>. If the update fails, the <code>LastUpdateStatusReasonCode</code> field provides a specific error code for troubleshooting. This operation is idempotent when you provide a <code>ClientToken</code>.</p>
|
|
284
|
+
|
|
285
|
+
Args:
|
|
286
|
+
configuration: <p>The updated network configuration for the connector. Provide the full <code>VpcEgressConfiguration</code> including all subnet IDs and security group IDs — this replaces the existing configuration.</p>
|
|
287
|
+
operator_role: <p>The updated ARN of the IAM role that Lambda assumes to manage ENIs. Use this to change the operator role without recreating the connector.</p>
|
|
288
|
+
client_token: <p>A unique, case-sensitive identifier to ensure idempotency of the update request.</p>
|
|
289
|
+
|
|
290
|
+
Raises:
|
|
291
|
+
capo_lambda_core.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One of the parameters in the request is not valid. Check the error message for details about which parameter failed validation.</p>
|
|
292
|
+
capo_lambda_core.errors.resource_conflict_exception.ResourceConflictException: <p>The request could not be completed due to a conflict with the current state of the resource. For example, attempting to update a connector that is not in <code>ACTIVE</code> state.</p>
|
|
293
|
+
capo_lambda_core.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified network connector does not exist. Verify the identifier (ID, name, or ARN) and Region.</p>
|
|
294
|
+
capo_lambda_core.errors.service_exception.ServiceException: <p>An internal service error occurred. Retry the request with exponential backoff.</p>
|
|
295
|
+
capo_lambda_core.errors.too_many_requests_exception.TooManyRequestsException: <p>The request was throttled due to exceeding the allowed request rate. Retry the request after a brief wait using exponential backoff.</p>
|
|
296
|
+
capo_lambda_core.errors.UnknownServiceError: The service returned an error code this client does not model.
|
|
297
|
+
"""
|
|
298
|
+
|
|
299
|
+
async def _handler(
|
|
300
|
+
req: "AsyncOperationRequest[capo_lambda_core.types.update_network_connector_request.UpdateNetworkConnectorRequest]",
|
|
301
|
+
) -> AsyncOperationResponse[
|
|
302
|
+
"capo_lambda_core.types.update_network_connector_response.UpdateNetworkConnectorResponse"
|
|
303
|
+
]:
|
|
304
|
+
import capo_lambda_core._operations.lambda_core_api_service.update_network_connector
|
|
305
|
+
|
|
306
|
+
(
|
|
307
|
+
output,
|
|
308
|
+
http_response,
|
|
309
|
+
) = await capo_lambda_core._operations.lambda_core_api_service.update_network_connector.async_update_network_connector(
|
|
310
|
+
req.options, req.input
|
|
311
|
+
)
|
|
312
|
+
return AsyncOperationResponse(output=output, response=http_response)
|
|
313
|
+
|
|
314
|
+
interceptors_, options_ = self.operation_options(config_overrides)
|
|
315
|
+
input_: capo_lambda_core.types.update_network_connector_request.UpdateNetworkConnectorRequest = {
|
|
316
|
+
"identifier": identifier
|
|
317
|
+
}
|
|
318
|
+
if configuration is not None:
|
|
319
|
+
input_["configuration"] = configuration
|
|
320
|
+
if operator_role is not None:
|
|
321
|
+
input_["operator_role"] = operator_role
|
|
322
|
+
if client_token is None:
|
|
323
|
+
client_token = str(uuid.uuid4())
|
|
324
|
+
input_["client_token"] = client_token
|
|
325
|
+
|
|
326
|
+
response = await aexecute_pipeline(
|
|
327
|
+
AsyncOperationRequest(input=input_, options=options_),
|
|
328
|
+
handler=_handler,
|
|
329
|
+
interceptors=list(interceptors_),
|
|
330
|
+
)
|
|
331
|
+
await response.response.aclose()
|
|
332
|
+
return response.output
|
|
333
|
+
|
|
334
|
+
async def delete_network_connector(
|
|
335
|
+
self,
|
|
336
|
+
identifier: "capo_lambda_core.types.network_connector_identifier.NetworkConnectorIdentifier",
|
|
337
|
+
*,
|
|
338
|
+
config_overrides: Optional[AsyncLambdaCoreClientConfig] = None,
|
|
339
|
+
) -> "capo_lambda_core.types.delete_network_connector_response.DeleteNetworkConnectorResponse":
|
|
340
|
+
"""<p>Initiates deletion of a network connector. The connector transitions to <code>DELETING</code> state while elastic network interfaces are cleaned up asynchronously. After deletion completes, subsequent calls to <code>GetNetworkConnector</code> return <code>ResourceNotFoundException</code>.</p> <p>This operation is idempotent — calling delete on a connector that is already deleting or has been deleted succeeds without error. You can delete connectors in <code>ACTIVE</code> or <code>FAILED</code> states. Before deleting a connector, ensure that no Lambda MicroVMs are using it, as they will lose VPC egress connectivity immediately.</p>
|
|
341
|
+
|
|
342
|
+
Raises:
|
|
343
|
+
capo_lambda_core.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One of the parameters in the request is not valid. Check the error message for details about which parameter failed validation.</p>
|
|
344
|
+
capo_lambda_core.errors.resource_conflict_exception.ResourceConflictException: <p>The request could not be completed due to a conflict with the current state of the resource. For example, attempting to update a connector that is not in <code>ACTIVE</code> state.</p>
|
|
345
|
+
capo_lambda_core.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified network connector does not exist. Verify the identifier (ID, name, or ARN) and Region.</p>
|
|
346
|
+
capo_lambda_core.errors.service_exception.ServiceException: <p>An internal service error occurred. Retry the request with exponential backoff.</p>
|
|
347
|
+
capo_lambda_core.errors.too_many_requests_exception.TooManyRequestsException: <p>The request was throttled due to exceeding the allowed request rate. Retry the request after a brief wait using exponential backoff.</p>
|
|
348
|
+
capo_lambda_core.errors.UnknownServiceError: The service returned an error code this client does not model.
|
|
349
|
+
"""
|
|
350
|
+
|
|
351
|
+
async def _handler(
|
|
352
|
+
req: "AsyncOperationRequest[capo_lambda_core.types.delete_network_connector_request.DeleteNetworkConnectorRequest]",
|
|
353
|
+
) -> AsyncOperationResponse[
|
|
354
|
+
"capo_lambda_core.types.delete_network_connector_response.DeleteNetworkConnectorResponse"
|
|
355
|
+
]:
|
|
356
|
+
import capo_lambda_core._operations.lambda_core_api_service.delete_network_connector
|
|
357
|
+
|
|
358
|
+
(
|
|
359
|
+
output,
|
|
360
|
+
http_response,
|
|
361
|
+
) = await capo_lambda_core._operations.lambda_core_api_service.delete_network_connector.async_delete_network_connector(
|
|
362
|
+
req.options, req.input
|
|
363
|
+
)
|
|
364
|
+
return AsyncOperationResponse(output=output, response=http_response)
|
|
365
|
+
|
|
366
|
+
interceptors_, options_ = self.operation_options(config_overrides)
|
|
367
|
+
input_: capo_lambda_core.types.delete_network_connector_request.DeleteNetworkConnectorRequest = {
|
|
368
|
+
"identifier": identifier
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
response = await aexecute_pipeline(
|
|
372
|
+
AsyncOperationRequest(input=input_, options=options_),
|
|
373
|
+
handler=_handler,
|
|
374
|
+
interceptors=list(interceptors_),
|
|
375
|
+
)
|
|
376
|
+
await response.response.aclose()
|
|
377
|
+
return response.output
|
|
378
|
+
|
|
379
|
+
async def list_network_connectors(
|
|
380
|
+
self,
|
|
381
|
+
*,
|
|
382
|
+
config_overrides: Optional[AsyncLambdaCoreClientConfig] = None,
|
|
383
|
+
state: Optional[
|
|
384
|
+
"capo_lambda_core.types.network_connector_state.NetworkConnectorState"
|
|
385
|
+
] = None,
|
|
386
|
+
marker: Optional["capo_lambda_core.types.string.String"] = None,
|
|
387
|
+
max_items: Optional[
|
|
388
|
+
"capo_lambda_core.types.max_hundred_list_items.MaxHundredListItems"
|
|
389
|
+
] = None,
|
|
390
|
+
) -> "capo_lambda_core.types.list_network_connectors_response.ListNetworkConnectorsResponse":
|
|
391
|
+
"""<p>Returns a paginated list of network connectors in your account for the current Region. You can optionally filter results by connector state. Use the <code>Marker</code> parameter from a previous response to retrieve the next page of results.</p> <p>Each item in the response includes the connector ARN, name, ID, type, current state, and last modified timestamp. To retrieve full configuration details for a specific connector, use <code>GetNetworkConnector</code>.</p>
|
|
392
|
+
|
|
393
|
+
Args:
|
|
394
|
+
state: <p>Optional filter to return only connectors in the specified state (for example, <code>ACTIVE</code> or <code>FAILED</code>).</p>
|
|
395
|
+
marker: <p>The pagination token from a previous <code>ListNetworkConnectors</code> response. Use this value to retrieve the next page of results.</p>
|
|
396
|
+
max_items: <p>The maximum number of connectors to return per page. Valid range: 1 to 100.</p>
|
|
397
|
+
|
|
398
|
+
Raises:
|
|
399
|
+
capo_lambda_core.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One of the parameters in the request is not valid. Check the error message for details about which parameter failed validation.</p>
|
|
400
|
+
capo_lambda_core.errors.service_exception.ServiceException: <p>An internal service error occurred. Retry the request with exponential backoff.</p>
|
|
401
|
+
capo_lambda_core.errors.too_many_requests_exception.TooManyRequestsException: <p>The request was throttled due to exceeding the allowed request rate. Retry the request after a brief wait using exponential backoff.</p>
|
|
402
|
+
capo_lambda_core.errors.UnknownServiceError: The service returned an error code this client does not model.
|
|
403
|
+
"""
|
|
404
|
+
|
|
405
|
+
async def _handler(
|
|
406
|
+
req: "AsyncOperationRequest[capo_lambda_core.types.list_network_connectors_request.ListNetworkConnectorsRequest]",
|
|
407
|
+
) -> AsyncOperationResponse[
|
|
408
|
+
"capo_lambda_core.types.list_network_connectors_response.ListNetworkConnectorsResponse"
|
|
409
|
+
]:
|
|
410
|
+
import capo_lambda_core._operations.lambda_core_api_service.list_network_connectors
|
|
411
|
+
|
|
412
|
+
(
|
|
413
|
+
output,
|
|
414
|
+
http_response,
|
|
415
|
+
) = await capo_lambda_core._operations.lambda_core_api_service.list_network_connectors.async_list_network_connectors(
|
|
416
|
+
req.options, req.input
|
|
417
|
+
)
|
|
418
|
+
return AsyncOperationResponse(output=output, response=http_response)
|
|
419
|
+
|
|
420
|
+
interceptors_, options_ = self.operation_options(config_overrides)
|
|
421
|
+
input_: capo_lambda_core.types.list_network_connectors_request.ListNetworkConnectorsRequest = {}
|
|
422
|
+
if state is not None:
|
|
423
|
+
input_["state"] = state
|
|
424
|
+
if marker is not None:
|
|
425
|
+
input_["marker"] = marker
|
|
426
|
+
if max_items is not None:
|
|
427
|
+
input_["max_items"] = max_items
|
|
428
|
+
|
|
429
|
+
response = await aexecute_pipeline(
|
|
430
|
+
AsyncOperationRequest(input=input_, options=options_),
|
|
431
|
+
handler=_handler,
|
|
432
|
+
interceptors=list(interceptors_),
|
|
433
|
+
)
|
|
434
|
+
await response.response.aclose()
|
|
435
|
+
return response.output
|
|
436
|
+
|
|
437
|
+
async def iter_list_network_connectors(
|
|
438
|
+
self,
|
|
439
|
+
*,
|
|
440
|
+
config_overrides: Optional[AsyncLambdaCoreClientConfig] = None,
|
|
441
|
+
state: Optional[
|
|
442
|
+
"capo_lambda_core.types.network_connector_state.NetworkConnectorState"
|
|
443
|
+
] = None,
|
|
444
|
+
marker: Optional["capo_lambda_core.types.string.String"] = None,
|
|
445
|
+
max_items: Optional[
|
|
446
|
+
"capo_lambda_core.types.max_hundred_list_items.MaxHundredListItems"
|
|
447
|
+
] = None,
|
|
448
|
+
) -> "AsyncIterator[capo_lambda_core.types.network_connector_summary.NetworkConnectorSummary]":
|
|
449
|
+
_token = marker
|
|
450
|
+
while True:
|
|
451
|
+
_response = await self.list_network_connectors(
|
|
452
|
+
config_overrides=config_overrides,
|
|
453
|
+
state=state,
|
|
454
|
+
marker=_token,
|
|
455
|
+
max_items=max_items,
|
|
456
|
+
)
|
|
457
|
+
_page = _resolve_path(_response, ("network_connectors",))
|
|
458
|
+
for _item in _page or []:
|
|
459
|
+
yield _item
|
|
460
|
+
_token = _resolve_path(_response, ("next_marker",))
|
|
461
|
+
if not _token:
|
|
462
|
+
break
|
|
463
|
+
|
|
464
|
+
async def __aenter__(self) -> Self:
|
|
465
|
+
return self
|
|
466
|
+
|
|
467
|
+
async def __aexit__(self, exc_type: Any, exc: Any, tb: Any):
|
|
468
|
+
await self._client.aclose()
|