hatchet-sdk 0.40.0a9__py3-none-any.whl → 0.41.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.

Potentially problematic release.


This version of hatchet-sdk might be problematic. Click here for more details.

Files changed (149) hide show
  1. hatchet_sdk/clients/admin.py +129 -59
  2. hatchet_sdk/clients/dispatcher/action_listener.py +25 -2
  3. hatchet_sdk/clients/events.py +91 -52
  4. hatchet_sdk/clients/rest/__init__.py +21 -0
  5. hatchet_sdk/clients/rest/api/api_token_api.py +12 -9
  6. hatchet_sdk/clients/rest/api/default_api.py +24 -18
  7. hatchet_sdk/clients/rest/api/event_api.py +32 -24
  8. hatchet_sdk/clients/rest/api/github_api.py +4 -3
  9. hatchet_sdk/clients/rest/api/log_api.py +4 -3
  10. hatchet_sdk/clients/rest/api/metadata_api.py +12 -9
  11. hatchet_sdk/clients/rest/api/rate_limits_api.py +7 -4
  12. hatchet_sdk/clients/rest/api/slack_api.py +8 -6
  13. hatchet_sdk/clients/rest/api/sns_api.py +12 -9
  14. hatchet_sdk/clients/rest/api/step_run_api.py +28 -21
  15. hatchet_sdk/clients/rest/api/tenant_api.py +67 -49
  16. hatchet_sdk/clients/rest/api/user_api.py +24 -18
  17. hatchet_sdk/clients/rest/api/worker_api.py +12 -9
  18. hatchet_sdk/clients/rest/api/workflow_api.py +3073 -936
  19. hatchet_sdk/clients/rest/api/workflow_run_api.py +669 -21
  20. hatchet_sdk/clients/rest/api_client.py +34 -11
  21. hatchet_sdk/clients/rest/configuration.py +161 -36
  22. hatchet_sdk/clients/rest/models/__init__.py +21 -0
  23. hatchet_sdk/clients/rest/models/api_errors.py +3 -3
  24. hatchet_sdk/clients/rest/models/bulk_create_event_request.py +3 -3
  25. hatchet_sdk/clients/rest/models/bulk_create_event_response.py +3 -3
  26. hatchet_sdk/clients/{cloud_rest/models/managed_worker_create_request_build_config_steps_inner.py → rest/models/create_cron_workflow_trigger_request.py} +18 -14
  27. hatchet_sdk/clients/{cloud_rest/models/github_app_list_installations200_response_rows_inner.py → rest/models/cron_workflows.py} +54 -21
  28. hatchet_sdk/clients/{cloud_rest/models/log_list200_response.py → rest/models/cron_workflows_list.py} +13 -22
  29. hatchet_sdk/clients/rest/models/cron_workflows_order_by_field.py +37 -0
  30. hatchet_sdk/clients/rest/models/event_list.py +3 -3
  31. hatchet_sdk/clients/rest/models/get_step_run_diff_response.py +3 -3
  32. hatchet_sdk/clients/rest/models/job.py +3 -3
  33. hatchet_sdk/clients/rest/models/job_run.py +3 -3
  34. hatchet_sdk/clients/rest/models/list_api_tokens_response.py +3 -3
  35. hatchet_sdk/clients/rest/models/list_pull_requests_response.py +3 -3
  36. hatchet_sdk/clients/rest/models/list_slack_webhooks.py +3 -3
  37. hatchet_sdk/clients/rest/models/list_sns_integrations.py +3 -3
  38. hatchet_sdk/clients/rest/models/log_line_list.py +3 -3
  39. hatchet_sdk/clients/rest/models/rate_limit_list.py +3 -3
  40. hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py +3 -3
  41. hatchet_sdk/clients/{cloud_rest/models/log_list200_response_rows_inner.py → rest/models/schedule_workflow_run_request.py} +12 -12
  42. hatchet_sdk/clients/rest/models/scheduled_run_status.py +42 -0
  43. hatchet_sdk/clients/rest/models/scheduled_workflows.py +153 -0
  44. hatchet_sdk/clients/{cloud_rest/models/managed_worker_list200_response.py → rest/models/scheduled_workflows_list.py} +13 -22
  45. hatchet_sdk/clients/rest/models/scheduled_workflows_order_by_field.py +37 -0
  46. hatchet_sdk/clients/rest/models/step_run_archive_list.py +3 -3
  47. hatchet_sdk/clients/rest/models/step_run_event_list.py +3 -3
  48. hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py +3 -3
  49. hatchet_sdk/clients/rest/models/tenant_invite_list.py +3 -3
  50. hatchet_sdk/clients/rest/models/tenant_list.py +3 -3
  51. hatchet_sdk/clients/rest/models/tenant_member_list.py +3 -3
  52. hatchet_sdk/clients/rest/models/tenant_queue_metrics.py +16 -0
  53. hatchet_sdk/clients/rest/models/tenant_resource_policy.py +3 -3
  54. hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py +1 -1
  55. hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py +3 -3
  56. hatchet_sdk/clients/rest/models/webhook_worker_list_response.py +3 -3
  57. hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py +3 -3
  58. hatchet_sdk/clients/rest/models/worker.py +20 -9
  59. hatchet_sdk/clients/rest/models/worker_list.py +3 -3
  60. hatchet_sdk/clients/{cloud_rest/models/tenant_billing_state_get200_response_payment_methods_inner.py → rest/models/worker_runtime_info.py} +23 -19
  61. hatchet_sdk/clients/rest/models/worker_runtime_sdks.py +38 -0
  62. hatchet_sdk/clients/rest/models/workflow.py +9 -9
  63. hatchet_sdk/clients/rest/models/workflow_list.py +3 -3
  64. hatchet_sdk/clients/rest/models/workflow_run.py +3 -3
  65. hatchet_sdk/clients/rest/models/workflow_run_list.py +3 -3
  66. hatchet_sdk/clients/rest/models/workflow_run_shape.py +3 -3
  67. hatchet_sdk/clients/rest/models/workflow_runs_metrics.py +1 -5
  68. hatchet_sdk/clients/rest/models/workflow_triggers.py +6 -6
  69. hatchet_sdk/clients/rest/models/workflow_version.py +3 -3
  70. hatchet_sdk/clients/rest/rest.py +3 -3
  71. hatchet_sdk/clients/rest_client.py +200 -21
  72. hatchet_sdk/contracts/dispatcher_pb2.pyi +2 -0
  73. hatchet_sdk/contracts/events_pb2.pyi +2 -0
  74. hatchet_sdk/contracts/workflows_pb2.pyi +2 -0
  75. hatchet_sdk/features/cron.py +286 -0
  76. hatchet_sdk/features/scheduled.py +248 -0
  77. hatchet_sdk/hatchet.py +71 -79
  78. hatchet_sdk/loader.py +37 -14
  79. hatchet_sdk/utils/serialization.py +15 -0
  80. hatchet_sdk/utils/tracing.py +67 -0
  81. hatchet_sdk/worker/runner/runner.py +158 -112
  82. hatchet_sdk/worker/worker.py +1 -17
  83. {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.41.0.dist-info}/METADATA +8 -2
  84. {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.41.0.dist-info}/RECORD +86 -140
  85. {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.41.0.dist-info}/entry_points.txt +0 -1
  86. hatchet_sdk/clients/cloud_rest/__init__.py +0 -186
  87. hatchet_sdk/clients/cloud_rest/api/__init__.py +0 -14
  88. hatchet_sdk/clients/cloud_rest/api/billing_api.py +0 -819
  89. hatchet_sdk/clients/cloud_rest/api/build_api.py +0 -298
  90. hatchet_sdk/clients/cloud_rest/api/feature_flags_api.py +0 -295
  91. hatchet_sdk/clients/cloud_rest/api/github_api.py +0 -1347
  92. hatchet_sdk/clients/cloud_rest/api/log_api.py +0 -971
  93. hatchet_sdk/clients/cloud_rest/api/managed_worker_api.py +0 -2546
  94. hatchet_sdk/clients/cloud_rest/api/metadata_api.py +0 -265
  95. hatchet_sdk/clients/cloud_rest/api/metrics_api.py +0 -1026
  96. hatchet_sdk/clients/cloud_rest/api/tenant_api.py +0 -301
  97. hatchet_sdk/clients/cloud_rest/api/user_api.py +0 -473
  98. hatchet_sdk/clients/cloud_rest/api/workflow_api.py +0 -369
  99. hatchet_sdk/clients/cloud_rest/api_client.py +0 -727
  100. hatchet_sdk/clients/cloud_rest/api_response.py +0 -22
  101. hatchet_sdk/clients/cloud_rest/configuration.py +0 -488
  102. hatchet_sdk/clients/cloud_rest/exceptions.py +0 -200
  103. hatchet_sdk/clients/cloud_rest/models/__init__.py +0 -157
  104. hatchet_sdk/clients/cloud_rest/models/billing_portal_link_get200_response.py +0 -85
  105. hatchet_sdk/clients/cloud_rest/models/build_get200_response.py +0 -121
  106. hatchet_sdk/clients/cloud_rest/models/github_app_list_branches200_response_inner.py +0 -86
  107. hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response.py +0 -119
  108. hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_pagination.py +0 -95
  109. hatchet_sdk/clients/cloud_rest/models/github_app_list_installations200_response_rows_inner_metadata.py +0 -98
  110. hatchet_sdk/clients/cloud_rest/models/github_app_list_repos200_response_inner.py +0 -86
  111. hatchet_sdk/clients/cloud_rest/models/infra_as_code_create_request.py +0 -107
  112. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner.py +0 -136
  113. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_event.py +0 -83
  114. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly.py +0 -100
  115. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_fly_app.py +0 -86
  116. hatchet_sdk/clients/cloud_rest/models/log_create_request_inner_log.py +0 -83
  117. hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request.py +0 -128
  118. hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_build_config.py +0 -121
  119. hatchet_sdk/clients/cloud_rest/models/managed_worker_create_request_runtime_config.py +0 -166
  120. hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response.py +0 -119
  121. hatchet_sdk/clients/cloud_rest/models/managed_worker_events_list200_response_rows_inner.py +0 -117
  122. hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response.py +0 -119
  123. hatchet_sdk/clients/cloud_rest/models/managed_worker_instances_list200_response_rows_inner.py +0 -113
  124. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner.py +0 -154
  125. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config.py +0 -151
  126. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_build_config_steps_inner.py +0 -109
  127. hatchet_sdk/clients/cloud_rest/models/managed_worker_list200_response_rows_inner_runtime_configs_inner.py +0 -171
  128. hatchet_sdk/clients/cloud_rest/models/managed_worker_update_request.py +0 -131
  129. hatchet_sdk/clients/cloud_rest/models/metadata_get200_response.py +0 -101
  130. hatchet_sdk/clients/cloud_rest/models/metadata_get400_response.py +0 -105
  131. hatchet_sdk/clients/cloud_rest/models/metadata_get400_response_errors_inner.py +0 -102
  132. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner.py +0 -108
  133. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner.py +0 -102
  134. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram.py +0 -113
  135. hatchet_sdk/clients/cloud_rest/models/metrics_cpu_get200_response_inner_histograms_inner_histogram_buckets_inner.py +0 -93
  136. hatchet_sdk/clients/cloud_rest/models/runtime_config_list_actions200_response.py +0 -83
  137. hatchet_sdk/clients/cloud_rest/models/subscription_upsert200_response.py +0 -114
  138. hatchet_sdk/clients/cloud_rest/models/subscription_upsert_request.py +0 -88
  139. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response.py +0 -170
  140. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_coupons_inner.py +0 -137
  141. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_plans_inner.py +0 -103
  142. hatchet_sdk/clients/cloud_rest/models/tenant_billing_state_get200_response_subscription.py +0 -114
  143. hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response.py +0 -107
  144. hatchet_sdk/clients/cloud_rest/models/workflow_run_events_get_metrics200_response_results_inner.py +0 -105
  145. hatchet_sdk/clients/cloud_rest/rest.py +0 -182
  146. hatchet_sdk/compute/__init__.py +0 -0
  147. hatchet_sdk/compute/configs.py +0 -34
  148. hatchet_sdk/compute/managed_compute.py +0 -111
  149. {hatchet_sdk-0.40.0a9.dist-info → hatchet_sdk-0.41.0.dist-info}/WHEEL +0 -0
@@ -1,2546 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- Hatchet API
5
-
6
- The Hatchet API
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
- import warnings
15
- from typing import Any, Dict, List, Optional, Tuple, Union
16
-
17
- from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
18
- from typing_extensions import Annotated
19
-
20
- from hatchet_sdk.clients.cloud_rest.api_client import ApiClient, RequestSerialized
21
- from hatchet_sdk.clients.cloud_rest.api_response import ApiResponse
22
- from hatchet_sdk.clients.cloud_rest.models.infra_as_code_create_request import (
23
- InfraAsCodeCreateRequest,
24
- )
25
- from hatchet_sdk.clients.cloud_rest.models.managed_worker_create_request import (
26
- ManagedWorkerCreateRequest,
27
- )
28
- from hatchet_sdk.clients.cloud_rest.models.managed_worker_events_list200_response import (
29
- ManagedWorkerEventsList200Response,
30
- )
31
- from hatchet_sdk.clients.cloud_rest.models.managed_worker_instances_list200_response import (
32
- ManagedWorkerInstancesList200Response,
33
- )
34
- from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response import (
35
- ManagedWorkerList200Response,
36
- )
37
- from hatchet_sdk.clients.cloud_rest.models.managed_worker_list200_response_rows_inner import (
38
- ManagedWorkerList200ResponseRowsInner,
39
- )
40
- from hatchet_sdk.clients.cloud_rest.models.managed_worker_update_request import (
41
- ManagedWorkerUpdateRequest,
42
- )
43
- from hatchet_sdk.clients.cloud_rest.models.runtime_config_list_actions200_response import (
44
- RuntimeConfigListActions200Response,
45
- )
46
- from hatchet_sdk.clients.cloud_rest.rest import RESTResponseType
47
-
48
-
49
- class ManagedWorkerApi:
50
- """NOTE: This class is auto generated by OpenAPI Generator
51
- Ref: https://openapi-generator.tech
52
-
53
- Do not edit the class manually.
54
- """
55
-
56
- def __init__(self, api_client=None) -> None:
57
- if api_client is None:
58
- api_client = ApiClient.get_default()
59
- self.api_client = api_client
60
-
61
- @validate_call
62
- async def infra_as_code_create(
63
- self,
64
- infra_as_code_request: Annotated[
65
- str,
66
- Field(
67
- min_length=36,
68
- strict=True,
69
- max_length=36,
70
- description="The infra as code request id",
71
- ),
72
- ],
73
- infra_as_code_create_request: Optional[InfraAsCodeCreateRequest] = None,
74
- _request_timeout: Union[
75
- None,
76
- Annotated[StrictFloat, Field(gt=0)],
77
- Tuple[
78
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
79
- ],
80
- ] = None,
81
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
82
- _content_type: Optional[StrictStr] = None,
83
- _headers: Optional[Dict[StrictStr, Any]] = None,
84
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
85
- ) -> None:
86
- """Create Infra as Code
87
-
88
- Registers runtime configs via infra-as-code
89
-
90
- :param infra_as_code_request: The infra as code request id (required)
91
- :type infra_as_code_request: str
92
- :param infra_as_code_create_request:
93
- :type infra_as_code_create_request: InfraAsCodeCreateRequest
94
- :param _request_timeout: timeout setting for this request. If one
95
- number provided, it will be total request
96
- timeout. It can also be a pair (tuple) of
97
- (connection, read) timeouts.
98
- :type _request_timeout: int, tuple(int, int), optional
99
- :param _request_auth: set to override the auth_settings for an a single
100
- request; this effectively ignores the
101
- authentication in the spec for a single request.
102
- :type _request_auth: dict, optional
103
- :param _content_type: force content-type for the request.
104
- :type _content_type: str, Optional
105
- :param _headers: set to override the headers for a single
106
- request; this effectively ignores the headers
107
- in the spec for a single request.
108
- :type _headers: dict, optional
109
- :param _host_index: set to override the host_index for a single
110
- request; this effectively ignores the host_index
111
- in the spec for a single request.
112
- :type _host_index: int, optional
113
- :return: Returns the result object.
114
- """ # noqa: E501
115
-
116
- _param = self._infra_as_code_create_serialize(
117
- infra_as_code_request=infra_as_code_request,
118
- infra_as_code_create_request=infra_as_code_create_request,
119
- _request_auth=_request_auth,
120
- _content_type=_content_type,
121
- _headers=_headers,
122
- _host_index=_host_index,
123
- )
124
-
125
- _response_types_map: Dict[str, Optional[str]] = {
126
- "200": None,
127
- "400": "MetadataGet400Response",
128
- "403": "MetadataGet400Response",
129
- }
130
- response_data = await self.api_client.call_api(
131
- *_param, _request_timeout=_request_timeout
132
- )
133
- await response_data.read()
134
- return self.api_client.response_deserialize(
135
- response_data=response_data,
136
- response_types_map=_response_types_map,
137
- ).data
138
-
139
- @validate_call
140
- async def infra_as_code_create_with_http_info(
141
- self,
142
- infra_as_code_request: Annotated[
143
- str,
144
- Field(
145
- min_length=36,
146
- strict=True,
147
- max_length=36,
148
- description="The infra as code request id",
149
- ),
150
- ],
151
- infra_as_code_create_request: Optional[InfraAsCodeCreateRequest] = None,
152
- _request_timeout: Union[
153
- None,
154
- Annotated[StrictFloat, Field(gt=0)],
155
- Tuple[
156
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
157
- ],
158
- ] = None,
159
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
160
- _content_type: Optional[StrictStr] = None,
161
- _headers: Optional[Dict[StrictStr, Any]] = None,
162
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
163
- ) -> ApiResponse[None]:
164
- """Create Infra as Code
165
-
166
- Registers runtime configs via infra-as-code
167
-
168
- :param infra_as_code_request: The infra as code request id (required)
169
- :type infra_as_code_request: str
170
- :param infra_as_code_create_request:
171
- :type infra_as_code_create_request: InfraAsCodeCreateRequest
172
- :param _request_timeout: timeout setting for this request. If one
173
- number provided, it will be total request
174
- timeout. It can also be a pair (tuple) of
175
- (connection, read) timeouts.
176
- :type _request_timeout: int, tuple(int, int), optional
177
- :param _request_auth: set to override the auth_settings for an a single
178
- request; this effectively ignores the
179
- authentication in the spec for a single request.
180
- :type _request_auth: dict, optional
181
- :param _content_type: force content-type for the request.
182
- :type _content_type: str, Optional
183
- :param _headers: set to override the headers for a single
184
- request; this effectively ignores the headers
185
- in the spec for a single request.
186
- :type _headers: dict, optional
187
- :param _host_index: set to override the host_index for a single
188
- request; this effectively ignores the host_index
189
- in the spec for a single request.
190
- :type _host_index: int, optional
191
- :return: Returns the result object.
192
- """ # noqa: E501
193
-
194
- _param = self._infra_as_code_create_serialize(
195
- infra_as_code_request=infra_as_code_request,
196
- infra_as_code_create_request=infra_as_code_create_request,
197
- _request_auth=_request_auth,
198
- _content_type=_content_type,
199
- _headers=_headers,
200
- _host_index=_host_index,
201
- )
202
-
203
- _response_types_map: Dict[str, Optional[str]] = {
204
- "200": None,
205
- "400": "MetadataGet400Response",
206
- "403": "MetadataGet400Response",
207
- }
208
- response_data = await self.api_client.call_api(
209
- *_param, _request_timeout=_request_timeout
210
- )
211
- await response_data.read()
212
- return self.api_client.response_deserialize(
213
- response_data=response_data,
214
- response_types_map=_response_types_map,
215
- )
216
-
217
- @validate_call
218
- async def infra_as_code_create_without_preload_content(
219
- self,
220
- infra_as_code_request: Annotated[
221
- str,
222
- Field(
223
- min_length=36,
224
- strict=True,
225
- max_length=36,
226
- description="The infra as code request id",
227
- ),
228
- ],
229
- infra_as_code_create_request: Optional[InfraAsCodeCreateRequest] = None,
230
- _request_timeout: Union[
231
- None,
232
- Annotated[StrictFloat, Field(gt=0)],
233
- Tuple[
234
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
235
- ],
236
- ] = None,
237
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
238
- _content_type: Optional[StrictStr] = None,
239
- _headers: Optional[Dict[StrictStr, Any]] = None,
240
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
241
- ) -> RESTResponseType:
242
- """Create Infra as Code
243
-
244
- Registers runtime configs via infra-as-code
245
-
246
- :param infra_as_code_request: The infra as code request id (required)
247
- :type infra_as_code_request: str
248
- :param infra_as_code_create_request:
249
- :type infra_as_code_create_request: InfraAsCodeCreateRequest
250
- :param _request_timeout: timeout setting for this request. If one
251
- number provided, it will be total request
252
- timeout. It can also be a pair (tuple) of
253
- (connection, read) timeouts.
254
- :type _request_timeout: int, tuple(int, int), optional
255
- :param _request_auth: set to override the auth_settings for an a single
256
- request; this effectively ignores the
257
- authentication in the spec for a single request.
258
- :type _request_auth: dict, optional
259
- :param _content_type: force content-type for the request.
260
- :type _content_type: str, Optional
261
- :param _headers: set to override the headers for a single
262
- request; this effectively ignores the headers
263
- in the spec for a single request.
264
- :type _headers: dict, optional
265
- :param _host_index: set to override the host_index for a single
266
- request; this effectively ignores the host_index
267
- in the spec for a single request.
268
- :type _host_index: int, optional
269
- :return: Returns the result object.
270
- """ # noqa: E501
271
-
272
- _param = self._infra_as_code_create_serialize(
273
- infra_as_code_request=infra_as_code_request,
274
- infra_as_code_create_request=infra_as_code_create_request,
275
- _request_auth=_request_auth,
276
- _content_type=_content_type,
277
- _headers=_headers,
278
- _host_index=_host_index,
279
- )
280
-
281
- _response_types_map: Dict[str, Optional[str]] = {
282
- "200": None,
283
- "400": "MetadataGet400Response",
284
- "403": "MetadataGet400Response",
285
- }
286
- response_data = await self.api_client.call_api(
287
- *_param, _request_timeout=_request_timeout
288
- )
289
- return response_data.response
290
-
291
- def _infra_as_code_create_serialize(
292
- self,
293
- infra_as_code_request,
294
- infra_as_code_create_request,
295
- _request_auth,
296
- _content_type,
297
- _headers,
298
- _host_index,
299
- ) -> RequestSerialized:
300
-
301
- _host = None
302
-
303
- _collection_formats: Dict[str, str] = {}
304
-
305
- _path_params: Dict[str, str] = {}
306
- _query_params: List[Tuple[str, str]] = []
307
- _header_params: Dict[str, Optional[str]] = _headers or {}
308
- _form_params: List[Tuple[str, str]] = []
309
- _files: Dict[str, Union[str, bytes]] = {}
310
- _body_params: Optional[bytes] = None
311
-
312
- # process the path parameters
313
- if infra_as_code_request is not None:
314
- _path_params["infra-as-code-request"] = infra_as_code_request
315
- # process the query parameters
316
- # process the header parameters
317
- # process the form parameters
318
- # process the body parameter
319
- if infra_as_code_create_request is not None:
320
- _body_params = infra_as_code_create_request
321
-
322
- # set the HTTP header `Accept`
323
- _header_params["Accept"] = self.api_client.select_header_accept(
324
- ["application/json"]
325
- )
326
-
327
- # set the HTTP header `Content-Type`
328
- if _content_type:
329
- _header_params["Content-Type"] = _content_type
330
- else:
331
- _default_content_type = self.api_client.select_header_content_type(
332
- ["application/json"]
333
- )
334
- if _default_content_type is not None:
335
- _header_params["Content-Type"] = _default_content_type
336
-
337
- # authentication setting
338
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
339
-
340
- return self.api_client.param_serialize(
341
- method="POST",
342
- resource_path="/api/v1/cloud/infra-as-code/{infra-as-code-request}",
343
- path_params=_path_params,
344
- query_params=_query_params,
345
- header_params=_header_params,
346
- body=_body_params,
347
- post_params=_form_params,
348
- files=_files,
349
- auth_settings=_auth_settings,
350
- collection_formats=_collection_formats,
351
- _host=_host,
352
- _request_auth=_request_auth,
353
- )
354
-
355
- @validate_call
356
- async def managed_worker_create(
357
- self,
358
- tenant: Annotated[
359
- str,
360
- Field(
361
- min_length=36, strict=True, max_length=36, description="The tenant id"
362
- ),
363
- ],
364
- managed_worker_create_request: Optional[ManagedWorkerCreateRequest] = None,
365
- _request_timeout: Union[
366
- None,
367
- Annotated[StrictFloat, Field(gt=0)],
368
- Tuple[
369
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
370
- ],
371
- ] = None,
372
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
373
- _content_type: Optional[StrictStr] = None,
374
- _headers: Optional[Dict[StrictStr, Any]] = None,
375
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
376
- ) -> ManagedWorkerList200ResponseRowsInner:
377
- """Create Managed Worker
378
-
379
- Create a managed worker for the tenant
380
-
381
- :param tenant: The tenant id (required)
382
- :type tenant: str
383
- :param managed_worker_create_request:
384
- :type managed_worker_create_request: ManagedWorkerCreateRequest
385
- :param _request_timeout: timeout setting for this request. If one
386
- number provided, it will be total request
387
- timeout. It can also be a pair (tuple) of
388
- (connection, read) timeouts.
389
- :type _request_timeout: int, tuple(int, int), optional
390
- :param _request_auth: set to override the auth_settings for an a single
391
- request; this effectively ignores the
392
- authentication in the spec for a single request.
393
- :type _request_auth: dict, optional
394
- :param _content_type: force content-type for the request.
395
- :type _content_type: str, Optional
396
- :param _headers: set to override the headers for a single
397
- request; this effectively ignores the headers
398
- in the spec for a single request.
399
- :type _headers: dict, optional
400
- :param _host_index: set to override the host_index for a single
401
- request; this effectively ignores the host_index
402
- in the spec for a single request.
403
- :type _host_index: int, optional
404
- :return: Returns the result object.
405
- """ # noqa: E501
406
-
407
- _param = self._managed_worker_create_serialize(
408
- tenant=tenant,
409
- managed_worker_create_request=managed_worker_create_request,
410
- _request_auth=_request_auth,
411
- _content_type=_content_type,
412
- _headers=_headers,
413
- _host_index=_host_index,
414
- )
415
-
416
- _response_types_map: Dict[str, Optional[str]] = {
417
- "200": "ManagedWorkerList200ResponseRowsInner",
418
- "400": "MetadataGet400Response",
419
- "403": "MetadataGet400Response",
420
- }
421
- response_data = await self.api_client.call_api(
422
- *_param, _request_timeout=_request_timeout
423
- )
424
- await response_data.read()
425
- return self.api_client.response_deserialize(
426
- response_data=response_data,
427
- response_types_map=_response_types_map,
428
- ).data
429
-
430
- @validate_call
431
- async def managed_worker_create_with_http_info(
432
- self,
433
- tenant: Annotated[
434
- str,
435
- Field(
436
- min_length=36, strict=True, max_length=36, description="The tenant id"
437
- ),
438
- ],
439
- managed_worker_create_request: Optional[ManagedWorkerCreateRequest] = None,
440
- _request_timeout: Union[
441
- None,
442
- Annotated[StrictFloat, Field(gt=0)],
443
- Tuple[
444
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
445
- ],
446
- ] = None,
447
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
448
- _content_type: Optional[StrictStr] = None,
449
- _headers: Optional[Dict[StrictStr, Any]] = None,
450
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
451
- ) -> ApiResponse[ManagedWorkerList200ResponseRowsInner]:
452
- """Create Managed Worker
453
-
454
- Create a managed worker for the tenant
455
-
456
- :param tenant: The tenant id (required)
457
- :type tenant: str
458
- :param managed_worker_create_request:
459
- :type managed_worker_create_request: ManagedWorkerCreateRequest
460
- :param _request_timeout: timeout setting for this request. If one
461
- number provided, it will be total request
462
- timeout. It can also be a pair (tuple) of
463
- (connection, read) timeouts.
464
- :type _request_timeout: int, tuple(int, int), optional
465
- :param _request_auth: set to override the auth_settings for an a single
466
- request; this effectively ignores the
467
- authentication in the spec for a single request.
468
- :type _request_auth: dict, optional
469
- :param _content_type: force content-type for the request.
470
- :type _content_type: str, Optional
471
- :param _headers: set to override the headers for a single
472
- request; this effectively ignores the headers
473
- in the spec for a single request.
474
- :type _headers: dict, optional
475
- :param _host_index: set to override the host_index for a single
476
- request; this effectively ignores the host_index
477
- in the spec for a single request.
478
- :type _host_index: int, optional
479
- :return: Returns the result object.
480
- """ # noqa: E501
481
-
482
- _param = self._managed_worker_create_serialize(
483
- tenant=tenant,
484
- managed_worker_create_request=managed_worker_create_request,
485
- _request_auth=_request_auth,
486
- _content_type=_content_type,
487
- _headers=_headers,
488
- _host_index=_host_index,
489
- )
490
-
491
- _response_types_map: Dict[str, Optional[str]] = {
492
- "200": "ManagedWorkerList200ResponseRowsInner",
493
- "400": "MetadataGet400Response",
494
- "403": "MetadataGet400Response",
495
- }
496
- response_data = await self.api_client.call_api(
497
- *_param, _request_timeout=_request_timeout
498
- )
499
- await response_data.read()
500
- return self.api_client.response_deserialize(
501
- response_data=response_data,
502
- response_types_map=_response_types_map,
503
- )
504
-
505
- @validate_call
506
- async def managed_worker_create_without_preload_content(
507
- self,
508
- tenant: Annotated[
509
- str,
510
- Field(
511
- min_length=36, strict=True, max_length=36, description="The tenant id"
512
- ),
513
- ],
514
- managed_worker_create_request: Optional[ManagedWorkerCreateRequest] = None,
515
- _request_timeout: Union[
516
- None,
517
- Annotated[StrictFloat, Field(gt=0)],
518
- Tuple[
519
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
520
- ],
521
- ] = None,
522
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
523
- _content_type: Optional[StrictStr] = None,
524
- _headers: Optional[Dict[StrictStr, Any]] = None,
525
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
526
- ) -> RESTResponseType:
527
- """Create Managed Worker
528
-
529
- Create a managed worker for the tenant
530
-
531
- :param tenant: The tenant id (required)
532
- :type tenant: str
533
- :param managed_worker_create_request:
534
- :type managed_worker_create_request: ManagedWorkerCreateRequest
535
- :param _request_timeout: timeout setting for this request. If one
536
- number provided, it will be total request
537
- timeout. It can also be a pair (tuple) of
538
- (connection, read) timeouts.
539
- :type _request_timeout: int, tuple(int, int), optional
540
- :param _request_auth: set to override the auth_settings for an a single
541
- request; this effectively ignores the
542
- authentication in the spec for a single request.
543
- :type _request_auth: dict, optional
544
- :param _content_type: force content-type for the request.
545
- :type _content_type: str, Optional
546
- :param _headers: set to override the headers for a single
547
- request; this effectively ignores the headers
548
- in the spec for a single request.
549
- :type _headers: dict, optional
550
- :param _host_index: set to override the host_index for a single
551
- request; this effectively ignores the host_index
552
- in the spec for a single request.
553
- :type _host_index: int, optional
554
- :return: Returns the result object.
555
- """ # noqa: E501
556
-
557
- _param = self._managed_worker_create_serialize(
558
- tenant=tenant,
559
- managed_worker_create_request=managed_worker_create_request,
560
- _request_auth=_request_auth,
561
- _content_type=_content_type,
562
- _headers=_headers,
563
- _host_index=_host_index,
564
- )
565
-
566
- _response_types_map: Dict[str, Optional[str]] = {
567
- "200": "ManagedWorkerList200ResponseRowsInner",
568
- "400": "MetadataGet400Response",
569
- "403": "MetadataGet400Response",
570
- }
571
- response_data = await self.api_client.call_api(
572
- *_param, _request_timeout=_request_timeout
573
- )
574
- return response_data.response
575
-
576
- def _managed_worker_create_serialize(
577
- self,
578
- tenant,
579
- managed_worker_create_request,
580
- _request_auth,
581
- _content_type,
582
- _headers,
583
- _host_index,
584
- ) -> RequestSerialized:
585
-
586
- _host = None
587
-
588
- _collection_formats: Dict[str, str] = {}
589
-
590
- _path_params: Dict[str, str] = {}
591
- _query_params: List[Tuple[str, str]] = []
592
- _header_params: Dict[str, Optional[str]] = _headers or {}
593
- _form_params: List[Tuple[str, str]] = []
594
- _files: Dict[str, Union[str, bytes]] = {}
595
- _body_params: Optional[bytes] = None
596
-
597
- # process the path parameters
598
- if tenant is not None:
599
- _path_params["tenant"] = tenant
600
- # process the query parameters
601
- # process the header parameters
602
- # process the form parameters
603
- # process the body parameter
604
- if managed_worker_create_request is not None:
605
- _body_params = managed_worker_create_request
606
-
607
- # set the HTTP header `Accept`
608
- _header_params["Accept"] = self.api_client.select_header_accept(
609
- ["application/json"]
610
- )
611
-
612
- # set the HTTP header `Content-Type`
613
- if _content_type:
614
- _header_params["Content-Type"] = _content_type
615
- else:
616
- _default_content_type = self.api_client.select_header_content_type(
617
- ["application/json"]
618
- )
619
- if _default_content_type is not None:
620
- _header_params["Content-Type"] = _default_content_type
621
-
622
- # authentication setting
623
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
624
-
625
- return self.api_client.param_serialize(
626
- method="POST",
627
- resource_path="/api/v1/cloud/tenants/{tenant}/managed-worker",
628
- path_params=_path_params,
629
- query_params=_query_params,
630
- header_params=_header_params,
631
- body=_body_params,
632
- post_params=_form_params,
633
- files=_files,
634
- auth_settings=_auth_settings,
635
- collection_formats=_collection_formats,
636
- _host=_host,
637
- _request_auth=_request_auth,
638
- )
639
-
640
- @validate_call
641
- async def managed_worker_delete(
642
- self,
643
- managed_worker: Annotated[
644
- str,
645
- Field(
646
- min_length=36,
647
- strict=True,
648
- max_length=36,
649
- description="The managed worker id",
650
- ),
651
- ],
652
- _request_timeout: Union[
653
- None,
654
- Annotated[StrictFloat, Field(gt=0)],
655
- Tuple[
656
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
657
- ],
658
- ] = None,
659
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
660
- _content_type: Optional[StrictStr] = None,
661
- _headers: Optional[Dict[StrictStr, Any]] = None,
662
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
663
- ) -> ManagedWorkerList200ResponseRowsInner:
664
- """Delete Managed Worker
665
-
666
- Delete a managed worker for the tenant
667
-
668
- :param managed_worker: The managed worker id (required)
669
- :type managed_worker: str
670
- :param _request_timeout: timeout setting for this request. If one
671
- number provided, it will be total request
672
- timeout. It can also be a pair (tuple) of
673
- (connection, read) timeouts.
674
- :type _request_timeout: int, tuple(int, int), optional
675
- :param _request_auth: set to override the auth_settings for an a single
676
- request; this effectively ignores the
677
- authentication in the spec for a single request.
678
- :type _request_auth: dict, optional
679
- :param _content_type: force content-type for the request.
680
- :type _content_type: str, Optional
681
- :param _headers: set to override the headers for a single
682
- request; this effectively ignores the headers
683
- in the spec for a single request.
684
- :type _headers: dict, optional
685
- :param _host_index: set to override the host_index for a single
686
- request; this effectively ignores the host_index
687
- in the spec for a single request.
688
- :type _host_index: int, optional
689
- :return: Returns the result object.
690
- """ # noqa: E501
691
-
692
- _param = self._managed_worker_delete_serialize(
693
- managed_worker=managed_worker,
694
- _request_auth=_request_auth,
695
- _content_type=_content_type,
696
- _headers=_headers,
697
- _host_index=_host_index,
698
- )
699
-
700
- _response_types_map: Dict[str, Optional[str]] = {
701
- "200": "ManagedWorkerList200ResponseRowsInner",
702
- "400": "MetadataGet400Response",
703
- "403": "MetadataGet400Response",
704
- "404": "MetadataGet400Response",
705
- }
706
- response_data = await self.api_client.call_api(
707
- *_param, _request_timeout=_request_timeout
708
- )
709
- await response_data.read()
710
- return self.api_client.response_deserialize(
711
- response_data=response_data,
712
- response_types_map=_response_types_map,
713
- ).data
714
-
715
- @validate_call
716
- async def managed_worker_delete_with_http_info(
717
- self,
718
- managed_worker: Annotated[
719
- str,
720
- Field(
721
- min_length=36,
722
- strict=True,
723
- max_length=36,
724
- description="The managed worker id",
725
- ),
726
- ],
727
- _request_timeout: Union[
728
- None,
729
- Annotated[StrictFloat, Field(gt=0)],
730
- Tuple[
731
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
732
- ],
733
- ] = None,
734
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
735
- _content_type: Optional[StrictStr] = None,
736
- _headers: Optional[Dict[StrictStr, Any]] = None,
737
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
738
- ) -> ApiResponse[ManagedWorkerList200ResponseRowsInner]:
739
- """Delete Managed Worker
740
-
741
- Delete a managed worker for the tenant
742
-
743
- :param managed_worker: The managed worker id (required)
744
- :type managed_worker: str
745
- :param _request_timeout: timeout setting for this request. If one
746
- number provided, it will be total request
747
- timeout. It can also be a pair (tuple) of
748
- (connection, read) timeouts.
749
- :type _request_timeout: int, tuple(int, int), optional
750
- :param _request_auth: set to override the auth_settings for an a single
751
- request; this effectively ignores the
752
- authentication in the spec for a single request.
753
- :type _request_auth: dict, optional
754
- :param _content_type: force content-type for the request.
755
- :type _content_type: str, Optional
756
- :param _headers: set to override the headers for a single
757
- request; this effectively ignores the headers
758
- in the spec for a single request.
759
- :type _headers: dict, optional
760
- :param _host_index: set to override the host_index for a single
761
- request; this effectively ignores the host_index
762
- in the spec for a single request.
763
- :type _host_index: int, optional
764
- :return: Returns the result object.
765
- """ # noqa: E501
766
-
767
- _param = self._managed_worker_delete_serialize(
768
- managed_worker=managed_worker,
769
- _request_auth=_request_auth,
770
- _content_type=_content_type,
771
- _headers=_headers,
772
- _host_index=_host_index,
773
- )
774
-
775
- _response_types_map: Dict[str, Optional[str]] = {
776
- "200": "ManagedWorkerList200ResponseRowsInner",
777
- "400": "MetadataGet400Response",
778
- "403": "MetadataGet400Response",
779
- "404": "MetadataGet400Response",
780
- }
781
- response_data = await self.api_client.call_api(
782
- *_param, _request_timeout=_request_timeout
783
- )
784
- await response_data.read()
785
- return self.api_client.response_deserialize(
786
- response_data=response_data,
787
- response_types_map=_response_types_map,
788
- )
789
-
790
- @validate_call
791
- async def managed_worker_delete_without_preload_content(
792
- self,
793
- managed_worker: Annotated[
794
- str,
795
- Field(
796
- min_length=36,
797
- strict=True,
798
- max_length=36,
799
- description="The managed worker id",
800
- ),
801
- ],
802
- _request_timeout: Union[
803
- None,
804
- Annotated[StrictFloat, Field(gt=0)],
805
- Tuple[
806
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
807
- ],
808
- ] = None,
809
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
810
- _content_type: Optional[StrictStr] = None,
811
- _headers: Optional[Dict[StrictStr, Any]] = None,
812
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
813
- ) -> RESTResponseType:
814
- """Delete Managed Worker
815
-
816
- Delete a managed worker for the tenant
817
-
818
- :param managed_worker: The managed worker id (required)
819
- :type managed_worker: str
820
- :param _request_timeout: timeout setting for this request. If one
821
- number provided, it will be total request
822
- timeout. It can also be a pair (tuple) of
823
- (connection, read) timeouts.
824
- :type _request_timeout: int, tuple(int, int), optional
825
- :param _request_auth: set to override the auth_settings for an a single
826
- request; this effectively ignores the
827
- authentication in the spec for a single request.
828
- :type _request_auth: dict, optional
829
- :param _content_type: force content-type for the request.
830
- :type _content_type: str, Optional
831
- :param _headers: set to override the headers for a single
832
- request; this effectively ignores the headers
833
- in the spec for a single request.
834
- :type _headers: dict, optional
835
- :param _host_index: set to override the host_index for a single
836
- request; this effectively ignores the host_index
837
- in the spec for a single request.
838
- :type _host_index: int, optional
839
- :return: Returns the result object.
840
- """ # noqa: E501
841
-
842
- _param = self._managed_worker_delete_serialize(
843
- managed_worker=managed_worker,
844
- _request_auth=_request_auth,
845
- _content_type=_content_type,
846
- _headers=_headers,
847
- _host_index=_host_index,
848
- )
849
-
850
- _response_types_map: Dict[str, Optional[str]] = {
851
- "200": "ManagedWorkerList200ResponseRowsInner",
852
- "400": "MetadataGet400Response",
853
- "403": "MetadataGet400Response",
854
- "404": "MetadataGet400Response",
855
- }
856
- response_data = await self.api_client.call_api(
857
- *_param, _request_timeout=_request_timeout
858
- )
859
- return response_data.response
860
-
861
- def _managed_worker_delete_serialize(
862
- self,
863
- managed_worker,
864
- _request_auth,
865
- _content_type,
866
- _headers,
867
- _host_index,
868
- ) -> RequestSerialized:
869
-
870
- _host = None
871
-
872
- _collection_formats: Dict[str, str] = {}
873
-
874
- _path_params: Dict[str, str] = {}
875
- _query_params: List[Tuple[str, str]] = []
876
- _header_params: Dict[str, Optional[str]] = _headers or {}
877
- _form_params: List[Tuple[str, str]] = []
878
- _files: Dict[str, Union[str, bytes]] = {}
879
- _body_params: Optional[bytes] = None
880
-
881
- # process the path parameters
882
- if managed_worker is not None:
883
- _path_params["managed-worker"] = managed_worker
884
- # process the query parameters
885
- # process the header parameters
886
- # process the form parameters
887
- # process the body parameter
888
-
889
- # set the HTTP header `Accept`
890
- _header_params["Accept"] = self.api_client.select_header_accept(
891
- ["application/json"]
892
- )
893
-
894
- # authentication setting
895
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
896
-
897
- return self.api_client.param_serialize(
898
- method="DELETE",
899
- resource_path="/api/v1/cloud/managed-worker/{managed-worker}",
900
- path_params=_path_params,
901
- query_params=_query_params,
902
- header_params=_header_params,
903
- body=_body_params,
904
- post_params=_form_params,
905
- files=_files,
906
- auth_settings=_auth_settings,
907
- collection_formats=_collection_formats,
908
- _host=_host,
909
- _request_auth=_request_auth,
910
- )
911
-
912
- @validate_call
913
- async def managed_worker_events_list(
914
- self,
915
- managed_worker: Annotated[
916
- str,
917
- Field(
918
- min_length=36,
919
- strict=True,
920
- max_length=36,
921
- description="The managed worker id",
922
- ),
923
- ],
924
- _request_timeout: Union[
925
- None,
926
- Annotated[StrictFloat, Field(gt=0)],
927
- Tuple[
928
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
929
- ],
930
- ] = None,
931
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
932
- _content_type: Optional[StrictStr] = None,
933
- _headers: Optional[Dict[StrictStr, Any]] = None,
934
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
935
- ) -> ManagedWorkerEventsList200Response:
936
- """Get Managed Worker Events
937
-
938
- Get events for a managed worker
939
-
940
- :param managed_worker: The managed worker id (required)
941
- :type managed_worker: str
942
- :param _request_timeout: timeout setting for this request. If one
943
- number provided, it will be total request
944
- timeout. It can also be a pair (tuple) of
945
- (connection, read) timeouts.
946
- :type _request_timeout: int, tuple(int, int), optional
947
- :param _request_auth: set to override the auth_settings for an a single
948
- request; this effectively ignores the
949
- authentication in the spec for a single request.
950
- :type _request_auth: dict, optional
951
- :param _content_type: force content-type for the request.
952
- :type _content_type: str, Optional
953
- :param _headers: set to override the headers for a single
954
- request; this effectively ignores the headers
955
- in the spec for a single request.
956
- :type _headers: dict, optional
957
- :param _host_index: set to override the host_index for a single
958
- request; this effectively ignores the host_index
959
- in the spec for a single request.
960
- :type _host_index: int, optional
961
- :return: Returns the result object.
962
- """ # noqa: E501
963
-
964
- _param = self._managed_worker_events_list_serialize(
965
- managed_worker=managed_worker,
966
- _request_auth=_request_auth,
967
- _content_type=_content_type,
968
- _headers=_headers,
969
- _host_index=_host_index,
970
- )
971
-
972
- _response_types_map: Dict[str, Optional[str]] = {
973
- "200": "ManagedWorkerEventsList200Response",
974
- "400": "MetadataGet400Response",
975
- "403": "MetadataGet400Response",
976
- }
977
- response_data = await self.api_client.call_api(
978
- *_param, _request_timeout=_request_timeout
979
- )
980
- await response_data.read()
981
- return self.api_client.response_deserialize(
982
- response_data=response_data,
983
- response_types_map=_response_types_map,
984
- ).data
985
-
986
- @validate_call
987
- async def managed_worker_events_list_with_http_info(
988
- self,
989
- managed_worker: Annotated[
990
- str,
991
- Field(
992
- min_length=36,
993
- strict=True,
994
- max_length=36,
995
- description="The managed worker id",
996
- ),
997
- ],
998
- _request_timeout: Union[
999
- None,
1000
- Annotated[StrictFloat, Field(gt=0)],
1001
- Tuple[
1002
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1003
- ],
1004
- ] = None,
1005
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1006
- _content_type: Optional[StrictStr] = None,
1007
- _headers: Optional[Dict[StrictStr, Any]] = None,
1008
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1009
- ) -> ApiResponse[ManagedWorkerEventsList200Response]:
1010
- """Get Managed Worker Events
1011
-
1012
- Get events for a managed worker
1013
-
1014
- :param managed_worker: The managed worker id (required)
1015
- :type managed_worker: str
1016
- :param _request_timeout: timeout setting for this request. If one
1017
- number provided, it will be total request
1018
- timeout. It can also be a pair (tuple) of
1019
- (connection, read) timeouts.
1020
- :type _request_timeout: int, tuple(int, int), optional
1021
- :param _request_auth: set to override the auth_settings for an a single
1022
- request; this effectively ignores the
1023
- authentication in the spec for a single request.
1024
- :type _request_auth: dict, optional
1025
- :param _content_type: force content-type for the request.
1026
- :type _content_type: str, Optional
1027
- :param _headers: set to override the headers for a single
1028
- request; this effectively ignores the headers
1029
- in the spec for a single request.
1030
- :type _headers: dict, optional
1031
- :param _host_index: set to override the host_index for a single
1032
- request; this effectively ignores the host_index
1033
- in the spec for a single request.
1034
- :type _host_index: int, optional
1035
- :return: Returns the result object.
1036
- """ # noqa: E501
1037
-
1038
- _param = self._managed_worker_events_list_serialize(
1039
- managed_worker=managed_worker,
1040
- _request_auth=_request_auth,
1041
- _content_type=_content_type,
1042
- _headers=_headers,
1043
- _host_index=_host_index,
1044
- )
1045
-
1046
- _response_types_map: Dict[str, Optional[str]] = {
1047
- "200": "ManagedWorkerEventsList200Response",
1048
- "400": "MetadataGet400Response",
1049
- "403": "MetadataGet400Response",
1050
- }
1051
- response_data = await self.api_client.call_api(
1052
- *_param, _request_timeout=_request_timeout
1053
- )
1054
- await response_data.read()
1055
- return self.api_client.response_deserialize(
1056
- response_data=response_data,
1057
- response_types_map=_response_types_map,
1058
- )
1059
-
1060
- @validate_call
1061
- async def managed_worker_events_list_without_preload_content(
1062
- self,
1063
- managed_worker: Annotated[
1064
- str,
1065
- Field(
1066
- min_length=36,
1067
- strict=True,
1068
- max_length=36,
1069
- description="The managed worker id",
1070
- ),
1071
- ],
1072
- _request_timeout: Union[
1073
- None,
1074
- Annotated[StrictFloat, Field(gt=0)],
1075
- Tuple[
1076
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1077
- ],
1078
- ] = None,
1079
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1080
- _content_type: Optional[StrictStr] = None,
1081
- _headers: Optional[Dict[StrictStr, Any]] = None,
1082
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1083
- ) -> RESTResponseType:
1084
- """Get Managed Worker Events
1085
-
1086
- Get events for a managed worker
1087
-
1088
- :param managed_worker: The managed worker id (required)
1089
- :type managed_worker: str
1090
- :param _request_timeout: timeout setting for this request. If one
1091
- number provided, it will be total request
1092
- timeout. It can also be a pair (tuple) of
1093
- (connection, read) timeouts.
1094
- :type _request_timeout: int, tuple(int, int), optional
1095
- :param _request_auth: set to override the auth_settings for an a single
1096
- request; this effectively ignores the
1097
- authentication in the spec for a single request.
1098
- :type _request_auth: dict, optional
1099
- :param _content_type: force content-type for the request.
1100
- :type _content_type: str, Optional
1101
- :param _headers: set to override the headers for a single
1102
- request; this effectively ignores the headers
1103
- in the spec for a single request.
1104
- :type _headers: dict, optional
1105
- :param _host_index: set to override the host_index for a single
1106
- request; this effectively ignores the host_index
1107
- in the spec for a single request.
1108
- :type _host_index: int, optional
1109
- :return: Returns the result object.
1110
- """ # noqa: E501
1111
-
1112
- _param = self._managed_worker_events_list_serialize(
1113
- managed_worker=managed_worker,
1114
- _request_auth=_request_auth,
1115
- _content_type=_content_type,
1116
- _headers=_headers,
1117
- _host_index=_host_index,
1118
- )
1119
-
1120
- _response_types_map: Dict[str, Optional[str]] = {
1121
- "200": "ManagedWorkerEventsList200Response",
1122
- "400": "MetadataGet400Response",
1123
- "403": "MetadataGet400Response",
1124
- }
1125
- response_data = await self.api_client.call_api(
1126
- *_param, _request_timeout=_request_timeout
1127
- )
1128
- return response_data.response
1129
-
1130
- def _managed_worker_events_list_serialize(
1131
- self,
1132
- managed_worker,
1133
- _request_auth,
1134
- _content_type,
1135
- _headers,
1136
- _host_index,
1137
- ) -> RequestSerialized:
1138
-
1139
- _host = None
1140
-
1141
- _collection_formats: Dict[str, str] = {}
1142
-
1143
- _path_params: Dict[str, str] = {}
1144
- _query_params: List[Tuple[str, str]] = []
1145
- _header_params: Dict[str, Optional[str]] = _headers or {}
1146
- _form_params: List[Tuple[str, str]] = []
1147
- _files: Dict[str, Union[str, bytes]] = {}
1148
- _body_params: Optional[bytes] = None
1149
-
1150
- # process the path parameters
1151
- if managed_worker is not None:
1152
- _path_params["managed-worker"] = managed_worker
1153
- # process the query parameters
1154
- # process the header parameters
1155
- # process the form parameters
1156
- # process the body parameter
1157
-
1158
- # set the HTTP header `Accept`
1159
- _header_params["Accept"] = self.api_client.select_header_accept(
1160
- ["application/json"]
1161
- )
1162
-
1163
- # authentication setting
1164
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
1165
-
1166
- return self.api_client.param_serialize(
1167
- method="GET",
1168
- resource_path="/api/v1/cloud/managed-worker/{managed-worker}/events",
1169
- path_params=_path_params,
1170
- query_params=_query_params,
1171
- header_params=_header_params,
1172
- body=_body_params,
1173
- post_params=_form_params,
1174
- files=_files,
1175
- auth_settings=_auth_settings,
1176
- collection_formats=_collection_formats,
1177
- _host=_host,
1178
- _request_auth=_request_auth,
1179
- )
1180
-
1181
- @validate_call
1182
- async def managed_worker_get(
1183
- self,
1184
- managed_worker: Annotated[
1185
- str,
1186
- Field(
1187
- min_length=36,
1188
- strict=True,
1189
- max_length=36,
1190
- description="The managed worker id",
1191
- ),
1192
- ],
1193
- _request_timeout: Union[
1194
- None,
1195
- Annotated[StrictFloat, Field(gt=0)],
1196
- Tuple[
1197
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1198
- ],
1199
- ] = None,
1200
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1201
- _content_type: Optional[StrictStr] = None,
1202
- _headers: Optional[Dict[StrictStr, Any]] = None,
1203
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1204
- ) -> ManagedWorkerList200ResponseRowsInner:
1205
- """Get Managed Worker
1206
-
1207
- Get a managed worker for the tenant
1208
-
1209
- :param managed_worker: The managed worker id (required)
1210
- :type managed_worker: str
1211
- :param _request_timeout: timeout setting for this request. If one
1212
- number provided, it will be total request
1213
- timeout. It can also be a pair (tuple) of
1214
- (connection, read) timeouts.
1215
- :type _request_timeout: int, tuple(int, int), optional
1216
- :param _request_auth: set to override the auth_settings for an a single
1217
- request; this effectively ignores the
1218
- authentication in the spec for a single request.
1219
- :type _request_auth: dict, optional
1220
- :param _content_type: force content-type for the request.
1221
- :type _content_type: str, Optional
1222
- :param _headers: set to override the headers for a single
1223
- request; this effectively ignores the headers
1224
- in the spec for a single request.
1225
- :type _headers: dict, optional
1226
- :param _host_index: set to override the host_index for a single
1227
- request; this effectively ignores the host_index
1228
- in the spec for a single request.
1229
- :type _host_index: int, optional
1230
- :return: Returns the result object.
1231
- """ # noqa: E501
1232
-
1233
- _param = self._managed_worker_get_serialize(
1234
- managed_worker=managed_worker,
1235
- _request_auth=_request_auth,
1236
- _content_type=_content_type,
1237
- _headers=_headers,
1238
- _host_index=_host_index,
1239
- )
1240
-
1241
- _response_types_map: Dict[str, Optional[str]] = {
1242
- "200": "ManagedWorkerList200ResponseRowsInner",
1243
- "400": "MetadataGet400Response",
1244
- "403": "MetadataGet400Response",
1245
- "404": "MetadataGet400Response",
1246
- }
1247
- response_data = await self.api_client.call_api(
1248
- *_param, _request_timeout=_request_timeout
1249
- )
1250
- await response_data.read()
1251
- return self.api_client.response_deserialize(
1252
- response_data=response_data,
1253
- response_types_map=_response_types_map,
1254
- ).data
1255
-
1256
- @validate_call
1257
- async def managed_worker_get_with_http_info(
1258
- self,
1259
- managed_worker: Annotated[
1260
- str,
1261
- Field(
1262
- min_length=36,
1263
- strict=True,
1264
- max_length=36,
1265
- description="The managed worker id",
1266
- ),
1267
- ],
1268
- _request_timeout: Union[
1269
- None,
1270
- Annotated[StrictFloat, Field(gt=0)],
1271
- Tuple[
1272
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1273
- ],
1274
- ] = None,
1275
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1276
- _content_type: Optional[StrictStr] = None,
1277
- _headers: Optional[Dict[StrictStr, Any]] = None,
1278
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1279
- ) -> ApiResponse[ManagedWorkerList200ResponseRowsInner]:
1280
- """Get Managed Worker
1281
-
1282
- Get a managed worker for the tenant
1283
-
1284
- :param managed_worker: The managed worker id (required)
1285
- :type managed_worker: str
1286
- :param _request_timeout: timeout setting for this request. If one
1287
- number provided, it will be total request
1288
- timeout. It can also be a pair (tuple) of
1289
- (connection, read) timeouts.
1290
- :type _request_timeout: int, tuple(int, int), optional
1291
- :param _request_auth: set to override the auth_settings for an a single
1292
- request; this effectively ignores the
1293
- authentication in the spec for a single request.
1294
- :type _request_auth: dict, optional
1295
- :param _content_type: force content-type for the request.
1296
- :type _content_type: str, Optional
1297
- :param _headers: set to override the headers for a single
1298
- request; this effectively ignores the headers
1299
- in the spec for a single request.
1300
- :type _headers: dict, optional
1301
- :param _host_index: set to override the host_index for a single
1302
- request; this effectively ignores the host_index
1303
- in the spec for a single request.
1304
- :type _host_index: int, optional
1305
- :return: Returns the result object.
1306
- """ # noqa: E501
1307
-
1308
- _param = self._managed_worker_get_serialize(
1309
- managed_worker=managed_worker,
1310
- _request_auth=_request_auth,
1311
- _content_type=_content_type,
1312
- _headers=_headers,
1313
- _host_index=_host_index,
1314
- )
1315
-
1316
- _response_types_map: Dict[str, Optional[str]] = {
1317
- "200": "ManagedWorkerList200ResponseRowsInner",
1318
- "400": "MetadataGet400Response",
1319
- "403": "MetadataGet400Response",
1320
- "404": "MetadataGet400Response",
1321
- }
1322
- response_data = await self.api_client.call_api(
1323
- *_param, _request_timeout=_request_timeout
1324
- )
1325
- await response_data.read()
1326
- return self.api_client.response_deserialize(
1327
- response_data=response_data,
1328
- response_types_map=_response_types_map,
1329
- )
1330
-
1331
- @validate_call
1332
- async def managed_worker_get_without_preload_content(
1333
- self,
1334
- managed_worker: Annotated[
1335
- str,
1336
- Field(
1337
- min_length=36,
1338
- strict=True,
1339
- max_length=36,
1340
- description="The managed worker id",
1341
- ),
1342
- ],
1343
- _request_timeout: Union[
1344
- None,
1345
- Annotated[StrictFloat, Field(gt=0)],
1346
- Tuple[
1347
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1348
- ],
1349
- ] = None,
1350
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1351
- _content_type: Optional[StrictStr] = None,
1352
- _headers: Optional[Dict[StrictStr, Any]] = None,
1353
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1354
- ) -> RESTResponseType:
1355
- """Get Managed Worker
1356
-
1357
- Get a managed worker for the tenant
1358
-
1359
- :param managed_worker: The managed worker id (required)
1360
- :type managed_worker: str
1361
- :param _request_timeout: timeout setting for this request. If one
1362
- number provided, it will be total request
1363
- timeout. It can also be a pair (tuple) of
1364
- (connection, read) timeouts.
1365
- :type _request_timeout: int, tuple(int, int), optional
1366
- :param _request_auth: set to override the auth_settings for an a single
1367
- request; this effectively ignores the
1368
- authentication in the spec for a single request.
1369
- :type _request_auth: dict, optional
1370
- :param _content_type: force content-type for the request.
1371
- :type _content_type: str, Optional
1372
- :param _headers: set to override the headers for a single
1373
- request; this effectively ignores the headers
1374
- in the spec for a single request.
1375
- :type _headers: dict, optional
1376
- :param _host_index: set to override the host_index for a single
1377
- request; this effectively ignores the host_index
1378
- in the spec for a single request.
1379
- :type _host_index: int, optional
1380
- :return: Returns the result object.
1381
- """ # noqa: E501
1382
-
1383
- _param = self._managed_worker_get_serialize(
1384
- managed_worker=managed_worker,
1385
- _request_auth=_request_auth,
1386
- _content_type=_content_type,
1387
- _headers=_headers,
1388
- _host_index=_host_index,
1389
- )
1390
-
1391
- _response_types_map: Dict[str, Optional[str]] = {
1392
- "200": "ManagedWorkerList200ResponseRowsInner",
1393
- "400": "MetadataGet400Response",
1394
- "403": "MetadataGet400Response",
1395
- "404": "MetadataGet400Response",
1396
- }
1397
- response_data = await self.api_client.call_api(
1398
- *_param, _request_timeout=_request_timeout
1399
- )
1400
- return response_data.response
1401
-
1402
- def _managed_worker_get_serialize(
1403
- self,
1404
- managed_worker,
1405
- _request_auth,
1406
- _content_type,
1407
- _headers,
1408
- _host_index,
1409
- ) -> RequestSerialized:
1410
-
1411
- _host = None
1412
-
1413
- _collection_formats: Dict[str, str] = {}
1414
-
1415
- _path_params: Dict[str, str] = {}
1416
- _query_params: List[Tuple[str, str]] = []
1417
- _header_params: Dict[str, Optional[str]] = _headers or {}
1418
- _form_params: List[Tuple[str, str]] = []
1419
- _files: Dict[str, Union[str, bytes]] = {}
1420
- _body_params: Optional[bytes] = None
1421
-
1422
- # process the path parameters
1423
- if managed_worker is not None:
1424
- _path_params["managed-worker"] = managed_worker
1425
- # process the query parameters
1426
- # process the header parameters
1427
- # process the form parameters
1428
- # process the body parameter
1429
-
1430
- # set the HTTP header `Accept`
1431
- _header_params["Accept"] = self.api_client.select_header_accept(
1432
- ["application/json"]
1433
- )
1434
-
1435
- # authentication setting
1436
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
1437
-
1438
- return self.api_client.param_serialize(
1439
- method="GET",
1440
- resource_path="/api/v1/cloud/managed-worker/{managed-worker}",
1441
- path_params=_path_params,
1442
- query_params=_query_params,
1443
- header_params=_header_params,
1444
- body=_body_params,
1445
- post_params=_form_params,
1446
- files=_files,
1447
- auth_settings=_auth_settings,
1448
- collection_formats=_collection_formats,
1449
- _host=_host,
1450
- _request_auth=_request_auth,
1451
- )
1452
-
1453
- @validate_call
1454
- async def managed_worker_instances_list(
1455
- self,
1456
- managed_worker: Annotated[
1457
- str,
1458
- Field(
1459
- min_length=36,
1460
- strict=True,
1461
- max_length=36,
1462
- description="The managed worker id",
1463
- ),
1464
- ],
1465
- _request_timeout: Union[
1466
- None,
1467
- Annotated[StrictFloat, Field(gt=0)],
1468
- Tuple[
1469
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1470
- ],
1471
- ] = None,
1472
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1473
- _content_type: Optional[StrictStr] = None,
1474
- _headers: Optional[Dict[StrictStr, Any]] = None,
1475
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1476
- ) -> ManagedWorkerInstancesList200Response:
1477
- """List Instances
1478
-
1479
- Get all instances for a managed worker
1480
-
1481
- :param managed_worker: The managed worker id (required)
1482
- :type managed_worker: str
1483
- :param _request_timeout: timeout setting for this request. If one
1484
- number provided, it will be total request
1485
- timeout. It can also be a pair (tuple) of
1486
- (connection, read) timeouts.
1487
- :type _request_timeout: int, tuple(int, int), optional
1488
- :param _request_auth: set to override the auth_settings for an a single
1489
- request; this effectively ignores the
1490
- authentication in the spec for a single request.
1491
- :type _request_auth: dict, optional
1492
- :param _content_type: force content-type for the request.
1493
- :type _content_type: str, Optional
1494
- :param _headers: set to override the headers for a single
1495
- request; this effectively ignores the headers
1496
- in the spec for a single request.
1497
- :type _headers: dict, optional
1498
- :param _host_index: set to override the host_index for a single
1499
- request; this effectively ignores the host_index
1500
- in the spec for a single request.
1501
- :type _host_index: int, optional
1502
- :return: Returns the result object.
1503
- """ # noqa: E501
1504
-
1505
- _param = self._managed_worker_instances_list_serialize(
1506
- managed_worker=managed_worker,
1507
- _request_auth=_request_auth,
1508
- _content_type=_content_type,
1509
- _headers=_headers,
1510
- _host_index=_host_index,
1511
- )
1512
-
1513
- _response_types_map: Dict[str, Optional[str]] = {
1514
- "200": "ManagedWorkerInstancesList200Response",
1515
- "400": "MetadataGet400Response",
1516
- "403": "MetadataGet400Response",
1517
- }
1518
- response_data = await self.api_client.call_api(
1519
- *_param, _request_timeout=_request_timeout
1520
- )
1521
- await response_data.read()
1522
- return self.api_client.response_deserialize(
1523
- response_data=response_data,
1524
- response_types_map=_response_types_map,
1525
- ).data
1526
-
1527
- @validate_call
1528
- async def managed_worker_instances_list_with_http_info(
1529
- self,
1530
- managed_worker: Annotated[
1531
- str,
1532
- Field(
1533
- min_length=36,
1534
- strict=True,
1535
- max_length=36,
1536
- description="The managed worker id",
1537
- ),
1538
- ],
1539
- _request_timeout: Union[
1540
- None,
1541
- Annotated[StrictFloat, Field(gt=0)],
1542
- Tuple[
1543
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1544
- ],
1545
- ] = None,
1546
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1547
- _content_type: Optional[StrictStr] = None,
1548
- _headers: Optional[Dict[StrictStr, Any]] = None,
1549
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1550
- ) -> ApiResponse[ManagedWorkerInstancesList200Response]:
1551
- """List Instances
1552
-
1553
- Get all instances for a managed worker
1554
-
1555
- :param managed_worker: The managed worker id (required)
1556
- :type managed_worker: str
1557
- :param _request_timeout: timeout setting for this request. If one
1558
- number provided, it will be total request
1559
- timeout. It can also be a pair (tuple) of
1560
- (connection, read) timeouts.
1561
- :type _request_timeout: int, tuple(int, int), optional
1562
- :param _request_auth: set to override the auth_settings for an a single
1563
- request; this effectively ignores the
1564
- authentication in the spec for a single request.
1565
- :type _request_auth: dict, optional
1566
- :param _content_type: force content-type for the request.
1567
- :type _content_type: str, Optional
1568
- :param _headers: set to override the headers for a single
1569
- request; this effectively ignores the headers
1570
- in the spec for a single request.
1571
- :type _headers: dict, optional
1572
- :param _host_index: set to override the host_index for a single
1573
- request; this effectively ignores the host_index
1574
- in the spec for a single request.
1575
- :type _host_index: int, optional
1576
- :return: Returns the result object.
1577
- """ # noqa: E501
1578
-
1579
- _param = self._managed_worker_instances_list_serialize(
1580
- managed_worker=managed_worker,
1581
- _request_auth=_request_auth,
1582
- _content_type=_content_type,
1583
- _headers=_headers,
1584
- _host_index=_host_index,
1585
- )
1586
-
1587
- _response_types_map: Dict[str, Optional[str]] = {
1588
- "200": "ManagedWorkerInstancesList200Response",
1589
- "400": "MetadataGet400Response",
1590
- "403": "MetadataGet400Response",
1591
- }
1592
- response_data = await self.api_client.call_api(
1593
- *_param, _request_timeout=_request_timeout
1594
- )
1595
- await response_data.read()
1596
- return self.api_client.response_deserialize(
1597
- response_data=response_data,
1598
- response_types_map=_response_types_map,
1599
- )
1600
-
1601
- @validate_call
1602
- async def managed_worker_instances_list_without_preload_content(
1603
- self,
1604
- managed_worker: Annotated[
1605
- str,
1606
- Field(
1607
- min_length=36,
1608
- strict=True,
1609
- max_length=36,
1610
- description="The managed worker id",
1611
- ),
1612
- ],
1613
- _request_timeout: Union[
1614
- None,
1615
- Annotated[StrictFloat, Field(gt=0)],
1616
- Tuple[
1617
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1618
- ],
1619
- ] = None,
1620
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1621
- _content_type: Optional[StrictStr] = None,
1622
- _headers: Optional[Dict[StrictStr, Any]] = None,
1623
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1624
- ) -> RESTResponseType:
1625
- """List Instances
1626
-
1627
- Get all instances for a managed worker
1628
-
1629
- :param managed_worker: The managed worker id (required)
1630
- :type managed_worker: str
1631
- :param _request_timeout: timeout setting for this request. If one
1632
- number provided, it will be total request
1633
- timeout. It can also be a pair (tuple) of
1634
- (connection, read) timeouts.
1635
- :type _request_timeout: int, tuple(int, int), optional
1636
- :param _request_auth: set to override the auth_settings for an a single
1637
- request; this effectively ignores the
1638
- authentication in the spec for a single request.
1639
- :type _request_auth: dict, optional
1640
- :param _content_type: force content-type for the request.
1641
- :type _content_type: str, Optional
1642
- :param _headers: set to override the headers for a single
1643
- request; this effectively ignores the headers
1644
- in the spec for a single request.
1645
- :type _headers: dict, optional
1646
- :param _host_index: set to override the host_index for a single
1647
- request; this effectively ignores the host_index
1648
- in the spec for a single request.
1649
- :type _host_index: int, optional
1650
- :return: Returns the result object.
1651
- """ # noqa: E501
1652
-
1653
- _param = self._managed_worker_instances_list_serialize(
1654
- managed_worker=managed_worker,
1655
- _request_auth=_request_auth,
1656
- _content_type=_content_type,
1657
- _headers=_headers,
1658
- _host_index=_host_index,
1659
- )
1660
-
1661
- _response_types_map: Dict[str, Optional[str]] = {
1662
- "200": "ManagedWorkerInstancesList200Response",
1663
- "400": "MetadataGet400Response",
1664
- "403": "MetadataGet400Response",
1665
- }
1666
- response_data = await self.api_client.call_api(
1667
- *_param, _request_timeout=_request_timeout
1668
- )
1669
- return response_data.response
1670
-
1671
- def _managed_worker_instances_list_serialize(
1672
- self,
1673
- managed_worker,
1674
- _request_auth,
1675
- _content_type,
1676
- _headers,
1677
- _host_index,
1678
- ) -> RequestSerialized:
1679
-
1680
- _host = None
1681
-
1682
- _collection_formats: Dict[str, str] = {}
1683
-
1684
- _path_params: Dict[str, str] = {}
1685
- _query_params: List[Tuple[str, str]] = []
1686
- _header_params: Dict[str, Optional[str]] = _headers or {}
1687
- _form_params: List[Tuple[str, str]] = []
1688
- _files: Dict[str, Union[str, bytes]] = {}
1689
- _body_params: Optional[bytes] = None
1690
-
1691
- # process the path parameters
1692
- if managed_worker is not None:
1693
- _path_params["managed-worker"] = managed_worker
1694
- # process the query parameters
1695
- # process the header parameters
1696
- # process the form parameters
1697
- # process the body parameter
1698
-
1699
- # set the HTTP header `Accept`
1700
- _header_params["Accept"] = self.api_client.select_header_accept(
1701
- ["application/json"]
1702
- )
1703
-
1704
- # authentication setting
1705
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
1706
-
1707
- return self.api_client.param_serialize(
1708
- method="GET",
1709
- resource_path="/api/v1/cloud/managed-worker/{managed-worker}/instances",
1710
- path_params=_path_params,
1711
- query_params=_query_params,
1712
- header_params=_header_params,
1713
- body=_body_params,
1714
- post_params=_form_params,
1715
- files=_files,
1716
- auth_settings=_auth_settings,
1717
- collection_formats=_collection_formats,
1718
- _host=_host,
1719
- _request_auth=_request_auth,
1720
- )
1721
-
1722
- @validate_call
1723
- async def managed_worker_list(
1724
- self,
1725
- tenant: Annotated[
1726
- str,
1727
- Field(
1728
- min_length=36, strict=True, max_length=36, description="The tenant id"
1729
- ),
1730
- ],
1731
- _request_timeout: Union[
1732
- None,
1733
- Annotated[StrictFloat, Field(gt=0)],
1734
- Tuple[
1735
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1736
- ],
1737
- ] = None,
1738
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1739
- _content_type: Optional[StrictStr] = None,
1740
- _headers: Optional[Dict[StrictStr, Any]] = None,
1741
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1742
- ) -> ManagedWorkerList200Response:
1743
- """List Managed Workers
1744
-
1745
- Get all managed workers for the tenant
1746
-
1747
- :param tenant: The tenant id (required)
1748
- :type tenant: str
1749
- :param _request_timeout: timeout setting for this request. If one
1750
- number provided, it will be total request
1751
- timeout. It can also be a pair (tuple) of
1752
- (connection, read) timeouts.
1753
- :type _request_timeout: int, tuple(int, int), optional
1754
- :param _request_auth: set to override the auth_settings for an a single
1755
- request; this effectively ignores the
1756
- authentication in the spec for a single request.
1757
- :type _request_auth: dict, optional
1758
- :param _content_type: force content-type for the request.
1759
- :type _content_type: str, Optional
1760
- :param _headers: set to override the headers for a single
1761
- request; this effectively ignores the headers
1762
- in the spec for a single request.
1763
- :type _headers: dict, optional
1764
- :param _host_index: set to override the host_index for a single
1765
- request; this effectively ignores the host_index
1766
- in the spec for a single request.
1767
- :type _host_index: int, optional
1768
- :return: Returns the result object.
1769
- """ # noqa: E501
1770
-
1771
- _param = self._managed_worker_list_serialize(
1772
- tenant=tenant,
1773
- _request_auth=_request_auth,
1774
- _content_type=_content_type,
1775
- _headers=_headers,
1776
- _host_index=_host_index,
1777
- )
1778
-
1779
- _response_types_map: Dict[str, Optional[str]] = {
1780
- "200": "ManagedWorkerList200Response",
1781
- "400": "MetadataGet400Response",
1782
- "403": "MetadataGet400Response",
1783
- }
1784
- response_data = await self.api_client.call_api(
1785
- *_param, _request_timeout=_request_timeout
1786
- )
1787
- await response_data.read()
1788
- return self.api_client.response_deserialize(
1789
- response_data=response_data,
1790
- response_types_map=_response_types_map,
1791
- ).data
1792
-
1793
- @validate_call
1794
- async def managed_worker_list_with_http_info(
1795
- self,
1796
- tenant: Annotated[
1797
- str,
1798
- Field(
1799
- min_length=36, strict=True, max_length=36, description="The tenant id"
1800
- ),
1801
- ],
1802
- _request_timeout: Union[
1803
- None,
1804
- Annotated[StrictFloat, Field(gt=0)],
1805
- Tuple[
1806
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1807
- ],
1808
- ] = None,
1809
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1810
- _content_type: Optional[StrictStr] = None,
1811
- _headers: Optional[Dict[StrictStr, Any]] = None,
1812
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1813
- ) -> ApiResponse[ManagedWorkerList200Response]:
1814
- """List Managed Workers
1815
-
1816
- Get all managed workers for the tenant
1817
-
1818
- :param tenant: The tenant id (required)
1819
- :type tenant: str
1820
- :param _request_timeout: timeout setting for this request. If one
1821
- number provided, it will be total request
1822
- timeout. It can also be a pair (tuple) of
1823
- (connection, read) timeouts.
1824
- :type _request_timeout: int, tuple(int, int), optional
1825
- :param _request_auth: set to override the auth_settings for an a single
1826
- request; this effectively ignores the
1827
- authentication in the spec for a single request.
1828
- :type _request_auth: dict, optional
1829
- :param _content_type: force content-type for the request.
1830
- :type _content_type: str, Optional
1831
- :param _headers: set to override the headers for a single
1832
- request; this effectively ignores the headers
1833
- in the spec for a single request.
1834
- :type _headers: dict, optional
1835
- :param _host_index: set to override the host_index for a single
1836
- request; this effectively ignores the host_index
1837
- in the spec for a single request.
1838
- :type _host_index: int, optional
1839
- :return: Returns the result object.
1840
- """ # noqa: E501
1841
-
1842
- _param = self._managed_worker_list_serialize(
1843
- tenant=tenant,
1844
- _request_auth=_request_auth,
1845
- _content_type=_content_type,
1846
- _headers=_headers,
1847
- _host_index=_host_index,
1848
- )
1849
-
1850
- _response_types_map: Dict[str, Optional[str]] = {
1851
- "200": "ManagedWorkerList200Response",
1852
- "400": "MetadataGet400Response",
1853
- "403": "MetadataGet400Response",
1854
- }
1855
- response_data = await self.api_client.call_api(
1856
- *_param, _request_timeout=_request_timeout
1857
- )
1858
- await response_data.read()
1859
- return self.api_client.response_deserialize(
1860
- response_data=response_data,
1861
- response_types_map=_response_types_map,
1862
- )
1863
-
1864
- @validate_call
1865
- async def managed_worker_list_without_preload_content(
1866
- self,
1867
- tenant: Annotated[
1868
- str,
1869
- Field(
1870
- min_length=36, strict=True, max_length=36, description="The tenant id"
1871
- ),
1872
- ],
1873
- _request_timeout: Union[
1874
- None,
1875
- Annotated[StrictFloat, Field(gt=0)],
1876
- Tuple[
1877
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1878
- ],
1879
- ] = None,
1880
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1881
- _content_type: Optional[StrictStr] = None,
1882
- _headers: Optional[Dict[StrictStr, Any]] = None,
1883
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1884
- ) -> RESTResponseType:
1885
- """List Managed Workers
1886
-
1887
- Get all managed workers for the tenant
1888
-
1889
- :param tenant: The tenant id (required)
1890
- :type tenant: str
1891
- :param _request_timeout: timeout setting for this request. If one
1892
- number provided, it will be total request
1893
- timeout. It can also be a pair (tuple) of
1894
- (connection, read) timeouts.
1895
- :type _request_timeout: int, tuple(int, int), optional
1896
- :param _request_auth: set to override the auth_settings for an a single
1897
- request; this effectively ignores the
1898
- authentication in the spec for a single request.
1899
- :type _request_auth: dict, optional
1900
- :param _content_type: force content-type for the request.
1901
- :type _content_type: str, Optional
1902
- :param _headers: set to override the headers for a single
1903
- request; this effectively ignores the headers
1904
- in the spec for a single request.
1905
- :type _headers: dict, optional
1906
- :param _host_index: set to override the host_index for a single
1907
- request; this effectively ignores the host_index
1908
- in the spec for a single request.
1909
- :type _host_index: int, optional
1910
- :return: Returns the result object.
1911
- """ # noqa: E501
1912
-
1913
- _param = self._managed_worker_list_serialize(
1914
- tenant=tenant,
1915
- _request_auth=_request_auth,
1916
- _content_type=_content_type,
1917
- _headers=_headers,
1918
- _host_index=_host_index,
1919
- )
1920
-
1921
- _response_types_map: Dict[str, Optional[str]] = {
1922
- "200": "ManagedWorkerList200Response",
1923
- "400": "MetadataGet400Response",
1924
- "403": "MetadataGet400Response",
1925
- }
1926
- response_data = await self.api_client.call_api(
1927
- *_param, _request_timeout=_request_timeout
1928
- )
1929
- return response_data.response
1930
-
1931
- def _managed_worker_list_serialize(
1932
- self,
1933
- tenant,
1934
- _request_auth,
1935
- _content_type,
1936
- _headers,
1937
- _host_index,
1938
- ) -> RequestSerialized:
1939
-
1940
- _host = None
1941
-
1942
- _collection_formats: Dict[str, str] = {}
1943
-
1944
- _path_params: Dict[str, str] = {}
1945
- _query_params: List[Tuple[str, str]] = []
1946
- _header_params: Dict[str, Optional[str]] = _headers or {}
1947
- _form_params: List[Tuple[str, str]] = []
1948
- _files: Dict[str, Union[str, bytes]] = {}
1949
- _body_params: Optional[bytes] = None
1950
-
1951
- # process the path parameters
1952
- if tenant is not None:
1953
- _path_params["tenant"] = tenant
1954
- # process the query parameters
1955
- # process the header parameters
1956
- # process the form parameters
1957
- # process the body parameter
1958
-
1959
- # set the HTTP header `Accept`
1960
- _header_params["Accept"] = self.api_client.select_header_accept(
1961
- ["application/json"]
1962
- )
1963
-
1964
- # authentication setting
1965
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
1966
-
1967
- return self.api_client.param_serialize(
1968
- method="GET",
1969
- resource_path="/api/v1/cloud/tenants/{tenant}/managed-worker",
1970
- path_params=_path_params,
1971
- query_params=_query_params,
1972
- header_params=_header_params,
1973
- body=_body_params,
1974
- post_params=_form_params,
1975
- files=_files,
1976
- auth_settings=_auth_settings,
1977
- collection_formats=_collection_formats,
1978
- _host=_host,
1979
- _request_auth=_request_auth,
1980
- )
1981
-
1982
- @validate_call
1983
- async def managed_worker_update(
1984
- self,
1985
- managed_worker: Annotated[
1986
- str,
1987
- Field(
1988
- min_length=36,
1989
- strict=True,
1990
- max_length=36,
1991
- description="The managed worker id",
1992
- ),
1993
- ],
1994
- managed_worker_update_request: Optional[ManagedWorkerUpdateRequest] = None,
1995
- _request_timeout: Union[
1996
- None,
1997
- Annotated[StrictFloat, Field(gt=0)],
1998
- Tuple[
1999
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2000
- ],
2001
- ] = None,
2002
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2003
- _content_type: Optional[StrictStr] = None,
2004
- _headers: Optional[Dict[StrictStr, Any]] = None,
2005
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2006
- ) -> ManagedWorkerList200ResponseRowsInner:
2007
- """Update Managed Worker
2008
-
2009
- Update a managed worker for the tenant
2010
-
2011
- :param managed_worker: The managed worker id (required)
2012
- :type managed_worker: str
2013
- :param managed_worker_update_request:
2014
- :type managed_worker_update_request: ManagedWorkerUpdateRequest
2015
- :param _request_timeout: timeout setting for this request. If one
2016
- number provided, it will be total request
2017
- timeout. It can also be a pair (tuple) of
2018
- (connection, read) timeouts.
2019
- :type _request_timeout: int, tuple(int, int), optional
2020
- :param _request_auth: set to override the auth_settings for an a single
2021
- request; this effectively ignores the
2022
- authentication in the spec for a single request.
2023
- :type _request_auth: dict, optional
2024
- :param _content_type: force content-type for the request.
2025
- :type _content_type: str, Optional
2026
- :param _headers: set to override the headers for a single
2027
- request; this effectively ignores the headers
2028
- in the spec for a single request.
2029
- :type _headers: dict, optional
2030
- :param _host_index: set to override the host_index for a single
2031
- request; this effectively ignores the host_index
2032
- in the spec for a single request.
2033
- :type _host_index: int, optional
2034
- :return: Returns the result object.
2035
- """ # noqa: E501
2036
-
2037
- _param = self._managed_worker_update_serialize(
2038
- managed_worker=managed_worker,
2039
- managed_worker_update_request=managed_worker_update_request,
2040
- _request_auth=_request_auth,
2041
- _content_type=_content_type,
2042
- _headers=_headers,
2043
- _host_index=_host_index,
2044
- )
2045
-
2046
- _response_types_map: Dict[str, Optional[str]] = {
2047
- "200": "ManagedWorkerList200ResponseRowsInner",
2048
- "400": "MetadataGet400Response",
2049
- "403": "MetadataGet400Response",
2050
- "404": "MetadataGet400Response",
2051
- }
2052
- response_data = await self.api_client.call_api(
2053
- *_param, _request_timeout=_request_timeout
2054
- )
2055
- await response_data.read()
2056
- return self.api_client.response_deserialize(
2057
- response_data=response_data,
2058
- response_types_map=_response_types_map,
2059
- ).data
2060
-
2061
- @validate_call
2062
- async def managed_worker_update_with_http_info(
2063
- self,
2064
- managed_worker: Annotated[
2065
- str,
2066
- Field(
2067
- min_length=36,
2068
- strict=True,
2069
- max_length=36,
2070
- description="The managed worker id",
2071
- ),
2072
- ],
2073
- managed_worker_update_request: Optional[ManagedWorkerUpdateRequest] = None,
2074
- _request_timeout: Union[
2075
- None,
2076
- Annotated[StrictFloat, Field(gt=0)],
2077
- Tuple[
2078
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2079
- ],
2080
- ] = None,
2081
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2082
- _content_type: Optional[StrictStr] = None,
2083
- _headers: Optional[Dict[StrictStr, Any]] = None,
2084
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2085
- ) -> ApiResponse[ManagedWorkerList200ResponseRowsInner]:
2086
- """Update Managed Worker
2087
-
2088
- Update a managed worker for the tenant
2089
-
2090
- :param managed_worker: The managed worker id (required)
2091
- :type managed_worker: str
2092
- :param managed_worker_update_request:
2093
- :type managed_worker_update_request: ManagedWorkerUpdateRequest
2094
- :param _request_timeout: timeout setting for this request. If one
2095
- number provided, it will be total request
2096
- timeout. It can also be a pair (tuple) of
2097
- (connection, read) timeouts.
2098
- :type _request_timeout: int, tuple(int, int), optional
2099
- :param _request_auth: set to override the auth_settings for an a single
2100
- request; this effectively ignores the
2101
- authentication in the spec for a single request.
2102
- :type _request_auth: dict, optional
2103
- :param _content_type: force content-type for the request.
2104
- :type _content_type: str, Optional
2105
- :param _headers: set to override the headers for a single
2106
- request; this effectively ignores the headers
2107
- in the spec for a single request.
2108
- :type _headers: dict, optional
2109
- :param _host_index: set to override the host_index for a single
2110
- request; this effectively ignores the host_index
2111
- in the spec for a single request.
2112
- :type _host_index: int, optional
2113
- :return: Returns the result object.
2114
- """ # noqa: E501
2115
-
2116
- _param = self._managed_worker_update_serialize(
2117
- managed_worker=managed_worker,
2118
- managed_worker_update_request=managed_worker_update_request,
2119
- _request_auth=_request_auth,
2120
- _content_type=_content_type,
2121
- _headers=_headers,
2122
- _host_index=_host_index,
2123
- )
2124
-
2125
- _response_types_map: Dict[str, Optional[str]] = {
2126
- "200": "ManagedWorkerList200ResponseRowsInner",
2127
- "400": "MetadataGet400Response",
2128
- "403": "MetadataGet400Response",
2129
- "404": "MetadataGet400Response",
2130
- }
2131
- response_data = await self.api_client.call_api(
2132
- *_param, _request_timeout=_request_timeout
2133
- )
2134
- await response_data.read()
2135
- return self.api_client.response_deserialize(
2136
- response_data=response_data,
2137
- response_types_map=_response_types_map,
2138
- )
2139
-
2140
- @validate_call
2141
- async def managed_worker_update_without_preload_content(
2142
- self,
2143
- managed_worker: Annotated[
2144
- str,
2145
- Field(
2146
- min_length=36,
2147
- strict=True,
2148
- max_length=36,
2149
- description="The managed worker id",
2150
- ),
2151
- ],
2152
- managed_worker_update_request: Optional[ManagedWorkerUpdateRequest] = None,
2153
- _request_timeout: Union[
2154
- None,
2155
- Annotated[StrictFloat, Field(gt=0)],
2156
- Tuple[
2157
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2158
- ],
2159
- ] = None,
2160
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2161
- _content_type: Optional[StrictStr] = None,
2162
- _headers: Optional[Dict[StrictStr, Any]] = None,
2163
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2164
- ) -> RESTResponseType:
2165
- """Update Managed Worker
2166
-
2167
- Update a managed worker for the tenant
2168
-
2169
- :param managed_worker: The managed worker id (required)
2170
- :type managed_worker: str
2171
- :param managed_worker_update_request:
2172
- :type managed_worker_update_request: ManagedWorkerUpdateRequest
2173
- :param _request_timeout: timeout setting for this request. If one
2174
- number provided, it will be total request
2175
- timeout. It can also be a pair (tuple) of
2176
- (connection, read) timeouts.
2177
- :type _request_timeout: int, tuple(int, int), optional
2178
- :param _request_auth: set to override the auth_settings for an a single
2179
- request; this effectively ignores the
2180
- authentication in the spec for a single request.
2181
- :type _request_auth: dict, optional
2182
- :param _content_type: force content-type for the request.
2183
- :type _content_type: str, Optional
2184
- :param _headers: set to override the headers for a single
2185
- request; this effectively ignores the headers
2186
- in the spec for a single request.
2187
- :type _headers: dict, optional
2188
- :param _host_index: set to override the host_index for a single
2189
- request; this effectively ignores the host_index
2190
- in the spec for a single request.
2191
- :type _host_index: int, optional
2192
- :return: Returns the result object.
2193
- """ # noqa: E501
2194
-
2195
- _param = self._managed_worker_update_serialize(
2196
- managed_worker=managed_worker,
2197
- managed_worker_update_request=managed_worker_update_request,
2198
- _request_auth=_request_auth,
2199
- _content_type=_content_type,
2200
- _headers=_headers,
2201
- _host_index=_host_index,
2202
- )
2203
-
2204
- _response_types_map: Dict[str, Optional[str]] = {
2205
- "200": "ManagedWorkerList200ResponseRowsInner",
2206
- "400": "MetadataGet400Response",
2207
- "403": "MetadataGet400Response",
2208
- "404": "MetadataGet400Response",
2209
- }
2210
- response_data = await self.api_client.call_api(
2211
- *_param, _request_timeout=_request_timeout
2212
- )
2213
- return response_data.response
2214
-
2215
- def _managed_worker_update_serialize(
2216
- self,
2217
- managed_worker,
2218
- managed_worker_update_request,
2219
- _request_auth,
2220
- _content_type,
2221
- _headers,
2222
- _host_index,
2223
- ) -> RequestSerialized:
2224
-
2225
- _host = None
2226
-
2227
- _collection_formats: Dict[str, str] = {}
2228
-
2229
- _path_params: Dict[str, str] = {}
2230
- _query_params: List[Tuple[str, str]] = []
2231
- _header_params: Dict[str, Optional[str]] = _headers or {}
2232
- _form_params: List[Tuple[str, str]] = []
2233
- _files: Dict[str, Union[str, bytes]] = {}
2234
- _body_params: Optional[bytes] = None
2235
-
2236
- # process the path parameters
2237
- if managed_worker is not None:
2238
- _path_params["managed-worker"] = managed_worker
2239
- # process the query parameters
2240
- # process the header parameters
2241
- # process the form parameters
2242
- # process the body parameter
2243
- if managed_worker_update_request is not None:
2244
- _body_params = managed_worker_update_request
2245
-
2246
- # set the HTTP header `Accept`
2247
- _header_params["Accept"] = self.api_client.select_header_accept(
2248
- ["application/json"]
2249
- )
2250
-
2251
- # set the HTTP header `Content-Type`
2252
- if _content_type:
2253
- _header_params["Content-Type"] = _content_type
2254
- else:
2255
- _default_content_type = self.api_client.select_header_content_type(
2256
- ["application/json"]
2257
- )
2258
- if _default_content_type is not None:
2259
- _header_params["Content-Type"] = _default_content_type
2260
-
2261
- # authentication setting
2262
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
2263
-
2264
- return self.api_client.param_serialize(
2265
- method="POST",
2266
- resource_path="/api/v1/cloud/managed-worker/{managed-worker}",
2267
- path_params=_path_params,
2268
- query_params=_query_params,
2269
- header_params=_header_params,
2270
- body=_body_params,
2271
- post_params=_form_params,
2272
- files=_files,
2273
- auth_settings=_auth_settings,
2274
- collection_formats=_collection_formats,
2275
- _host=_host,
2276
- _request_auth=_request_auth,
2277
- )
2278
-
2279
- @validate_call
2280
- async def runtime_config_list_actions(
2281
- self,
2282
- runtime_config: Annotated[
2283
- str,
2284
- Field(
2285
- min_length=36,
2286
- strict=True,
2287
- max_length=36,
2288
- description="The runtime config id",
2289
- ),
2290
- ],
2291
- _request_timeout: Union[
2292
- None,
2293
- Annotated[StrictFloat, Field(gt=0)],
2294
- Tuple[
2295
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2296
- ],
2297
- ] = None,
2298
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2299
- _content_type: Optional[StrictStr] = None,
2300
- _headers: Optional[Dict[StrictStr, Any]] = None,
2301
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2302
- ) -> RuntimeConfigListActions200Response:
2303
- """Get Runtime Config Actions
2304
-
2305
- Get a list of runtime config actions for a managed worker
2306
-
2307
- :param runtime_config: The runtime config id (required)
2308
- :type runtime_config: str
2309
- :param _request_timeout: timeout setting for this request. If one
2310
- number provided, it will be total request
2311
- timeout. It can also be a pair (tuple) of
2312
- (connection, read) timeouts.
2313
- :type _request_timeout: int, tuple(int, int), optional
2314
- :param _request_auth: set to override the auth_settings for an a single
2315
- request; this effectively ignores the
2316
- authentication in the spec for a single request.
2317
- :type _request_auth: dict, optional
2318
- :param _content_type: force content-type for the request.
2319
- :type _content_type: str, Optional
2320
- :param _headers: set to override the headers for a single
2321
- request; this effectively ignores the headers
2322
- in the spec for a single request.
2323
- :type _headers: dict, optional
2324
- :param _host_index: set to override the host_index for a single
2325
- request; this effectively ignores the host_index
2326
- in the spec for a single request.
2327
- :type _host_index: int, optional
2328
- :return: Returns the result object.
2329
- """ # noqa: E501
2330
-
2331
- _param = self._runtime_config_list_actions_serialize(
2332
- runtime_config=runtime_config,
2333
- _request_auth=_request_auth,
2334
- _content_type=_content_type,
2335
- _headers=_headers,
2336
- _host_index=_host_index,
2337
- )
2338
-
2339
- _response_types_map: Dict[str, Optional[str]] = {
2340
- "200": "RuntimeConfigListActions200Response",
2341
- "400": "MetadataGet400Response",
2342
- "403": "MetadataGet400Response",
2343
- }
2344
- response_data = await self.api_client.call_api(
2345
- *_param, _request_timeout=_request_timeout
2346
- )
2347
- await response_data.read()
2348
- return self.api_client.response_deserialize(
2349
- response_data=response_data,
2350
- response_types_map=_response_types_map,
2351
- ).data
2352
-
2353
- @validate_call
2354
- async def runtime_config_list_actions_with_http_info(
2355
- self,
2356
- runtime_config: Annotated[
2357
- str,
2358
- Field(
2359
- min_length=36,
2360
- strict=True,
2361
- max_length=36,
2362
- description="The runtime config id",
2363
- ),
2364
- ],
2365
- _request_timeout: Union[
2366
- None,
2367
- Annotated[StrictFloat, Field(gt=0)],
2368
- Tuple[
2369
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2370
- ],
2371
- ] = None,
2372
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2373
- _content_type: Optional[StrictStr] = None,
2374
- _headers: Optional[Dict[StrictStr, Any]] = None,
2375
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2376
- ) -> ApiResponse[RuntimeConfigListActions200Response]:
2377
- """Get Runtime Config Actions
2378
-
2379
- Get a list of runtime config actions for a managed worker
2380
-
2381
- :param runtime_config: The runtime config id (required)
2382
- :type runtime_config: str
2383
- :param _request_timeout: timeout setting for this request. If one
2384
- number provided, it will be total request
2385
- timeout. It can also be a pair (tuple) of
2386
- (connection, read) timeouts.
2387
- :type _request_timeout: int, tuple(int, int), optional
2388
- :param _request_auth: set to override the auth_settings for an a single
2389
- request; this effectively ignores the
2390
- authentication in the spec for a single request.
2391
- :type _request_auth: dict, optional
2392
- :param _content_type: force content-type for the request.
2393
- :type _content_type: str, Optional
2394
- :param _headers: set to override the headers for a single
2395
- request; this effectively ignores the headers
2396
- in the spec for a single request.
2397
- :type _headers: dict, optional
2398
- :param _host_index: set to override the host_index for a single
2399
- request; this effectively ignores the host_index
2400
- in the spec for a single request.
2401
- :type _host_index: int, optional
2402
- :return: Returns the result object.
2403
- """ # noqa: E501
2404
-
2405
- _param = self._runtime_config_list_actions_serialize(
2406
- runtime_config=runtime_config,
2407
- _request_auth=_request_auth,
2408
- _content_type=_content_type,
2409
- _headers=_headers,
2410
- _host_index=_host_index,
2411
- )
2412
-
2413
- _response_types_map: Dict[str, Optional[str]] = {
2414
- "200": "RuntimeConfigListActions200Response",
2415
- "400": "MetadataGet400Response",
2416
- "403": "MetadataGet400Response",
2417
- }
2418
- response_data = await self.api_client.call_api(
2419
- *_param, _request_timeout=_request_timeout
2420
- )
2421
- await response_data.read()
2422
- return self.api_client.response_deserialize(
2423
- response_data=response_data,
2424
- response_types_map=_response_types_map,
2425
- )
2426
-
2427
- @validate_call
2428
- async def runtime_config_list_actions_without_preload_content(
2429
- self,
2430
- runtime_config: Annotated[
2431
- str,
2432
- Field(
2433
- min_length=36,
2434
- strict=True,
2435
- max_length=36,
2436
- description="The runtime config id",
2437
- ),
2438
- ],
2439
- _request_timeout: Union[
2440
- None,
2441
- Annotated[StrictFloat, Field(gt=0)],
2442
- Tuple[
2443
- Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2444
- ],
2445
- ] = None,
2446
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2447
- _content_type: Optional[StrictStr] = None,
2448
- _headers: Optional[Dict[StrictStr, Any]] = None,
2449
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2450
- ) -> RESTResponseType:
2451
- """Get Runtime Config Actions
2452
-
2453
- Get a list of runtime config actions for a managed worker
2454
-
2455
- :param runtime_config: The runtime config id (required)
2456
- :type runtime_config: str
2457
- :param _request_timeout: timeout setting for this request. If one
2458
- number provided, it will be total request
2459
- timeout. It can also be a pair (tuple) of
2460
- (connection, read) timeouts.
2461
- :type _request_timeout: int, tuple(int, int), optional
2462
- :param _request_auth: set to override the auth_settings for an a single
2463
- request; this effectively ignores the
2464
- authentication in the spec for a single request.
2465
- :type _request_auth: dict, optional
2466
- :param _content_type: force content-type for the request.
2467
- :type _content_type: str, Optional
2468
- :param _headers: set to override the headers for a single
2469
- request; this effectively ignores the headers
2470
- in the spec for a single request.
2471
- :type _headers: dict, optional
2472
- :param _host_index: set to override the host_index for a single
2473
- request; this effectively ignores the host_index
2474
- in the spec for a single request.
2475
- :type _host_index: int, optional
2476
- :return: Returns the result object.
2477
- """ # noqa: E501
2478
-
2479
- _param = self._runtime_config_list_actions_serialize(
2480
- runtime_config=runtime_config,
2481
- _request_auth=_request_auth,
2482
- _content_type=_content_type,
2483
- _headers=_headers,
2484
- _host_index=_host_index,
2485
- )
2486
-
2487
- _response_types_map: Dict[str, Optional[str]] = {
2488
- "200": "RuntimeConfigListActions200Response",
2489
- "400": "MetadataGet400Response",
2490
- "403": "MetadataGet400Response",
2491
- }
2492
- response_data = await self.api_client.call_api(
2493
- *_param, _request_timeout=_request_timeout
2494
- )
2495
- return response_data.response
2496
-
2497
- def _runtime_config_list_actions_serialize(
2498
- self,
2499
- runtime_config,
2500
- _request_auth,
2501
- _content_type,
2502
- _headers,
2503
- _host_index,
2504
- ) -> RequestSerialized:
2505
-
2506
- _host = None
2507
-
2508
- _collection_formats: Dict[str, str] = {}
2509
-
2510
- _path_params: Dict[str, str] = {}
2511
- _query_params: List[Tuple[str, str]] = []
2512
- _header_params: Dict[str, Optional[str]] = _headers or {}
2513
- _form_params: List[Tuple[str, str]] = []
2514
- _files: Dict[str, Union[str, bytes]] = {}
2515
- _body_params: Optional[bytes] = None
2516
-
2517
- # process the path parameters
2518
- if runtime_config is not None:
2519
- _path_params["runtime-config"] = runtime_config
2520
- # process the query parameters
2521
- # process the header parameters
2522
- # process the form parameters
2523
- # process the body parameter
2524
-
2525
- # set the HTTP header `Accept`
2526
- _header_params["Accept"] = self.api_client.select_header_accept(
2527
- ["application/json"]
2528
- )
2529
-
2530
- # authentication setting
2531
- _auth_settings: List[str] = ["cookieAuth", "bearerAuth"]
2532
-
2533
- return self.api_client.param_serialize(
2534
- method="GET",
2535
- resource_path="/api/v1/cloud/runtime-config/{runtime-config}/actions",
2536
- path_params=_path_params,
2537
- query_params=_query_params,
2538
- header_params=_header_params,
2539
- body=_body_params,
2540
- post_params=_form_params,
2541
- files=_files,
2542
- auth_settings=_auth_settings,
2543
- collection_formats=_collection_formats,
2544
- _host=_host,
2545
- _request_auth=_request_auth,
2546
- )