capo-lambda-microvms 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.
Files changed (180) hide show
  1. capo_lambda_microvms/__init__.py +73 -0
  2. capo_lambda_microvms/_async.py +25 -0
  3. capo_lambda_microvms/_auth/_identity.py +16 -0
  4. capo_lambda_microvms/_auth/_providers.py +886 -0
  5. capo_lambda_microvms/_auth/_signers.py +125 -0
  6. capo_lambda_microvms/_auth/_sigv4.py +579 -0
  7. capo_lambda_microvms/_auth/_zapros_handler.py +80 -0
  8. capo_lambda_microvms/_body.py +221 -0
  9. capo_lambda_microvms/_iter.py +113 -0
  10. capo_lambda_microvms/_operations/lambda_microvms/create_microvm_auth_token.py +181 -0
  11. capo_lambda_microvms/_operations/lambda_microvms/create_microvm_image.py +190 -0
  12. capo_lambda_microvms/_operations/lambda_microvms/create_microvm_shell_auth_token.py +181 -0
  13. capo_lambda_microvms/_operations/lambda_microvms/delete_microvm_image.py +170 -0
  14. capo_lambda_microvms/_operations/lambda_microvms/delete_microvm_image_version.py +174 -0
  15. capo_lambda_microvms/_operations/lambda_microvms/get_microvm.py +171 -0
  16. capo_lambda_microvms/_operations/lambda_microvms/get_microvm_image.py +170 -0
  17. capo_lambda_microvms/_operations/lambda_microvms/get_microvm_image_build.py +177 -0
  18. capo_lambda_microvms/_operations/lambda_microvms/get_microvm_image_version.py +179 -0
  19. capo_lambda_microvms/_operations/lambda_microvms/list_managed_microvm_image_versions.py +172 -0
  20. capo_lambda_microvms/_operations/lambda_microvms/list_managed_microvm_images.py +162 -0
  21. capo_lambda_microvms/_operations/lambda_microvms/list_microvm_image_builds.py +196 -0
  22. capo_lambda_microvms/_operations/lambda_microvms/list_microvm_image_versions.py +172 -0
  23. capo_lambda_microvms/_operations/lambda_microvms/list_microvm_images.py +164 -0
  24. capo_lambda_microvms/_operations/lambda_microvms/list_microvms.py +175 -0
  25. capo_lambda_microvms/_operations/lambda_microvms/list_tags.py +182 -0
  26. capo_lambda_microvms/_operations/lambda_microvms/resume_microvm.py +167 -0
  27. capo_lambda_microvms/_operations/lambda_microvms/run_microvm.py +187 -0
  28. capo_lambda_microvms/_operations/lambda_microvms/suspend_microvm.py +167 -0
  29. capo_lambda_microvms/_operations/lambda_microvms/tag_resource.py +164 -0
  30. capo_lambda_microvms/_operations/lambda_microvms/terminate_microvm.py +167 -0
  31. capo_lambda_microvms/_operations/lambda_microvms/untag_resource.py +162 -0
  32. capo_lambda_microvms/_operations/lambda_microvms/update_microvm_image.py +191 -0
  33. capo_lambda_microvms/_operations/lambda_microvms/update_microvm_image_version.py +190 -0
  34. capo_lambda_microvms/_pagination.py +21 -0
  35. capo_lambda_microvms/_protocol/__init__.py +1 -0
  36. capo_lambda_microvms/_protocol/errors.py +93 -0
  37. capo_lambda_microvms/_protocol/eventstream.py +240 -0
  38. capo_lambda_microvms/_protocol/serialize.py +47 -0
  39. capo_lambda_microvms/_protocol/xml.py +33 -0
  40. capo_lambda_microvms/_resources/lambda_microvms/microvm.py +983 -0
  41. capo_lambda_microvms/_resources/lambda_microvms/microvm_image.py +1394 -0
  42. capo_lambda_microvms/_rule_engine/__init__.py +0 -0
  43. capo_lambda_microvms/_rule_engine/_aws_partition.py +160 -0
  44. capo_lambda_microvms/_rule_engine/_endpoint_rule_set.py +135 -0
  45. capo_lambda_microvms/_rule_engine/_endpoint_runtime.py +389 -0
  46. capo_lambda_microvms/_services/_aws_config.py +160 -0
  47. capo_lambda_microvms/_services/_pipeline.py +247 -0
  48. capo_lambda_microvms/_services/async_lambda_microvms.py +1822 -0
  49. capo_lambda_microvms/_services/lambda_microvms.py +1798 -0
  50. capo_lambda_microvms/errors/__init__.py +49 -0
  51. capo_lambda_microvms/errors/_base.py +94 -0
  52. capo_lambda_microvms/errors/access_denied_exception.py +46 -0
  53. capo_lambda_microvms/errors/conflict_exception.py +56 -0
  54. capo_lambda_microvms/errors/insufficient_capacity_exception.py +49 -0
  55. capo_lambda_microvms/errors/internal_server_exception.py +48 -0
  56. capo_lambda_microvms/errors/invalid_parameter_value_exception.py +54 -0
  57. capo_lambda_microvms/errors/resource_conflict_exception.py +52 -0
  58. capo_lambda_microvms/errors/resource_not_found_exception.py +59 -0
  59. capo_lambda_microvms/errors/service_exception.py +50 -0
  60. capo_lambda_microvms/errors/service_quota_exceeded_exception.py +72 -0
  61. capo_lambda_microvms/errors/throttling_exception.py +58 -0
  62. capo_lambda_microvms/errors/too_many_requests_exception.py +52 -0
  63. capo_lambda_microvms/errors/validation_exception.py +44 -0
  64. capo_lambda_microvms/py.typed +0 -0
  65. capo_lambda_microvms/types/_prelude/blob.py +12 -0
  66. capo_lambda_microvms/types/_prelude/timestamp.py +17 -0
  67. capo_lambda_microvms/types/architecture.py +14 -0
  68. capo_lambda_microvms/types/auth_token_key.py +5 -0
  69. capo_lambda_microvms/types/auth_token_value.py +5 -0
  70. capo_lambda_microvms/types/build_state.py +19 -0
  71. capo_lambda_microvms/types/capability.py +15 -0
  72. capo_lambda_microvms/types/capability_list.py +29 -0
  73. capo_lambda_microvms/types/chipset.py +14 -0
  74. capo_lambda_microvms/types/cloud_watch_logging.py +34 -0
  75. capo_lambda_microvms/types/code_artifact.py +32 -0
  76. capo_lambda_microvms/types/cpu_configuration.py +39 -0
  77. capo_lambda_microvms/types/cpu_configuration_list.py +31 -0
  78. capo_lambda_microvms/types/create_microvm_auth_token_request.py +62 -0
  79. capo_lambda_microvms/types/create_microvm_auth_token_response.py +39 -0
  80. capo_lambda_microvms/types/create_microvm_image_request.py +219 -0
  81. capo_lambda_microvms/types/create_microvm_image_response.py +294 -0
  82. capo_lambda_microvms/types/create_microvm_shell_auth_token_request.py +38 -0
  83. capo_lambda_microvms/types/create_microvm_shell_auth_token_response.py +41 -0
  84. capo_lambda_microvms/types/delete_microvm_image_input.py +26 -0
  85. capo_lambda_microvms/types/delete_microvm_image_output.py +49 -0
  86. capo_lambda_microvms/types/delete_microvm_image_version_input.py +29 -0
  87. capo_lambda_microvms/types/delete_microvm_image_version_output.py +65 -0
  88. capo_lambda_microvms/types/environment_variable_key.py +5 -0
  89. capo_lambda_microvms/types/environment_variable_map.py +29 -0
  90. capo_lambda_microvms/types/environment_variable_value.py +5 -0
  91. capo_lambda_microvms/types/get_microvm_image_build_input.py +31 -0
  92. capo_lambda_microvms/types/get_microvm_image_build_output.py +144 -0
  93. capo_lambda_microvms/types/get_microvm_image_input.py +26 -0
  94. capo_lambda_microvms/types/get_microvm_image_output.py +117 -0
  95. capo_lambda_microvms/types/get_microvm_image_version_input.py +29 -0
  96. capo_lambda_microvms/types/get_microvm_image_version_output.py +308 -0
  97. capo_lambda_microvms/types/get_microvm_request.py +26 -0
  98. capo_lambda_microvms/types/get_microvm_response.py +188 -0
  99. capo_lambda_microvms/types/hook_state.py +18 -0
  100. capo_lambda_microvms/types/hooks.py +65 -0
  101. capo_lambda_microvms/types/idle_policy.py +40 -0
  102. capo_lambda_microvms/types/image_name.py +6 -0
  103. capo_lambda_microvms/types/list_managed_microvm_image_versions_input.py +31 -0
  104. capo_lambda_microvms/types/list_managed_microvm_image_versions_output.py +52 -0
  105. capo_lambda_microvms/types/list_managed_microvm_images_input.py +26 -0
  106. capo_lambda_microvms/types/list_managed_microvm_images_output.py +50 -0
  107. capo_lambda_microvms/types/list_microvm_image_builds_input.py +44 -0
  108. capo_lambda_microvms/types/list_microvm_image_builds_output.py +50 -0
  109. capo_lambda_microvms/types/list_microvm_image_versions_input.py +31 -0
  110. capo_lambda_microvms/types/list_microvm_image_versions_output.py +50 -0
  111. capo_lambda_microvms/types/list_microvm_images_request.py +31 -0
  112. capo_lambda_microvms/types/list_microvm_images_response.py +48 -0
  113. capo_lambda_microvms/types/list_microvms_request.py +33 -0
  114. capo_lambda_microvms/types/list_microvms_response.py +46 -0
  115. capo_lambda_microvms/types/list_of_port_specification.py +31 -0
  116. capo_lambda_microvms/types/list_tags_request.py +24 -0
  117. capo_lambda_microvms/types/list_tags_response.py +32 -0
  118. capo_lambda_microvms/types/logging.py +65 -0
  119. capo_lambda_microvms/types/logging_disabled.py +18 -0
  120. capo_lambda_microvms/types/managed_microvm_image_summary.py +66 -0
  121. capo_lambda_microvms/types/managed_microvm_image_summary_list.py +39 -0
  122. capo_lambda_microvms/types/managed_microvm_image_version.py +94 -0
  123. capo_lambda_microvms/types/managed_microvm_image_version_list.py +39 -0
  124. capo_lambda_microvms/types/managed_microvm_image_version_status.py +18 -0
  125. capo_lambda_microvms/types/microvm_hooks.py +108 -0
  126. capo_lambda_microvms/types/microvm_identifier.py +6 -0
  127. capo_lambda_microvms/types/microvm_image_arn.py +6 -0
  128. capo_lambda_microvms/types/microvm_image_build_summaries.py +37 -0
  129. capo_lambda_microvms/types/microvm_image_build_summary.py +125 -0
  130. capo_lambda_microvms/types/microvm_image_hooks.py +66 -0
  131. capo_lambda_microvms/types/microvm_image_identifier.py +6 -0
  132. capo_lambda_microvms/types/microvm_image_state.py +24 -0
  133. capo_lambda_microvms/types/microvm_image_summaries.py +35 -0
  134. capo_lambda_microvms/types/microvm_image_summary.py +90 -0
  135. capo_lambda_microvms/types/microvm_image_version_state.py +22 -0
  136. capo_lambda_microvms/types/microvm_image_version_status.py +17 -0
  137. capo_lambda_microvms/types/microvm_image_version_summary.py +300 -0
  138. capo_lambda_microvms/types/microvm_image_version_summary_list.py +39 -0
  139. capo_lambda_microvms/types/microvm_item.py +82 -0
  140. capo_lambda_microvms/types/microvm_item_list.py +29 -0
  141. capo_lambda_microvms/types/microvm_state.py +22 -0
  142. capo_lambda_microvms/types/network_connector.py +5 -0
  143. capo_lambda_microvms/types/network_connector_list.py +19 -0
  144. capo_lambda_microvms/types/non_blank_string.py +6 -0
  145. capo_lambda_microvms/types/port_number.py +6 -0
  146. capo_lambda_microvms/types/port_range.py +38 -0
  147. capo_lambda_microvms/types/port_specification.py +63 -0
  148. capo_lambda_microvms/types/positive_integer.py +5 -0
  149. capo_lambda_microvms/types/resources.py +26 -0
  150. capo_lambda_microvms/types/resources_list.py +29 -0
  151. capo_lambda_microvms/types/resume_microvm_request.py +26 -0
  152. capo_lambda_microvms/types/resume_microvm_response.py +18 -0
  153. capo_lambda_microvms/types/role_arn.py +6 -0
  154. capo_lambda_microvms/types/run_hook_payload.py +5 -0
  155. capo_lambda_microvms/types/run_microvm_request.py +139 -0
  156. capo_lambda_microvms/types/run_microvm_response.py +188 -0
  157. capo_lambda_microvms/types/snapshot_build.py +35 -0
  158. capo_lambda_microvms/types/string.py +5 -0
  159. capo_lambda_microvms/types/suspend_microvm_request.py +26 -0
  160. capo_lambda_microvms/types/suspend_microvm_response.py +18 -0
  161. capo_lambda_microvms/types/tag_key.py +5 -0
  162. capo_lambda_microvms/types/tag_key_list.py +17 -0
  163. capo_lambda_microvms/types/tag_resource_request.py +38 -0
  164. capo_lambda_microvms/types/tag_value.py +5 -0
  165. capo_lambda_microvms/types/taggable_resource.py +6 -0
  166. capo_lambda_microvms/types/tags.py +29 -0
  167. capo_lambda_microvms/types/terminate_microvm_request.py +26 -0
  168. capo_lambda_microvms/types/terminate_microvm_response.py +18 -0
  169. capo_lambda_microvms/types/token_parts.py +29 -0
  170. capo_lambda_microvms/types/untag_resource_request.py +27 -0
  171. capo_lambda_microvms/types/update_microvm_image_request.py +205 -0
  172. capo_lambda_microvms/types/update_microvm_image_response.py +284 -0
  173. capo_lambda_microvms/types/update_microvm_image_version_request.py +51 -0
  174. capo_lambda_microvms/types/update_microvm_image_version_response.py +312 -0
  175. capo_lambda_microvms/types/version.py +5 -0
  176. capo_lambda_microvms-0.1.0.dist-info/METADATA +103 -0
  177. capo_lambda_microvms-0.1.0.dist-info/RECORD +180 -0
  178. capo_lambda_microvms-0.1.0.dist-info/WHEEL +5 -0
  179. capo_lambda_microvms-0.1.0.dist-info/licenses/LICENSE +21 -0
  180. capo_lambda_microvms-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1798 @@
1
+ """Generated from Smithy shape ``com.amazonaws.lambdamicrovms#LambdaMicrovms``."""
2
+
3
+ import uuid
4
+ import warnings
5
+ from collections.abc import Iterator
6
+ from typing import TYPE_CHECKING, Any, Iterable, Optional
7
+
8
+ from typing_extensions import Self, TypedDict
9
+ from zapros import BaseHandler, Client
10
+
11
+ import capo_lambda_microvms._auth._signers
12
+ import capo_lambda_microvms._auth._sigv4
13
+ from capo_lambda_microvms._auth._identity import Credentials
14
+ from capo_lambda_microvms._auth._providers import (
15
+ CredentialsProvider,
16
+ IdentityProvider,
17
+ StaticAwsCredentialsProvider,
18
+ default_aws_credentials_chain,
19
+ )
20
+ from capo_lambda_microvms._auth._zapros_handler import AuthMiddleware
21
+ from capo_lambda_microvms._pagination import resolve_path as _resolve_path
22
+ from capo_lambda_microvms._resources.lambda_microvms.microvm import Microvm
23
+ from capo_lambda_microvms._resources.lambda_microvms.microvm_image import MicrovmImage
24
+ from capo_lambda_microvms._services._aws_config import aws_config
25
+ from capo_lambda_microvms._services._pipeline import (
26
+ Interceptor,
27
+ OperationOptions,
28
+ OperationRequest,
29
+ OperationResponse,
30
+ execute_pipeline,
31
+ retry,
32
+ )
33
+
34
+ if TYPE_CHECKING:
35
+ import capo_lambda_microvms.types.architecture
36
+ import capo_lambda_microvms.types.capability_list
37
+ import capo_lambda_microvms.types.chipset
38
+ import capo_lambda_microvms.types.code_artifact
39
+ import capo_lambda_microvms.types.cpu_configuration_list
40
+ import capo_lambda_microvms.types.create_microvm_auth_token_request
41
+ import capo_lambda_microvms.types.create_microvm_auth_token_response
42
+ import capo_lambda_microvms.types.create_microvm_image_request
43
+ import capo_lambda_microvms.types.create_microvm_image_response
44
+ import capo_lambda_microvms.types.create_microvm_shell_auth_token_request
45
+ import capo_lambda_microvms.types.create_microvm_shell_auth_token_response
46
+ import capo_lambda_microvms.types.delete_microvm_image_input
47
+ import capo_lambda_microvms.types.delete_microvm_image_output
48
+ import capo_lambda_microvms.types.delete_microvm_image_version_input
49
+ import capo_lambda_microvms.types.delete_microvm_image_version_output
50
+ import capo_lambda_microvms.types.environment_variable_map
51
+ import capo_lambda_microvms.types.get_microvm_image_build_input
52
+ import capo_lambda_microvms.types.get_microvm_image_build_output
53
+ import capo_lambda_microvms.types.get_microvm_image_input
54
+ import capo_lambda_microvms.types.get_microvm_image_output
55
+ import capo_lambda_microvms.types.get_microvm_image_version_input
56
+ import capo_lambda_microvms.types.get_microvm_image_version_output
57
+ import capo_lambda_microvms.types.get_microvm_request
58
+ import capo_lambda_microvms.types.get_microvm_response
59
+ import capo_lambda_microvms.types.hooks
60
+ import capo_lambda_microvms.types.idle_policy
61
+ import capo_lambda_microvms.types.image_name
62
+ import capo_lambda_microvms.types.list_managed_microvm_image_versions_input
63
+ import capo_lambda_microvms.types.list_managed_microvm_image_versions_output
64
+ import capo_lambda_microvms.types.list_managed_microvm_images_input
65
+ import capo_lambda_microvms.types.list_managed_microvm_images_output
66
+ import capo_lambda_microvms.types.list_microvm_image_builds_input
67
+ import capo_lambda_microvms.types.list_microvm_image_builds_output
68
+ import capo_lambda_microvms.types.list_microvm_image_versions_input
69
+ import capo_lambda_microvms.types.list_microvm_image_versions_output
70
+ import capo_lambda_microvms.types.list_microvm_images_request
71
+ import capo_lambda_microvms.types.list_microvm_images_response
72
+ import capo_lambda_microvms.types.list_microvms_request
73
+ import capo_lambda_microvms.types.list_microvms_response
74
+ import capo_lambda_microvms.types.list_of_port_specification
75
+ import capo_lambda_microvms.types.list_tags_request
76
+ import capo_lambda_microvms.types.list_tags_response
77
+ import capo_lambda_microvms.types.logging
78
+ import capo_lambda_microvms.types.managed_microvm_image_summary
79
+ import capo_lambda_microvms.types.managed_microvm_image_version
80
+ import capo_lambda_microvms.types.microvm_identifier
81
+ import capo_lambda_microvms.types.microvm_image_build_summary
82
+ import capo_lambda_microvms.types.microvm_image_identifier
83
+ import capo_lambda_microvms.types.microvm_image_summary
84
+ import capo_lambda_microvms.types.microvm_image_version_status
85
+ import capo_lambda_microvms.types.microvm_image_version_summary
86
+ import capo_lambda_microvms.types.microvm_item
87
+ import capo_lambda_microvms.types.network_connector_list
88
+ import capo_lambda_microvms.types.non_blank_string
89
+ import capo_lambda_microvms.types.positive_integer
90
+ import capo_lambda_microvms.types.resources_list
91
+ import capo_lambda_microvms.types.resume_microvm_request
92
+ import capo_lambda_microvms.types.resume_microvm_response
93
+ import capo_lambda_microvms.types.role_arn
94
+ import capo_lambda_microvms.types.run_hook_payload
95
+ import capo_lambda_microvms.types.run_microvm_request
96
+ import capo_lambda_microvms.types.run_microvm_response
97
+ import capo_lambda_microvms.types.string
98
+ import capo_lambda_microvms.types.suspend_microvm_request
99
+ import capo_lambda_microvms.types.suspend_microvm_response
100
+ import capo_lambda_microvms.types.tag_key_list
101
+ import capo_lambda_microvms.types.tag_resource_request
102
+ import capo_lambda_microvms.types.taggable_resource
103
+ import capo_lambda_microvms.types.tags
104
+ import capo_lambda_microvms.types.terminate_microvm_request
105
+ import capo_lambda_microvms.types.terminate_microvm_response
106
+ import capo_lambda_microvms.types.untag_resource_request
107
+ import capo_lambda_microvms.types.update_microvm_image_request
108
+ import capo_lambda_microvms.types.update_microvm_image_response
109
+ import capo_lambda_microvms.types.update_microvm_image_version_request
110
+ import capo_lambda_microvms.types.update_microvm_image_version_response
111
+ import capo_lambda_microvms.types.version
112
+
113
+
114
+ class LambdaMicrovmsClientConfig(TypedDict, total=False, closed=True):
115
+ operation_interceptors: Iterable[Interceptor[Any, Any]]
116
+ retry_max_attempts: int | None
117
+ region: str | None
118
+ use_dual_stack: bool | None
119
+ use_fips: bool | None
120
+ endpoint: str | None
121
+ credentials_provider: IdentityProvider[Credentials] | None
122
+
123
+
124
+ class LambdaMicrovmsClient:
125
+ """A client for the ``LambdaMicrovms`` service.
126
+
127
+ Args:
128
+ http_handler: HTTP handler for sending requests. If not provided, creates a default handler.
129
+ operation_interceptors: Interceptors that wrap every operation call. If not provided, defaults to an empty list.
130
+ retry_max_attempts: Maximum number of times to retry a failed operation. Defaults to 3.
131
+ region: The value of the ``AWS::Region`` endpoint parameter.
132
+ use_dual_stack: The value of the ``AWS::UseDualStack`` endpoint parameter.
133
+ use_fips: The value of the ``AWS::UseFIPS`` endpoint parameter.
134
+ endpoint: The value of the ``SDK::Endpoint`` endpoint parameter.
135
+ credentials: AWS credentials for request signing.
136
+ credentials_provider: Provider that resolves AWS credentials. Takes precedence over ``credentials``.
137
+ """
138
+
139
+ def __init__(
140
+ self,
141
+ http_handler: BaseHandler | None = None,
142
+ operation_interceptors: Iterable[Interceptor[Any, Any]] | None = None,
143
+ retry_max_attempts: int | None = None,
144
+ region: str | None = None,
145
+ use_dual_stack: bool | None = None,
146
+ use_fips: bool | None = None,
147
+ endpoint: str | None = None,
148
+ credentials: Credentials | None = None,
149
+ credentials_provider: CredentialsProvider | None = None,
150
+ ):
151
+ self._client = Client(http_handler).wrap_with_middleware(
152
+ lambda next: AuthMiddleware(next)
153
+ )
154
+ if credentials is not None and credentials_provider is not None:
155
+ warnings.warn(
156
+ "Both credentials and credentials_provider given; provider takes precedence"
157
+ )
158
+ resolved_credentials_provider: IdentityProvider[Credentials] | None = (
159
+ credentials_provider
160
+ )
161
+ if resolved_credentials_provider is None and credentials is not None:
162
+ resolved_credentials_provider = StaticAwsCredentialsProvider(credentials)
163
+ if resolved_credentials_provider is None and credentials is None:
164
+ resolved_credentials_provider = default_aws_credentials_chain(
165
+ Client(http_handler)
166
+ )
167
+ self._config = LambdaMicrovmsClientConfig(
168
+ {
169
+ "operation_interceptors": operation_interceptors or [],
170
+ "retry_max_attempts": retry_max_attempts,
171
+ "region": region,
172
+ "use_dual_stack": use_dual_stack,
173
+ "use_fips": use_fips,
174
+ "endpoint": endpoint,
175
+ "credentials_provider": resolved_credentials_provider,
176
+ }
177
+ )
178
+
179
+ # resources
180
+ self.microvm = Microvm(self)
181
+ self.microvm_image = MicrovmImage(self)
182
+
183
+ def operation_options(
184
+ self, config_overrides: Optional[LambdaMicrovmsClientConfig] = None
185
+ ) -> tuple[Iterable[Interceptor[Any, Any]], OperationOptions]:
186
+ overrides: LambdaMicrovmsClientConfig = config_overrides or {}
187
+ interceptors_: list[Interceptor[Any, Any]] = [
188
+ *overrides.get(
189
+ "operation_interceptors", self._config.get("operation_interceptors", [])
190
+ ),
191
+ aws_config(),
192
+ retry(),
193
+ ]
194
+ options_: OperationOptions = OperationOptions(
195
+ client=self._client,
196
+ retry_max_attempts=overrides.get(
197
+ "retry_max_attempts", self._config.get("retry_max_attempts")
198
+ ),
199
+ region=overrides.get("region", self._config.get("region")),
200
+ use_dual_stack=overrides.get(
201
+ "use_dual_stack", self._config.get("use_dual_stack")
202
+ ),
203
+ use_fips=overrides.get("use_fips", self._config.get("use_fips")),
204
+ endpoint=overrides.get("endpoint", self._config.get("endpoint")),
205
+ credentials_provider=overrides.get(
206
+ "credentials_provider", self._config.get("credentials_provider")
207
+ ),
208
+ )
209
+ return interceptors_, options_
210
+
211
+ def create_microvm_image(
212
+ self,
213
+ base_image_arn: "capo_lambda_microvms.types.non_blank_string.NonBlankString",
214
+ build_role_arn: "capo_lambda_microvms.types.role_arn.RoleArn",
215
+ code_artifact: "capo_lambda_microvms.types.code_artifact.CodeArtifact",
216
+ name: "capo_lambda_microvms.types.image_name.ImageName",
217
+ *,
218
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
219
+ base_image_version: Optional[
220
+ "capo_lambda_microvms.types.version.Version"
221
+ ] = None,
222
+ description: Optional[str] = None,
223
+ logging: Optional["capo_lambda_microvms.types.logging.Logging"] = None,
224
+ egress_network_connectors: Optional[
225
+ "capo_lambda_microvms.types.network_connector_list.NetworkConnectorList"
226
+ ] = None,
227
+ cpu_configurations: Optional[
228
+ "capo_lambda_microvms.types.cpu_configuration_list.CpuConfigurationList"
229
+ ] = None,
230
+ resources: Optional[
231
+ "capo_lambda_microvms.types.resources_list.ResourcesList"
232
+ ] = None,
233
+ additional_os_capabilities: Optional[
234
+ "capo_lambda_microvms.types.capability_list.CapabilityList"
235
+ ] = None,
236
+ hooks: Optional["capo_lambda_microvms.types.hooks.Hooks"] = None,
237
+ environment_variables: Optional[
238
+ "capo_lambda_microvms.types.environment_variable_map.EnvironmentVariableMap"
239
+ ] = None,
240
+ tags: Optional["capo_lambda_microvms.types.tags.Tags"] = None,
241
+ client_token: Optional[str] = None,
242
+ ) -> "capo_lambda_microvms.types.create_microvm_image_response.CreateMicrovmImageResponse":
243
+ r"""<p>Creates a MicroVM image from the specified code artifact and base image. The build is asynchronous — the image transitions from CREATING to CREATED on success, or CREATE_FAILED on failure. Use GetMicrovmImage to poll for completion.</p>
244
+
245
+ Args:
246
+ base_image_arn: <p>The ARN of the Lambda-managed base MicroVM image to build upon. Use ListManagedMicrovmImages to discover available base images.</p>
247
+ base_image_version: <p>The specific version of the base MicroVM image to use.</p>
248
+ build_role_arn: <p>The ARN of the IAM role assumed during the image build process. This role must have permissions to access the code artifact and any required resources.</p>
249
+ description: <p>A description of the MicroVM image.</p>
250
+ code_artifact: <p>The code artifact containing the application code and metadata for the MicroVM image.</p>
251
+ logging: <p>The logging configuration for build-time and runtime logs. Specify {\"cloudWatch\": {\"logGroup\": \"...\"}} to stream logs to a custom CloudWatch log group, or {\"disabled\": {}} to turn off logging.</p>
252
+ egress_network_connectors: <p>The list of egress network connectors available to the MicroVM at runtime.</p>
253
+ cpu_configurations: <p>The list of supported CPU configurations for the MicroVM.</p>
254
+ resources: <p>The resource requirements for the MicroVM.</p>
255
+ additional_os_capabilities: <p>Additional OS capabilities granted to the MicroVM runtime environment.</p>
256
+ environment_variables: <p>Environment variables set in the MicroVM runtime environment.</p>
257
+ name: <p>The name of the MicroVM image. Must be unique within the AWS account.</p>
258
+ tags: <p>A set of key-value pairs that you can attach to the resource. Use tags to categorize resources for cost allocation, access control (ABAC), and organization.</p>
259
+ client_token: <p>A unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token, the operation returns the successful response without performing any further actions.</p>
260
+
261
+ Raises:
262
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
263
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
264
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
265
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
266
+ capo_lambda_microvms.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
267
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
268
+ capo_lambda_microvms.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have exceeded a service quota for Lambda MicroVMs.</p>
269
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
270
+ """
271
+
272
+ def _handler(
273
+ req: "OperationRequest[capo_lambda_microvms.types.create_microvm_image_request.CreateMicrovmImageRequest]",
274
+ ) -> OperationResponse[
275
+ "capo_lambda_microvms.types.create_microvm_image_response.CreateMicrovmImageResponse"
276
+ ]:
277
+ import capo_lambda_microvms._operations.lambda_microvms.create_microvm_image
278
+
279
+ output, http_response = (
280
+ capo_lambda_microvms._operations.lambda_microvms.create_microvm_image.create_microvm_image(
281
+ req.options, req.input
282
+ )
283
+ )
284
+ return OperationResponse(output=output, response=http_response)
285
+
286
+ interceptors_, options_ = self.operation_options(config_overrides)
287
+ input_: capo_lambda_microvms.types.create_microvm_image_request.CreateMicrovmImageRequest = {
288
+ "base_image_arn": base_image_arn,
289
+ "build_role_arn": build_role_arn,
290
+ "code_artifact": code_artifact,
291
+ "name": name,
292
+ }
293
+ if base_image_version is not None:
294
+ input_["base_image_version"] = base_image_version
295
+ if description is not None:
296
+ input_["description"] = description
297
+ if logging is not None:
298
+ input_["logging"] = logging
299
+ if egress_network_connectors is not None:
300
+ input_["egress_network_connectors"] = egress_network_connectors
301
+ if cpu_configurations is not None:
302
+ input_["cpu_configurations"] = cpu_configurations
303
+ if resources is not None:
304
+ input_["resources"] = resources
305
+ if additional_os_capabilities is not None:
306
+ input_["additional_os_capabilities"] = additional_os_capabilities
307
+ if hooks is not None:
308
+ input_["hooks"] = hooks
309
+ if environment_variables is not None:
310
+ input_["environment_variables"] = environment_variables
311
+ if tags is not None:
312
+ input_["tags"] = tags
313
+ if client_token is None:
314
+ client_token = str(uuid.uuid4())
315
+ input_["client_token"] = client_token
316
+
317
+ response = execute_pipeline(
318
+ OperationRequest(input=input_, options=options_),
319
+ handler=_handler,
320
+ interceptors=list(interceptors_),
321
+ )
322
+ response.response.close()
323
+ return response.output
324
+
325
+ def list_managed_microvm_images(
326
+ self,
327
+ *,
328
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
329
+ max_results: Optional[int] = None,
330
+ next_token: Optional["capo_lambda_microvms.types.string.String"] = None,
331
+ ) -> "capo_lambda_microvms.types.list_managed_microvm_images_output.ListManagedMicrovmImagesOutput":
332
+ """<p>Lists AWS managed MicroVM images available for use as base images. We recommend using pagination to ensure that the operation returns quickly and successfully.</p>
333
+
334
+ Args:
335
+ max_results: <p>The maximum number of results to return in a single call.</p>
336
+ next_token: <p>The pagination token from a previous call. Use this token to retrieve the next page of results.</p>
337
+
338
+ Raises:
339
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
340
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
341
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
342
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
343
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
344
+ """
345
+
346
+ def _handler(
347
+ req: "OperationRequest[capo_lambda_microvms.types.list_managed_microvm_images_input.ListManagedMicrovmImagesInput]",
348
+ ) -> OperationResponse[
349
+ "capo_lambda_microvms.types.list_managed_microvm_images_output.ListManagedMicrovmImagesOutput"
350
+ ]:
351
+ import capo_lambda_microvms._operations.lambda_microvms.list_managed_microvm_images
352
+
353
+ output, http_response = (
354
+ capo_lambda_microvms._operations.lambda_microvms.list_managed_microvm_images.list_managed_microvm_images(
355
+ req.options, req.input
356
+ )
357
+ )
358
+ return OperationResponse(output=output, response=http_response)
359
+
360
+ interceptors_, options_ = self.operation_options(config_overrides)
361
+ input_: capo_lambda_microvms.types.list_managed_microvm_images_input.ListManagedMicrovmImagesInput = {}
362
+ if max_results is not None:
363
+ input_["max_results"] = max_results
364
+ if next_token is not None:
365
+ input_["next_token"] = next_token
366
+
367
+ response = execute_pipeline(
368
+ OperationRequest(input=input_, options=options_),
369
+ handler=_handler,
370
+ interceptors=list(interceptors_),
371
+ )
372
+ response.response.close()
373
+ return response.output
374
+
375
+ def iter_list_managed_microvm_images(
376
+ self,
377
+ *,
378
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
379
+ max_results: Optional[int] = None,
380
+ next_token: Optional["capo_lambda_microvms.types.string.String"] = None,
381
+ ) -> "Iterator[capo_lambda_microvms.types.managed_microvm_image_summary.ManagedMicrovmImageSummary]":
382
+ _token = next_token
383
+ while True:
384
+ _response = self.list_managed_microvm_images(
385
+ config_overrides=config_overrides,
386
+ max_results=max_results,
387
+ next_token=_token,
388
+ )
389
+ _page = _resolve_path(_response, ("items",))
390
+ for _item in _page or []:
391
+ yield _item
392
+ _token = _resolve_path(_response, ("next_token",))
393
+ if not _token:
394
+ break
395
+
396
+ def list_tags(
397
+ self,
398
+ resource: "capo_lambda_microvms.types.taggable_resource.TaggableResource",
399
+ *,
400
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
401
+ ) -> "capo_lambda_microvms.types.list_tags_response.ListTagsResponse":
402
+ """<p>Lists the tags associated with a Lambda MicroVM resource.</p>
403
+
404
+ Args:
405
+ resource: <p>The ARN of the resource to list tags for.</p>
406
+
407
+ Raises:
408
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
409
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
410
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
411
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
412
+ capo_lambda_microvms.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One of the parameters in the request is not valid.</p>
413
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
414
+ capo_lambda_microvms.errors.service_exception.ServiceException: <p>The AWS Lambda MicroVMs service encountered an internal error.</p>
415
+ capo_lambda_microvms.errors.too_many_requests_exception.TooManyRequestsException: <p>The request throughput limit was exceeded. Retry the request later.</p>
416
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
417
+ """
418
+
419
+ def _handler(
420
+ req: "OperationRequest[capo_lambda_microvms.types.list_tags_request.ListTagsRequest]",
421
+ ) -> OperationResponse[
422
+ "capo_lambda_microvms.types.list_tags_response.ListTagsResponse"
423
+ ]:
424
+ import capo_lambda_microvms._operations.lambda_microvms.list_tags
425
+
426
+ output, http_response = (
427
+ capo_lambda_microvms._operations.lambda_microvms.list_tags.list_tags(
428
+ req.options, req.input
429
+ )
430
+ )
431
+ return OperationResponse(output=output, response=http_response)
432
+
433
+ interceptors_, options_ = self.operation_options(config_overrides)
434
+ input_: capo_lambda_microvms.types.list_tags_request.ListTagsRequest = {
435
+ "resource": resource
436
+ }
437
+
438
+ response = execute_pipeline(
439
+ OperationRequest(input=input_, options=options_),
440
+ handler=_handler,
441
+ interceptors=list(interceptors_),
442
+ )
443
+ response.response.close()
444
+ return response.output
445
+
446
+ def tag_resource(
447
+ self,
448
+ resource: "capo_lambda_microvms.types.taggable_resource.TaggableResource",
449
+ tags: "capo_lambda_microvms.types.tags.Tags",
450
+ *,
451
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
452
+ ) -> None:
453
+ """<p>Adds tags to a Lambda MicroVM resource.</p>
454
+
455
+ Args:
456
+ resource: <p>The ARN of the resource to tag.</p>
457
+ tags: <p>The key-value pairs of tags to add to the resource.</p>
458
+
459
+ Raises:
460
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
461
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
462
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
463
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
464
+ capo_lambda_microvms.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One of the parameters in the request is not valid.</p>
465
+ capo_lambda_microvms.errors.resource_conflict_exception.ResourceConflictException: <p>The resource already exists, or another operation is in progress.</p>
466
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
467
+ capo_lambda_microvms.errors.service_exception.ServiceException: <p>The AWS Lambda MicroVMs service encountered an internal error.</p>
468
+ capo_lambda_microvms.errors.too_many_requests_exception.TooManyRequestsException: <p>The request throughput limit was exceeded. Retry the request later.</p>
469
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
470
+ """
471
+
472
+ def _handler(
473
+ req: "OperationRequest[capo_lambda_microvms.types.tag_resource_request.TagResourceRequest]",
474
+ ) -> OperationResponse[None]:
475
+ import capo_lambda_microvms._operations.lambda_microvms.tag_resource
476
+
477
+ output, http_response = (
478
+ capo_lambda_microvms._operations.lambda_microvms.tag_resource.tag_resource(
479
+ req.options, req.input
480
+ )
481
+ )
482
+ return OperationResponse(output=output, response=http_response)
483
+
484
+ interceptors_, options_ = self.operation_options(config_overrides)
485
+ input_: capo_lambda_microvms.types.tag_resource_request.TagResourceRequest = {
486
+ "resource": resource,
487
+ "tags": tags,
488
+ }
489
+
490
+ response = execute_pipeline(
491
+ OperationRequest(input=input_, options=options_),
492
+ handler=_handler,
493
+ interceptors=list(interceptors_),
494
+ )
495
+ response.response.close()
496
+ return response.output
497
+
498
+ def untag_resource(
499
+ self,
500
+ resource: "capo_lambda_microvms.types.taggable_resource.TaggableResource",
501
+ tag_keys: "capo_lambda_microvms.types.tag_key_list.TagKeyList",
502
+ *,
503
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
504
+ ) -> None:
505
+ """<p>Removes tags from a Lambda MicroVM resource.</p>
506
+
507
+ Args:
508
+ resource: <p>The ARN of the resource to remove tags from.</p>
509
+ tag_keys: <p>The list of tag keys to remove from the resource.</p>
510
+
511
+ Raises:
512
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
513
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
514
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
515
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
516
+ capo_lambda_microvms.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One of the parameters in the request is not valid.</p>
517
+ capo_lambda_microvms.errors.resource_conflict_exception.ResourceConflictException: <p>The resource already exists, or another operation is in progress.</p>
518
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
519
+ capo_lambda_microvms.errors.service_exception.ServiceException: <p>The AWS Lambda MicroVMs service encountered an internal error.</p>
520
+ capo_lambda_microvms.errors.too_many_requests_exception.TooManyRequestsException: <p>The request throughput limit was exceeded. Retry the request later.</p>
521
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
522
+ """
523
+
524
+ def _handler(
525
+ req: "OperationRequest[capo_lambda_microvms.types.untag_resource_request.UntagResourceRequest]",
526
+ ) -> OperationResponse[None]:
527
+ import capo_lambda_microvms._operations.lambda_microvms.untag_resource
528
+
529
+ output, http_response = (
530
+ capo_lambda_microvms._operations.lambda_microvms.untag_resource.untag_resource(
531
+ req.options, req.input
532
+ )
533
+ )
534
+ return OperationResponse(output=output, response=http_response)
535
+
536
+ interceptors_, options_ = self.operation_options(config_overrides)
537
+ input_: capo_lambda_microvms.types.untag_resource_request.UntagResourceRequest = {
538
+ "resource": resource,
539
+ "tag_keys": tag_keys,
540
+ }
541
+
542
+ response = execute_pipeline(
543
+ OperationRequest(input=input_, options=options_),
544
+ handler=_handler,
545
+ interceptors=list(interceptors_),
546
+ )
547
+ response.response.close()
548
+ return response.output
549
+
550
+ def run_microvm(
551
+ self,
552
+ image_identifier: "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier",
553
+ *,
554
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
555
+ ingress_network_connectors: Optional[
556
+ "capo_lambda_microvms.types.network_connector_list.NetworkConnectorList"
557
+ ] = None,
558
+ egress_network_connectors: Optional[
559
+ "capo_lambda_microvms.types.network_connector_list.NetworkConnectorList"
560
+ ] = None,
561
+ image_version: Optional["capo_lambda_microvms.types.version.Version"] = None,
562
+ execution_role_arn: Optional[
563
+ "capo_lambda_microvms.types.role_arn.RoleArn"
564
+ ] = None,
565
+ idle_policy: Optional[
566
+ "capo_lambda_microvms.types.idle_policy.IdlePolicy"
567
+ ] = None,
568
+ logging: Optional["capo_lambda_microvms.types.logging.Logging"] = None,
569
+ run_hook_payload: Optional[
570
+ "capo_lambda_microvms.types.run_hook_payload.RunHookPayload"
571
+ ] = None,
572
+ maximum_duration_in_seconds: Optional[int] = None,
573
+ client_token: Optional[str] = None,
574
+ ) -> "capo_lambda_microvms.types.run_microvm_response.RunMicrovmResponse":
575
+ r"""<p>Runs a new MicroVM from the specified image. The MicroVM starts in PENDING state and transitions to RUNNING once provisioning completes. To connect, generate an authentication token using CreateMicrovmAuthToken.</p>
576
+
577
+ Args:
578
+ ingress_network_connectors: <p>The list of ingress network connectors to configure for the MicroVM.</p>
579
+ egress_network_connectors: <p>The list of egress network connectors to configure for the MicroVM.</p>
580
+ image_identifier: <p>The identifier (ARN or ID) of the MicroVM image to run.</p>
581
+ image_version: <p>The version of the MicroVM image to run.</p>
582
+ execution_role_arn: <p>The ARN of the IAM role to be assumed by the MicroVM during execution.</p>
583
+ idle_policy: <p>Configuration to control auto-suspend and auto-resume behavior.</p>
584
+ logging: <p>The logging configuration for this MicroVM instance. Specify {\"cloudWatch\": {\"logGroup\": \"...\"}} to stream application logs to a custom CloudWatch log group, or {\"disabled\": {}} to turn off logging.</p>
585
+ run_hook_payload: <p>Per-MicroVM initialization data delivered as the request body of the /run lifecycle hook. Use to pass tenant-specific configuration such as session IDs or secret references. Maximum: 16,384 bytes.</p>
586
+ maximum_duration_in_seconds: <p>The maximum duration in seconds that the MicroVM can exist before being terminated by the platform. Valid range: 1–28,800 (8 hours).</p>
587
+ client_token: <p>A unique, case-sensitive identifier you provide to ensure the idempotency of the request.</p>
588
+
589
+ Raises:
590
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
591
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
592
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
593
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
594
+ capo_lambda_microvms.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
595
+ capo_lambda_microvms.errors.insufficient_capacity_exception.InsufficientCapacityException: <p>There is insufficient capacity to fulfill the request. Retry the request later.</p>
596
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
597
+ capo_lambda_microvms.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have exceeded a service quota for Lambda MicroVMs.</p>
598
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
599
+ """
600
+
601
+ def _handler(
602
+ req: "OperationRequest[capo_lambda_microvms.types.run_microvm_request.RunMicrovmRequest]",
603
+ ) -> OperationResponse[
604
+ "capo_lambda_microvms.types.run_microvm_response.RunMicrovmResponse"
605
+ ]:
606
+ import capo_lambda_microvms._operations.lambda_microvms.run_microvm
607
+
608
+ output, http_response = (
609
+ capo_lambda_microvms._operations.lambda_microvms.run_microvm.run_microvm(
610
+ req.options, req.input
611
+ )
612
+ )
613
+ return OperationResponse(output=output, response=http_response)
614
+
615
+ interceptors_, options_ = self.operation_options(config_overrides)
616
+ input_: capo_lambda_microvms.types.run_microvm_request.RunMicrovmRequest = {
617
+ "image_identifier": image_identifier
618
+ }
619
+ if ingress_network_connectors is not None:
620
+ input_["ingress_network_connectors"] = ingress_network_connectors
621
+ if egress_network_connectors is not None:
622
+ input_["egress_network_connectors"] = egress_network_connectors
623
+ if image_version is not None:
624
+ input_["image_version"] = image_version
625
+ if execution_role_arn is not None:
626
+ input_["execution_role_arn"] = execution_role_arn
627
+ if idle_policy is not None:
628
+ input_["idle_policy"] = idle_policy
629
+ if logging is not None:
630
+ input_["logging"] = logging
631
+ if run_hook_payload is not None:
632
+ input_["run_hook_payload"] = run_hook_payload
633
+ if maximum_duration_in_seconds is not None:
634
+ input_["maximum_duration_in_seconds"] = maximum_duration_in_seconds
635
+ if client_token is None:
636
+ client_token = str(uuid.uuid4())
637
+ input_["client_token"] = client_token
638
+
639
+ response = execute_pipeline(
640
+ OperationRequest(input=input_, options=options_),
641
+ handler=_handler,
642
+ interceptors=list(interceptors_),
643
+ )
644
+ response.response.close()
645
+ return response.output
646
+
647
+ def get_microvm(
648
+ self,
649
+ microvm_identifier: "capo_lambda_microvms.types.microvm_identifier.MicrovmIdentifier",
650
+ *,
651
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
652
+ ) -> "capo_lambda_microvms.types.get_microvm_response.GetMicrovmResponse":
653
+ """<p>Retrieves the details of a specific MicroVM, including its state, endpoint, image information, and configuration. The state field is eventually consistent — determine readiness by connecting to the endpoint.</p>
654
+
655
+ Args:
656
+ microvm_identifier: <p>The ID of the MicroVM to retrieve.</p>
657
+
658
+ Raises:
659
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
660
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
661
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
662
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
663
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
664
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
665
+ """
666
+
667
+ def _handler(
668
+ req: "OperationRequest[capo_lambda_microvms.types.get_microvm_request.GetMicrovmRequest]",
669
+ ) -> OperationResponse[
670
+ "capo_lambda_microvms.types.get_microvm_response.GetMicrovmResponse"
671
+ ]:
672
+ import capo_lambda_microvms._operations.lambda_microvms.get_microvm
673
+
674
+ output, http_response = (
675
+ capo_lambda_microvms._operations.lambda_microvms.get_microvm.get_microvm(
676
+ req.options, req.input
677
+ )
678
+ )
679
+ return OperationResponse(output=output, response=http_response)
680
+
681
+ interceptors_, options_ = self.operation_options(config_overrides)
682
+ input_: capo_lambda_microvms.types.get_microvm_request.GetMicrovmRequest = {
683
+ "microvm_identifier": microvm_identifier
684
+ }
685
+
686
+ response = execute_pipeline(
687
+ OperationRequest(input=input_, options=options_),
688
+ handler=_handler,
689
+ interceptors=list(interceptors_),
690
+ )
691
+ response.response.close()
692
+ return response.output
693
+
694
+ def terminate_microvm(
695
+ self,
696
+ microvm_identifier: "capo_lambda_microvms.types.microvm_identifier.MicrovmIdentifier",
697
+ *,
698
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
699
+ ) -> (
700
+ "capo_lambda_microvms.types.terminate_microvm_response.TerminateMicrovmResponse"
701
+ ):
702
+ """<p>Terminates a MicroVM. This operation is idempotent; terminating a MicroVM that has already been terminated succeeds without error.</p>
703
+
704
+ Args:
705
+ microvm_identifier: <p>The ID of the MicroVM to terminate.</p>
706
+
707
+ Raises:
708
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
709
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
710
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
711
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
712
+ capo_lambda_microvms.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
713
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
714
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
715
+ """
716
+
717
+ def _handler(
718
+ req: "OperationRequest[capo_lambda_microvms.types.terminate_microvm_request.TerminateMicrovmRequest]",
719
+ ) -> OperationResponse[
720
+ "capo_lambda_microvms.types.terminate_microvm_response.TerminateMicrovmResponse"
721
+ ]:
722
+ import capo_lambda_microvms._operations.lambda_microvms.terminate_microvm
723
+
724
+ output, http_response = (
725
+ capo_lambda_microvms._operations.lambda_microvms.terminate_microvm.terminate_microvm(
726
+ req.options, req.input
727
+ )
728
+ )
729
+ return OperationResponse(output=output, response=http_response)
730
+
731
+ interceptors_, options_ = self.operation_options(config_overrides)
732
+ input_: capo_lambda_microvms.types.terminate_microvm_request.TerminateMicrovmRequest = {
733
+ "microvm_identifier": microvm_identifier
734
+ }
735
+
736
+ response = execute_pipeline(
737
+ OperationRequest(input=input_, options=options_),
738
+ handler=_handler,
739
+ interceptors=list(interceptors_),
740
+ )
741
+ response.response.close()
742
+ return response.output
743
+
744
+ def list_microvms(
745
+ self,
746
+ *,
747
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
748
+ max_results: Optional[int] = None,
749
+ next_token: Optional["capo_lambda_microvms.types.string.String"] = None,
750
+ image_identifier: Optional[
751
+ "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier"
752
+ ] = None,
753
+ image_version: Optional[str] = None,
754
+ ) -> "capo_lambda_microvms.types.list_microvms_response.ListMicrovmsResponse":
755
+ """<p>Lists MicroVMs in the account with optional filtering by image and version. We recommend using pagination to ensure that the operation returns quickly and successfully.</p>
756
+
757
+ Args:
758
+ max_results: <p>The maximum number of results to return in a single call.</p>
759
+ next_token: <p>The pagination token from a previous call. Use this token to retrieve the next page of results.</p>
760
+ image_identifier: <p>Optional filter to list only MicroVMs running the specified image.</p>
761
+ image_version: <p>Optional filter to list only MicroVMs running the specified image version.</p>
762
+
763
+ Raises:
764
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
765
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
766
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
767
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
768
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
769
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
770
+ """
771
+
772
+ def _handler(
773
+ req: "OperationRequest[capo_lambda_microvms.types.list_microvms_request.ListMicrovmsRequest]",
774
+ ) -> OperationResponse[
775
+ "capo_lambda_microvms.types.list_microvms_response.ListMicrovmsResponse"
776
+ ]:
777
+ import capo_lambda_microvms._operations.lambda_microvms.list_microvms
778
+
779
+ output, http_response = (
780
+ capo_lambda_microvms._operations.lambda_microvms.list_microvms.list_microvms(
781
+ req.options, req.input
782
+ )
783
+ )
784
+ return OperationResponse(output=output, response=http_response)
785
+
786
+ interceptors_, options_ = self.operation_options(config_overrides)
787
+ input_: capo_lambda_microvms.types.list_microvms_request.ListMicrovmsRequest = {}
788
+ if max_results is not None:
789
+ input_["max_results"] = max_results
790
+ if next_token is not None:
791
+ input_["next_token"] = next_token
792
+ if image_identifier is not None:
793
+ input_["image_identifier"] = image_identifier
794
+ if image_version is not None:
795
+ input_["image_version"] = image_version
796
+
797
+ response = execute_pipeline(
798
+ OperationRequest(input=input_, options=options_),
799
+ handler=_handler,
800
+ interceptors=list(interceptors_),
801
+ )
802
+ response.response.close()
803
+ return response.output
804
+
805
+ def iter_list_microvms(
806
+ self,
807
+ *,
808
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
809
+ max_results: Optional[int] = None,
810
+ next_token: Optional["capo_lambda_microvms.types.string.String"] = None,
811
+ image_identifier: Optional[
812
+ "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier"
813
+ ] = None,
814
+ image_version: Optional[str] = None,
815
+ ) -> "Iterator[capo_lambda_microvms.types.microvm_item.MicrovmItem]":
816
+ _token = next_token
817
+ while True:
818
+ _response = self.list_microvms(
819
+ config_overrides=config_overrides,
820
+ max_results=max_results,
821
+ next_token=_token,
822
+ image_identifier=image_identifier,
823
+ image_version=image_version,
824
+ )
825
+ _page = _resolve_path(_response, ("items",))
826
+ for _item in _page or []:
827
+ yield _item
828
+ _token = _resolve_path(_response, ("next_token",))
829
+ if not _token:
830
+ break
831
+
832
+ def create_microvm_auth_token(
833
+ self,
834
+ microvm_identifier: "capo_lambda_microvms.types.microvm_identifier.MicrovmIdentifier",
835
+ expiration_in_minutes: "capo_lambda_microvms.types.positive_integer.PositiveInteger",
836
+ allowed_ports: "capo_lambda_microvms.types.list_of_port_specification.ListOfPortSpecification",
837
+ *,
838
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
839
+ ) -> "capo_lambda_microvms.types.create_microvm_auth_token_response.CreateMicrovmAuthTokenResponse":
840
+ """<p>Creates an authentication token for accessing a running MicroVM. The token grants access to the specified ports on the MicroVM endpoint.</p>
841
+
842
+ Args:
843
+ microvm_identifier: <p>The ID of the MicroVM to create an authentication token for.</p>
844
+ expiration_in_minutes: <p>The duration in minutes before the authentication token expires. Maximum: 60 minutes.</p>
845
+ allowed_ports: <p>The list of port specifications that the authentication token grants access to on the MicroVM.</p>
846
+
847
+ Raises:
848
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
849
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
850
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
851
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
852
+ capo_lambda_microvms.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
853
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
854
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
855
+ """
856
+
857
+ def _handler(
858
+ req: "OperationRequest[capo_lambda_microvms.types.create_microvm_auth_token_request.CreateMicrovmAuthTokenRequest]",
859
+ ) -> OperationResponse[
860
+ "capo_lambda_microvms.types.create_microvm_auth_token_response.CreateMicrovmAuthTokenResponse"
861
+ ]:
862
+ import capo_lambda_microvms._operations.lambda_microvms.create_microvm_auth_token
863
+
864
+ output, http_response = (
865
+ capo_lambda_microvms._operations.lambda_microvms.create_microvm_auth_token.create_microvm_auth_token(
866
+ req.options, req.input
867
+ )
868
+ )
869
+ return OperationResponse(output=output, response=http_response)
870
+
871
+ interceptors_, options_ = self.operation_options(config_overrides)
872
+ input_: capo_lambda_microvms.types.create_microvm_auth_token_request.CreateMicrovmAuthTokenRequest = {
873
+ "microvm_identifier": microvm_identifier,
874
+ "expiration_in_minutes": expiration_in_minutes,
875
+ "allowed_ports": allowed_ports,
876
+ }
877
+
878
+ response = execute_pipeline(
879
+ OperationRequest(input=input_, options=options_),
880
+ handler=_handler,
881
+ interceptors=list(interceptors_),
882
+ )
883
+ response.response.close()
884
+ return response.output
885
+
886
+ def create_microvm_shell_auth_token(
887
+ self,
888
+ microvm_identifier: "capo_lambda_microvms.types.microvm_identifier.MicrovmIdentifier",
889
+ expiration_in_minutes: "capo_lambda_microvms.types.positive_integer.PositiveInteger",
890
+ *,
891
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
892
+ ) -> "capo_lambda_microvms.types.create_microvm_shell_auth_token_response.CreateMicrovmShellAuthTokenResponse":
893
+ """<p>Creates a shell authentication token for interactive shell access to a running MicroVM. The MicroVM must have been run with the SHELL_INGRESS network connector attached.</p>
894
+
895
+ Args:
896
+ microvm_identifier: <p>The ID of the MicroVM to create a shell authentication token for.</p>
897
+ expiration_in_minutes: <p>The duration in minutes before the shell authentication token expires.</p>
898
+
899
+ Raises:
900
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
901
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
902
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
903
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
904
+ capo_lambda_microvms.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
905
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
906
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
907
+ """
908
+
909
+ def _handler(
910
+ req: "OperationRequest[capo_lambda_microvms.types.create_microvm_shell_auth_token_request.CreateMicrovmShellAuthTokenRequest]",
911
+ ) -> OperationResponse[
912
+ "capo_lambda_microvms.types.create_microvm_shell_auth_token_response.CreateMicrovmShellAuthTokenResponse"
913
+ ]:
914
+ import capo_lambda_microvms._operations.lambda_microvms.create_microvm_shell_auth_token
915
+
916
+ output, http_response = (
917
+ capo_lambda_microvms._operations.lambda_microvms.create_microvm_shell_auth_token.create_microvm_shell_auth_token(
918
+ req.options, req.input
919
+ )
920
+ )
921
+ return OperationResponse(output=output, response=http_response)
922
+
923
+ interceptors_, options_ = self.operation_options(config_overrides)
924
+ input_: capo_lambda_microvms.types.create_microvm_shell_auth_token_request.CreateMicrovmShellAuthTokenRequest = {
925
+ "microvm_identifier": microvm_identifier,
926
+ "expiration_in_minutes": expiration_in_minutes,
927
+ }
928
+
929
+ response = execute_pipeline(
930
+ OperationRequest(input=input_, options=options_),
931
+ handler=_handler,
932
+ interceptors=list(interceptors_),
933
+ )
934
+ response.response.close()
935
+ return response.output
936
+
937
+ def resume_microvm(
938
+ self,
939
+ microvm_identifier: "capo_lambda_microvms.types.microvm_identifier.MicrovmIdentifier",
940
+ *,
941
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
942
+ ) -> "capo_lambda_microvms.types.resume_microvm_response.ResumeMicrovmResponse":
943
+ """<p>Resumes a suspended MicroVM, restoring it to RUNNING state with all state intact. The MicroVM must be in SUSPENDED state.</p>
944
+
945
+ Args:
946
+ microvm_identifier: <p>The ID of the MicroVM to resume.</p>
947
+
948
+ Raises:
949
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
950
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
951
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
952
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
953
+ capo_lambda_microvms.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
954
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
955
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
956
+ """
957
+
958
+ def _handler(
959
+ req: "OperationRequest[capo_lambda_microvms.types.resume_microvm_request.ResumeMicrovmRequest]",
960
+ ) -> OperationResponse[
961
+ "capo_lambda_microvms.types.resume_microvm_response.ResumeMicrovmResponse"
962
+ ]:
963
+ import capo_lambda_microvms._operations.lambda_microvms.resume_microvm
964
+
965
+ output, http_response = (
966
+ capo_lambda_microvms._operations.lambda_microvms.resume_microvm.resume_microvm(
967
+ req.options, req.input
968
+ )
969
+ )
970
+ return OperationResponse(output=output, response=http_response)
971
+
972
+ interceptors_, options_ = self.operation_options(config_overrides)
973
+ input_: capo_lambda_microvms.types.resume_microvm_request.ResumeMicrovmRequest = {
974
+ "microvm_identifier": microvm_identifier
975
+ }
976
+
977
+ response = execute_pipeline(
978
+ OperationRequest(input=input_, options=options_),
979
+ handler=_handler,
980
+ interceptors=list(interceptors_),
981
+ )
982
+ response.response.close()
983
+ return response.output
984
+
985
+ def suspend_microvm(
986
+ self,
987
+ microvm_identifier: "capo_lambda_microvms.types.microvm_identifier.MicrovmIdentifier",
988
+ *,
989
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
990
+ ) -> "capo_lambda_microvms.types.suspend_microvm_response.SuspendMicrovmResponse":
991
+ """<p>Suspends a running MicroVM, preserving its full memory and disk state. The MicroVM transitions through SUSPENDING to SUSPENDED. To restore, call ResumeMicrovm or send traffic to the endpoint if autoResumeEnabled is true.</p>
992
+
993
+ Args:
994
+ microvm_identifier: <p>The ID of the MicroVM to suspend.</p>
995
+
996
+ Raises:
997
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
998
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
999
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
1000
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
1001
+ capo_lambda_microvms.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
1002
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
1003
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
1004
+ """
1005
+
1006
+ def _handler(
1007
+ req: "OperationRequest[capo_lambda_microvms.types.suspend_microvm_request.SuspendMicrovmRequest]",
1008
+ ) -> OperationResponse[
1009
+ "capo_lambda_microvms.types.suspend_microvm_response.SuspendMicrovmResponse"
1010
+ ]:
1011
+ import capo_lambda_microvms._operations.lambda_microvms.suspend_microvm
1012
+
1013
+ output, http_response = (
1014
+ capo_lambda_microvms._operations.lambda_microvms.suspend_microvm.suspend_microvm(
1015
+ req.options, req.input
1016
+ )
1017
+ )
1018
+ return OperationResponse(output=output, response=http_response)
1019
+
1020
+ interceptors_, options_ = self.operation_options(config_overrides)
1021
+ input_: capo_lambda_microvms.types.suspend_microvm_request.SuspendMicrovmRequest = {
1022
+ "microvm_identifier": microvm_identifier
1023
+ }
1024
+
1025
+ response = execute_pipeline(
1026
+ OperationRequest(input=input_, options=options_),
1027
+ handler=_handler,
1028
+ interceptors=list(interceptors_),
1029
+ )
1030
+ response.response.close()
1031
+ return response.output
1032
+
1033
+ def get_microvm_image(
1034
+ self,
1035
+ image_identifier: "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier",
1036
+ *,
1037
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
1038
+ ) -> "capo_lambda_microvms.types.get_microvm_image_output.GetMicrovmImageOutput":
1039
+ """<p>Retrieves the details of a MicroVM image, including its state, versions, and configuration.</p>
1040
+
1041
+ Args:
1042
+ image_identifier: <p>The unique identifier (ARN or ID) of the MicroVM image to retrieve.</p>
1043
+
1044
+ Raises:
1045
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
1046
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
1047
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
1048
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
1049
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
1050
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
1051
+ """
1052
+
1053
+ def _handler(
1054
+ req: "OperationRequest[capo_lambda_microvms.types.get_microvm_image_input.GetMicrovmImageInput]",
1055
+ ) -> OperationResponse[
1056
+ "capo_lambda_microvms.types.get_microvm_image_output.GetMicrovmImageOutput"
1057
+ ]:
1058
+ import capo_lambda_microvms._operations.lambda_microvms.get_microvm_image
1059
+
1060
+ output, http_response = (
1061
+ capo_lambda_microvms._operations.lambda_microvms.get_microvm_image.get_microvm_image(
1062
+ req.options, req.input
1063
+ )
1064
+ )
1065
+ return OperationResponse(output=output, response=http_response)
1066
+
1067
+ interceptors_, options_ = self.operation_options(config_overrides)
1068
+ input_: capo_lambda_microvms.types.get_microvm_image_input.GetMicrovmImageInput = {
1069
+ "image_identifier": image_identifier
1070
+ }
1071
+
1072
+ response = execute_pipeline(
1073
+ OperationRequest(input=input_, options=options_),
1074
+ handler=_handler,
1075
+ interceptors=list(interceptors_),
1076
+ )
1077
+ response.response.close()
1078
+ return response.output
1079
+
1080
+ def delete_microvm_image(
1081
+ self,
1082
+ image_identifier: "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier",
1083
+ *,
1084
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
1085
+ ) -> "capo_lambda_microvms.types.delete_microvm_image_output.DeleteMicrovmImageOutput":
1086
+ """<p>Deletes a MicroVM image. This operation is idempotent; deleting an image that has already been deleted succeeds without error.</p>
1087
+
1088
+ Args:
1089
+ image_identifier: <p>The unique identifier (ARN or ID) of the MicroVM image to delete.</p>
1090
+
1091
+ Raises:
1092
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
1093
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
1094
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
1095
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
1096
+ capo_lambda_microvms.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
1097
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
1098
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
1099
+ """
1100
+
1101
+ def _handler(
1102
+ req: "OperationRequest[capo_lambda_microvms.types.delete_microvm_image_input.DeleteMicrovmImageInput]",
1103
+ ) -> OperationResponse[
1104
+ "capo_lambda_microvms.types.delete_microvm_image_output.DeleteMicrovmImageOutput"
1105
+ ]:
1106
+ import capo_lambda_microvms._operations.lambda_microvms.delete_microvm_image
1107
+
1108
+ output, http_response = (
1109
+ capo_lambda_microvms._operations.lambda_microvms.delete_microvm_image.delete_microvm_image(
1110
+ req.options, req.input
1111
+ )
1112
+ )
1113
+ return OperationResponse(output=output, response=http_response)
1114
+
1115
+ interceptors_, options_ = self.operation_options(config_overrides)
1116
+ input_: capo_lambda_microvms.types.delete_microvm_image_input.DeleteMicrovmImageInput = {
1117
+ "image_identifier": image_identifier
1118
+ }
1119
+
1120
+ response = execute_pipeline(
1121
+ OperationRequest(input=input_, options=options_),
1122
+ handler=_handler,
1123
+ interceptors=list(interceptors_),
1124
+ )
1125
+ response.response.close()
1126
+ return response.output
1127
+
1128
+ def list_microvm_images(
1129
+ self,
1130
+ *,
1131
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
1132
+ max_results: Optional[int] = None,
1133
+ next_token: Optional["capo_lambda_microvms.types.string.String"] = None,
1134
+ name_filter: Optional[
1135
+ "capo_lambda_microvms.types.non_blank_string.NonBlankString"
1136
+ ] = None,
1137
+ ) -> "capo_lambda_microvms.types.list_microvm_images_response.ListMicrovmImagesResponse":
1138
+ """<p>Lists MicroVM images in the account with optional name filtering. We recommend using pagination to ensure that the operation returns quickly and successfully.</p>
1139
+
1140
+ Args:
1141
+ max_results: <p>The maximum number of results to return in a single call.</p>
1142
+ next_token: <p>The pagination token from a previous call. Use this token to retrieve the next page of results.</p>
1143
+ name_filter: <p>Filters images whose name contains the specified string.</p>
1144
+
1145
+ Raises:
1146
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
1147
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
1148
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
1149
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
1150
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
1151
+ """
1152
+
1153
+ def _handler(
1154
+ req: "OperationRequest[capo_lambda_microvms.types.list_microvm_images_request.ListMicrovmImagesRequest]",
1155
+ ) -> OperationResponse[
1156
+ "capo_lambda_microvms.types.list_microvm_images_response.ListMicrovmImagesResponse"
1157
+ ]:
1158
+ import capo_lambda_microvms._operations.lambda_microvms.list_microvm_images
1159
+
1160
+ output, http_response = (
1161
+ capo_lambda_microvms._operations.lambda_microvms.list_microvm_images.list_microvm_images(
1162
+ req.options, req.input
1163
+ )
1164
+ )
1165
+ return OperationResponse(output=output, response=http_response)
1166
+
1167
+ interceptors_, options_ = self.operation_options(config_overrides)
1168
+ input_: capo_lambda_microvms.types.list_microvm_images_request.ListMicrovmImagesRequest = {}
1169
+ if max_results is not None:
1170
+ input_["max_results"] = max_results
1171
+ if next_token is not None:
1172
+ input_["next_token"] = next_token
1173
+ if name_filter is not None:
1174
+ input_["name_filter"] = name_filter
1175
+
1176
+ response = execute_pipeline(
1177
+ OperationRequest(input=input_, options=options_),
1178
+ handler=_handler,
1179
+ interceptors=list(interceptors_),
1180
+ )
1181
+ response.response.close()
1182
+ return response.output
1183
+
1184
+ def iter_list_microvm_images(
1185
+ self,
1186
+ *,
1187
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
1188
+ max_results: Optional[int] = None,
1189
+ next_token: Optional["capo_lambda_microvms.types.string.String"] = None,
1190
+ name_filter: Optional[
1191
+ "capo_lambda_microvms.types.non_blank_string.NonBlankString"
1192
+ ] = None,
1193
+ ) -> (
1194
+ "Iterator[capo_lambda_microvms.types.microvm_image_summary.MicrovmImageSummary]"
1195
+ ):
1196
+ _token = next_token
1197
+ while True:
1198
+ _response = self.list_microvm_images(
1199
+ config_overrides=config_overrides,
1200
+ max_results=max_results,
1201
+ next_token=_token,
1202
+ name_filter=name_filter,
1203
+ )
1204
+ _page = _resolve_path(_response, ("items",))
1205
+ for _item in _page or []:
1206
+ yield _item
1207
+ _token = _resolve_path(_response, ("next_token",))
1208
+ if not _token:
1209
+ break
1210
+
1211
+ def delete_microvm_image_version(
1212
+ self,
1213
+ image_identifier: "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier",
1214
+ image_version: "capo_lambda_microvms.types.non_blank_string.NonBlankString",
1215
+ *,
1216
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
1217
+ ) -> "capo_lambda_microvms.types.delete_microvm_image_version_output.DeleteMicrovmImageVersionOutput":
1218
+ """<p>Deletes a specific version of a MicroVM image. This operation is idempotent; deleting a version that has already been deleted succeeds without error.</p>
1219
+
1220
+ Args:
1221
+ image_identifier: <p>The unique identifier (ARN or ID) of the MicroVM image.</p>
1222
+ image_version: <p>The version of the MicroVM image to delete.</p>
1223
+
1224
+ Raises:
1225
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
1226
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
1227
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
1228
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
1229
+ capo_lambda_microvms.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
1230
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
1231
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
1232
+ """
1233
+
1234
+ def _handler(
1235
+ req: "OperationRequest[capo_lambda_microvms.types.delete_microvm_image_version_input.DeleteMicrovmImageVersionInput]",
1236
+ ) -> OperationResponse[
1237
+ "capo_lambda_microvms.types.delete_microvm_image_version_output.DeleteMicrovmImageVersionOutput"
1238
+ ]:
1239
+ import capo_lambda_microvms._operations.lambda_microvms.delete_microvm_image_version
1240
+
1241
+ output, http_response = (
1242
+ capo_lambda_microvms._operations.lambda_microvms.delete_microvm_image_version.delete_microvm_image_version(
1243
+ req.options, req.input
1244
+ )
1245
+ )
1246
+ return OperationResponse(output=output, response=http_response)
1247
+
1248
+ interceptors_, options_ = self.operation_options(config_overrides)
1249
+ input_: capo_lambda_microvms.types.delete_microvm_image_version_input.DeleteMicrovmImageVersionInput = {
1250
+ "image_identifier": image_identifier,
1251
+ "image_version": image_version,
1252
+ }
1253
+
1254
+ response = execute_pipeline(
1255
+ OperationRequest(input=input_, options=options_),
1256
+ handler=_handler,
1257
+ interceptors=list(interceptors_),
1258
+ )
1259
+ response.response.close()
1260
+ return response.output
1261
+
1262
+ def get_microvm_image_build(
1263
+ self,
1264
+ image_identifier: "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier",
1265
+ image_version: "capo_lambda_microvms.types.non_blank_string.NonBlankString",
1266
+ build_id: "capo_lambda_microvms.types.non_blank_string.NonBlankString",
1267
+ *,
1268
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
1269
+ ) -> "capo_lambda_microvms.types.get_microvm_image_build_output.GetMicrovmImageBuildOutput":
1270
+ """<p>Retrieves the details of a specific MicroVM image build, including its state, target architecture, and snapshot information.</p>
1271
+
1272
+ Args:
1273
+ image_identifier: <p>The unique identifier (ARN or ID) of the MicroVM image.</p>
1274
+ image_version: <p>The version of the MicroVM image.</p>
1275
+ build_id: <p>The unique identifier of the build to retrieve.</p>
1276
+
1277
+ Raises:
1278
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
1279
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
1280
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
1281
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
1282
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
1283
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
1284
+ """
1285
+
1286
+ def _handler(
1287
+ req: "OperationRequest[capo_lambda_microvms.types.get_microvm_image_build_input.GetMicrovmImageBuildInput]",
1288
+ ) -> OperationResponse[
1289
+ "capo_lambda_microvms.types.get_microvm_image_build_output.GetMicrovmImageBuildOutput"
1290
+ ]:
1291
+ import capo_lambda_microvms._operations.lambda_microvms.get_microvm_image_build
1292
+
1293
+ output, http_response = (
1294
+ capo_lambda_microvms._operations.lambda_microvms.get_microvm_image_build.get_microvm_image_build(
1295
+ req.options, req.input
1296
+ )
1297
+ )
1298
+ return OperationResponse(output=output, response=http_response)
1299
+
1300
+ interceptors_, options_ = self.operation_options(config_overrides)
1301
+ input_: capo_lambda_microvms.types.get_microvm_image_build_input.GetMicrovmImageBuildInput = {
1302
+ "image_identifier": image_identifier,
1303
+ "image_version": image_version,
1304
+ "build_id": build_id,
1305
+ }
1306
+
1307
+ response = execute_pipeline(
1308
+ OperationRequest(input=input_, options=options_),
1309
+ handler=_handler,
1310
+ interceptors=list(interceptors_),
1311
+ )
1312
+ response.response.close()
1313
+ return response.output
1314
+
1315
+ def get_microvm_image_version(
1316
+ self,
1317
+ image_identifier: "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier",
1318
+ image_version: "capo_lambda_microvms.types.non_blank_string.NonBlankString",
1319
+ *,
1320
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
1321
+ ) -> "capo_lambda_microvms.types.get_microvm_image_version_output.GetMicrovmImageVersionOutput":
1322
+ """<p>Retrieves the details of a specific version of a MicroVM image, including its configuration, state, and build information.</p>
1323
+
1324
+ Args:
1325
+ image_identifier: <p>The unique identifier (ARN or ID) of the MicroVM image.</p>
1326
+ image_version: <p>The version of the MicroVM image to retrieve.</p>
1327
+
1328
+ Raises:
1329
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
1330
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
1331
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
1332
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
1333
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
1334
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
1335
+ """
1336
+
1337
+ def _handler(
1338
+ req: "OperationRequest[capo_lambda_microvms.types.get_microvm_image_version_input.GetMicrovmImageVersionInput]",
1339
+ ) -> OperationResponse[
1340
+ "capo_lambda_microvms.types.get_microvm_image_version_output.GetMicrovmImageVersionOutput"
1341
+ ]:
1342
+ import capo_lambda_microvms._operations.lambda_microvms.get_microvm_image_version
1343
+
1344
+ output, http_response = (
1345
+ capo_lambda_microvms._operations.lambda_microvms.get_microvm_image_version.get_microvm_image_version(
1346
+ req.options, req.input
1347
+ )
1348
+ )
1349
+ return OperationResponse(output=output, response=http_response)
1350
+
1351
+ interceptors_, options_ = self.operation_options(config_overrides)
1352
+ input_: capo_lambda_microvms.types.get_microvm_image_version_input.GetMicrovmImageVersionInput = {
1353
+ "image_identifier": image_identifier,
1354
+ "image_version": image_version,
1355
+ }
1356
+
1357
+ response = execute_pipeline(
1358
+ OperationRequest(input=input_, options=options_),
1359
+ handler=_handler,
1360
+ interceptors=list(interceptors_),
1361
+ )
1362
+ response.response.close()
1363
+ return response.output
1364
+
1365
+ def list_managed_microvm_image_versions(
1366
+ self,
1367
+ image_identifier: "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier",
1368
+ *,
1369
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
1370
+ max_results: Optional[int] = None,
1371
+ next_token: Optional["capo_lambda_microvms.types.string.String"] = None,
1372
+ ) -> "capo_lambda_microvms.types.list_managed_microvm_image_versions_output.ListManagedMicrovmImageVersionsOutput":
1373
+ """<p>Lists versions of a managed MicroVM image. We recommend using pagination to ensure that the operation returns quickly and successfully.</p>
1374
+
1375
+ Args:
1376
+ max_results: <p>The maximum number of results to return in a single call.</p>
1377
+ next_token: <p>The pagination token from a previous call. Use this token to retrieve the next page of results.</p>
1378
+ image_identifier: <p>The unique identifier (ARN or ID) of the managed MicroVM image to list versions for.</p>
1379
+
1380
+ Raises:
1381
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
1382
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
1383
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
1384
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
1385
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
1386
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
1387
+ """
1388
+
1389
+ def _handler(
1390
+ req: "OperationRequest[capo_lambda_microvms.types.list_managed_microvm_image_versions_input.ListManagedMicrovmImageVersionsInput]",
1391
+ ) -> OperationResponse[
1392
+ "capo_lambda_microvms.types.list_managed_microvm_image_versions_output.ListManagedMicrovmImageVersionsOutput"
1393
+ ]:
1394
+ import capo_lambda_microvms._operations.lambda_microvms.list_managed_microvm_image_versions
1395
+
1396
+ output, http_response = (
1397
+ capo_lambda_microvms._operations.lambda_microvms.list_managed_microvm_image_versions.list_managed_microvm_image_versions(
1398
+ req.options, req.input
1399
+ )
1400
+ )
1401
+ return OperationResponse(output=output, response=http_response)
1402
+
1403
+ interceptors_, options_ = self.operation_options(config_overrides)
1404
+ input_: capo_lambda_microvms.types.list_managed_microvm_image_versions_input.ListManagedMicrovmImageVersionsInput = {
1405
+ "image_identifier": image_identifier
1406
+ }
1407
+ if max_results is not None:
1408
+ input_["max_results"] = max_results
1409
+ if next_token is not None:
1410
+ input_["next_token"] = next_token
1411
+
1412
+ response = execute_pipeline(
1413
+ OperationRequest(input=input_, options=options_),
1414
+ handler=_handler,
1415
+ interceptors=list(interceptors_),
1416
+ )
1417
+ response.response.close()
1418
+ return response.output
1419
+
1420
+ def iter_list_managed_microvm_image_versions(
1421
+ self,
1422
+ image_identifier: "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier",
1423
+ *,
1424
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
1425
+ max_results: Optional[int] = None,
1426
+ next_token: Optional["capo_lambda_microvms.types.string.String"] = None,
1427
+ ) -> "Iterator[capo_lambda_microvms.types.managed_microvm_image_version.ManagedMicrovmImageVersion]":
1428
+ _token = next_token
1429
+ while True:
1430
+ _response = self.list_managed_microvm_image_versions(
1431
+ image_identifier,
1432
+ config_overrides=config_overrides,
1433
+ max_results=max_results,
1434
+ next_token=_token,
1435
+ )
1436
+ _page = _resolve_path(_response, ("items",))
1437
+ for _item in _page or []:
1438
+ yield _item
1439
+ _token = _resolve_path(_response, ("next_token",))
1440
+ if not _token:
1441
+ break
1442
+
1443
+ def list_microvm_image_builds(
1444
+ self,
1445
+ image_identifier: "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier",
1446
+ image_version: "capo_lambda_microvms.types.non_blank_string.NonBlankString",
1447
+ *,
1448
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
1449
+ max_results: Optional[int] = None,
1450
+ next_token: Optional["capo_lambda_microvms.types.string.String"] = None,
1451
+ architecture: Optional[
1452
+ "capo_lambda_microvms.types.architecture.Architecture"
1453
+ ] = None,
1454
+ chipset: Optional["capo_lambda_microvms.types.chipset.Chipset"] = None,
1455
+ chipset_generation: Optional[
1456
+ "capo_lambda_microvms.types.non_blank_string.NonBlankString"
1457
+ ] = None,
1458
+ ) -> "capo_lambda_microvms.types.list_microvm_image_builds_output.ListMicrovmImageBuildsOutput":
1459
+ """<p>Lists builds for a MicroVM image version with optional filtering by architecture and chipset. We recommend using pagination to ensure that the operation returns quickly and successfully.</p>
1460
+
1461
+ Args:
1462
+ max_results: <p>The maximum number of results to return in a single call.</p>
1463
+ next_token: <p>The pagination token from a previous call. Use this token to retrieve the next page of results.</p>
1464
+ image_identifier: <p>The unique identifier (ARN or ID) of the MicroVM image.</p>
1465
+ image_version: <p>The version of the MicroVM image to list builds for.</p>
1466
+ architecture: <p>Filters builds by target CPU architecture.</p>
1467
+ chipset: <p>Filters builds by target chipset.</p>
1468
+ chipset_generation: <p>Filters builds by target chipset generation.</p>
1469
+
1470
+ Raises:
1471
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
1472
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
1473
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
1474
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
1475
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
1476
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
1477
+ """
1478
+
1479
+ def _handler(
1480
+ req: "OperationRequest[capo_lambda_microvms.types.list_microvm_image_builds_input.ListMicrovmImageBuildsInput]",
1481
+ ) -> OperationResponse[
1482
+ "capo_lambda_microvms.types.list_microvm_image_builds_output.ListMicrovmImageBuildsOutput"
1483
+ ]:
1484
+ import capo_lambda_microvms._operations.lambda_microvms.list_microvm_image_builds
1485
+
1486
+ output, http_response = (
1487
+ capo_lambda_microvms._operations.lambda_microvms.list_microvm_image_builds.list_microvm_image_builds(
1488
+ req.options, req.input
1489
+ )
1490
+ )
1491
+ return OperationResponse(output=output, response=http_response)
1492
+
1493
+ interceptors_, options_ = self.operation_options(config_overrides)
1494
+ input_: capo_lambda_microvms.types.list_microvm_image_builds_input.ListMicrovmImageBuildsInput = {
1495
+ "image_identifier": image_identifier,
1496
+ "image_version": image_version,
1497
+ }
1498
+ if max_results is not None:
1499
+ input_["max_results"] = max_results
1500
+ if next_token is not None:
1501
+ input_["next_token"] = next_token
1502
+ if architecture is not None:
1503
+ input_["architecture"] = architecture
1504
+ if chipset is not None:
1505
+ input_["chipset"] = chipset
1506
+ if chipset_generation is not None:
1507
+ input_["chipset_generation"] = chipset_generation
1508
+
1509
+ response = execute_pipeline(
1510
+ OperationRequest(input=input_, options=options_),
1511
+ handler=_handler,
1512
+ interceptors=list(interceptors_),
1513
+ )
1514
+ response.response.close()
1515
+ return response.output
1516
+
1517
+ def iter_list_microvm_image_builds(
1518
+ self,
1519
+ image_identifier: "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier",
1520
+ image_version: "capo_lambda_microvms.types.non_blank_string.NonBlankString",
1521
+ *,
1522
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
1523
+ max_results: Optional[int] = None,
1524
+ next_token: Optional["capo_lambda_microvms.types.string.String"] = None,
1525
+ architecture: Optional[
1526
+ "capo_lambda_microvms.types.architecture.Architecture"
1527
+ ] = None,
1528
+ chipset: Optional["capo_lambda_microvms.types.chipset.Chipset"] = None,
1529
+ chipset_generation: Optional[
1530
+ "capo_lambda_microvms.types.non_blank_string.NonBlankString"
1531
+ ] = None,
1532
+ ) -> "Iterator[capo_lambda_microvms.types.microvm_image_build_summary.MicrovmImageBuildSummary]":
1533
+ _token = next_token
1534
+ while True:
1535
+ _response = self.list_microvm_image_builds(
1536
+ image_identifier,
1537
+ image_version,
1538
+ config_overrides=config_overrides,
1539
+ max_results=max_results,
1540
+ next_token=_token,
1541
+ architecture=architecture,
1542
+ chipset=chipset,
1543
+ chipset_generation=chipset_generation,
1544
+ )
1545
+ _page = _resolve_path(_response, ("items",))
1546
+ for _item in _page or []:
1547
+ yield _item
1548
+ _token = _resolve_path(_response, ("next_token",))
1549
+ if not _token:
1550
+ break
1551
+
1552
+ def list_microvm_image_versions(
1553
+ self,
1554
+ image_identifier: "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier",
1555
+ *,
1556
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
1557
+ max_results: Optional[int] = None,
1558
+ next_token: Optional["capo_lambda_microvms.types.string.String"] = None,
1559
+ ) -> "capo_lambda_microvms.types.list_microvm_image_versions_output.ListMicrovmImageVersionsOutput":
1560
+ """<p>Lists versions of a MicroVM image. We recommend using pagination to ensure that the operation returns quickly and successfully.</p>
1561
+
1562
+ Args:
1563
+ max_results: <p>The maximum number of results to return in a single call.</p>
1564
+ next_token: <p>The pagination token from a previous call. Use this token to retrieve the next page of results.</p>
1565
+ image_identifier: <p>The unique identifier (ARN or ID) of the MicroVM image to list versions for.</p>
1566
+
1567
+ Raises:
1568
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
1569
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
1570
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
1571
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
1572
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
1573
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
1574
+ """
1575
+
1576
+ def _handler(
1577
+ req: "OperationRequest[capo_lambda_microvms.types.list_microvm_image_versions_input.ListMicrovmImageVersionsInput]",
1578
+ ) -> OperationResponse[
1579
+ "capo_lambda_microvms.types.list_microvm_image_versions_output.ListMicrovmImageVersionsOutput"
1580
+ ]:
1581
+ import capo_lambda_microvms._operations.lambda_microvms.list_microvm_image_versions
1582
+
1583
+ output, http_response = (
1584
+ capo_lambda_microvms._operations.lambda_microvms.list_microvm_image_versions.list_microvm_image_versions(
1585
+ req.options, req.input
1586
+ )
1587
+ )
1588
+ return OperationResponse(output=output, response=http_response)
1589
+
1590
+ interceptors_, options_ = self.operation_options(config_overrides)
1591
+ input_: capo_lambda_microvms.types.list_microvm_image_versions_input.ListMicrovmImageVersionsInput = {
1592
+ "image_identifier": image_identifier
1593
+ }
1594
+ if max_results is not None:
1595
+ input_["max_results"] = max_results
1596
+ if next_token is not None:
1597
+ input_["next_token"] = next_token
1598
+
1599
+ response = execute_pipeline(
1600
+ OperationRequest(input=input_, options=options_),
1601
+ handler=_handler,
1602
+ interceptors=list(interceptors_),
1603
+ )
1604
+ response.response.close()
1605
+ return response.output
1606
+
1607
+ def iter_list_microvm_image_versions(
1608
+ self,
1609
+ image_identifier: "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier",
1610
+ *,
1611
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
1612
+ max_results: Optional[int] = None,
1613
+ next_token: Optional["capo_lambda_microvms.types.string.String"] = None,
1614
+ ) -> "Iterator[capo_lambda_microvms.types.microvm_image_version_summary.MicrovmImageVersionSummary]":
1615
+ _token = next_token
1616
+ while True:
1617
+ _response = self.list_microvm_image_versions(
1618
+ image_identifier,
1619
+ config_overrides=config_overrides,
1620
+ max_results=max_results,
1621
+ next_token=_token,
1622
+ )
1623
+ _page = _resolve_path(_response, ("items",))
1624
+ for _item in _page or []:
1625
+ yield _item
1626
+ _token = _resolve_path(_response, ("next_token",))
1627
+ if not _token:
1628
+ break
1629
+
1630
+ def update_microvm_image(
1631
+ self,
1632
+ base_image_arn: "capo_lambda_microvms.types.non_blank_string.NonBlankString",
1633
+ build_role_arn: "capo_lambda_microvms.types.role_arn.RoleArn",
1634
+ code_artifact: "capo_lambda_microvms.types.code_artifact.CodeArtifact",
1635
+ image_identifier: "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier",
1636
+ *,
1637
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
1638
+ base_image_version: Optional[
1639
+ "capo_lambda_microvms.types.version.Version"
1640
+ ] = None,
1641
+ description: Optional[str] = None,
1642
+ logging: Optional["capo_lambda_microvms.types.logging.Logging"] = None,
1643
+ egress_network_connectors: Optional[
1644
+ "capo_lambda_microvms.types.network_connector_list.NetworkConnectorList"
1645
+ ] = None,
1646
+ cpu_configurations: Optional[
1647
+ "capo_lambda_microvms.types.cpu_configuration_list.CpuConfigurationList"
1648
+ ] = None,
1649
+ resources: Optional[
1650
+ "capo_lambda_microvms.types.resources_list.ResourcesList"
1651
+ ] = None,
1652
+ additional_os_capabilities: Optional[
1653
+ "capo_lambda_microvms.types.capability_list.CapabilityList"
1654
+ ] = None,
1655
+ hooks: Optional["capo_lambda_microvms.types.hooks.Hooks"] = None,
1656
+ environment_variables: Optional[
1657
+ "capo_lambda_microvms.types.environment_variable_map.EnvironmentVariableMap"
1658
+ ] = None,
1659
+ client_token: Optional[str] = None,
1660
+ ) -> "capo_lambda_microvms.types.update_microvm_image_response.UpdateMicrovmImageResponse":
1661
+ r"""<p>Updates the configuration of a MicroVM image and triggers a new version build. This operation uses PUT semantics — all required fields (codeArtifact, baseImageArn, buildRoleArn) must be provided with every request.</p>
1662
+
1663
+ Args:
1664
+ base_image_arn: <p>The ARN of the base MicroVM image.</p>
1665
+ base_image_version: <p>The specific version of the base MicroVM image to use.</p>
1666
+ build_role_arn: <p>The ARN of the IAM build role.</p>
1667
+ description: <p>The description of the MicroVM image.</p>
1668
+ code_artifact: <p>The code artifact containing the application code and metadata for the MicroVM image.</p>
1669
+ logging: <p>The logging configuration for build-time and runtime logs. Specify {\"cloudWatch\": {\"logGroup\": \"...\"}} to stream logs to a custom CloudWatch log group, or {\"disabled\": {}} to turn off logging.</p>
1670
+ egress_network_connectors: <p>The list of egress network connectors available to the MicroVM at runtime.</p>
1671
+ cpu_configurations: <p>The list of supported CPU configurations for the MicroVM.</p>
1672
+ resources: <p>The resource requirements for the MicroVM.</p>
1673
+ additional_os_capabilities: <p>Additional OS capabilities granted to the MicroVM runtime environment.</p>
1674
+ environment_variables: <p>Environment variables set in the MicroVM runtime environment.</p>
1675
+ image_identifier: <p>The unique identifier (ARN or ID) of the MicroVM image to update.</p>
1676
+ client_token: <p>A unique, case-sensitive identifier you provide to ensure the idempotency of the request.</p>
1677
+
1678
+ Raises:
1679
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
1680
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
1681
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
1682
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
1683
+ capo_lambda_microvms.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
1684
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
1685
+ capo_lambda_microvms.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have exceeded a service quota for Lambda MicroVMs.</p>
1686
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
1687
+ """
1688
+
1689
+ def _handler(
1690
+ req: "OperationRequest[capo_lambda_microvms.types.update_microvm_image_request.UpdateMicrovmImageRequest]",
1691
+ ) -> OperationResponse[
1692
+ "capo_lambda_microvms.types.update_microvm_image_response.UpdateMicrovmImageResponse"
1693
+ ]:
1694
+ import capo_lambda_microvms._operations.lambda_microvms.update_microvm_image
1695
+
1696
+ output, http_response = (
1697
+ capo_lambda_microvms._operations.lambda_microvms.update_microvm_image.update_microvm_image(
1698
+ req.options, req.input
1699
+ )
1700
+ )
1701
+ return OperationResponse(output=output, response=http_response)
1702
+
1703
+ interceptors_, options_ = self.operation_options(config_overrides)
1704
+ input_: capo_lambda_microvms.types.update_microvm_image_request.UpdateMicrovmImageRequest = {
1705
+ "base_image_arn": base_image_arn,
1706
+ "build_role_arn": build_role_arn,
1707
+ "code_artifact": code_artifact,
1708
+ "image_identifier": image_identifier,
1709
+ }
1710
+ if base_image_version is not None:
1711
+ input_["base_image_version"] = base_image_version
1712
+ if description is not None:
1713
+ input_["description"] = description
1714
+ if logging is not None:
1715
+ input_["logging"] = logging
1716
+ if egress_network_connectors is not None:
1717
+ input_["egress_network_connectors"] = egress_network_connectors
1718
+ if cpu_configurations is not None:
1719
+ input_["cpu_configurations"] = cpu_configurations
1720
+ if resources is not None:
1721
+ input_["resources"] = resources
1722
+ if additional_os_capabilities is not None:
1723
+ input_["additional_os_capabilities"] = additional_os_capabilities
1724
+ if hooks is not None:
1725
+ input_["hooks"] = hooks
1726
+ if environment_variables is not None:
1727
+ input_["environment_variables"] = environment_variables
1728
+ if client_token is None:
1729
+ client_token = str(uuid.uuid4())
1730
+ input_["client_token"] = client_token
1731
+
1732
+ response = execute_pipeline(
1733
+ OperationRequest(input=input_, options=options_),
1734
+ handler=_handler,
1735
+ interceptors=list(interceptors_),
1736
+ )
1737
+ response.response.close()
1738
+ return response.output
1739
+
1740
+ def update_microvm_image_version(
1741
+ self,
1742
+ image_identifier: "capo_lambda_microvms.types.microvm_image_identifier.MicrovmImageIdentifier",
1743
+ image_version: "capo_lambda_microvms.types.non_blank_string.NonBlankString",
1744
+ status: "capo_lambda_microvms.types.microvm_image_version_status.MicrovmImageVersionStatus",
1745
+ *,
1746
+ config_overrides: Optional[LambdaMicrovmsClientConfig] = None,
1747
+ ) -> "capo_lambda_microvms.types.update_microvm_image_version_response.UpdateMicrovmImageVersionResponse":
1748
+ """<p>Updates the status of a specific MicroVM image version.</p>
1749
+
1750
+ Args:
1751
+ image_identifier: <p>The unique identifier (ARN or ID) of the MicroVM image.</p>
1752
+ image_version: <p>The version of the MicroVM image to update.</p>
1753
+ status: <p>The new status to set for the MicroVM image version.</p>
1754
+
1755
+ Raises:
1756
+ capo_lambda_microvms.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
1757
+ capo_lambda_microvms.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry the request later.</p>
1758
+ capo_lambda_microvms.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Retry the request later.</p>
1759
+ capo_lambda_microvms.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service.</p>
1760
+ capo_lambda_microvms.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
1761
+ capo_lambda_microvms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
1762
+ capo_lambda_microvms.errors.UnknownServiceError: The service returned an error code this client does not model.
1763
+ """
1764
+
1765
+ def _handler(
1766
+ req: "OperationRequest[capo_lambda_microvms.types.update_microvm_image_version_request.UpdateMicrovmImageVersionRequest]",
1767
+ ) -> OperationResponse[
1768
+ "capo_lambda_microvms.types.update_microvm_image_version_response.UpdateMicrovmImageVersionResponse"
1769
+ ]:
1770
+ import capo_lambda_microvms._operations.lambda_microvms.update_microvm_image_version
1771
+
1772
+ output, http_response = (
1773
+ capo_lambda_microvms._operations.lambda_microvms.update_microvm_image_version.update_microvm_image_version(
1774
+ req.options, req.input
1775
+ )
1776
+ )
1777
+ return OperationResponse(output=output, response=http_response)
1778
+
1779
+ interceptors_, options_ = self.operation_options(config_overrides)
1780
+ input_: capo_lambda_microvms.types.update_microvm_image_version_request.UpdateMicrovmImageVersionRequest = {
1781
+ "image_identifier": image_identifier,
1782
+ "image_version": image_version,
1783
+ "status": status,
1784
+ }
1785
+
1786
+ response = execute_pipeline(
1787
+ OperationRequest(input=input_, options=options_),
1788
+ handler=_handler,
1789
+ interceptors=list(interceptors_),
1790
+ )
1791
+ response.response.close()
1792
+ return response.output
1793
+
1794
+ def __enter__(self) -> Self:
1795
+ return self
1796
+
1797
+ def __exit__(self, exc_type: Any, exc: Any, tb: Any):
1798
+ self._client.close()