gcore 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of gcore might be problematic. Click here for more details.

Files changed (437) hide show
  1. gcore/__init__.py +89 -0
  2. gcore/_base_client.py +1943 -0
  3. gcore/_client.py +493 -0
  4. gcore/_compat.py +219 -0
  5. gcore/_constants.py +16 -0
  6. gcore/_exceptions.py +108 -0
  7. gcore/_files.py +123 -0
  8. gcore/_models.py +803 -0
  9. gcore/_qs.py +150 -0
  10. gcore/_resource.py +43 -0
  11. gcore/_response.py +830 -0
  12. gcore/_streaming.py +333 -0
  13. gcore/_types.py +217 -0
  14. gcore/_utils/__init__.py +57 -0
  15. gcore/_utils/_logs.py +25 -0
  16. gcore/_utils/_proxy.py +65 -0
  17. gcore/_utils/_reflection.py +42 -0
  18. gcore/_utils/_resources_proxy.py +24 -0
  19. gcore/_utils/_streams.py +12 -0
  20. gcore/_utils/_sync.py +86 -0
  21. gcore/_utils/_transform.py +447 -0
  22. gcore/_utils/_typing.py +151 -0
  23. gcore/_utils/_utils.py +422 -0
  24. gcore/_version.py +4 -0
  25. gcore/lib/.keep +4 -0
  26. gcore/lib/polling.py +19 -0
  27. gcore/pagination.py +70 -0
  28. gcore/py.typed +0 -0
  29. gcore/resources/__init__.py +33 -0
  30. gcore/resources/cloud/__init__.py +327 -0
  31. gcore/resources/cloud/baremetal/__init__.py +61 -0
  32. gcore/resources/cloud/baremetal/baremetal.py +166 -0
  33. gcore/resources/cloud/baremetal/flavors.py +371 -0
  34. gcore/resources/cloud/baremetal/images.py +238 -0
  35. gcore/resources/cloud/baremetal/servers.py +1042 -0
  36. gcore/resources/cloud/billing_reservations.py +386 -0
  37. gcore/resources/cloud/cloud.py +774 -0
  38. gcore/resources/cloud/file_shares/__init__.py +33 -0
  39. gcore/resources/cloud/file_shares/access_rules.py +434 -0
  40. gcore/resources/cloud/file_shares/file_shares.py +994 -0
  41. gcore/resources/cloud/floating_ips.py +765 -0
  42. gcore/resources/cloud/gpu_baremetal_clusters/__init__.py +75 -0
  43. gcore/resources/cloud/gpu_baremetal_clusters/flavors.py +211 -0
  44. gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +1493 -0
  45. gcore/resources/cloud/gpu_baremetal_clusters/images.py +785 -0
  46. gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py +175 -0
  47. gcore/resources/cloud/gpu_baremetal_clusters/servers.py +1178 -0
  48. gcore/resources/cloud/inference/__init__.py +89 -0
  49. gcore/resources/cloud/inference/deployments/__init__.py +33 -0
  50. gcore/resources/cloud/inference/deployments/deployments.py +1493 -0
  51. gcore/resources/cloud/inference/deployments/logs.py +235 -0
  52. gcore/resources/cloud/inference/flavors.py +280 -0
  53. gcore/resources/cloud/inference/inference.py +295 -0
  54. gcore/resources/cloud/inference/models.py +289 -0
  55. gcore/resources/cloud/inference/registry_credentials.py +649 -0
  56. gcore/resources/cloud/inference/secrets.py +629 -0
  57. gcore/resources/cloud/instances/__init__.py +75 -0
  58. gcore/resources/cloud/instances/flavors.py +449 -0
  59. gcore/resources/cloud/instances/images.py +1297 -0
  60. gcore/resources/cloud/instances/instances.py +2821 -0
  61. gcore/resources/cloud/instances/interfaces.py +797 -0
  62. gcore/resources/cloud/instances/metrics.py +217 -0
  63. gcore/resources/cloud/ip_ranges.py +135 -0
  64. gcore/resources/cloud/load_balancers/__init__.py +103 -0
  65. gcore/resources/cloud/load_balancers/flavors.py +193 -0
  66. gcore/resources/cloud/load_balancers/l7_policies/__init__.py +33 -0
  67. gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +1020 -0
  68. gcore/resources/cloud/load_balancers/l7_policies/rules.py +1036 -0
  69. gcore/resources/cloud/load_balancers/listeners.py +1089 -0
  70. gcore/resources/cloud/load_balancers/load_balancers.py +1583 -0
  71. gcore/resources/cloud/load_balancers/metrics.py +205 -0
  72. gcore/resources/cloud/load_balancers/pools/__init__.py +47 -0
  73. gcore/resources/cloud/load_balancers/pools/health_monitors.py +352 -0
  74. gcore/resources/cloud/load_balancers/pools/members.py +353 -0
  75. gcore/resources/cloud/load_balancers/pools/pools.py +1190 -0
  76. gcore/resources/cloud/load_balancers/statuses.py +260 -0
  77. gcore/resources/cloud/networks/__init__.py +47 -0
  78. gcore/resources/cloud/networks/networks.py +771 -0
  79. gcore/resources/cloud/networks/routers.py +875 -0
  80. gcore/resources/cloud/networks/subnets.py +865 -0
  81. gcore/resources/cloud/placement_groups.py +465 -0
  82. gcore/resources/cloud/projects.py +608 -0
  83. gcore/resources/cloud/quotas/__init__.py +33 -0
  84. gcore/resources/cloud/quotas/quotas.py +335 -0
  85. gcore/resources/cloud/quotas/requests.py +482 -0
  86. gcore/resources/cloud/regions.py +328 -0
  87. gcore/resources/cloud/registries/__init__.py +75 -0
  88. gcore/resources/cloud/registries/artifacts.py +277 -0
  89. gcore/resources/cloud/registries/registries.py +688 -0
  90. gcore/resources/cloud/registries/repositories.py +265 -0
  91. gcore/resources/cloud/registries/tags.py +190 -0
  92. gcore/resources/cloud/registries/users.py +701 -0
  93. gcore/resources/cloud/reserved_fixed_ips/__init__.py +33 -0
  94. gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +965 -0
  95. gcore/resources/cloud/reserved_fixed_ips/vip.py +577 -0
  96. gcore/resources/cloud/secrets.py +797 -0
  97. gcore/resources/cloud/security_groups/__init__.py +33 -0
  98. gcore/resources/cloud/security_groups/rules.py +626 -0
  99. gcore/resources/cloud/security_groups/security_groups.py +863 -0
  100. gcore/resources/cloud/ssh_keys.py +635 -0
  101. gcore/resources/cloud/tasks.py +700 -0
  102. gcore/resources/cloud/users/__init__.py +33 -0
  103. gcore/resources/cloud/users/role_assignments.py +533 -0
  104. gcore/resources/cloud/users/users.py +102 -0
  105. gcore/resources/cloud/volumes.py +1710 -0
  106. gcore/resources/waap/__init__.py +33 -0
  107. gcore/resources/waap/domains/__init__.py +33 -0
  108. gcore/resources/waap/domains/domains.py +515 -0
  109. gcore/resources/waap/domains/settings.py +271 -0
  110. gcore/resources/waap/waap.py +102 -0
  111. gcore/types/__init__.py +3 -0
  112. gcore/types/cloud/__init__.py +199 -0
  113. gcore/types/cloud/allowed_address_pairs.py +15 -0
  114. gcore/types/cloud/aws_iam_data.py +13 -0
  115. gcore/types/cloud/aws_iam_data_param.py +15 -0
  116. gcore/types/cloud/baremetal/__init__.py +13 -0
  117. gcore/types/cloud/baremetal/baremetal_fixed_address.py +30 -0
  118. gcore/types/cloud/baremetal/baremetal_floating_address.py +15 -0
  119. gcore/types/cloud/baremetal/baremetal_server.py +178 -0
  120. gcore/types/cloud/baremetal/flavor_list_params.py +35 -0
  121. gcore/types/cloud/baremetal/flavor_list_suitable_params.py +22 -0
  122. gcore/types/cloud/baremetal/image_list_params.py +33 -0
  123. gcore/types/cloud/baremetal/server_create_params.py +370 -0
  124. gcore/types/cloud/baremetal/server_list_params.py +114 -0
  125. gcore/types/cloud/baremetal/server_rebuild_params.py +23 -0
  126. gcore/types/cloud/baremetal_flavor.py +58 -0
  127. gcore/types/cloud/baremetal_flavor_list.py +16 -0
  128. gcore/types/cloud/billing_reservation.py +153 -0
  129. gcore/types/cloud/billing_reservation_list_params.py +59 -0
  130. gcore/types/cloud/blackhole_port.py +66 -0
  131. gcore/types/cloud/capacity.py +13 -0
  132. gcore/types/cloud/console.py +18 -0
  133. gcore/types/cloud/container_probe.py +36 -0
  134. gcore/types/cloud/container_probe_config.py +16 -0
  135. gcore/types/cloud/container_probe_config_create_param.py +18 -0
  136. gcore/types/cloud/container_probe_create_param.py +38 -0
  137. gcore/types/cloud/container_probe_exec.py +12 -0
  138. gcore/types/cloud/container_probe_exec_create_param.py +13 -0
  139. gcore/types/cloud/container_probe_http_get.py +26 -0
  140. gcore/types/cloud/container_probe_http_get_create_param.py +25 -0
  141. gcore/types/cloud/container_probe_tcp_socket.py +10 -0
  142. gcore/types/cloud/container_probe_tcp_socket_create_param.py +12 -0
  143. gcore/types/cloud/container_scale.py +25 -0
  144. gcore/types/cloud/container_scale_trigger_rate.py +13 -0
  145. gcore/types/cloud/container_scale_trigger_sqs.py +33 -0
  146. gcore/types/cloud/container_scale_trigger_threshold.py +10 -0
  147. gcore/types/cloud/container_scale_triggers.py +36 -0
  148. gcore/types/cloud/ddos_profile.py +33 -0
  149. gcore/types/cloud/ddos_profile_field.py +31 -0
  150. gcore/types/cloud/ddos_profile_option_list.py +15 -0
  151. gcore/types/cloud/ddos_profile_status.py +13 -0
  152. gcore/types/cloud/ddos_profile_template.py +18 -0
  153. gcore/types/cloud/ddos_profile_template_field.py +23 -0
  154. gcore/types/cloud/deploy_status.py +13 -0
  155. gcore/types/cloud/file_share.py +111 -0
  156. gcore/types/cloud/file_share_create_params.py +104 -0
  157. gcore/types/cloud/file_share_list_params.py +24 -0
  158. gcore/types/cloud/file_share_resize_params.py +18 -0
  159. gcore/types/cloud/file_share_update_params.py +18 -0
  160. gcore/types/cloud/file_shares/__init__.py +7 -0
  161. gcore/types/cloud/file_shares/access_rule.py +21 -0
  162. gcore/types/cloud/file_shares/access_rule_create_params.py +21 -0
  163. gcore/types/cloud/file_shares/access_rule_list.py +16 -0
  164. gcore/types/cloud/fixed_address.py +38 -0
  165. gcore/types/cloud/fixed_address_short.py +24 -0
  166. gcore/types/cloud/flavor_hardware_description.py +27 -0
  167. gcore/types/cloud/floating_address.py +15 -0
  168. gcore/types/cloud/floating_ip.py +77 -0
  169. gcore/types/cloud/floating_ip_assign_params.py +20 -0
  170. gcore/types/cloud/floating_ip_create_params.py +40 -0
  171. gcore/types/cloud/floating_ip_detailed.py +222 -0
  172. gcore/types/cloud/floating_ip_list_params.py +35 -0
  173. gcore/types/cloud/floating_ip_status.py +7 -0
  174. gcore/types/cloud/gpu_baremetal_cluster.py +116 -0
  175. gcore/types/cloud/gpu_baremetal_cluster_create_params.py +155 -0
  176. gcore/types/cloud/gpu_baremetal_cluster_delete_params.py +28 -0
  177. gcore/types/cloud/gpu_baremetal_cluster_list_params.py +19 -0
  178. gcore/types/cloud/gpu_baremetal_cluster_rebuild_params.py +26 -0
  179. gcore/types/cloud/gpu_baremetal_cluster_resize_params.py +16 -0
  180. gcore/types/cloud/gpu_baremetal_cluster_server.py +200 -0
  181. gcore/types/cloud/gpu_baremetal_cluster_server_list.py +16 -0
  182. gcore/types/cloud/gpu_baremetal_clusters/__init__.py +9 -0
  183. gcore/types/cloud/gpu_baremetal_clusters/flavor_list_params.py +21 -0
  184. gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py +58 -0
  185. gcore/types/cloud/gpu_baremetal_clusters/server_attach_interface_params.py +253 -0
  186. gcore/types/cloud/gpu_baremetal_clusters/server_delete_params.py +21 -0
  187. gcore/types/cloud/gpu_baremetal_clusters/server_detach_interface_params.py +19 -0
  188. gcore/types/cloud/gpu_baremetal_flavor.py +133 -0
  189. gcore/types/cloud/gpu_baremetal_flavor_list.py +16 -0
  190. gcore/types/cloud/gpu_image.py +70 -0
  191. gcore/types/cloud/gpu_image_list.py +16 -0
  192. gcore/types/cloud/health_monitor.py +48 -0
  193. gcore/types/cloud/health_monitor_status.py +22 -0
  194. gcore/types/cloud/http_method.py +7 -0
  195. gcore/types/cloud/image.py +100 -0
  196. gcore/types/cloud/image_list.py +16 -0
  197. gcore/types/cloud/inference/__init__.py +25 -0
  198. gcore/types/cloud/inference/container.py +26 -0
  199. gcore/types/cloud/inference/deployment_create_params.py +222 -0
  200. gcore/types/cloud/inference/deployment_list_params.py +21 -0
  201. gcore/types/cloud/inference/deployment_update_params.py +215 -0
  202. gcore/types/cloud/inference/deployments/__init__.py +5 -0
  203. gcore/types/cloud/inference/deployments/log_list_params.py +28 -0
  204. gcore/types/cloud/inference/flavor_list_params.py +18 -0
  205. gcore/types/cloud/inference/inference.py +95 -0
  206. gcore/types/cloud/inference/inference_apikey_secret.py +15 -0
  207. gcore/types/cloud/inference/inference_flavor.py +34 -0
  208. gcore/types/cloud/inference/inference_log.py +21 -0
  209. gcore/types/cloud/inference/inference_registry_credential.py +19 -0
  210. gcore/types/cloud/inference/inference_registry_credential_full.py +22 -0
  211. gcore/types/cloud/inference/inference_secret.py +17 -0
  212. gcore/types/cloud/inference/mlcatalog_model_card.py +65 -0
  213. gcore/types/cloud/inference/mlcatalog_order_by_choices.py +7 -0
  214. gcore/types/cloud/inference/model_list_params.py +23 -0
  215. gcore/types/cloud/inference/registry_credential_create_params.py +24 -0
  216. gcore/types/cloud/inference/registry_credential_list_params.py +21 -0
  217. gcore/types/cloud/inference/registry_credential_replace_params.py +21 -0
  218. gcore/types/cloud/inference/secret_create_params.py +23 -0
  219. gcore/types/cloud/inference/secret_list_params.py +21 -0
  220. gcore/types/cloud/inference/secret_replace_params.py +20 -0
  221. gcore/types/cloud/inference_probes.py +19 -0
  222. gcore/types/cloud/ingress_opts_out.py +16 -0
  223. gcore/types/cloud/ingress_opts_param.py +18 -0
  224. gcore/types/cloud/instance.py +296 -0
  225. gcore/types/cloud/instance_action_params.py +32 -0
  226. gcore/types/cloud/instance_add_to_placement_group_params.py +16 -0
  227. gcore/types/cloud/instance_assign_security_group_params.py +28 -0
  228. gcore/types/cloud/instance_create_params.py +622 -0
  229. gcore/types/cloud/instance_delete_params.py +33 -0
  230. gcore/types/cloud/instance_get_console_params.py +16 -0
  231. gcore/types/cloud/instance_interface.py +40 -0
  232. gcore/types/cloud/instance_isolation.py +12 -0
  233. gcore/types/cloud/instance_list.py +16 -0
  234. gcore/types/cloud/instance_list_params.py +146 -0
  235. gcore/types/cloud/instance_metrics_time_unit.py +7 -0
  236. gcore/types/cloud/instance_resize_params.py +16 -0
  237. gcore/types/cloud/instance_unassign_security_group_params.py +28 -0
  238. gcore/types/cloud/instance_update_params.py +18 -0
  239. gcore/types/cloud/instances/__init__.py +19 -0
  240. gcore/types/cloud/instances/flavor_list_for_resize_params.py +16 -0
  241. gcore/types/cloud/instances/flavor_list_params.py +25 -0
  242. gcore/types/cloud/instances/flavor_list_suitable_params.py +56 -0
  243. gcore/types/cloud/instances/image_create_from_volume_params.py +53 -0
  244. gcore/types/cloud/instances/image_get_params.py +16 -0
  245. gcore/types/cloud/instances/image_list_params.py +33 -0
  246. gcore/types/cloud/instances/image_update_params.py +43 -0
  247. gcore/types/cloud/instances/image_upload_params.py +62 -0
  248. gcore/types/cloud/instances/instance_flavor.py +49 -0
  249. gcore/types/cloud/instances/instance_flavor_list.py +16 -0
  250. gcore/types/cloud/instances/interface_attach_params.py +253 -0
  251. gcore/types/cloud/instances/interface_detach_params.py +19 -0
  252. gcore/types/cloud/instances/metric_list_params.py +23 -0
  253. gcore/types/cloud/instances/metrics.py +52 -0
  254. gcore/types/cloud/instances/metrics_list.py +16 -0
  255. gcore/types/cloud/interface_ip_family.py +7 -0
  256. gcore/types/cloud/ip_assignment.py +13 -0
  257. gcore/types/cloud/ip_ranges.py +12 -0
  258. gcore/types/cloud/ip_version.py +7 -0
  259. gcore/types/cloud/laas_index_retention_policy.py +12 -0
  260. gcore/types/cloud/laas_index_retention_policy_param.py +13 -0
  261. gcore/types/cloud/lb_algorithm.py +7 -0
  262. gcore/types/cloud/lb_health_monitor_type.py +7 -0
  263. gcore/types/cloud/lb_listener_protocol.py +7 -0
  264. gcore/types/cloud/lb_pool_protocol.py +7 -0
  265. gcore/types/cloud/lb_session_persistence_type.py +7 -0
  266. gcore/types/cloud/listener_status.py +27 -0
  267. gcore/types/cloud/load_balancer.py +144 -0
  268. gcore/types/cloud/load_balancer_create_params.py +327 -0
  269. gcore/types/cloud/load_balancer_failover_params.py +16 -0
  270. gcore/types/cloud/load_balancer_flavor_detail.py +40 -0
  271. gcore/types/cloud/load_balancer_flavor_list.py +16 -0
  272. gcore/types/cloud/load_balancer_get_params.py +19 -0
  273. gcore/types/cloud/load_balancer_instance_role.py +7 -0
  274. gcore/types/cloud/load_balancer_l7_policy.py +86 -0
  275. gcore/types/cloud/load_balancer_l7_policy_list.py +16 -0
  276. gcore/types/cloud/load_balancer_l7_rule.py +72 -0
  277. gcore/types/cloud/load_balancer_l7_rule_list.py +16 -0
  278. gcore/types/cloud/load_balancer_list_params.py +53 -0
  279. gcore/types/cloud/load_balancer_listener_detail.py +97 -0
  280. gcore/types/cloud/load_balancer_listener_list.py +16 -0
  281. gcore/types/cloud/load_balancer_member_connectivity.py +7 -0
  282. gcore/types/cloud/load_balancer_metrics.py +32 -0
  283. gcore/types/cloud/load_balancer_metrics_list.py +16 -0
  284. gcore/types/cloud/load_balancer_operating_status.py +7 -0
  285. gcore/types/cloud/load_balancer_pool.py +87 -0
  286. gcore/types/cloud/load_balancer_pool_list.py +16 -0
  287. gcore/types/cloud/load_balancer_resize_params.py +16 -0
  288. gcore/types/cloud/load_balancer_statistics.py +22 -0
  289. gcore/types/cloud/load_balancer_status.py +38 -0
  290. gcore/types/cloud/load_balancer_status_list.py +16 -0
  291. gcore/types/cloud/load_balancer_update_params.py +43 -0
  292. gcore/types/cloud/load_balancers/__init__.py +15 -0
  293. gcore/types/cloud/load_balancers/flavor_list_params.py +16 -0
  294. gcore/types/cloud/load_balancers/l7_policies/__init__.py +6 -0
  295. gcore/types/cloud/load_balancers/l7_policies/rule_create_params.py +50 -0
  296. gcore/types/cloud/load_balancers/l7_policies/rule_replace_params.py +43 -0
  297. gcore/types/cloud/load_balancers/l7_policy_create_params.py +54 -0
  298. gcore/types/cloud/load_balancers/l7_policy_replace_params.py +51 -0
  299. gcore/types/cloud/load_balancers/listener_create_params.py +72 -0
  300. gcore/types/cloud/load_balancers/listener_get_params.py +16 -0
  301. gcore/types/cloud/load_balancers/listener_list_params.py +19 -0
  302. gcore/types/cloud/load_balancers/listener_update_params.py +55 -0
  303. gcore/types/cloud/load_balancers/metric_list_params.py +21 -0
  304. gcore/types/cloud/load_balancers/pool_create_params.py +141 -0
  305. gcore/types/cloud/load_balancers/pool_list_params.py +25 -0
  306. gcore/types/cloud/load_balancers/pool_update_params.py +139 -0
  307. gcore/types/cloud/load_balancers/pools/__init__.py +6 -0
  308. gcore/types/cloud/load_balancers/pools/health_monitor_create_params.py +49 -0
  309. gcore/types/cloud/load_balancers/pools/member_add_params.py +44 -0
  310. gcore/types/cloud/logging.py +22 -0
  311. gcore/types/cloud/member.py +47 -0
  312. gcore/types/cloud/member_status.py +24 -0
  313. gcore/types/cloud/network.py +79 -0
  314. gcore/types/cloud/network_create_params.py +36 -0
  315. gcore/types/cloud/network_details.py +80 -0
  316. gcore/types/cloud/network_interface.py +78 -0
  317. gcore/types/cloud/network_interface_list.py +16 -0
  318. gcore/types/cloud/network_list_params.py +41 -0
  319. gcore/types/cloud/network_update_params.py +18 -0
  320. gcore/types/cloud/networks/__init__.py +14 -0
  321. gcore/types/cloud/networks/router.py +83 -0
  322. gcore/types/cloud/networks/router_attach_subnet_params.py +24 -0
  323. gcore/types/cloud/networks/router_create_params.py +75 -0
  324. gcore/types/cloud/networks/router_detach_subnet_params.py +16 -0
  325. gcore/types/cloud/networks/router_list.py +16 -0
  326. gcore/types/cloud/networks/router_list_params.py +19 -0
  327. gcore/types/cloud/networks/router_update_params.py +45 -0
  328. gcore/types/cloud/networks/subnet_create_params.py +82 -0
  329. gcore/types/cloud/networks/subnet_list_params.py +58 -0
  330. gcore/types/cloud/networks/subnet_update_params.py +47 -0
  331. gcore/types/cloud/placement_group.py +41 -0
  332. gcore/types/cloud/placement_group_create_params.py +19 -0
  333. gcore/types/cloud/placement_group_list.py +16 -0
  334. gcore/types/cloud/pool_status.py +31 -0
  335. gcore/types/cloud/project.py +47 -0
  336. gcore/types/cloud/project_create_params.py +22 -0
  337. gcore/types/cloud/project_list_params.py +27 -0
  338. gcore/types/cloud/project_replace_params.py +18 -0
  339. gcore/types/cloud/provisioning_status.py +9 -0
  340. gcore/types/cloud/quota_get_all_response.py +340 -0
  341. gcore/types/cloud/quota_get_by_region_response.py +288 -0
  342. gcore/types/cloud/quota_get_global_response.py +51 -0
  343. gcore/types/cloud/quotas/__init__.py +8 -0
  344. gcore/types/cloud/quotas/request_create_params.py +193 -0
  345. gcore/types/cloud/quotas/request_get_response.py +205 -0
  346. gcore/types/cloud/quotas/request_list_params.py +22 -0
  347. gcore/types/cloud/quotas/request_list_response.py +205 -0
  348. gcore/types/cloud/region.py +101 -0
  349. gcore/types/cloud/region_capacity.py +16 -0
  350. gcore/types/cloud/region_capacity_list.py +16 -0
  351. gcore/types/cloud/region_get_params.py +18 -0
  352. gcore/types/cloud/region_list_params.py +31 -0
  353. gcore/types/cloud/registries/__init__.py +14 -0
  354. gcore/types/cloud/registries/registry_artifact.py +35 -0
  355. gcore/types/cloud/registries/registry_artifact_list.py +16 -0
  356. gcore/types/cloud/registries/registry_repository.py +30 -0
  357. gcore/types/cloud/registries/registry_repository_list.py +16 -0
  358. gcore/types/cloud/registries/registry_user.py +28 -0
  359. gcore/types/cloud/registries/registry_user_created.py +31 -0
  360. gcore/types/cloud/registries/registry_user_list.py +16 -0
  361. gcore/types/cloud/registries/user_create_multiple_params.py +36 -0
  362. gcore/types/cloud/registries/user_create_params.py +30 -0
  363. gcore/types/cloud/registries/user_update_params.py +21 -0
  364. gcore/types/cloud/registry.py +33 -0
  365. gcore/types/cloud/registry_create_params.py +24 -0
  366. gcore/types/cloud/registry_list.py +16 -0
  367. gcore/types/cloud/registry_resize_params.py +16 -0
  368. gcore/types/cloud/registry_tag.py +27 -0
  369. gcore/types/cloud/reserved_fixed_ip.py +98 -0
  370. gcore/types/cloud/reserved_fixed_ip_create_params.py +107 -0
  371. gcore/types/cloud/reserved_fixed_ip_list_params.py +47 -0
  372. gcore/types/cloud/reserved_fixed_ips/__init__.py +12 -0
  373. gcore/types/cloud/reserved_fixed_ips/candidate_port.py +26 -0
  374. gcore/types/cloud/reserved_fixed_ips/candidate_port_list.py +16 -0
  375. gcore/types/cloud/reserved_fixed_ips/connected_port.py +26 -0
  376. gcore/types/cloud/reserved_fixed_ips/connected_port_list.py +16 -0
  377. gcore/types/cloud/reserved_fixed_ips/ip_with_subnet.py +17 -0
  378. gcore/types/cloud/reserved_fixed_ips/vip_replace_connected_ports_params.py +17 -0
  379. gcore/types/cloud/reserved_fixed_ips/vip_toggle_params.py +16 -0
  380. gcore/types/cloud/reserved_fixed_ips/vip_update_connected_ports_params.py +17 -0
  381. gcore/types/cloud/route.py +16 -0
  382. gcore/types/cloud/secret.py +64 -0
  383. gcore/types/cloud/secret_create_params.py +66 -0
  384. gcore/types/cloud/secret_list_response.py +16 -0
  385. gcore/types/cloud/secret_upload_tls_certificate_params.py +39 -0
  386. gcore/types/cloud/security_group.py +45 -0
  387. gcore/types/cloud/security_group_copy_params.py +16 -0
  388. gcore/types/cloud/security_group_create_params.py +94 -0
  389. gcore/types/cloud/security_group_list_params.py +30 -0
  390. gcore/types/cloud/security_group_rule.py +83 -0
  391. gcore/types/cloud/security_group_update_params.py +83 -0
  392. gcore/types/cloud/security_groups/__init__.py +6 -0
  393. gcore/types/cloud/security_groups/rule_create_params.py +65 -0
  394. gcore/types/cloud/security_groups/rule_replace_params.py +72 -0
  395. gcore/types/cloud/session_persistence.py +22 -0
  396. gcore/types/cloud/ssh_key.py +39 -0
  397. gcore/types/cloud/ssh_key_create_params.py +31 -0
  398. gcore/types/cloud/ssh_key_created.py +53 -0
  399. gcore/types/cloud/ssh_key_list_params.py +21 -0
  400. gcore/types/cloud/ssh_key_update_params.py +15 -0
  401. gcore/types/cloud/subnet.py +87 -0
  402. gcore/types/cloud/tag.py +16 -0
  403. gcore/types/cloud/tag_update_map_param.py +10 -0
  404. gcore/types/cloud/task.py +191 -0
  405. gcore/types/cloud/task_acknowledge_all_params.py +16 -0
  406. gcore/types/cloud/task_id_list.py +12 -0
  407. gcore/types/cloud/task_list_params.py +104 -0
  408. gcore/types/cloud/users/__init__.py +9 -0
  409. gcore/types/cloud/users/role_assignment.py +33 -0
  410. gcore/types/cloud/users/role_assignment_create_params.py +22 -0
  411. gcore/types/cloud/users/role_assignment_list_params.py +25 -0
  412. gcore/types/cloud/users/role_assignment_update_delete.py +10 -0
  413. gcore/types/cloud/users/role_assignment_update_params.py +22 -0
  414. gcore/types/cloud/volume.py +141 -0
  415. gcore/types/cloud/volume_attach_to_instance_params.py +21 -0
  416. gcore/types/cloud/volume_change_type_params.py +18 -0
  417. gcore/types/cloud/volume_create_params.py +176 -0
  418. gcore/types/cloud/volume_delete_params.py +18 -0
  419. gcore/types/cloud/volume_detach_from_instance_params.py +18 -0
  420. gcore/types/cloud/volume_list_params.py +56 -0
  421. gcore/types/cloud/volume_resize_params.py +18 -0
  422. gcore/types/cloud/volume_update_params.py +18 -0
  423. gcore/types/waap/__init__.py +12 -0
  424. gcore/types/waap/domain_list_params.py +30 -0
  425. gcore/types/waap/domain_update_params.py +12 -0
  426. gcore/types/waap/domains/__init__.py +5 -0
  427. gcore/types/waap/domains/setting_update_params.py +41 -0
  428. gcore/types/waap/waap_api_urls.py +15 -0
  429. gcore/types/waap/waap_detailed_domain.py +37 -0
  430. gcore/types/waap/waap_domain_ddos_settings.py +31 -0
  431. gcore/types/waap/waap_domain_settings.py +15 -0
  432. gcore/types/waap/waap_domain_status.py +7 -0
  433. gcore/types/waap/waap_summary_domain.py +26 -0
  434. gcore-0.1.0.dist-info/METADATA +482 -0
  435. gcore-0.1.0.dist-info/RECORD +437 -0
  436. gcore-0.1.0.dist-info/WHEEL +4 -0
  437. gcore-0.1.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,1042 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import List, Union, Iterable, Optional
6
+ from datetime import datetime
7
+ from typing_extensions import Literal
8
+
9
+ import httpx
10
+
11
+ from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
12
+ from ...._utils import maybe_transform, async_maybe_transform
13
+ from ...._compat import cached_property
14
+ from ...._resource import SyncAPIResource, AsyncAPIResource
15
+ from ...._response import (
16
+ to_raw_response_wrapper,
17
+ to_streamed_response_wrapper,
18
+ async_to_raw_response_wrapper,
19
+ async_to_streamed_response_wrapper,
20
+ )
21
+ from ....pagination import SyncOffsetPage, AsyncOffsetPage
22
+ from ...._base_client import AsyncPaginator, make_request_options
23
+ from ....types.cloud.baremetal import server_list_params, server_create_params, server_rebuild_params
24
+ from ....types.cloud.task_id_list import TaskIDList
25
+ from ....types.cloud.tag_update_map_param import TagUpdateMapParam
26
+ from ....types.cloud.baremetal.baremetal_server import BaremetalServer
27
+
28
+ __all__ = ["ServersResource", "AsyncServersResource"]
29
+
30
+
31
+ class ServersResource(SyncAPIResource):
32
+ @cached_property
33
+ def with_raw_response(self) -> ServersResourceWithRawResponse:
34
+ """
35
+ This property can be used as a prefix for any HTTP method call to return
36
+ the raw response object instead of the parsed content.
37
+
38
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
39
+ """
40
+ return ServersResourceWithRawResponse(self)
41
+
42
+ @cached_property
43
+ def with_streaming_response(self) -> ServersResourceWithStreamingResponse:
44
+ """
45
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
46
+
47
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
48
+ """
49
+ return ServersResourceWithStreamingResponse(self)
50
+
51
+ def create(
52
+ self,
53
+ *,
54
+ project_id: int | None = None,
55
+ region_id: int | None = None,
56
+ flavor: str,
57
+ interfaces: Iterable[server_create_params.Interface],
58
+ app_config: Optional[object] | NotGiven = NOT_GIVEN,
59
+ apptemplate_id: str | NotGiven = NOT_GIVEN,
60
+ ddos_profile: server_create_params.DDOSProfile | NotGiven = NOT_GIVEN,
61
+ image_id: str | NotGiven = NOT_GIVEN,
62
+ name: str | NotGiven = NOT_GIVEN,
63
+ name_template: str | NotGiven = NOT_GIVEN,
64
+ password: str | NotGiven = NOT_GIVEN,
65
+ ssh_key_name: Optional[str] | NotGiven = NOT_GIVEN,
66
+ tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
67
+ user_data: str | NotGiven = NOT_GIVEN,
68
+ username: str | NotGiven = NOT_GIVEN,
69
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
70
+ # The extra values given here take precedence over values defined on the client or passed to this method.
71
+ extra_headers: Headers | None = None,
72
+ extra_query: Query | None = None,
73
+ extra_body: Body | None = None,
74
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
75
+ ) -> TaskIDList:
76
+ """
77
+ For Linux,
78
+
79
+ - Use the `user_data` field to provide a
80
+ <a href=https://cloudinit.readthedocs.io/en/latest/reference/examples.html>cloud-init
81
+ script</a> in base64 to apply configurations to the instance.
82
+ - Specify the `username` and `password` to create a new user.
83
+ - When only `password` is provided, it is set as the password for the default
84
+ user of the image.
85
+ - The `user_data` is ignored when the `password` is specified.
86
+
87
+ For Windows,
88
+
89
+ - Use the `user_data` field to provide a
90
+ <a href=https://cloudbase-init.readthedocs.io/en/latest/userdata.html#cloud-config>cloudbase-init
91
+ script</a> in base64 to create new users on Windows.
92
+ - Use the `password` field to set the password for the 'Admin' user on Windows.
93
+ - The password of the Admin user cannot be updated via `user_data`.
94
+ - The `username` cannot be specified in the request.
95
+
96
+ Args:
97
+ project_id: Project ID
98
+
99
+ region_id: Region ID
100
+
101
+ flavor: The flavor of the instance.
102
+
103
+ interfaces: A list of network interfaces for the server. You can create one or more
104
+ interfaces - private, public, or both.
105
+
106
+ app_config: Parameters for the application template if creating the instance from an
107
+ `apptemplate`.
108
+
109
+ apptemplate_id: Apptemplate ID. Either `image_id` or `apptemplate_id` is required.
110
+
111
+ ddos_profile: Enable advanced DDoS protection for the server
112
+
113
+ image_id: Image ID. Either `image_id` or `apptemplate_id` is required.
114
+
115
+ name: Server name.
116
+
117
+ name_template: If you want server names to be automatically generated based on IP addresses,
118
+ you can provide a name template instead of specifying the name manually. The
119
+ template should include a placeholder that will be replaced during provisioning.
120
+ Supported placeholders are: `{ip_octets}` (last 3 octets of the IP),
121
+ `{two_ip_octets}`, and `{one_ip_octet}`.
122
+
123
+ password: For Linux instances, 'username' and 'password' are used to create a new user.
124
+ When only 'password' is provided, it is set as the password for the default user
125
+ of the image. For Windows instances, 'username' cannot be specified. Use the
126
+ 'password' field to set the password for the 'Admin' user on Windows. Use the
127
+ 'user_data' field to provide a script to create new users on Windows. The
128
+ password of the Admin user cannot be updated via 'user_data'.
129
+
130
+ ssh_key_name: Specifies the name of the SSH keypair, created via the
131
+ <a href="#operation/SSHKeyCollectionViewSet.post">/v1/ssh_keys endpoint</a>.
132
+
133
+ tags: Key-value tags to associate with the resource. A tag is a key-value pair that
134
+ can be associated with a resource, enabling efficient filtering and grouping for
135
+ better organization and management. Some tags are read-only and cannot be
136
+ modified by the user. Tags are also integrated with cost reports, allowing cost
137
+ data to be filtered based on tag keys or values.
138
+
139
+ user_data: String in base64 format. For Linux instances, 'user_data' is ignored when
140
+ 'password' field is provided. For Windows instances, Admin user password is set
141
+ by 'password' field and cannot be updated via 'user_data'. Examples of the
142
+ user_data: https://cloudinit.readthedocs.io/en/latest/topics/examples.html
143
+
144
+ username: For Linux instances, 'username' and 'password' are used to create a new user.
145
+ For Windows instances, 'username' cannot be specified. Use 'password' field to
146
+ set the password for the 'Admin' user on Windows.
147
+
148
+ extra_headers: Send extra headers
149
+
150
+ extra_query: Add additional query parameters to the request
151
+
152
+ extra_body: Add additional JSON properties to the request
153
+
154
+ timeout: Override the client-level default timeout for this request, in seconds
155
+ """
156
+ if project_id is None:
157
+ project_id = self._client._get_cloud_project_id_path_param()
158
+ if region_id is None:
159
+ region_id = self._client._get_cloud_region_id_path_param()
160
+ return self._post(
161
+ f"/cloud/v1/bminstances/{project_id}/{region_id}",
162
+ body=maybe_transform(
163
+ {
164
+ "flavor": flavor,
165
+ "interfaces": interfaces,
166
+ "app_config": app_config,
167
+ "apptemplate_id": apptemplate_id,
168
+ "ddos_profile": ddos_profile,
169
+ "image_id": image_id,
170
+ "name": name,
171
+ "name_template": name_template,
172
+ "password": password,
173
+ "ssh_key_name": ssh_key_name,
174
+ "tags": tags,
175
+ "user_data": user_data,
176
+ "username": username,
177
+ },
178
+ server_create_params.ServerCreateParams,
179
+ ),
180
+ options=make_request_options(
181
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
182
+ ),
183
+ cast_to=TaskIDList,
184
+ )
185
+
186
+ def list(
187
+ self,
188
+ *,
189
+ project_id: int | None = None,
190
+ region_id: int | None = None,
191
+ changes_before: Union[str, datetime] | NotGiven = NOT_GIVEN,
192
+ changes_since: Union[str, datetime] | NotGiven = NOT_GIVEN,
193
+ flavor_id: str | NotGiven = NOT_GIVEN,
194
+ flavor_prefix: str | NotGiven = NOT_GIVEN,
195
+ include_k8s: bool | NotGiven = NOT_GIVEN,
196
+ ip: str | NotGiven = NOT_GIVEN,
197
+ limit: int | NotGiven = NOT_GIVEN,
198
+ name: str | NotGiven = NOT_GIVEN,
199
+ offset: int | NotGiven = NOT_GIVEN,
200
+ only_isolated: bool | NotGiven = NOT_GIVEN,
201
+ only_with_fixed_external_ip: bool | NotGiven = NOT_GIVEN,
202
+ order_by: Literal["created.asc", "created.desc", "name.asc", "name.desc", "status.asc", "status.desc"]
203
+ | NotGiven = NOT_GIVEN,
204
+ profile_name: str | NotGiven = NOT_GIVEN,
205
+ protection_status: Literal["Active", "Queued", "Error"] | NotGiven = NOT_GIVEN,
206
+ status: Literal[
207
+ "ACTIVE", "BUILD", "ERROR", "HARD_REBOOT", "REBOOT", "REBUILD", "RESCUE", "SHUTOFF", "SUSPENDED"
208
+ ]
209
+ | NotGiven = NOT_GIVEN,
210
+ tag_key_value: str | NotGiven = NOT_GIVEN,
211
+ tag_value: List[str] | NotGiven = NOT_GIVEN,
212
+ type_ddos_profile: Literal["basic", "advanced"] | NotGiven = NOT_GIVEN,
213
+ uuid: str | NotGiven = NOT_GIVEN,
214
+ with_ddos: bool | NotGiven = NOT_GIVEN,
215
+ with_interfaces_name: bool | NotGiven = NOT_GIVEN,
216
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
217
+ # The extra values given here take precedence over values defined on the client or passed to this method.
218
+ extra_headers: Headers | None = None,
219
+ extra_query: Query | None = None,
220
+ extra_body: Body | None = None,
221
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
222
+ ) -> SyncOffsetPage[BaremetalServer]:
223
+ """
224
+ List bare metal servers
225
+
226
+ Args:
227
+ project_id: Project ID
228
+
229
+ region_id: Region ID
230
+
231
+ changes_before: Filters the instances by a date and time stamp when the instances last changed.
232
+
233
+ changes_since: Filters the instances by a date and time stamp when the instances last changed
234
+ status.
235
+
236
+ flavor_id: Filter out instances by flavor_id. Flavor id must match exactly.
237
+
238
+ flavor_prefix: Filter out instances by flavor_prefix.
239
+
240
+ include_k8s: Include managed k8s worker nodes
241
+
242
+ ip: An IPv4 address to filter results by. Note: partial matches are allowed. For
243
+ example, searching for 192.168.0.1 will return 192.168.0.1, 192.168.0.10,
244
+ 192.168.0.110, and so on.
245
+
246
+ limit: Optional. Limit the number of returned items
247
+
248
+ name: Filter instances by name. You can provide a full or partial name, instances with
249
+ matching names will be returned. For example, entering 'test' will return all
250
+ instances that contain 'test' in their name.
251
+
252
+ offset: Optional. Offset value is used to exclude the first set of records from the
253
+ result
254
+
255
+ only_isolated: Include only isolated instances
256
+
257
+ only_with_fixed_external_ip: Return bare metals only with external fixed IP addresses.
258
+
259
+ order_by: Order by field and direction.
260
+
261
+ profile_name: Filter result by ddos protection profile name. Effective only with with_ddos set
262
+ to true.
263
+
264
+ protection_status: Filter result by DDoS protection_status. Effective only with with_ddos set to
265
+ true. (Active, Queued or Error)
266
+
267
+ status: Filters instances by a server status, as a string.
268
+
269
+ tag_key_value: Optional. Filter by tag key-value pairs. curl -G --data-urlencode
270
+ "tag_key_value={"key": "value"}" --url
271
+ "https://example.com/cloud/v1/resource/1/1"
272
+
273
+ tag_value: Optional. Filter by tag values. ?tag_value=value1&tag_value=value2
274
+
275
+ type_ddos_profile: Return bare metals either only with advanced or only basic DDoS protection.
276
+ Effective only with with_ddos set to true. (advanced or basic)
277
+
278
+ uuid: Filter the server list result by the UUID of the server. Allowed UUID part
279
+
280
+ with_ddos: Include DDoS profile information for bare-metal servers in the response when set
281
+ to `true`. Otherwise, the `ddos_profile` field in the response is `null` by
282
+ default.
283
+
284
+ with_interfaces_name: Include `interface_name` in the addresses
285
+
286
+ extra_headers: Send extra headers
287
+
288
+ extra_query: Add additional query parameters to the request
289
+
290
+ extra_body: Add additional JSON properties to the request
291
+
292
+ timeout: Override the client-level default timeout for this request, in seconds
293
+ """
294
+ if project_id is None:
295
+ project_id = self._client._get_cloud_project_id_path_param()
296
+ if region_id is None:
297
+ region_id = self._client._get_cloud_region_id_path_param()
298
+ return self._get_api_list(
299
+ f"/cloud/v1/bminstances/{project_id}/{region_id}",
300
+ page=SyncOffsetPage[BaremetalServer],
301
+ options=make_request_options(
302
+ extra_headers=extra_headers,
303
+ extra_query=extra_query,
304
+ extra_body=extra_body,
305
+ timeout=timeout,
306
+ query=maybe_transform(
307
+ {
308
+ "changes_before": changes_before,
309
+ "changes_since": changes_since,
310
+ "flavor_id": flavor_id,
311
+ "flavor_prefix": flavor_prefix,
312
+ "include_k8s": include_k8s,
313
+ "ip": ip,
314
+ "limit": limit,
315
+ "name": name,
316
+ "offset": offset,
317
+ "only_isolated": only_isolated,
318
+ "only_with_fixed_external_ip": only_with_fixed_external_ip,
319
+ "order_by": order_by,
320
+ "profile_name": profile_name,
321
+ "protection_status": protection_status,
322
+ "status": status,
323
+ "tag_key_value": tag_key_value,
324
+ "tag_value": tag_value,
325
+ "type_ddos_profile": type_ddos_profile,
326
+ "uuid": uuid,
327
+ "with_ddos": with_ddos,
328
+ "with_interfaces_name": with_interfaces_name,
329
+ },
330
+ server_list_params.ServerListParams,
331
+ ),
332
+ ),
333
+ model=BaremetalServer,
334
+ )
335
+
336
+ def rebuild(
337
+ self,
338
+ server_id: str,
339
+ *,
340
+ project_id: int | None = None,
341
+ region_id: int | None = None,
342
+ image_id: str | NotGiven = NOT_GIVEN,
343
+ user_data: str | NotGiven = NOT_GIVEN,
344
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
345
+ # The extra values given here take precedence over values defined on the client or passed to this method.
346
+ extra_headers: Headers | None = None,
347
+ extra_query: Query | None = None,
348
+ extra_body: Body | None = None,
349
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
350
+ ) -> TaskIDList:
351
+ """
352
+ Rebuild bare metal server
353
+
354
+ Args:
355
+ image_id: Image ID
356
+
357
+ user_data: String in base64 format. Must not be passed together with 'username' or
358
+ 'password'. Examples of the user_data:
359
+ https://cloudinit.readthedocs.io/en/latest/topics/examples.html
360
+
361
+ extra_headers: Send extra headers
362
+
363
+ extra_query: Add additional query parameters to the request
364
+
365
+ extra_body: Add additional JSON properties to the request
366
+
367
+ timeout: Override the client-level default timeout for this request, in seconds
368
+ """
369
+ if project_id is None:
370
+ project_id = self._client._get_cloud_project_id_path_param()
371
+ if region_id is None:
372
+ region_id = self._client._get_cloud_region_id_path_param()
373
+ if not server_id:
374
+ raise ValueError(f"Expected a non-empty value for `server_id` but received {server_id!r}")
375
+ return self._post(
376
+ f"/cloud/v1/bminstances/{project_id}/{region_id}/{server_id}/rebuild",
377
+ body=maybe_transform(
378
+ {
379
+ "image_id": image_id,
380
+ "user_data": user_data,
381
+ },
382
+ server_rebuild_params.ServerRebuildParams,
383
+ ),
384
+ options=make_request_options(
385
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
386
+ ),
387
+ cast_to=TaskIDList,
388
+ )
389
+
390
+ def create_and_poll(
391
+ self,
392
+ *,
393
+ project_id: int | None = None,
394
+ region_id: int | None = None,
395
+ flavor: str,
396
+ interfaces: Iterable[server_create_params.Interface],
397
+ app_config: Optional[object] | NotGiven = NOT_GIVEN,
398
+ apptemplate_id: str | NotGiven = NOT_GIVEN,
399
+ ddos_profile: server_create_params.DDOSProfile | NotGiven = NOT_GIVEN,
400
+ image_id: str | NotGiven = NOT_GIVEN,
401
+ name: str | NotGiven = NOT_GIVEN,
402
+ name_template: str | NotGiven = NOT_GIVEN,
403
+ password: str | NotGiven = NOT_GIVEN,
404
+ ssh_key_name: Optional[str] | NotGiven = NOT_GIVEN,
405
+ tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
406
+ user_data: str | NotGiven = NOT_GIVEN,
407
+ username: str | NotGiven = NOT_GIVEN,
408
+ polling_interval_seconds: int | NotGiven = NOT_GIVEN,
409
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
410
+ # The extra values given here take precedence over values defined on the client or passed to this method.
411
+ extra_headers: Headers | None = None,
412
+ extra_query: Query | None = None,
413
+ extra_body: Body | None = None,
414
+ ) -> BaremetalServer:
415
+ """
416
+ Create a bare metal server and wait for it to be ready.
417
+ """
418
+ response = self.create(
419
+ project_id=project_id,
420
+ region_id=region_id,
421
+ flavor=flavor,
422
+ interfaces=interfaces,
423
+ app_config=app_config,
424
+ apptemplate_id=apptemplate_id,
425
+ ddos_profile=ddos_profile,
426
+ image_id=image_id,
427
+ name=name,
428
+ name_template=name_template,
429
+ password=password,
430
+ ssh_key_name=ssh_key_name,
431
+ tags=tags,
432
+ user_data=user_data,
433
+ username=username,
434
+ extra_headers=extra_headers,
435
+ extra_query=extra_query,
436
+ extra_body=extra_body,
437
+ )
438
+ if not response.tasks or len(response.tasks) != 1:
439
+ raise ValueError(f"Expected exactly one task to be created")
440
+ task = self._client.cloud.tasks.poll(
441
+ response.tasks[0],
442
+ extra_headers=extra_headers,
443
+ polling_interval_seconds=polling_interval_seconds,
444
+ )
445
+ if not task.created_resources or not task.created_resources.instances:
446
+ raise ValueError("No server was created")
447
+ server_id = task.created_resources.instances[0]
448
+ servers = self.list(
449
+ project_id=project_id,
450
+ region_id=region_id,
451
+ uuid=server_id,
452
+ extra_headers=extra_headers,
453
+ extra_query=extra_query,
454
+ extra_body=extra_body,
455
+ )
456
+ if len(servers.results) != 1:
457
+ raise ValueError(f"Server {server_id} not found")
458
+ return servers.results[0]
459
+
460
+ def rebuild_and_poll(
461
+ self,
462
+ server_id: str,
463
+ *,
464
+ project_id: int | None = None,
465
+ region_id: int | None = None,
466
+ image_id: str | NotGiven = NOT_GIVEN,
467
+ user_data: str | NotGiven = NOT_GIVEN,
468
+ polling_interval_seconds: int | NotGiven = NOT_GIVEN,
469
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
470
+ # The extra values given here take precedence over values defined on the client or passed to this method.
471
+ extra_headers: Headers | None = None,
472
+ extra_query: Query | None = None,
473
+ extra_body: Body | None = None,
474
+ ) -> BaremetalServer:
475
+ """
476
+ Rebuild a bare metal server and wait for it to be ready.
477
+ """
478
+ response = self.rebuild(
479
+ server_id=server_id,
480
+ project_id=project_id,
481
+ region_id=region_id,
482
+ image_id=image_id,
483
+ user_data=user_data,
484
+ extra_headers=extra_headers,
485
+ extra_query=extra_query,
486
+ extra_body=extra_body,
487
+ )
488
+ if not response.tasks or len(response.tasks) != 1:
489
+ raise ValueError(f"Expected exactly one task to be created")
490
+ self._client.cloud.tasks.poll(
491
+ response.tasks[0],
492
+ extra_headers=extra_headers,
493
+ polling_interval_seconds=polling_interval_seconds,
494
+ )
495
+ servers = self.list(
496
+ project_id=project_id,
497
+ region_id=region_id,
498
+ uuid=server_id,
499
+ extra_headers=extra_headers,
500
+ extra_query=extra_query,
501
+ extra_body=extra_body,
502
+ )
503
+ if len(servers.results) != 1:
504
+ raise ValueError(f"Server {server_id} not found")
505
+ return servers.results[0]
506
+
507
+
508
+ class AsyncServersResource(AsyncAPIResource):
509
+ @cached_property
510
+ def with_raw_response(self) -> AsyncServersResourceWithRawResponse:
511
+ """
512
+ This property can be used as a prefix for any HTTP method call to return
513
+ the raw response object instead of the parsed content.
514
+
515
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
516
+ """
517
+ return AsyncServersResourceWithRawResponse(self)
518
+
519
+ @cached_property
520
+ def with_streaming_response(self) -> AsyncServersResourceWithStreamingResponse:
521
+ """
522
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
523
+
524
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
525
+ """
526
+ return AsyncServersResourceWithStreamingResponse(self)
527
+
528
+ async def create(
529
+ self,
530
+ *,
531
+ project_id: int | None = None,
532
+ region_id: int | None = None,
533
+ flavor: str,
534
+ interfaces: Iterable[server_create_params.Interface],
535
+ app_config: Optional[object] | NotGiven = NOT_GIVEN,
536
+ apptemplate_id: str | NotGiven = NOT_GIVEN,
537
+ ddos_profile: server_create_params.DDOSProfile | NotGiven = NOT_GIVEN,
538
+ image_id: str | NotGiven = NOT_GIVEN,
539
+ name: str | NotGiven = NOT_GIVEN,
540
+ name_template: str | NotGiven = NOT_GIVEN,
541
+ password: str | NotGiven = NOT_GIVEN,
542
+ ssh_key_name: Optional[str] | NotGiven = NOT_GIVEN,
543
+ tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
544
+ user_data: str | NotGiven = NOT_GIVEN,
545
+ username: str | NotGiven = NOT_GIVEN,
546
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
547
+ # The extra values given here take precedence over values defined on the client or passed to this method.
548
+ extra_headers: Headers | None = None,
549
+ extra_query: Query | None = None,
550
+ extra_body: Body | None = None,
551
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
552
+ ) -> TaskIDList:
553
+ """
554
+ For Linux,
555
+
556
+ - Use the `user_data` field to provide a
557
+ <a href=https://cloudinit.readthedocs.io/en/latest/reference/examples.html>cloud-init
558
+ script</a> in base64 to apply configurations to the instance.
559
+ - Specify the `username` and `password` to create a new user.
560
+ - When only `password` is provided, it is set as the password for the default
561
+ user of the image.
562
+ - The `user_data` is ignored when the `password` is specified.
563
+
564
+ For Windows,
565
+
566
+ - Use the `user_data` field to provide a
567
+ <a href=https://cloudbase-init.readthedocs.io/en/latest/userdata.html#cloud-config>cloudbase-init
568
+ script</a> in base64 to create new users on Windows.
569
+ - Use the `password` field to set the password for the 'Admin' user on Windows.
570
+ - The password of the Admin user cannot be updated via `user_data`.
571
+ - The `username` cannot be specified in the request.
572
+
573
+ Args:
574
+ project_id: Project ID
575
+
576
+ region_id: Region ID
577
+
578
+ flavor: The flavor of the instance.
579
+
580
+ interfaces: A list of network interfaces for the server. You can create one or more
581
+ interfaces - private, public, or both.
582
+
583
+ app_config: Parameters for the application template if creating the instance from an
584
+ `apptemplate`.
585
+
586
+ apptemplate_id: Apptemplate ID. Either `image_id` or `apptemplate_id` is required.
587
+
588
+ ddos_profile: Enable advanced DDoS protection for the server
589
+
590
+ image_id: Image ID. Either `image_id` or `apptemplate_id` is required.
591
+
592
+ name: Server name.
593
+
594
+ name_template: If you want server names to be automatically generated based on IP addresses,
595
+ you can provide a name template instead of specifying the name manually. The
596
+ template should include a placeholder that will be replaced during provisioning.
597
+ Supported placeholders are: `{ip_octets}` (last 3 octets of the IP),
598
+ `{two_ip_octets}`, and `{one_ip_octet}`.
599
+
600
+ password: For Linux instances, 'username' and 'password' are used to create a new user.
601
+ When only 'password' is provided, it is set as the password for the default user
602
+ of the image. For Windows instances, 'username' cannot be specified. Use the
603
+ 'password' field to set the password for the 'Admin' user on Windows. Use the
604
+ 'user_data' field to provide a script to create new users on Windows. The
605
+ password of the Admin user cannot be updated via 'user_data'.
606
+
607
+ ssh_key_name: Specifies the name of the SSH keypair, created via the
608
+ <a href="#operation/SSHKeyCollectionViewSet.post">/v1/ssh_keys endpoint</a>.
609
+
610
+ tags: Key-value tags to associate with the resource. A tag is a key-value pair that
611
+ can be associated with a resource, enabling efficient filtering and grouping for
612
+ better organization and management. Some tags are read-only and cannot be
613
+ modified by the user. Tags are also integrated with cost reports, allowing cost
614
+ data to be filtered based on tag keys or values.
615
+
616
+ user_data: String in base64 format. For Linux instances, 'user_data' is ignored when
617
+ 'password' field is provided. For Windows instances, Admin user password is set
618
+ by 'password' field and cannot be updated via 'user_data'. Examples of the
619
+ user_data: https://cloudinit.readthedocs.io/en/latest/topics/examples.html
620
+
621
+ username: For Linux instances, 'username' and 'password' are used to create a new user.
622
+ For Windows instances, 'username' cannot be specified. Use 'password' field to
623
+ set the password for the 'Admin' user on Windows.
624
+
625
+ extra_headers: Send extra headers
626
+
627
+ extra_query: Add additional query parameters to the request
628
+
629
+ extra_body: Add additional JSON properties to the request
630
+
631
+ timeout: Override the client-level default timeout for this request, in seconds
632
+ """
633
+ if project_id is None:
634
+ project_id = self._client._get_cloud_project_id_path_param()
635
+ if region_id is None:
636
+ region_id = self._client._get_cloud_region_id_path_param()
637
+ return await self._post(
638
+ f"/cloud/v1/bminstances/{project_id}/{region_id}",
639
+ body=await async_maybe_transform(
640
+ {
641
+ "flavor": flavor,
642
+ "interfaces": interfaces,
643
+ "app_config": app_config,
644
+ "apptemplate_id": apptemplate_id,
645
+ "ddos_profile": ddos_profile,
646
+ "image_id": image_id,
647
+ "name": name,
648
+ "name_template": name_template,
649
+ "password": password,
650
+ "ssh_key_name": ssh_key_name,
651
+ "tags": tags,
652
+ "user_data": user_data,
653
+ "username": username,
654
+ },
655
+ server_create_params.ServerCreateParams,
656
+ ),
657
+ options=make_request_options(
658
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
659
+ ),
660
+ cast_to=TaskIDList,
661
+ )
662
+
663
+ def list(
664
+ self,
665
+ *,
666
+ project_id: int | None = None,
667
+ region_id: int | None = None,
668
+ changes_before: Union[str, datetime] | NotGiven = NOT_GIVEN,
669
+ changes_since: Union[str, datetime] | NotGiven = NOT_GIVEN,
670
+ flavor_id: str | NotGiven = NOT_GIVEN,
671
+ flavor_prefix: str | NotGiven = NOT_GIVEN,
672
+ include_k8s: bool | NotGiven = NOT_GIVEN,
673
+ ip: str | NotGiven = NOT_GIVEN,
674
+ limit: int | NotGiven = NOT_GIVEN,
675
+ name: str | NotGiven = NOT_GIVEN,
676
+ offset: int | NotGiven = NOT_GIVEN,
677
+ only_isolated: bool | NotGiven = NOT_GIVEN,
678
+ only_with_fixed_external_ip: bool | NotGiven = NOT_GIVEN,
679
+ order_by: Literal["created.asc", "created.desc", "name.asc", "name.desc", "status.asc", "status.desc"]
680
+ | NotGiven = NOT_GIVEN,
681
+ profile_name: str | NotGiven = NOT_GIVEN,
682
+ protection_status: Literal["Active", "Queued", "Error"] | NotGiven = NOT_GIVEN,
683
+ status: Literal[
684
+ "ACTIVE", "BUILD", "ERROR", "HARD_REBOOT", "REBOOT", "REBUILD", "RESCUE", "SHUTOFF", "SUSPENDED"
685
+ ]
686
+ | NotGiven = NOT_GIVEN,
687
+ tag_key_value: str | NotGiven = NOT_GIVEN,
688
+ tag_value: List[str] | NotGiven = NOT_GIVEN,
689
+ type_ddos_profile: Literal["basic", "advanced"] | NotGiven = NOT_GIVEN,
690
+ uuid: str | NotGiven = NOT_GIVEN,
691
+ with_ddos: bool | NotGiven = NOT_GIVEN,
692
+ with_interfaces_name: bool | NotGiven = NOT_GIVEN,
693
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
694
+ # The extra values given here take precedence over values defined on the client or passed to this method.
695
+ extra_headers: Headers | None = None,
696
+ extra_query: Query | None = None,
697
+ extra_body: Body | None = None,
698
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
699
+ ) -> AsyncPaginator[BaremetalServer, AsyncOffsetPage[BaremetalServer]]:
700
+ """
701
+ List bare metal servers
702
+
703
+ Args:
704
+ project_id: Project ID
705
+
706
+ region_id: Region ID
707
+
708
+ changes_before: Filters the instances by a date and time stamp when the instances last changed.
709
+
710
+ changes_since: Filters the instances by a date and time stamp when the instances last changed
711
+ status.
712
+
713
+ flavor_id: Filter out instances by flavor_id. Flavor id must match exactly.
714
+
715
+ flavor_prefix: Filter out instances by flavor_prefix.
716
+
717
+ include_k8s: Include managed k8s worker nodes
718
+
719
+ ip: An IPv4 address to filter results by. Note: partial matches are allowed. For
720
+ example, searching for 192.168.0.1 will return 192.168.0.1, 192.168.0.10,
721
+ 192.168.0.110, and so on.
722
+
723
+ limit: Optional. Limit the number of returned items
724
+
725
+ name: Filter instances by name. You can provide a full or partial name, instances with
726
+ matching names will be returned. For example, entering 'test' will return all
727
+ instances that contain 'test' in their name.
728
+
729
+ offset: Optional. Offset value is used to exclude the first set of records from the
730
+ result
731
+
732
+ only_isolated: Include only isolated instances
733
+
734
+ only_with_fixed_external_ip: Return bare metals only with external fixed IP addresses.
735
+
736
+ order_by: Order by field and direction.
737
+
738
+ profile_name: Filter result by ddos protection profile name. Effective only with with_ddos set
739
+ to true.
740
+
741
+ protection_status: Filter result by DDoS protection_status. Effective only with with_ddos set to
742
+ true. (Active, Queued or Error)
743
+
744
+ status: Filters instances by a server status, as a string.
745
+
746
+ tag_key_value: Optional. Filter by tag key-value pairs. curl -G --data-urlencode
747
+ "tag_key_value={"key": "value"}" --url
748
+ "https://example.com/cloud/v1/resource/1/1"
749
+
750
+ tag_value: Optional. Filter by tag values. ?tag_value=value1&tag_value=value2
751
+
752
+ type_ddos_profile: Return bare metals either only with advanced or only basic DDoS protection.
753
+ Effective only with with_ddos set to true. (advanced or basic)
754
+
755
+ uuid: Filter the server list result by the UUID of the server. Allowed UUID part
756
+
757
+ with_ddos: Include DDoS profile information for bare-metal servers in the response when set
758
+ to `true`. Otherwise, the `ddos_profile` field in the response is `null` by
759
+ default.
760
+
761
+ with_interfaces_name: Include `interface_name` in the addresses
762
+
763
+ extra_headers: Send extra headers
764
+
765
+ extra_query: Add additional query parameters to the request
766
+
767
+ extra_body: Add additional JSON properties to the request
768
+
769
+ timeout: Override the client-level default timeout for this request, in seconds
770
+ """
771
+ if project_id is None:
772
+ project_id = self._client._get_cloud_project_id_path_param()
773
+ if region_id is None:
774
+ region_id = self._client._get_cloud_region_id_path_param()
775
+ return self._get_api_list(
776
+ f"/cloud/v1/bminstances/{project_id}/{region_id}",
777
+ page=AsyncOffsetPage[BaremetalServer],
778
+ options=make_request_options(
779
+ extra_headers=extra_headers,
780
+ extra_query=extra_query,
781
+ extra_body=extra_body,
782
+ timeout=timeout,
783
+ query=maybe_transform(
784
+ {
785
+ "changes_before": changes_before,
786
+ "changes_since": changes_since,
787
+ "flavor_id": flavor_id,
788
+ "flavor_prefix": flavor_prefix,
789
+ "include_k8s": include_k8s,
790
+ "ip": ip,
791
+ "limit": limit,
792
+ "name": name,
793
+ "offset": offset,
794
+ "only_isolated": only_isolated,
795
+ "only_with_fixed_external_ip": only_with_fixed_external_ip,
796
+ "order_by": order_by,
797
+ "profile_name": profile_name,
798
+ "protection_status": protection_status,
799
+ "status": status,
800
+ "tag_key_value": tag_key_value,
801
+ "tag_value": tag_value,
802
+ "type_ddos_profile": type_ddos_profile,
803
+ "uuid": uuid,
804
+ "with_ddos": with_ddos,
805
+ "with_interfaces_name": with_interfaces_name,
806
+ },
807
+ server_list_params.ServerListParams,
808
+ ),
809
+ ),
810
+ model=BaremetalServer,
811
+ )
812
+
813
+ async def rebuild(
814
+ self,
815
+ server_id: str,
816
+ *,
817
+ project_id: int | None = None,
818
+ region_id: int | None = None,
819
+ image_id: str | NotGiven = NOT_GIVEN,
820
+ user_data: str | NotGiven = NOT_GIVEN,
821
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
822
+ # The extra values given here take precedence over values defined on the client or passed to this method.
823
+ extra_headers: Headers | None = None,
824
+ extra_query: Query | None = None,
825
+ extra_body: Body | None = None,
826
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
827
+ ) -> TaskIDList:
828
+ """
829
+ Rebuild bare metal server
830
+
831
+ Args:
832
+ image_id: Image ID
833
+
834
+ user_data: String in base64 format. Must not be passed together with 'username' or
835
+ 'password'. Examples of the user_data:
836
+ https://cloudinit.readthedocs.io/en/latest/topics/examples.html
837
+
838
+ extra_headers: Send extra headers
839
+
840
+ extra_query: Add additional query parameters to the request
841
+
842
+ extra_body: Add additional JSON properties to the request
843
+
844
+ timeout: Override the client-level default timeout for this request, in seconds
845
+ """
846
+ if project_id is None:
847
+ project_id = self._client._get_cloud_project_id_path_param()
848
+ if region_id is None:
849
+ region_id = self._client._get_cloud_region_id_path_param()
850
+ if not server_id:
851
+ raise ValueError(f"Expected a non-empty value for `server_id` but received {server_id!r}")
852
+ return await self._post(
853
+ f"/cloud/v1/bminstances/{project_id}/{region_id}/{server_id}/rebuild",
854
+ body=await async_maybe_transform(
855
+ {
856
+ "image_id": image_id,
857
+ "user_data": user_data,
858
+ },
859
+ server_rebuild_params.ServerRebuildParams,
860
+ ),
861
+ options=make_request_options(
862
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
863
+ ),
864
+ cast_to=TaskIDList,
865
+ )
866
+
867
+ async def create_and_poll(
868
+ self,
869
+ *,
870
+ project_id: int | None = None,
871
+ region_id: int | None = None,
872
+ flavor: str,
873
+ interfaces: Iterable[server_create_params.Interface],
874
+ app_config: Optional[object] | NotGiven = NOT_GIVEN,
875
+ apptemplate_id: str | NotGiven = NOT_GIVEN,
876
+ ddos_profile: server_create_params.DDOSProfile | NotGiven = NOT_GIVEN,
877
+ image_id: str | NotGiven = NOT_GIVEN,
878
+ name: str | NotGiven = NOT_GIVEN,
879
+ name_template: str | NotGiven = NOT_GIVEN,
880
+ password: str | NotGiven = NOT_GIVEN,
881
+ ssh_key_name: Optional[str] | NotGiven = NOT_GIVEN,
882
+ tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
883
+ user_data: str | NotGiven = NOT_GIVEN,
884
+ username: str | NotGiven = NOT_GIVEN,
885
+ polling_interval_seconds: int | NotGiven = NOT_GIVEN,
886
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
887
+ # The extra values given here take precedence over values defined on the client or passed to this method.
888
+ extra_headers: Headers | None = None,
889
+ extra_query: Query | None = None,
890
+ extra_body: Body | None = None,
891
+ ) -> BaremetalServer:
892
+ """
893
+ Create a bare metal server and wait for it to be ready.
894
+ """
895
+ response = await self.create(
896
+ project_id=project_id,
897
+ region_id=region_id,
898
+ flavor=flavor,
899
+ interfaces=interfaces,
900
+ app_config=app_config,
901
+ apptemplate_id=apptemplate_id,
902
+ ddos_profile=ddos_profile,
903
+ image_id=image_id,
904
+ name=name,
905
+ name_template=name_template,
906
+ password=password,
907
+ ssh_key_name=ssh_key_name,
908
+ tags=tags,
909
+ user_data=user_data,
910
+ username=username,
911
+ extra_headers=extra_headers,
912
+ extra_query=extra_query,
913
+ extra_body=extra_body,
914
+ )
915
+ if not response.tasks or len(response.tasks) != 1:
916
+ raise ValueError(f"Expected exactly one task to be created")
917
+ task =await self._client.cloud.tasks.poll(
918
+ response.tasks[0],
919
+ extra_headers=extra_headers,
920
+ polling_interval_seconds=polling_interval_seconds,
921
+ )
922
+ if not task.created_resources or not task.created_resources.instances:
923
+ raise ValueError("No server was created")
924
+ server_id = task.created_resources.instances[0]
925
+ servers = await self.list(
926
+ project_id=project_id,
927
+ region_id=region_id,
928
+ uuid=server_id,
929
+ extra_headers=extra_headers,
930
+ extra_query=extra_query,
931
+ extra_body=extra_body,
932
+ )
933
+ if len(servers.results) != 1:
934
+ raise ValueError(f"Server {server_id} not found")
935
+ return servers.results[0]
936
+
937
+ async def rebuild_and_poll(
938
+ self,
939
+ server_id: str,
940
+ *,
941
+ project_id: int | None = None,
942
+ region_id: int | None = None,
943
+ image_id: str | NotGiven = NOT_GIVEN,
944
+ user_data: str | NotGiven = NOT_GIVEN,
945
+ polling_interval_seconds: int | NotGiven = NOT_GIVEN,
946
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
947
+ # The extra values given here take precedence over values defined on the client or passed to this method.
948
+ extra_headers: Headers | None = None,
949
+ extra_query: Query | None = None,
950
+ extra_body: Body | None = None,
951
+ ) -> BaremetalServer:
952
+ """
953
+ Rebuild a bare metal server and wait for it to be ready.
954
+ """
955
+ response = await self.rebuild(
956
+ server_id=server_id,
957
+ project_id=project_id,
958
+ region_id=region_id,
959
+ image_id=image_id,
960
+ user_data=user_data,
961
+ extra_headers=extra_headers,
962
+ extra_query=extra_query,
963
+ extra_body=extra_body,
964
+ )
965
+ if not response.tasks or len(response.tasks) != 1:
966
+ raise ValueError(f"Expected exactly one task to be created")
967
+ await self._client.cloud.tasks.poll(
968
+ response.tasks[0],
969
+ extra_headers=extra_headers,
970
+ polling_interval_seconds=polling_interval_seconds,
971
+ )
972
+ servers = await self.list(
973
+ project_id=project_id,
974
+ region_id=region_id,
975
+ uuid=server_id,
976
+ extra_headers=extra_headers,
977
+ extra_query=extra_query,
978
+ extra_body=extra_body,
979
+ )
980
+ if len(servers.results) != 1:
981
+ raise ValueError(f"Server {server_id} not found")
982
+ return servers.results[0]
983
+
984
+
985
+ class ServersResourceWithRawResponse:
986
+ def __init__(self, servers: ServersResource) -> None:
987
+ self._servers = servers
988
+
989
+ self.create = to_raw_response_wrapper(
990
+ servers.create,
991
+ )
992
+ self.list = to_raw_response_wrapper(
993
+ servers.list,
994
+ )
995
+ self.rebuild = to_raw_response_wrapper(
996
+ servers.rebuild,
997
+ )
998
+
999
+
1000
+ class AsyncServersResourceWithRawResponse:
1001
+ def __init__(self, servers: AsyncServersResource) -> None:
1002
+ self._servers = servers
1003
+
1004
+ self.create = async_to_raw_response_wrapper(
1005
+ servers.create,
1006
+ )
1007
+ self.list = async_to_raw_response_wrapper(
1008
+ servers.list,
1009
+ )
1010
+ self.rebuild = async_to_raw_response_wrapper(
1011
+ servers.rebuild,
1012
+ )
1013
+
1014
+
1015
+ class ServersResourceWithStreamingResponse:
1016
+ def __init__(self, servers: ServersResource) -> None:
1017
+ self._servers = servers
1018
+
1019
+ self.create = to_streamed_response_wrapper(
1020
+ servers.create,
1021
+ )
1022
+ self.list = to_streamed_response_wrapper(
1023
+ servers.list,
1024
+ )
1025
+ self.rebuild = to_streamed_response_wrapper(
1026
+ servers.rebuild,
1027
+ )
1028
+
1029
+
1030
+ class AsyncServersResourceWithStreamingResponse:
1031
+ def __init__(self, servers: AsyncServersResource) -> None:
1032
+ self._servers = servers
1033
+
1034
+ self.create = async_to_streamed_response_wrapper(
1035
+ servers.create,
1036
+ )
1037
+ self.list = async_to_streamed_response_wrapper(
1038
+ servers.list,
1039
+ )
1040
+ self.rebuild = async_to_streamed_response_wrapper(
1041
+ servers.rebuild,
1042
+ )