gcore 0.10.0__py3-none-any.whl → 0.12.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 gcore might be problematic. Click here for more details.

Files changed (320) hide show
  1. gcore/_base_client.py +3 -3
  2. gcore/_client.py +18 -0
  3. gcore/_compat.py +48 -48
  4. gcore/_models.py +41 -41
  5. gcore/_types.py +35 -1
  6. gcore/_utils/__init__.py +9 -2
  7. gcore/_utils/_compat.py +45 -0
  8. gcore/_utils/_datetime_parse.py +136 -0
  9. gcore/_utils/_transform.py +11 -1
  10. gcore/_utils/_typing.py +6 -1
  11. gcore/_utils/_utils.py +0 -1
  12. gcore/_version.py +1 -1
  13. gcore/resources/__init__.py +28 -0
  14. gcore/resources/cloud/__init__.py +14 -0
  15. gcore/resources/cloud/audit_logs.py +3 -3
  16. gcore/resources/cloud/baremetal/images.py +3 -4
  17. gcore/resources/cloud/baremetal/servers.py +16 -4
  18. gcore/resources/cloud/cloud.py +32 -0
  19. gcore/resources/cloud/cost_reports.py +24 -16
  20. gcore/resources/cloud/file_shares/access_rules.py +2 -2
  21. gcore/resources/cloud/file_shares/file_shares.py +30 -14
  22. gcore/resources/cloud/floating_ips.py +196 -4
  23. gcore/resources/cloud/gpu_baremetal_clusters/flavors.py +1 -1
  24. gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +166 -190
  25. gcore/resources/cloud/gpu_baremetal_clusters/servers.py +268 -12
  26. gcore/resources/cloud/inference/__init__.py +14 -14
  27. gcore/resources/cloud/inference/applications/__init__.py +47 -0
  28. gcore/resources/cloud/inference/applications/applications.py +134 -0
  29. gcore/resources/cloud/inference/applications/deployments.py +649 -0
  30. gcore/resources/cloud/inference/applications/templates.py +238 -0
  31. gcore/resources/cloud/inference/deployments/deployments.py +41 -22
  32. gcore/resources/cloud/inference/inference.py +32 -32
  33. gcore/resources/cloud/inference/registry_credentials.py +8 -9
  34. gcore/resources/cloud/instances/images.py +4 -4
  35. gcore/resources/cloud/instances/instances.py +254 -4
  36. gcore/resources/cloud/instances/interfaces.py +544 -0
  37. gcore/resources/cloud/k8s/__init__.py +47 -0
  38. gcore/resources/cloud/k8s/clusters/__init__.py +47 -0
  39. gcore/resources/cloud/k8s/clusters/clusters.py +1391 -0
  40. gcore/resources/cloud/k8s/clusters/nodes.py +291 -0
  41. gcore/resources/cloud/k8s/clusters/pools/__init__.py +33 -0
  42. gcore/resources/cloud/k8s/clusters/pools/nodes.py +303 -0
  43. gcore/resources/cloud/k8s/clusters/pools/pools.py +870 -0
  44. gcore/resources/cloud/k8s/flavors.py +209 -0
  45. gcore/resources/cloud/k8s/k8s.py +233 -0
  46. gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +11 -12
  47. gcore/resources/cloud/load_balancers/l7_policies/rules.py +9 -10
  48. gcore/resources/cloud/load_balancers/listeners.py +18 -18
  49. gcore/resources/cloud/load_balancers/load_balancers.py +4 -4
  50. gcore/resources/cloud/load_balancers/pools/health_monitors.py +18 -6
  51. gcore/resources/cloud/load_balancers/pools/members.py +32 -2
  52. gcore/resources/cloud/load_balancers/pools/pools.py +32 -8
  53. gcore/resources/cloud/networks/networks.py +192 -4
  54. gcore/resources/cloud/networks/subnets.py +140 -8
  55. gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +608 -0
  56. gcore/resources/cloud/reserved_fixed_ips/vip.py +5 -7
  57. gcore/resources/cloud/security_groups/security_groups.py +6 -6
  58. gcore/resources/cloud/tasks.py +46 -46
  59. gcore/resources/cloud/users/role_assignments.py +5 -4
  60. gcore/resources/cloud/volumes.py +1125 -223
  61. gcore/resources/dns/__init__.py +75 -0
  62. gcore/resources/dns/dns.py +374 -0
  63. gcore/resources/dns/locations.py +288 -0
  64. gcore/resources/dns/metrics.py +214 -0
  65. gcore/resources/dns/pickers/__init__.py +33 -0
  66. gcore/resources/dns/pickers/pickers.py +167 -0
  67. gcore/resources/dns/pickers/presets.py +135 -0
  68. gcore/resources/dns/zones/__init__.py +47 -0
  69. gcore/resources/{cloud/inference/models.py → dns/zones/dnssec.py} +80 -122
  70. gcore/resources/dns/zones/rrsets.py +1005 -0
  71. gcore/resources/dns/zones/zones.py +1493 -0
  72. gcore/resources/storage/__init__.py +75 -0
  73. gcore/resources/storage/buckets/__init__.py +61 -0
  74. gcore/resources/storage/buckets/buckets.py +470 -0
  75. gcore/resources/storage/buckets/cors.py +265 -0
  76. gcore/resources/storage/buckets/lifecycle.py +276 -0
  77. gcore/resources/storage/buckets/policy.py +345 -0
  78. gcore/resources/storage/credentials.py +221 -0
  79. gcore/resources/storage/locations.py +190 -0
  80. gcore/resources/storage/statistics.py +364 -0
  81. gcore/resources/storage/storage.py +1046 -0
  82. gcore/resources/streaming/ai_tasks.py +56 -70
  83. gcore/resources/streaming/playlists.py +18 -18
  84. gcore/resources/streaming/quality_sets.py +8 -8
  85. gcore/resources/streaming/statistics.py +4 -122
  86. gcore/resources/streaming/streams/overlays.py +6 -6
  87. gcore/resources/streaming/streams/streams.py +40 -64
  88. gcore/resources/streaming/videos/subtitles.py +32 -30
  89. gcore/resources/streaming/videos/videos.py +78 -72
  90. gcore/resources/waap/domains/advanced_rules.py +2 -2
  91. gcore/resources/waap/domains/api_paths.py +13 -13
  92. gcore/resources/waap/domains/custom_rules.py +2 -2
  93. gcore/resources/waap/domains/domains.py +4 -4
  94. gcore/resources/waap/domains/firewall_rules.py +2 -2
  95. gcore/resources/waap/domains/insight_silences.py +6 -6
  96. gcore/resources/waap/domains/insights.py +7 -7
  97. gcore/resources/waap/domains/statistics.py +47 -47
  98. gcore/types/cloud/__init__.py +2 -4
  99. gcore/types/cloud/audit_log_list_params.py +2 -1
  100. gcore/types/cloud/baremetal/image_list_params.py +3 -2
  101. gcore/types/cloud/baremetal/server_create_params.py +8 -6
  102. gcore/types/cloud/baremetal/server_list_params.py +3 -2
  103. gcore/types/cloud/baremetal/server_rebuild_params.py +2 -0
  104. gcore/types/cloud/cost_report_get_aggregated_monthly_params.py +35 -31
  105. gcore/types/cloud/cost_report_get_aggregated_params.py +26 -25
  106. gcore/types/cloud/cost_report_get_detailed_params.py +26 -25
  107. gcore/types/cloud/ddos_profile.py +13 -7
  108. gcore/types/cloud/ddos_profile_field.py +21 -8
  109. gcore/types/cloud/ddos_profile_option_list.py +7 -6
  110. gcore/types/cloud/ddos_profile_status.py +2 -2
  111. gcore/types/cloud/ddos_profile_template.py +7 -3
  112. gcore/types/cloud/ddos_profile_template_field.py +12 -3
  113. gcore/types/cloud/file_share.py +2 -2
  114. gcore/types/cloud/file_share_create_params.py +12 -6
  115. gcore/types/cloud/floating_ip_list_params.py +3 -2
  116. gcore/types/cloud/gpu_baremetal_cluster.py +101 -74
  117. gcore/types/cloud/gpu_baremetal_cluster_create_params.py +76 -93
  118. gcore/types/cloud/gpu_baremetal_cluster_delete_params.py +17 -10
  119. gcore/types/cloud/gpu_baremetal_cluster_list_params.py +14 -3
  120. gcore/types/cloud/gpu_baremetal_cluster_rebuild_params.py +4 -2
  121. gcore/types/cloud/gpu_baremetal_clusters/__init__.py +6 -0
  122. gcore/types/cloud/gpu_baremetal_clusters/gpu_baremetal_cluster_server.py +74 -0
  123. gcore/types/cloud/{gpu_baremetal_cluster_server.py → gpu_baremetal_clusters/gpu_baremetal_cluster_server_v1.py} +10 -10
  124. gcore/types/cloud/gpu_baremetal_clusters/gpu_baremetal_cluster_server_v1_list.py +16 -0
  125. gcore/types/cloud/{gpu_baremetal_flavor.py → gpu_baremetal_clusters/gpu_baremetal_flavor.py} +1 -1
  126. gcore/types/cloud/{gpu_baremetal_flavor_list.py → gpu_baremetal_clusters/gpu_baremetal_flavor_list.py} +1 -1
  127. gcore/types/cloud/gpu_baremetal_clusters/server_list_params.py +75 -0
  128. gcore/types/cloud/inference/__init__.py +0 -5
  129. gcore/types/cloud/inference/applications/__init__.py +12 -0
  130. gcore/types/cloud/inference/applications/deployment_create_params.py +68 -0
  131. gcore/types/cloud/inference/applications/deployment_patch_params.py +62 -0
  132. gcore/types/cloud/inference/applications/inference_application_deployment.py +111 -0
  133. gcore/types/cloud/inference/applications/inference_application_deployment_list.py +16 -0
  134. gcore/types/cloud/inference/applications/inference_application_template.py +94 -0
  135. gcore/types/cloud/inference/applications/inference_application_template_list.py +16 -0
  136. gcore/types/cloud/inference/deployment_create_params.py +7 -6
  137. gcore/types/cloud/inference/deployment_update_params.py +7 -6
  138. gcore/types/cloud/instance_assign_security_group_params.py +4 -2
  139. gcore/types/cloud/instance_list_params.py +3 -2
  140. gcore/types/cloud/instance_unassign_security_group_params.py +4 -2
  141. gcore/types/cloud/instances/image_list_params.py +3 -2
  142. gcore/types/cloud/k8s/__init__.py +13 -0
  143. gcore/types/cloud/k8s/cluster_create_params.py +299 -0
  144. gcore/types/cloud/k8s/cluster_delete_params.py +16 -0
  145. gcore/types/cloud/k8s/cluster_update_params.py +203 -0
  146. gcore/types/cloud/k8s/cluster_upgrade_params.py +16 -0
  147. gcore/types/cloud/k8s/clusters/__init__.py +10 -0
  148. gcore/types/cloud/k8s/clusters/k8s_cluster_pool.py +66 -0
  149. gcore/types/cloud/k8s/clusters/k8s_cluster_pool_list.py +16 -0
  150. gcore/types/cloud/k8s/clusters/node_list_params.py +16 -0
  151. gcore/types/cloud/k8s/clusters/pool_create_params.py +53 -0
  152. gcore/types/cloud/k8s/clusters/pool_resize_params.py +18 -0
  153. gcore/types/cloud/k8s/clusters/pool_update_params.py +34 -0
  154. gcore/types/cloud/k8s/clusters/pools/__init__.py +5 -0
  155. gcore/types/cloud/k8s/clusters/pools/node_list_params.py +18 -0
  156. gcore/types/cloud/k8s/flavor_list_params.py +19 -0
  157. gcore/types/cloud/k8s/k8s_cluster.py +209 -0
  158. gcore/types/cloud/k8s/k8s_cluster_certificate.py +13 -0
  159. gcore/types/cloud/k8s/k8s_cluster_kubeconfig.py +19 -0
  160. gcore/types/cloud/k8s/k8s_cluster_list.py +16 -0
  161. gcore/types/cloud/k8s_cluster_version.py +10 -0
  162. gcore/types/cloud/{gpu_baremetal_cluster_server_list.py → k8s_cluster_version_list.py} +4 -4
  163. gcore/types/cloud/load_balancer_create_params.py +23 -4
  164. gcore/types/cloud/load_balancer_list_params.py +3 -2
  165. gcore/types/cloud/load_balancers/l7_policies/rule_create_params.py +3 -2
  166. gcore/types/cloud/load_balancers/l7_policies/rule_replace_params.py +3 -2
  167. gcore/types/cloud/load_balancers/l7_policy_create_params.py +3 -2
  168. gcore/types/cloud/load_balancers/l7_policy_replace_params.py +3 -2
  169. gcore/types/cloud/load_balancers/listener_create_params.py +4 -3
  170. gcore/types/cloud/load_balancers/listener_update_params.py +5 -3
  171. gcore/types/cloud/load_balancers/pool_create_params.py +19 -1
  172. gcore/types/cloud/load_balancers/pool_update_params.py +19 -1
  173. gcore/types/cloud/load_balancers/pools/member_add_params.py +19 -1
  174. gcore/types/cloud/member.py +19 -1
  175. gcore/types/cloud/network_list_params.py +3 -2
  176. gcore/types/cloud/networks/subnet_create_params.py +3 -2
  177. gcore/types/cloud/networks/subnet_list_params.py +3 -2
  178. gcore/types/cloud/networks/subnet_update_params.py +3 -2
  179. gcore/types/cloud/project.py +9 -9
  180. gcore/types/cloud/reserved_fixed_ips/vip_replace_connected_ports_params.py +3 -2
  181. gcore/types/cloud/reserved_fixed_ips/vip_update_connected_ports_params.py +3 -2
  182. gcore/types/cloud/security_group_create_params.py +4 -2
  183. gcore/types/cloud/security_group_list_params.py +3 -2
  184. gcore/types/cloud/task_id_list.py +8 -1
  185. gcore/types/cloud/task_list_params.py +23 -23
  186. gcore/types/cloud/usage_report_get_params.py +26 -25
  187. gcore/types/cloud/users/role_assignment.py +2 -1
  188. gcore/types/cloud/users/role_assignment_create_params.py +4 -2
  189. gcore/types/cloud/users/role_assignment_update_params.py +4 -2
  190. gcore/types/cloud/volume_list_params.py +3 -2
  191. gcore/types/dns/__init__.py +31 -0
  192. gcore/types/dns/dns_get_account_overview_response.py +21 -0
  193. gcore/types/dns/dns_label_name.py +13 -0
  194. gcore/types/dns/dns_location_translations.py +11 -0
  195. gcore/types/dns/dns_lookup_params.py +15 -0
  196. gcore/types/dns/dns_lookup_response.py +21 -0
  197. gcore/types/dns/dns_name_server.py +17 -0
  198. gcore/types/dns/location_list_continents_response.py +10 -0
  199. gcore/types/dns/location_list_countries_response.py +10 -0
  200. gcore/types/dns/location_list_regions_response.py +10 -0
  201. gcore/types/dns/location_list_response.py +16 -0
  202. gcore/types/dns/metric_list_params.py +24 -0
  203. gcore/types/dns/metric_list_response.py +7 -0
  204. gcore/types/dns/picker_list_response.py +10 -0
  205. gcore/types/dns/pickers/__init__.py +5 -0
  206. gcore/types/dns/pickers/preset_list_response.py +10 -0
  207. gcore/types/dns/zone_check_delegation_status_response.py +20 -0
  208. gcore/types/dns/zone_create_params.py +59 -0
  209. gcore/types/dns/zone_create_response.py +13 -0
  210. gcore/types/dns/zone_export_response.py +11 -0
  211. gcore/types/dns/zone_get_response.py +106 -0
  212. gcore/types/dns/zone_get_statistics_params.py +43 -0
  213. gcore/types/dns/zone_get_statistics_response.py +19 -0
  214. gcore/types/dns/zone_import_params.py +32 -0
  215. gcore/types/dns/zone_import_response.py +26 -0
  216. gcore/types/dns/zone_list_params.py +57 -0
  217. gcore/types/dns/zone_list_response.py +105 -0
  218. gcore/types/dns/zone_replace_params.py +61 -0
  219. gcore/types/dns/zones/__init__.py +15 -0
  220. gcore/types/dns/zones/dns_failover_log.py +19 -0
  221. gcore/types/dns/zones/dns_output_rrset.py +123 -0
  222. gcore/types/dns/zones/dnssec_get_response.py +38 -0
  223. gcore/types/dns/zones/dnssec_update_params.py +11 -0
  224. gcore/types/dns/zones/dnssec_update_response.py +38 -0
  225. gcore/types/dns/zones/rrset_create_params.py +82 -0
  226. gcore/types/dns/zones/rrset_get_failover_logs_params.py +21 -0
  227. gcore/types/dns/zones/rrset_get_failover_logs_response.py +15 -0
  228. gcore/types/dns/zones/rrset_list_params.py +21 -0
  229. gcore/types/dns/zones/rrset_list_response.py +14 -0
  230. gcore/types/dns/zones/rrset_replace_params.py +82 -0
  231. gcore/types/security/client_profile.py +1 -1
  232. gcore/types/security/profile_create_params.py +2 -2
  233. gcore/types/security/profile_recreate_params.py +2 -2
  234. gcore/types/security/profile_replace_params.py +2 -2
  235. gcore/types/storage/__init__.py +21 -0
  236. gcore/types/storage/bucket.py +15 -0
  237. gcore/types/storage/bucket_list_params.py +15 -0
  238. gcore/types/storage/buckets/__init__.py +9 -0
  239. gcore/types/storage/buckets/bucket_cors.py +18 -0
  240. gcore/types/storage/buckets/bucket_policy.py +7 -0
  241. gcore/types/storage/buckets/cor_create_params.py +17 -0
  242. gcore/types/storage/buckets/lifecycle_create_params.py +18 -0
  243. gcore/types/storage/buckets/policy_get_response.py +7 -0
  244. gcore/types/storage/credential_recreate_params.py +36 -0
  245. gcore/types/storage/location.py +24 -0
  246. gcore/types/storage/location_list_params.py +13 -0
  247. gcore/types/storage/statistic_get_usage_aggregated_params.py +24 -0
  248. gcore/types/storage/statistic_get_usage_series_params.py +38 -0
  249. gcore/types/storage/statistic_get_usage_series_response.py +12 -0
  250. gcore/types/storage/storage.py +101 -0
  251. gcore/types/storage/storage_create_params.py +44 -0
  252. gcore/types/storage/storage_list_params.py +39 -0
  253. gcore/types/storage/storage_restore_params.py +11 -0
  254. gcore/types/storage/storage_update_params.py +18 -0
  255. gcore/types/storage/usage_series.py +201 -0
  256. gcore/types/storage/usage_total.py +54 -0
  257. gcore/types/streaming/__init__.py +0 -4
  258. gcore/types/streaming/ai_contentmoderation_hardnudity.py +1 -1
  259. gcore/types/streaming/ai_contentmoderation_nsfw.py +1 -1
  260. gcore/types/streaming/ai_contentmoderation_softnudity.py +1 -1
  261. gcore/types/streaming/ai_contentmoderation_sport.py +1 -1
  262. gcore/types/streaming/ai_task.py +1 -5
  263. gcore/types/streaming/ai_task_create_params.py +2 -2
  264. gcore/types/streaming/ai_task_get_response.py +0 -46
  265. gcore/types/streaming/clip.py +2 -1
  266. gcore/types/streaming/create_video_param.py +13 -12
  267. gcore/types/streaming/max_stream_series.py +5 -5
  268. gcore/types/streaming/playlist.py +1 -1
  269. gcore/types/streaming/playlist_create_params.py +1 -1
  270. gcore/types/streaming/playlist_update_params.py +1 -1
  271. gcore/types/streaming/playlist_video.py +13 -12
  272. gcore/types/streaming/storage_series.py +5 -5
  273. gcore/types/streaming/stream.py +86 -49
  274. gcore/types/streaming/stream_create_clip_params.py +2 -1
  275. gcore/types/streaming/stream_create_params.py +9 -23
  276. gcore/types/streaming/stream_series.py +5 -5
  277. gcore/types/streaming/stream_update_params.py +9 -23
  278. gcore/types/streaming/video.py +53 -42
  279. gcore/types/streaming/video_update_params.py +13 -12
  280. gcore/types/streaming/vod_statistics_series.py +5 -5
  281. gcore/types/streaming/vod_total_stream_duration_series.py +3 -3
  282. gcore/types/waap/domain_list_params.py +1 -1
  283. gcore/types/waap/domain_update_params.py +1 -1
  284. gcore/types/waap/domains/advanced_rule_create_params.py +7 -4
  285. gcore/types/waap/domains/advanced_rule_update_params.py +6 -3
  286. gcore/types/waap/domains/api_path_create_params.py +4 -3
  287. gcore/types/waap/domains/api_path_list_params.py +3 -1
  288. gcore/types/waap/domains/api_path_update_params.py +5 -4
  289. gcore/types/waap/domains/custom_rule_create_params.py +13 -14
  290. gcore/types/waap/domains/custom_rule_update_params.py +12 -13
  291. gcore/types/waap/domains/firewall_rule_create_params.py +3 -2
  292. gcore/types/waap/domains/firewall_rule_update_params.py +2 -1
  293. gcore/types/waap/domains/insight_list_params.py +4 -2
  294. gcore/types/waap/domains/insight_replace_params.py +1 -1
  295. gcore/types/waap/domains/insight_silence_list_params.py +5 -3
  296. gcore/types/waap/domains/setting_update_params.py +3 -2
  297. gcore/types/waap/domains/statistic_get_ddos_info_params.py +6 -9
  298. gcore/types/waap/domains/statistic_get_events_aggregated_params.py +9 -10
  299. gcore/types/waap/domains/statistic_get_requests_series_params.py +8 -9
  300. gcore/types/waap/domains/statistic_get_traffic_series_params.py +6 -9
  301. gcore/types/waap/domains/waap_advanced_rule.py +3 -2
  302. gcore/types/waap/domains/waap_api_path.py +4 -4
  303. gcore/types/waap/domains/waap_api_scan_result.py +2 -2
  304. gcore/types/waap/domains/waap_custom_rule.py +4 -7
  305. gcore/types/waap/domains/waap_firewall_rule.py +3 -2
  306. gcore/types/waap/domains/waap_insight.py +1 -1
  307. gcore/types/waap/domains/waap_request_details.py +5 -4
  308. gcore/types/waap/waap_ip_ddos_info_model.py +3 -3
  309. gcore/types/waap/waap_rule_set.py +1 -1
  310. {gcore-0.10.0.dist-info → gcore-0.12.0.dist-info}/METADATA +7 -2
  311. {gcore-0.10.0.dist-info → gcore-0.12.0.dist-info}/RECORD +313 -193
  312. gcore/types/cloud/inference/inference_model.py +0 -65
  313. gcore/types/cloud/inference/inference_registry_credentials_create.py +0 -22
  314. gcore/types/cloud/inference/model_list_params.py +0 -21
  315. gcore/types/streaming/ai_contentmoderation_casm.py +0 -39
  316. gcore/types/streaming/ai_contentmoderation_weapon.py +0 -39
  317. gcore/types/streaming/meet_series.py +0 -23
  318. gcore/types/streaming/statistic_get_meet_series_params.py +0 -20
  319. {gcore-0.10.0.dist-info → gcore-0.12.0.dist-info}/WHEEL +0 -0
  320. {gcore-0.10.0.dist-info → gcore-0.12.0.dist-info}/licenses/LICENSE +0 -0
@@ -283,11 +283,17 @@ class InterfacesResource(SyncAPIResource):
283
283
  project_id: int | None = None,
284
284
  region_id: int | None = None,
285
285
  ddos_profile: interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
286
+ | interface_attach_params.NewInterfaceSpecificSubnetSchemaDDOSProfile
287
+ | interface_attach_params.NewInterfaceAnySubnetSchemaDDOSProfile
288
+ | interface_attach_params.NewInterfaceReservedFixedIPSchemaDDOSProfile
286
289
  | NotGiven = NOT_GIVEN,
287
290
  interface_name: str | NotGiven = NOT_GIVEN,
288
291
  ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
289
292
  port_group: int | NotGiven = NOT_GIVEN,
290
293
  security_groups: Iterable[interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
294
+ | Iterable[interface_attach_params.NewInterfaceSpecificSubnetSchemaSecurityGroup]
295
+ | Iterable[interface_attach_params.NewInterfaceAnySubnetSchemaSecurityGroup]
296
+ | Iterable[interface_attach_params.NewInterfaceReservedFixedIPSchemaSecurityGroup]
291
297
  | NotGiven = NOT_GIVEN,
292
298
  type: str | NotGiven = NOT_GIVEN,
293
299
  subnet_id: str | NotGiven = NOT_GIVEN,
@@ -328,6 +334,299 @@ class InterfacesResource(SyncAPIResource):
328
334
  cast_to=TaskIDList,
329
335
  )
330
336
 
337
+ @overload
338
+ def attach_and_poll(
339
+ self,
340
+ instance_id: str,
341
+ *,
342
+ project_id: int | None = None,
343
+ region_id: int | None = None,
344
+ ddos_profile: interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
345
+ | NotGiven = NOT_GIVEN,
346
+ interface_name: str | NotGiven = NOT_GIVEN,
347
+ ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
348
+ port_group: int | NotGiven = NOT_GIVEN,
349
+ security_groups: Iterable[interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
350
+ | NotGiven = NOT_GIVEN,
351
+ type: str | NotGiven = NOT_GIVEN,
352
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
353
+ # The extra values given here take precedence over values defined on the client or passed to this method.
354
+ extra_headers: Headers | None = None,
355
+ extra_query: Query | None = None,
356
+ extra_body: Body | None = None,
357
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
358
+ ) -> NetworkInterfaceList:
359
+ """
360
+ Attach interface to instance
361
+
362
+ Args:
363
+ ddos_profile: Advanced DDoS protection.
364
+
365
+ interface_name: Interface name
366
+
367
+ ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
368
+
369
+ port_group: Each group will be added to the separate trunk.
370
+
371
+ security_groups: List of security group IDs
372
+
373
+ type: Must be 'external'. Union tag
374
+
375
+ extra_headers: Send extra headers
376
+
377
+ extra_query: Add additional query parameters to the request
378
+
379
+ extra_body: Add additional JSON properties to the request
380
+
381
+ timeout: Override the client-level default timeout for this request, in seconds
382
+ """
383
+ ...
384
+
385
+ @overload
386
+ def attach_and_poll(
387
+ self,
388
+ instance_id: str,
389
+ *,
390
+ project_id: int | None = None,
391
+ region_id: int | None = None,
392
+ subnet_id: str,
393
+ ddos_profile: interface_attach_params.NewInterfaceSpecificSubnetSchemaDDOSProfile | NotGiven = NOT_GIVEN,
394
+ interface_name: str | NotGiven = NOT_GIVEN,
395
+ port_group: int | NotGiven = NOT_GIVEN,
396
+ security_groups: Iterable[interface_attach_params.NewInterfaceSpecificSubnetSchemaSecurityGroup]
397
+ | NotGiven = NOT_GIVEN,
398
+ type: str | NotGiven = NOT_GIVEN,
399
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
400
+ # The extra values given here take precedence over values defined on the client or passed to this method.
401
+ extra_headers: Headers | None = None,
402
+ extra_query: Query | None = None,
403
+ extra_body: Body | None = None,
404
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
405
+ ) -> NetworkInterfaceList:
406
+ """
407
+ Attach interface to instance
408
+
409
+ Args:
410
+ subnet_id: Port will get an IP address from this subnet
411
+
412
+ ddos_profile: Advanced DDoS protection.
413
+
414
+ interface_name: Interface name
415
+
416
+ port_group: Each group will be added to the separate trunk.
417
+
418
+ security_groups: List of security group IDs
419
+
420
+ type: Must be 'subnet'
421
+
422
+ extra_headers: Send extra headers
423
+
424
+ extra_query: Add additional query parameters to the request
425
+
426
+ extra_body: Add additional JSON properties to the request
427
+
428
+ timeout: Override the client-level default timeout for this request, in seconds
429
+ """
430
+ ...
431
+
432
+ @overload
433
+ def attach_and_poll(
434
+ self,
435
+ instance_id: str,
436
+ *,
437
+ project_id: int | None = None,
438
+ region_id: int | None = None,
439
+ network_id: str,
440
+ ddos_profile: interface_attach_params.NewInterfaceAnySubnetSchemaDDOSProfile | NotGiven = NOT_GIVEN,
441
+ interface_name: str | NotGiven = NOT_GIVEN,
442
+ ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
443
+ port_group: int | NotGiven = NOT_GIVEN,
444
+ security_groups: Iterable[interface_attach_params.NewInterfaceAnySubnetSchemaSecurityGroup]
445
+ | NotGiven = NOT_GIVEN,
446
+ type: str | NotGiven = NOT_GIVEN,
447
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
448
+ # The extra values given here take precedence over values defined on the client or passed to this method.
449
+ extra_headers: Headers | None = None,
450
+ extra_query: Query | None = None,
451
+ extra_body: Body | None = None,
452
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
453
+ ) -> NetworkInterfaceList:
454
+ """
455
+ Attach interface to instance
456
+
457
+ Args:
458
+ network_id: Port will get an IP address in this network subnet
459
+
460
+ ddos_profile: Advanced DDoS protection.
461
+
462
+ interface_name: Interface name
463
+
464
+ ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
465
+
466
+ port_group: Each group will be added to the separate trunk.
467
+
468
+ security_groups: List of security group IDs
469
+
470
+ type: Must be '`any_subnet`'
471
+
472
+ extra_headers: Send extra headers
473
+
474
+ extra_query: Add additional query parameters to the request
475
+
476
+ extra_body: Add additional JSON properties to the request
477
+
478
+ timeout: Override the client-level default timeout for this request, in seconds
479
+ """
480
+ ...
481
+
482
+ @overload
483
+ def attach_and_poll(
484
+ self,
485
+ instance_id: str,
486
+ *,
487
+ project_id: int | None = None,
488
+ region_id: int | None = None,
489
+ port_id: str,
490
+ ddos_profile: interface_attach_params.NewInterfaceReservedFixedIPSchemaDDOSProfile | NotGiven = NOT_GIVEN,
491
+ interface_name: str | NotGiven = NOT_GIVEN,
492
+ port_group: int | NotGiven = NOT_GIVEN,
493
+ security_groups: Iterable[interface_attach_params.NewInterfaceReservedFixedIPSchemaSecurityGroup]
494
+ | NotGiven = NOT_GIVEN,
495
+ type: str | NotGiven = NOT_GIVEN,
496
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
497
+ # The extra values given here take precedence over values defined on the client or passed to this method.
498
+ extra_headers: Headers | None = None,
499
+ extra_query: Query | None = None,
500
+ extra_body: Body | None = None,
501
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
502
+ ) -> NetworkInterfaceList:
503
+ """
504
+ Attach interface to instance
505
+
506
+ Args:
507
+ port_id: Port ID
508
+
509
+ ddos_profile: Advanced DDoS protection.
510
+
511
+ interface_name: Interface name
512
+
513
+ port_group: Each group will be added to the separate trunk.
514
+
515
+ security_groups: List of security group IDs
516
+
517
+ type: Must be '`reserved_fixed_ip`'. Union tag
518
+
519
+ extra_headers: Send extra headers
520
+
521
+ extra_query: Add additional query parameters to the request
522
+
523
+ extra_body: Add additional JSON properties to the request
524
+
525
+ timeout: Override the client-level default timeout for this request, in seconds
526
+ """
527
+ ...
528
+
529
+ def attach_and_poll(
530
+ self,
531
+ instance_id: str,
532
+ *,
533
+ project_id: int | None = None,
534
+ region_id: int | None = None,
535
+ ddos_profile: interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
536
+ | NotGiven = NOT_GIVEN,
537
+ interface_name: str | NotGiven = NOT_GIVEN,
538
+ ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
539
+ port_group: int | NotGiven = NOT_GIVEN,
540
+ security_groups: Iterable[interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
541
+ | NotGiven = NOT_GIVEN,
542
+ type: str | NotGiven = NOT_GIVEN,
543
+ subnet_id: str | NotGiven = NOT_GIVEN,
544
+ network_id: str | NotGiven = NOT_GIVEN,
545
+ port_id: str | NotGiven = NOT_GIVEN,
546
+ polling_interval_seconds: int | NotGiven = NOT_GIVEN,
547
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
548
+ # The extra values given here take precedence over values defined on the client or passed to this method.
549
+ extra_headers: Headers | None = None,
550
+ extra_query: Query | None = None,
551
+ extra_body: Body | None = None,
552
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
553
+ ) -> NetworkInterfaceList:
554
+ if project_id is None:
555
+ project_id = self._client._get_cloud_project_id_path_param()
556
+ if region_id is None:
557
+ region_id = self._client._get_cloud_region_id_path_param()
558
+ if not instance_id:
559
+ raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
560
+ response = self._post(
561
+ f"/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/attach_interface",
562
+ body=maybe_transform(
563
+ {
564
+ "ddos_profile": ddos_profile,
565
+ "interface_name": interface_name,
566
+ "ip_family": ip_family,
567
+ "port_group": port_group,
568
+ "security_groups": security_groups,
569
+ "type": type,
570
+ "subnet_id": subnet_id,
571
+ "network_id": network_id,
572
+ "port_id": port_id,
573
+ },
574
+ interface_attach_params.InterfaceAttachParams,
575
+ ),
576
+ options=make_request_options(
577
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
578
+ ),
579
+ cast_to=TaskIDList,
580
+ )
581
+ if not response.tasks:
582
+ raise ValueError("Expected at least one task to be created")
583
+ self._client.cloud.tasks.poll(
584
+ task_id=response.tasks[0],
585
+ extra_headers=extra_headers,
586
+ polling_interval_seconds=polling_interval_seconds,
587
+ )
588
+ return self.list(instance_id, project_id=project_id, region_id=region_id, extra_headers=extra_headers)
589
+
590
+ def detach_and_poll(
591
+ self,
592
+ instance_id: str,
593
+ *,
594
+ project_id: int | None = None,
595
+ region_id: int | None = None,
596
+ ip_address: str,
597
+ port_id: str,
598
+ polling_interval_seconds: int | NotGiven = NOT_GIVEN,
599
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
600
+ # The extra values given here take precedence over values defined on the client or passed to this method.
601
+ extra_headers: Headers | None = None,
602
+ extra_query: Query | None = None,
603
+ extra_body: Body | None = None,
604
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
605
+ ) -> NetworkInterfaceList:
606
+ """
607
+ Detach interface from instance and poll for completion. Only the first task will be polled.
608
+ If you need to poll more tasks, use the `tasks.poll` method.
609
+ """
610
+ response = self.detach(
611
+ instance_id=instance_id,
612
+ project_id=project_id,
613
+ region_id=region_id,
614
+ ip_address=ip_address,
615
+ port_id=port_id,
616
+ extra_headers=extra_headers,
617
+ extra_query=extra_query,
618
+ extra_body=extra_body,
619
+ timeout=timeout,
620
+ )
621
+ if not response.tasks:
622
+ raise ValueError("Expected at least one task to be created")
623
+ self._client.cloud.tasks.poll(
624
+ task_id=response.tasks[0],
625
+ extra_headers=extra_headers,
626
+ polling_interval_seconds=polling_interval_seconds,
627
+ )
628
+ return self.list(instance_id, project_id=project_id, region_id=region_id, extra_headers=extra_headers)
629
+
331
630
  def detach(
332
631
  self,
333
632
  instance_id: str,
@@ -639,11 +938,17 @@ class AsyncInterfacesResource(AsyncAPIResource):
639
938
  project_id: int | None = None,
640
939
  region_id: int | None = None,
641
940
  ddos_profile: interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
941
+ | interface_attach_params.NewInterfaceSpecificSubnetSchemaDDOSProfile
942
+ | interface_attach_params.NewInterfaceAnySubnetSchemaDDOSProfile
943
+ | interface_attach_params.NewInterfaceReservedFixedIPSchemaDDOSProfile
642
944
  | NotGiven = NOT_GIVEN,
643
945
  interface_name: str | NotGiven = NOT_GIVEN,
644
946
  ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
645
947
  port_group: int | NotGiven = NOT_GIVEN,
646
948
  security_groups: Iterable[interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
949
+ | Iterable[interface_attach_params.NewInterfaceSpecificSubnetSchemaSecurityGroup]
950
+ | Iterable[interface_attach_params.NewInterfaceAnySubnetSchemaSecurityGroup]
951
+ | Iterable[interface_attach_params.NewInterfaceReservedFixedIPSchemaSecurityGroup]
647
952
  | NotGiven = NOT_GIVEN,
648
953
  type: str | NotGiven = NOT_GIVEN,
649
954
  subnet_id: str | NotGiven = NOT_GIVEN,
@@ -684,6 +989,221 @@ class AsyncInterfacesResource(AsyncAPIResource):
684
989
  cast_to=TaskIDList,
685
990
  )
686
991
 
992
+ @overload
993
+ async def attach_and_poll(
994
+ self,
995
+ instance_id: str,
996
+ *,
997
+ project_id: int | None = None,
998
+ region_id: int | None = None,
999
+ ddos_profile: interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
1000
+ | NotGiven = NOT_GIVEN,
1001
+ interface_name: str | NotGiven = NOT_GIVEN,
1002
+ ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
1003
+ port_group: int | NotGiven = NOT_GIVEN,
1004
+ security_groups: Iterable[interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
1005
+ | NotGiven = NOT_GIVEN,
1006
+ type: str | NotGiven = NOT_GIVEN,
1007
+ polling_interval_seconds: int | NotGiven = NOT_GIVEN,
1008
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1009
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1010
+ extra_headers: Headers | None = None,
1011
+ extra_query: Query | None = None,
1012
+ extra_body: Body | None = None,
1013
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1014
+ ) -> NetworkInterfaceList:
1015
+ """
1016
+ Attach interface to instance using external extend and poll for completion. Only the first task will be polled.
1017
+ If you need to poll more tasks, use the `tasks.poll` method.
1018
+ """
1019
+ ...
1020
+
1021
+ @overload
1022
+ async def attach_and_poll(
1023
+ self,
1024
+ instance_id: str,
1025
+ *,
1026
+ project_id: int | None = None,
1027
+ region_id: int | None = None,
1028
+ subnet_id: str,
1029
+ ddos_profile: interface_attach_params.NewInterfaceSpecificSubnetSchemaDDOSProfile | NotGiven = NOT_GIVEN,
1030
+ interface_name: str | NotGiven = NOT_GIVEN,
1031
+ port_group: int | NotGiven = NOT_GIVEN,
1032
+ security_groups: Iterable[interface_attach_params.NewInterfaceSpecificSubnetSchemaSecurityGroup]
1033
+ | NotGiven = NOT_GIVEN,
1034
+ type: str | NotGiven = NOT_GIVEN,
1035
+ polling_interval_seconds: int | NotGiven = NOT_GIVEN,
1036
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1037
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1038
+ extra_headers: Headers | None = None,
1039
+ extra_query: Query | None = None,
1040
+ extra_body: Body | None = None,
1041
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1042
+ ) -> NetworkInterfaceList:
1043
+ """
1044
+ Attach interface to instance using specific subnet and poll for completion. Only the first task will be polled.
1045
+ If you need to poll more tasks, use the `tasks.poll` method.
1046
+ """
1047
+ ...
1048
+
1049
+ @overload
1050
+ async def attach_and_poll(
1051
+ self,
1052
+ instance_id: str,
1053
+ *,
1054
+ project_id: int | None = None,
1055
+ region_id: int | None = None,
1056
+ network_id: str,
1057
+ ddos_profile: interface_attach_params.NewInterfaceAnySubnetSchemaDDOSProfile | NotGiven = NOT_GIVEN,
1058
+ interface_name: str | NotGiven = NOT_GIVEN,
1059
+ ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
1060
+ port_group: int | NotGiven = NOT_GIVEN,
1061
+ security_groups: Iterable[interface_attach_params.NewInterfaceAnySubnetSchemaSecurityGroup]
1062
+ | NotGiven = NOT_GIVEN,
1063
+ type: str | NotGiven = NOT_GIVEN,
1064
+ polling_interval_seconds: int | NotGiven = NOT_GIVEN,
1065
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1066
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1067
+ extra_headers: Headers | None = None,
1068
+ extra_query: Query | None = None,
1069
+ extra_body: Body | None = None,
1070
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1071
+ ) -> NetworkInterfaceList:
1072
+ """
1073
+ Attach interface to instance using any subnet and poll for completion. Only the first task will be polled.
1074
+ If you need to poll more tasks, use the `tasks.poll` method.
1075
+ """
1076
+ ...
1077
+
1078
+ @overload
1079
+ async def attach_and_poll(
1080
+ self,
1081
+ instance_id: str,
1082
+ *,
1083
+ project_id: int | None = None,
1084
+ region_id: int | None = None,
1085
+ port_id: str,
1086
+ ddos_profile: interface_attach_params.NewInterfaceReservedFixedIPSchemaDDOSProfile | NotGiven = NOT_GIVEN,
1087
+ interface_name: str | NotGiven = NOT_GIVEN,
1088
+ port_group: int | NotGiven = NOT_GIVEN,
1089
+ security_groups: Iterable[interface_attach_params.NewInterfaceReservedFixedIPSchemaSecurityGroup]
1090
+ | NotGiven = NOT_GIVEN,
1091
+ type: str | NotGiven = NOT_GIVEN,
1092
+ polling_interval_seconds: int | NotGiven = NOT_GIVEN,
1093
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1094
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1095
+ extra_headers: Headers | None = None,
1096
+ extra_query: Query | None = None,
1097
+ extra_body: Body | None = None,
1098
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1099
+ ) -> NetworkInterfaceList:
1100
+ """
1101
+ Attach interface to instance using reserved fixed IP and poll for completion. Only the first task will be polled.
1102
+ If you need to poll more tasks, use the `tasks.poll` method.
1103
+ """
1104
+ ...
1105
+
1106
+ async def attach_and_poll(
1107
+ self,
1108
+ instance_id: str,
1109
+ *,
1110
+ project_id: int | None = None,
1111
+ region_id: int | None = None,
1112
+ ddos_profile: interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
1113
+ | NotGiven = NOT_GIVEN,
1114
+ interface_name: str | NotGiven = NOT_GIVEN,
1115
+ ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
1116
+ port_group: int | NotGiven = NOT_GIVEN,
1117
+ security_groups: Iterable[interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
1118
+ | NotGiven = NOT_GIVEN,
1119
+ type: str | NotGiven = NOT_GIVEN,
1120
+ subnet_id: str | NotGiven = NOT_GIVEN,
1121
+ network_id: str | NotGiven = NOT_GIVEN,
1122
+ port_id: str | NotGiven = NOT_GIVEN,
1123
+ polling_interval_seconds: int | NotGiven = NOT_GIVEN,
1124
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1125
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1126
+ extra_headers: Headers | None = None,
1127
+ extra_query: Query | None = None,
1128
+ extra_body: Body | None = None,
1129
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1130
+ ) -> NetworkInterfaceList:
1131
+ if project_id is None:
1132
+ project_id = self._client._get_cloud_project_id_path_param()
1133
+ if region_id is None:
1134
+ region_id = self._client._get_cloud_region_id_path_param()
1135
+ if not instance_id:
1136
+ raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
1137
+ response = await self._post(
1138
+ f"/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/attach_interface",
1139
+ body=await async_maybe_transform(
1140
+ {
1141
+ "ddos_profile": ddos_profile,
1142
+ "interface_name": interface_name,
1143
+ "ip_family": ip_family,
1144
+ "port_group": port_group,
1145
+ "security_groups": security_groups,
1146
+ "type": type,
1147
+ "subnet_id": subnet_id,
1148
+ "network_id": network_id,
1149
+ "port_id": port_id,
1150
+ },
1151
+ interface_attach_params.InterfaceAttachParams,
1152
+ ),
1153
+ options=make_request_options(
1154
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1155
+ ),
1156
+ cast_to=TaskIDList,
1157
+ )
1158
+ if not response.tasks:
1159
+ raise ValueError("Expected at least one task to be created")
1160
+ await self._client.cloud.tasks.poll(
1161
+ task_id=response.tasks[0],
1162
+ extra_headers=extra_headers,
1163
+ polling_interval_seconds=polling_interval_seconds,
1164
+ )
1165
+ return await self.list(instance_id, project_id=project_id, region_id=region_id, extra_headers=extra_headers)
1166
+
1167
+ async def detach_and_poll(
1168
+ self,
1169
+ instance_id: str,
1170
+ *,
1171
+ project_id: int | None = None,
1172
+ region_id: int | None = None,
1173
+ ip_address: str,
1174
+ port_id: str,
1175
+ polling_interval_seconds: int | NotGiven = NOT_GIVEN,
1176
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1177
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1178
+ extra_headers: Headers | None = None,
1179
+ extra_query: Query | None = None,
1180
+ extra_body: Body | None = None,
1181
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1182
+ ) -> NetworkInterfaceList:
1183
+ """
1184
+ Detach interface from instance and poll for completion. Only the first task will be polled.
1185
+ If you need to poll more tasks, use the `tasks.poll` method.
1186
+ """
1187
+ response = await self.detach(
1188
+ instance_id=instance_id,
1189
+ project_id=project_id,
1190
+ region_id=region_id,
1191
+ ip_address=ip_address,
1192
+ port_id=port_id,
1193
+ extra_headers=extra_headers,
1194
+ extra_query=extra_query,
1195
+ extra_body=extra_body,
1196
+ timeout=timeout,
1197
+ )
1198
+ if not response.tasks:
1199
+ raise ValueError("Expected at least one task to be created")
1200
+ await self._client.cloud.tasks.poll(
1201
+ task_id=response.tasks[0],
1202
+ extra_headers=extra_headers,
1203
+ polling_interval_seconds=polling_interval_seconds,
1204
+ )
1205
+ return await self.list(instance_id, project_id=project_id, region_id=region_id, extra_headers=extra_headers)
1206
+
687
1207
  async def detach(
688
1208
  self,
689
1209
  instance_id: str,
@@ -747,9 +1267,15 @@ class InterfacesResourceWithRawResponse:
747
1267
  self.attach = to_raw_response_wrapper(
748
1268
  interfaces.attach,
749
1269
  )
1270
+ self.attach_and_poll = to_raw_response_wrapper(
1271
+ interfaces.attach_and_poll,
1272
+ )
750
1273
  self.detach = to_raw_response_wrapper(
751
1274
  interfaces.detach,
752
1275
  )
1276
+ self.detach_and_poll = to_raw_response_wrapper(
1277
+ interfaces.detach_and_poll,
1278
+ )
753
1279
 
754
1280
 
755
1281
  class AsyncInterfacesResourceWithRawResponse:
@@ -762,9 +1288,15 @@ class AsyncInterfacesResourceWithRawResponse:
762
1288
  self.attach = async_to_raw_response_wrapper(
763
1289
  interfaces.attach,
764
1290
  )
1291
+ self.attach_and_poll = async_to_raw_response_wrapper(
1292
+ interfaces.attach_and_poll,
1293
+ )
765
1294
  self.detach = async_to_raw_response_wrapper(
766
1295
  interfaces.detach,
767
1296
  )
1297
+ self.detach_and_poll = async_to_raw_response_wrapper(
1298
+ interfaces.detach_and_poll,
1299
+ )
768
1300
 
769
1301
 
770
1302
  class InterfacesResourceWithStreamingResponse:
@@ -777,9 +1309,15 @@ class InterfacesResourceWithStreamingResponse:
777
1309
  self.attach = to_streamed_response_wrapper(
778
1310
  interfaces.attach,
779
1311
  )
1312
+ self.attach_and_poll = to_streamed_response_wrapper(
1313
+ interfaces.attach_and_poll,
1314
+ )
780
1315
  self.detach = to_streamed_response_wrapper(
781
1316
  interfaces.detach,
782
1317
  )
1318
+ self.detach_and_poll = to_streamed_response_wrapper(
1319
+ interfaces.detach_and_poll,
1320
+ )
783
1321
 
784
1322
 
785
1323
  class AsyncInterfacesResourceWithStreamingResponse:
@@ -792,6 +1330,12 @@ class AsyncInterfacesResourceWithStreamingResponse:
792
1330
  self.attach = async_to_streamed_response_wrapper(
793
1331
  interfaces.attach,
794
1332
  )
1333
+ self.attach_and_poll = async_to_streamed_response_wrapper(
1334
+ interfaces.attach_and_poll,
1335
+ )
795
1336
  self.detach = async_to_streamed_response_wrapper(
796
1337
  interfaces.detach,
797
1338
  )
1339
+ self.detach_and_poll = async_to_streamed_response_wrapper(
1340
+ interfaces.detach_and_poll,
1341
+ )
@@ -0,0 +1,47 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .k8s import (
4
+ K8sResource,
5
+ AsyncK8sResource,
6
+ K8sResourceWithRawResponse,
7
+ AsyncK8sResourceWithRawResponse,
8
+ K8sResourceWithStreamingResponse,
9
+ AsyncK8sResourceWithStreamingResponse,
10
+ )
11
+ from .flavors import (
12
+ FlavorsResource,
13
+ AsyncFlavorsResource,
14
+ FlavorsResourceWithRawResponse,
15
+ AsyncFlavorsResourceWithRawResponse,
16
+ FlavorsResourceWithStreamingResponse,
17
+ AsyncFlavorsResourceWithStreamingResponse,
18
+ )
19
+ from .clusters import (
20
+ ClustersResource,
21
+ AsyncClustersResource,
22
+ ClustersResourceWithRawResponse,
23
+ AsyncClustersResourceWithRawResponse,
24
+ ClustersResourceWithStreamingResponse,
25
+ AsyncClustersResourceWithStreamingResponse,
26
+ )
27
+
28
+ __all__ = [
29
+ "FlavorsResource",
30
+ "AsyncFlavorsResource",
31
+ "FlavorsResourceWithRawResponse",
32
+ "AsyncFlavorsResourceWithRawResponse",
33
+ "FlavorsResourceWithStreamingResponse",
34
+ "AsyncFlavorsResourceWithStreamingResponse",
35
+ "ClustersResource",
36
+ "AsyncClustersResource",
37
+ "ClustersResourceWithRawResponse",
38
+ "AsyncClustersResourceWithRawResponse",
39
+ "ClustersResourceWithStreamingResponse",
40
+ "AsyncClustersResourceWithStreamingResponse",
41
+ "K8sResource",
42
+ "AsyncK8sResource",
43
+ "K8sResourceWithRawResponse",
44
+ "AsyncK8sResourceWithRawResponse",
45
+ "K8sResourceWithStreamingResponse",
46
+ "AsyncK8sResourceWithStreamingResponse",
47
+ ]