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,797 @@
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 Iterable
6
+ from typing_extensions import Literal, overload
7
+
8
+ import httpx
9
+
10
+ from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
11
+ from ...._utils import maybe_transform, async_maybe_transform
12
+ from ...._compat import cached_property
13
+ from ...._resource import SyncAPIResource, AsyncAPIResource
14
+ from ...._response import (
15
+ to_raw_response_wrapper,
16
+ to_streamed_response_wrapper,
17
+ async_to_raw_response_wrapper,
18
+ async_to_streamed_response_wrapper,
19
+ )
20
+ from ...._base_client import make_request_options
21
+ from ....types.cloud.instances import interface_attach_params, interface_detach_params
22
+ from ....types.cloud.task_id_list import TaskIDList
23
+ from ....types.cloud.network_interface_list import NetworkInterfaceList
24
+
25
+ __all__ = ["InterfacesResource", "AsyncInterfacesResource"]
26
+
27
+
28
+ class InterfacesResource(SyncAPIResource):
29
+ @cached_property
30
+ def with_raw_response(self) -> InterfacesResourceWithRawResponse:
31
+ """
32
+ This property can be used as a prefix for any HTTP method call to return
33
+ the raw response object instead of the parsed content.
34
+
35
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
36
+ """
37
+ return InterfacesResourceWithRawResponse(self)
38
+
39
+ @cached_property
40
+ def with_streaming_response(self) -> InterfacesResourceWithStreamingResponse:
41
+ """
42
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
43
+
44
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
45
+ """
46
+ return InterfacesResourceWithStreamingResponse(self)
47
+
48
+ def list(
49
+ self,
50
+ instance_id: str,
51
+ *,
52
+ project_id: int | None = None,
53
+ region_id: int | None = None,
54
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
55
+ # The extra values given here take precedence over values defined on the client or passed to this method.
56
+ extra_headers: Headers | None = None,
57
+ extra_query: Query | None = None,
58
+ extra_body: Body | None = None,
59
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
60
+ ) -> NetworkInterfaceList:
61
+ """
62
+ List network interfaces attached to the instance
63
+
64
+ Args:
65
+ extra_headers: Send extra headers
66
+
67
+ extra_query: Add additional query parameters to the request
68
+
69
+ extra_body: Add additional JSON properties to the request
70
+
71
+ timeout: Override the client-level default timeout for this request, in seconds
72
+ """
73
+ if project_id is None:
74
+ project_id = self._client._get_cloud_project_id_path_param()
75
+ if region_id is None:
76
+ region_id = self._client._get_cloud_region_id_path_param()
77
+ if not instance_id:
78
+ raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
79
+ return self._get(
80
+ f"/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/interfaces",
81
+ options=make_request_options(
82
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
83
+ ),
84
+ cast_to=NetworkInterfaceList,
85
+ )
86
+
87
+ @overload
88
+ def attach(
89
+ self,
90
+ instance_id: str,
91
+ *,
92
+ project_id: int | None = None,
93
+ region_id: int | None = None,
94
+ ddos_profile: interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
95
+ | NotGiven = NOT_GIVEN,
96
+ interface_name: str | NotGiven = NOT_GIVEN,
97
+ ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
98
+ port_group: int | NotGiven = NOT_GIVEN,
99
+ security_groups: Iterable[interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
100
+ | NotGiven = NOT_GIVEN,
101
+ type: str | NotGiven = NOT_GIVEN,
102
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
103
+ # The extra values given here take precedence over values defined on the client or passed to this method.
104
+ extra_headers: Headers | None = None,
105
+ extra_query: Query | None = None,
106
+ extra_body: Body | None = None,
107
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
108
+ ) -> TaskIDList:
109
+ """
110
+ Attach interface to instance
111
+
112
+ Args:
113
+ ddos_profile: Advanced DDoS protection.
114
+
115
+ interface_name: Interface name
116
+
117
+ ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
118
+
119
+ port_group: Each group will be added to the separate trunk.
120
+
121
+ security_groups: List of security group IDs
122
+
123
+ type: Must be 'external'. Union tag
124
+
125
+ extra_headers: Send extra headers
126
+
127
+ extra_query: Add additional query parameters to the request
128
+
129
+ extra_body: Add additional JSON properties to the request
130
+
131
+ timeout: Override the client-level default timeout for this request, in seconds
132
+ """
133
+ ...
134
+
135
+ @overload
136
+ def attach(
137
+ self,
138
+ instance_id: str,
139
+ *,
140
+ project_id: int | None = None,
141
+ region_id: int | None = None,
142
+ subnet_id: str,
143
+ ddos_profile: interface_attach_params.NewInterfaceSpecificSubnetSchemaDDOSProfile | NotGiven = NOT_GIVEN,
144
+ interface_name: str | NotGiven = NOT_GIVEN,
145
+ port_group: int | NotGiven = NOT_GIVEN,
146
+ security_groups: Iterable[interface_attach_params.NewInterfaceSpecificSubnetSchemaSecurityGroup]
147
+ | NotGiven = NOT_GIVEN,
148
+ type: str | NotGiven = NOT_GIVEN,
149
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
150
+ # The extra values given here take precedence over values defined on the client or passed to this method.
151
+ extra_headers: Headers | None = None,
152
+ extra_query: Query | None = None,
153
+ extra_body: Body | None = None,
154
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
155
+ ) -> TaskIDList:
156
+ """
157
+ Attach interface to instance
158
+
159
+ Args:
160
+ subnet_id: Port will get an IP address from this subnet
161
+
162
+ ddos_profile: Advanced DDoS protection.
163
+
164
+ interface_name: Interface name
165
+
166
+ port_group: Each group will be added to the separate trunk.
167
+
168
+ security_groups: List of security group IDs
169
+
170
+ type: Must be 'subnet'
171
+
172
+ extra_headers: Send extra headers
173
+
174
+ extra_query: Add additional query parameters to the request
175
+
176
+ extra_body: Add additional JSON properties to the request
177
+
178
+ timeout: Override the client-level default timeout for this request, in seconds
179
+ """
180
+ ...
181
+
182
+ @overload
183
+ def attach(
184
+ self,
185
+ instance_id: str,
186
+ *,
187
+ project_id: int | None = None,
188
+ region_id: int | None = None,
189
+ network_id: str,
190
+ ddos_profile: interface_attach_params.NewInterfaceAnySubnetSchemaDDOSProfile | NotGiven = NOT_GIVEN,
191
+ interface_name: str | NotGiven = NOT_GIVEN,
192
+ ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
193
+ port_group: int | NotGiven = NOT_GIVEN,
194
+ security_groups: Iterable[interface_attach_params.NewInterfaceAnySubnetSchemaSecurityGroup]
195
+ | NotGiven = NOT_GIVEN,
196
+ type: str | NotGiven = NOT_GIVEN,
197
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
198
+ # The extra values given here take precedence over values defined on the client or passed to this method.
199
+ extra_headers: Headers | None = None,
200
+ extra_query: Query | None = None,
201
+ extra_body: Body | None = None,
202
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
203
+ ) -> TaskIDList:
204
+ """
205
+ Attach interface to instance
206
+
207
+ Args:
208
+ network_id: Port will get an IP address in this network subnet
209
+
210
+ ddos_profile: Advanced DDoS protection.
211
+
212
+ interface_name: Interface name
213
+
214
+ ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
215
+
216
+ port_group: Each group will be added to the separate trunk.
217
+
218
+ security_groups: List of security group IDs
219
+
220
+ type: Must be 'any_subnet'
221
+
222
+ extra_headers: Send extra headers
223
+
224
+ extra_query: Add additional query parameters to the request
225
+
226
+ extra_body: Add additional JSON properties to the request
227
+
228
+ timeout: Override the client-level default timeout for this request, in seconds
229
+ """
230
+ ...
231
+
232
+ @overload
233
+ def attach(
234
+ self,
235
+ instance_id: str,
236
+ *,
237
+ project_id: int | None = None,
238
+ region_id: int | None = None,
239
+ port_id: str,
240
+ ddos_profile: interface_attach_params.NewInterfaceReservedFixedIPSchemaDDOSProfile | NotGiven = NOT_GIVEN,
241
+ interface_name: str | NotGiven = NOT_GIVEN,
242
+ port_group: int | NotGiven = NOT_GIVEN,
243
+ security_groups: Iterable[interface_attach_params.NewInterfaceReservedFixedIPSchemaSecurityGroup]
244
+ | NotGiven = NOT_GIVEN,
245
+ type: str | NotGiven = NOT_GIVEN,
246
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
247
+ # The extra values given here take precedence over values defined on the client or passed to this method.
248
+ extra_headers: Headers | None = None,
249
+ extra_query: Query | None = None,
250
+ extra_body: Body | None = None,
251
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
252
+ ) -> TaskIDList:
253
+ """
254
+ Attach interface to instance
255
+
256
+ Args:
257
+ port_id: Port ID
258
+
259
+ ddos_profile: Advanced DDoS protection.
260
+
261
+ interface_name: Interface name
262
+
263
+ port_group: Each group will be added to the separate trunk.
264
+
265
+ security_groups: List of security group IDs
266
+
267
+ type: Must be 'reserved_fixed_ip'. Union tag
268
+
269
+ extra_headers: Send extra headers
270
+
271
+ extra_query: Add additional query parameters to the request
272
+
273
+ extra_body: Add additional JSON properties to the request
274
+
275
+ timeout: Override the client-level default timeout for this request, in seconds
276
+ """
277
+ ...
278
+
279
+ def attach(
280
+ self,
281
+ instance_id: str,
282
+ *,
283
+ project_id: int | None = None,
284
+ region_id: int | None = None,
285
+ ddos_profile: interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
286
+ | NotGiven = NOT_GIVEN,
287
+ interface_name: str | NotGiven = NOT_GIVEN,
288
+ ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
289
+ port_group: int | NotGiven = NOT_GIVEN,
290
+ security_groups: Iterable[interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
291
+ | NotGiven = NOT_GIVEN,
292
+ type: str | NotGiven = NOT_GIVEN,
293
+ subnet_id: str | NotGiven = NOT_GIVEN,
294
+ network_id: str | NotGiven = NOT_GIVEN,
295
+ port_id: str | NotGiven = NOT_GIVEN,
296
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
297
+ # The extra values given here take precedence over values defined on the client or passed to this method.
298
+ extra_headers: Headers | None = None,
299
+ extra_query: Query | None = None,
300
+ extra_body: Body | None = None,
301
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
302
+ ) -> TaskIDList:
303
+ if project_id is None:
304
+ project_id = self._client._get_cloud_project_id_path_param()
305
+ if region_id is None:
306
+ region_id = self._client._get_cloud_region_id_path_param()
307
+ if not instance_id:
308
+ raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
309
+ return self._post(
310
+ f"/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/attach_interface",
311
+ body=maybe_transform(
312
+ {
313
+ "ddos_profile": ddos_profile,
314
+ "interface_name": interface_name,
315
+ "ip_family": ip_family,
316
+ "port_group": port_group,
317
+ "security_groups": security_groups,
318
+ "type": type,
319
+ "subnet_id": subnet_id,
320
+ "network_id": network_id,
321
+ "port_id": port_id,
322
+ },
323
+ interface_attach_params.InterfaceAttachParams,
324
+ ),
325
+ options=make_request_options(
326
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
327
+ ),
328
+ cast_to=TaskIDList,
329
+ )
330
+
331
+ def detach(
332
+ self,
333
+ instance_id: str,
334
+ *,
335
+ project_id: int | None = None,
336
+ region_id: int | None = None,
337
+ ip_address: str,
338
+ port_id: str,
339
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
340
+ # The extra values given here take precedence over values defined on the client or passed to this method.
341
+ extra_headers: Headers | None = None,
342
+ extra_query: Query | None = None,
343
+ extra_body: Body | None = None,
344
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
345
+ ) -> TaskIDList:
346
+ """
347
+ Detach interface from instance
348
+
349
+ Args:
350
+ ip_address: IP address
351
+
352
+ port_id: ID of the port
353
+
354
+ extra_headers: Send extra headers
355
+
356
+ extra_query: Add additional query parameters to the request
357
+
358
+ extra_body: Add additional JSON properties to the request
359
+
360
+ timeout: Override the client-level default timeout for this request, in seconds
361
+ """
362
+ if project_id is None:
363
+ project_id = self._client._get_cloud_project_id_path_param()
364
+ if region_id is None:
365
+ region_id = self._client._get_cloud_region_id_path_param()
366
+ if not instance_id:
367
+ raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
368
+ return self._post(
369
+ f"/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/detach_interface",
370
+ body=maybe_transform(
371
+ {
372
+ "ip_address": ip_address,
373
+ "port_id": port_id,
374
+ },
375
+ interface_detach_params.InterfaceDetachParams,
376
+ ),
377
+ options=make_request_options(
378
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
379
+ ),
380
+ cast_to=TaskIDList,
381
+ )
382
+
383
+
384
+ class AsyncInterfacesResource(AsyncAPIResource):
385
+ @cached_property
386
+ def with_raw_response(self) -> AsyncInterfacesResourceWithRawResponse:
387
+ """
388
+ This property can be used as a prefix for any HTTP method call to return
389
+ the raw response object instead of the parsed content.
390
+
391
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
392
+ """
393
+ return AsyncInterfacesResourceWithRawResponse(self)
394
+
395
+ @cached_property
396
+ def with_streaming_response(self) -> AsyncInterfacesResourceWithStreamingResponse:
397
+ """
398
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
399
+
400
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
401
+ """
402
+ return AsyncInterfacesResourceWithStreamingResponse(self)
403
+
404
+ async def list(
405
+ self,
406
+ instance_id: str,
407
+ *,
408
+ project_id: int | None = None,
409
+ region_id: int | None = None,
410
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
411
+ # The extra values given here take precedence over values defined on the client or passed to this method.
412
+ extra_headers: Headers | None = None,
413
+ extra_query: Query | None = None,
414
+ extra_body: Body | None = None,
415
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
416
+ ) -> NetworkInterfaceList:
417
+ """
418
+ List network interfaces attached to the instance
419
+
420
+ Args:
421
+ extra_headers: Send extra headers
422
+
423
+ extra_query: Add additional query parameters to the request
424
+
425
+ extra_body: Add additional JSON properties to the request
426
+
427
+ timeout: Override the client-level default timeout for this request, in seconds
428
+ """
429
+ if project_id is None:
430
+ project_id = self._client._get_cloud_project_id_path_param()
431
+ if region_id is None:
432
+ region_id = self._client._get_cloud_region_id_path_param()
433
+ if not instance_id:
434
+ raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
435
+ return await self._get(
436
+ f"/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/interfaces",
437
+ options=make_request_options(
438
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
439
+ ),
440
+ cast_to=NetworkInterfaceList,
441
+ )
442
+
443
+ @overload
444
+ async def attach(
445
+ self,
446
+ instance_id: str,
447
+ *,
448
+ project_id: int | None = None,
449
+ region_id: int | None = None,
450
+ ddos_profile: interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
451
+ | NotGiven = NOT_GIVEN,
452
+ interface_name: str | NotGiven = NOT_GIVEN,
453
+ ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
454
+ port_group: int | NotGiven = NOT_GIVEN,
455
+ security_groups: Iterable[interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
456
+ | NotGiven = NOT_GIVEN,
457
+ type: str | NotGiven = NOT_GIVEN,
458
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
459
+ # The extra values given here take precedence over values defined on the client or passed to this method.
460
+ extra_headers: Headers | None = None,
461
+ extra_query: Query | None = None,
462
+ extra_body: Body | None = None,
463
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
464
+ ) -> TaskIDList:
465
+ """
466
+ Attach interface to instance
467
+
468
+ Args:
469
+ ddos_profile: Advanced DDoS protection.
470
+
471
+ interface_name: Interface name
472
+
473
+ ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
474
+
475
+ port_group: Each group will be added to the separate trunk.
476
+
477
+ security_groups: List of security group IDs
478
+
479
+ type: Must be 'external'. Union tag
480
+
481
+ extra_headers: Send extra headers
482
+
483
+ extra_query: Add additional query parameters to the request
484
+
485
+ extra_body: Add additional JSON properties to the request
486
+
487
+ timeout: Override the client-level default timeout for this request, in seconds
488
+ """
489
+ ...
490
+
491
+ @overload
492
+ async def attach(
493
+ self,
494
+ instance_id: str,
495
+ *,
496
+ project_id: int | None = None,
497
+ region_id: int | None = None,
498
+ subnet_id: str,
499
+ ddos_profile: interface_attach_params.NewInterfaceSpecificSubnetSchemaDDOSProfile | NotGiven = NOT_GIVEN,
500
+ interface_name: str | NotGiven = NOT_GIVEN,
501
+ port_group: int | NotGiven = NOT_GIVEN,
502
+ security_groups: Iterable[interface_attach_params.NewInterfaceSpecificSubnetSchemaSecurityGroup]
503
+ | NotGiven = NOT_GIVEN,
504
+ type: str | NotGiven = NOT_GIVEN,
505
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
506
+ # The extra values given here take precedence over values defined on the client or passed to this method.
507
+ extra_headers: Headers | None = None,
508
+ extra_query: Query | None = None,
509
+ extra_body: Body | None = None,
510
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
511
+ ) -> TaskIDList:
512
+ """
513
+ Attach interface to instance
514
+
515
+ Args:
516
+ subnet_id: Port will get an IP address from this subnet
517
+
518
+ ddos_profile: Advanced DDoS protection.
519
+
520
+ interface_name: Interface name
521
+
522
+ port_group: Each group will be added to the separate trunk.
523
+
524
+ security_groups: List of security group IDs
525
+
526
+ type: Must be 'subnet'
527
+
528
+ extra_headers: Send extra headers
529
+
530
+ extra_query: Add additional query parameters to the request
531
+
532
+ extra_body: Add additional JSON properties to the request
533
+
534
+ timeout: Override the client-level default timeout for this request, in seconds
535
+ """
536
+ ...
537
+
538
+ @overload
539
+ async def attach(
540
+ self,
541
+ instance_id: str,
542
+ *,
543
+ project_id: int | None = None,
544
+ region_id: int | None = None,
545
+ network_id: str,
546
+ ddos_profile: interface_attach_params.NewInterfaceAnySubnetSchemaDDOSProfile | NotGiven = NOT_GIVEN,
547
+ interface_name: str | NotGiven = NOT_GIVEN,
548
+ ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
549
+ port_group: int | NotGiven = NOT_GIVEN,
550
+ security_groups: Iterable[interface_attach_params.NewInterfaceAnySubnetSchemaSecurityGroup]
551
+ | NotGiven = NOT_GIVEN,
552
+ type: str | NotGiven = NOT_GIVEN,
553
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
554
+ # The extra values given here take precedence over values defined on the client or passed to this method.
555
+ extra_headers: Headers | None = None,
556
+ extra_query: Query | None = None,
557
+ extra_body: Body | None = None,
558
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
559
+ ) -> TaskIDList:
560
+ """
561
+ Attach interface to instance
562
+
563
+ Args:
564
+ network_id: Port will get an IP address in this network subnet
565
+
566
+ ddos_profile: Advanced DDoS protection.
567
+
568
+ interface_name: Interface name
569
+
570
+ ip_family: Which subnets should be selected: IPv4, IPv6 or use dual stack.
571
+
572
+ port_group: Each group will be added to the separate trunk.
573
+
574
+ security_groups: List of security group IDs
575
+
576
+ type: Must be 'any_subnet'
577
+
578
+ extra_headers: Send extra headers
579
+
580
+ extra_query: Add additional query parameters to the request
581
+
582
+ extra_body: Add additional JSON properties to the request
583
+
584
+ timeout: Override the client-level default timeout for this request, in seconds
585
+ """
586
+ ...
587
+
588
+ @overload
589
+ async def attach(
590
+ self,
591
+ instance_id: str,
592
+ *,
593
+ project_id: int | None = None,
594
+ region_id: int | None = None,
595
+ port_id: str,
596
+ ddos_profile: interface_attach_params.NewInterfaceReservedFixedIPSchemaDDOSProfile | NotGiven = NOT_GIVEN,
597
+ interface_name: str | NotGiven = NOT_GIVEN,
598
+ port_group: int | NotGiven = NOT_GIVEN,
599
+ security_groups: Iterable[interface_attach_params.NewInterfaceReservedFixedIPSchemaSecurityGroup]
600
+ | NotGiven = NOT_GIVEN,
601
+ type: str | NotGiven = NOT_GIVEN,
602
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
603
+ # The extra values given here take precedence over values defined on the client or passed to this method.
604
+ extra_headers: Headers | None = None,
605
+ extra_query: Query | None = None,
606
+ extra_body: Body | None = None,
607
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
608
+ ) -> TaskIDList:
609
+ """
610
+ Attach interface to instance
611
+
612
+ Args:
613
+ port_id: Port ID
614
+
615
+ ddos_profile: Advanced DDoS protection.
616
+
617
+ interface_name: Interface name
618
+
619
+ port_group: Each group will be added to the separate trunk.
620
+
621
+ security_groups: List of security group IDs
622
+
623
+ type: Must be 'reserved_fixed_ip'. Union tag
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
+ ...
634
+
635
+ async def attach(
636
+ self,
637
+ instance_id: str,
638
+ *,
639
+ project_id: int | None = None,
640
+ region_id: int | None = None,
641
+ ddos_profile: interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSDDOSProfile
642
+ | NotGiven = NOT_GIVEN,
643
+ interface_name: str | NotGiven = NOT_GIVEN,
644
+ ip_family: Literal["dual", "ipv4", "ipv6"] | NotGiven = NOT_GIVEN,
645
+ port_group: int | NotGiven = NOT_GIVEN,
646
+ security_groups: Iterable[interface_attach_params.NewInterfaceExternalExtendSchemaWithDDOSSecurityGroup]
647
+ | NotGiven = NOT_GIVEN,
648
+ type: str | NotGiven = NOT_GIVEN,
649
+ subnet_id: str | NotGiven = NOT_GIVEN,
650
+ network_id: str | NotGiven = NOT_GIVEN,
651
+ port_id: str | NotGiven = NOT_GIVEN,
652
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
653
+ # The extra values given here take precedence over values defined on the client or passed to this method.
654
+ extra_headers: Headers | None = None,
655
+ extra_query: Query | None = None,
656
+ extra_body: Body | None = None,
657
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
658
+ ) -> TaskIDList:
659
+ if project_id is None:
660
+ project_id = self._client._get_cloud_project_id_path_param()
661
+ if region_id is None:
662
+ region_id = self._client._get_cloud_region_id_path_param()
663
+ if not instance_id:
664
+ raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
665
+ return await self._post(
666
+ f"/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/attach_interface",
667
+ body=await async_maybe_transform(
668
+ {
669
+ "ddos_profile": ddos_profile,
670
+ "interface_name": interface_name,
671
+ "ip_family": ip_family,
672
+ "port_group": port_group,
673
+ "security_groups": security_groups,
674
+ "type": type,
675
+ "subnet_id": subnet_id,
676
+ "network_id": network_id,
677
+ "port_id": port_id,
678
+ },
679
+ interface_attach_params.InterfaceAttachParams,
680
+ ),
681
+ options=make_request_options(
682
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
683
+ ),
684
+ cast_to=TaskIDList,
685
+ )
686
+
687
+ async def detach(
688
+ self,
689
+ instance_id: str,
690
+ *,
691
+ project_id: int | None = None,
692
+ region_id: int | None = None,
693
+ ip_address: str,
694
+ port_id: str,
695
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
696
+ # The extra values given here take precedence over values defined on the client or passed to this method.
697
+ extra_headers: Headers | None = None,
698
+ extra_query: Query | None = None,
699
+ extra_body: Body | None = None,
700
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
701
+ ) -> TaskIDList:
702
+ """
703
+ Detach interface from instance
704
+
705
+ Args:
706
+ ip_address: IP address
707
+
708
+ port_id: ID of the port
709
+
710
+ extra_headers: Send extra headers
711
+
712
+ extra_query: Add additional query parameters to the request
713
+
714
+ extra_body: Add additional JSON properties to the request
715
+
716
+ timeout: Override the client-level default timeout for this request, in seconds
717
+ """
718
+ if project_id is None:
719
+ project_id = self._client._get_cloud_project_id_path_param()
720
+ if region_id is None:
721
+ region_id = self._client._get_cloud_region_id_path_param()
722
+ if not instance_id:
723
+ raise ValueError(f"Expected a non-empty value for `instance_id` but received {instance_id!r}")
724
+ return await self._post(
725
+ f"/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/detach_interface",
726
+ body=await async_maybe_transform(
727
+ {
728
+ "ip_address": ip_address,
729
+ "port_id": port_id,
730
+ },
731
+ interface_detach_params.InterfaceDetachParams,
732
+ ),
733
+ options=make_request_options(
734
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
735
+ ),
736
+ cast_to=TaskIDList,
737
+ )
738
+
739
+
740
+ class InterfacesResourceWithRawResponse:
741
+ def __init__(self, interfaces: InterfacesResource) -> None:
742
+ self._interfaces = interfaces
743
+
744
+ self.list = to_raw_response_wrapper(
745
+ interfaces.list,
746
+ )
747
+ self.attach = to_raw_response_wrapper(
748
+ interfaces.attach,
749
+ )
750
+ self.detach = to_raw_response_wrapper(
751
+ interfaces.detach,
752
+ )
753
+
754
+
755
+ class AsyncInterfacesResourceWithRawResponse:
756
+ def __init__(self, interfaces: AsyncInterfacesResource) -> None:
757
+ self._interfaces = interfaces
758
+
759
+ self.list = async_to_raw_response_wrapper(
760
+ interfaces.list,
761
+ )
762
+ self.attach = async_to_raw_response_wrapper(
763
+ interfaces.attach,
764
+ )
765
+ self.detach = async_to_raw_response_wrapper(
766
+ interfaces.detach,
767
+ )
768
+
769
+
770
+ class InterfacesResourceWithStreamingResponse:
771
+ def __init__(self, interfaces: InterfacesResource) -> None:
772
+ self._interfaces = interfaces
773
+
774
+ self.list = to_streamed_response_wrapper(
775
+ interfaces.list,
776
+ )
777
+ self.attach = to_streamed_response_wrapper(
778
+ interfaces.attach,
779
+ )
780
+ self.detach = to_streamed_response_wrapper(
781
+ interfaces.detach,
782
+ )
783
+
784
+
785
+ class AsyncInterfacesResourceWithStreamingResponse:
786
+ def __init__(self, interfaces: AsyncInterfacesResource) -> None:
787
+ self._interfaces = interfaces
788
+
789
+ self.list = async_to_streamed_response_wrapper(
790
+ interfaces.list,
791
+ )
792
+ self.attach = async_to_streamed_response_wrapper(
793
+ interfaces.attach,
794
+ )
795
+ self.detach = async_to_streamed_response_wrapper(
796
+ interfaces.detach,
797
+ )