gcore 0.15.0__py3-none-any.whl → 0.17.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 (199) hide show
  1. gcore/_client.py +18 -8
  2. gcore/_version.py +1 -1
  3. gcore/resources/cdn/audit_log.py +4 -12
  4. gcore/resources/cdn/cdn.py +130 -39
  5. gcore/resources/cdn/certificates.py +16 -40
  6. gcore/resources/cdn/ip_ranges.py +4 -8
  7. gcore/resources/cdn/{logs/logs.py → logs.py} +13 -53
  8. gcore/resources/cdn/logs_uploader/configs.py +14 -42
  9. gcore/resources/cdn/logs_uploader/policies.py +14 -42
  10. gcore/resources/cdn/logs_uploader/targets.py +14 -42
  11. gcore/resources/cdn/metrics.py +2 -6
  12. gcore/resources/cdn/network_capacity.py +2 -6
  13. gcore/resources/cdn/origin_groups.py +12 -32
  14. gcore/resources/cdn/resources/resources.py +18 -46
  15. gcore/resources/cdn/resources/rules.py +12 -36
  16. gcore/resources/cdn/resources/shield.py +4 -12
  17. gcore/resources/cdn/rule_templates.py +12 -36
  18. gcore/resources/cdn/shields.py +2 -6
  19. gcore/resources/cdn/statistics.py +16 -40
  20. gcore/resources/cdn/trusted_ca_certificates.py +10 -30
  21. gcore/resources/cloud/audit_logs.py +2 -6
  22. gcore/resources/cloud/baremetal/flavors.py +2 -6
  23. gcore/resources/cloud/baremetal/images.py +2 -6
  24. gcore/resources/cloud/baremetal/servers.py +14 -18
  25. gcore/resources/cloud/billing_reservations.py +25 -208
  26. gcore/resources/cloud/cloud.py +18 -0
  27. gcore/resources/cloud/cost_reports.py +44 -62
  28. gcore/resources/cloud/file_shares/access_rules.py +6 -18
  29. gcore/resources/cloud/file_shares/file_shares.py +126 -42
  30. gcore/resources/cloud/floating_ips.py +22 -42
  31. gcore/resources/cloud/gpu_baremetal_clusters/flavors.py +2 -6
  32. gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +30 -54
  33. gcore/resources/cloud/gpu_baremetal_clusters/images.py +16 -24
  34. gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py +2 -6
  35. gcore/resources/cloud/gpu_baremetal_clusters/servers.py +18 -42
  36. gcore/resources/cloud/inference/api_keys.py +10 -30
  37. gcore/resources/cloud/inference/applications/deployments.py +135 -155
  38. gcore/resources/cloud/inference/applications/templates.py +4 -12
  39. gcore/resources/cloud/inference/deployments/deployments.py +28 -48
  40. gcore/resources/cloud/inference/deployments/logs.py +2 -6
  41. gcore/resources/cloud/inference/flavors.py +4 -12
  42. gcore/resources/cloud/inference/inference.py +2 -6
  43. gcore/resources/cloud/inference/registry_credentials.py +10 -30
  44. gcore/resources/cloud/inference/secrets.py +10 -30
  45. gcore/resources/cloud/instances/flavors.py +2 -6
  46. gcore/resources/cloud/instances/images.py +24 -36
  47. gcore/resources/cloud/instances/instances.py +119 -94
  48. gcore/resources/cloud/instances/interfaces.py +18 -18
  49. gcore/resources/cloud/instances/metrics.py +2 -6
  50. gcore/resources/cloud/ip_ranges.py +2 -6
  51. gcore/resources/cloud/k8s/clusters/clusters.py +18 -54
  52. gcore/resources/cloud/k8s/clusters/nodes.py +4 -12
  53. gcore/resources/cloud/k8s/clusters/pools/nodes.py +4 -12
  54. gcore/resources/cloud/k8s/clusters/pools/pools.py +12 -36
  55. gcore/resources/cloud/k8s/flavors.py +2 -6
  56. gcore/resources/cloud/k8s/k8s.py +2 -6
  57. gcore/resources/cloud/load_balancers/flavors.py +2 -6
  58. gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +22 -30
  59. gcore/resources/cloud/load_balancers/l7_policies/rules.py +22 -30
  60. gcore/resources/cloud/load_balancers/listeners.py +38 -46
  61. gcore/resources/cloud/load_balancers/load_balancers.py +509 -521
  62. gcore/resources/cloud/load_balancers/metrics.py +8 -12
  63. gcore/resources/cloud/load_balancers/pools/health_monitors.py +4 -12
  64. gcore/resources/cloud/load_balancers/pools/members.py +4 -12
  65. gcore/resources/cloud/load_balancers/pools/pools.py +38 -46
  66. gcore/resources/cloud/load_balancers/statuses.py +10 -18
  67. gcore/resources/cloud/networks/networks.py +18 -30
  68. gcore/resources/cloud/networks/routers.py +14 -42
  69. gcore/resources/cloud/networks/subnets.py +14 -30
  70. gcore/resources/cloud/placement_groups.py +16 -24
  71. gcore/resources/cloud/projects.py +117 -129
  72. gcore/resources/cloud/quotas/quotas.py +6 -18
  73. gcore/resources/cloud/quotas/requests.py +8 -24
  74. gcore/resources/cloud/regions.py +4 -8
  75. gcore/resources/cloud/registries/artifacts.py +4 -12
  76. gcore/resources/cloud/registries/registries.py +10 -30
  77. gcore/resources/cloud/registries/repositories.py +4 -12
  78. gcore/resources/cloud/registries/tags.py +2 -6
  79. gcore/resources/cloud/registries/users.py +12 -36
  80. gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +28 -30
  81. gcore/resources/cloud/reserved_fixed_ips/vip.py +10 -30
  82. gcore/resources/cloud/secrets.py +12 -24
  83. gcore/resources/cloud/security_groups/rules.py +6 -18
  84. gcore/resources/cloud/security_groups/security_groups.py +14 -42
  85. gcore/resources/cloud/ssh_keys.py +10 -30
  86. gcore/resources/cloud/tasks.py +36 -33
  87. gcore/resources/cloud/usage_reports.py +18 -24
  88. gcore/resources/cloud/users/role_assignments.py +8 -24
  89. gcore/resources/cloud/volumes.py +47 -61
  90. gcore/resources/dns/dns.py +4 -8
  91. gcore/resources/dns/locations.py +8 -20
  92. gcore/resources/dns/metrics.py +2 -6
  93. gcore/resources/dns/pickers/pickers.py +2 -2
  94. gcore/resources/dns/pickers/presets.py +2 -6
  95. gcore/resources/dns/zones/dnssec.py +4 -12
  96. gcore/resources/dns/zones/rrsets.py +12 -36
  97. gcore/resources/dns/zones/zones.py +22 -58
  98. gcore/resources/fastedge/apps/apps.py +12 -28
  99. gcore/resources/fastedge/apps/logs.py +2 -6
  100. gcore/resources/fastedge/binaries.py +8 -24
  101. gcore/resources/fastedge/fastedge.py +2 -2
  102. gcore/resources/fastedge/kv_stores.py +10 -22
  103. gcore/resources/fastedge/secrets.py +12 -36
  104. gcore/resources/fastedge/statistics.py +4 -12
  105. gcore/resources/fastedge/templates.py +10 -30
  106. gcore/resources/iam/api_tokens.py +8 -24
  107. gcore/resources/iam/iam.py +2 -2
  108. gcore/resources/iam/users.py +10 -26
  109. gcore/resources/security/bgp_announces.py +4 -12
  110. gcore/resources/security/events.py +2 -6
  111. gcore/resources/security/profile_templates.py +2 -6
  112. gcore/resources/security/profiles.py +16 -40
  113. gcore/resources/storage/buckets/buckets.py +6 -18
  114. gcore/resources/storage/buckets/cors.py +4 -12
  115. gcore/resources/storage/buckets/lifecycle.py +4 -12
  116. gcore/resources/storage/buckets/policy.py +6 -18
  117. gcore/resources/storage/credentials.py +2 -6
  118. gcore/resources/storage/locations.py +2 -6
  119. gcore/resources/storage/statistics.py +4 -12
  120. gcore/resources/storage/storage.py +16 -48
  121. gcore/resources/streaming/ai_tasks.py +10 -18
  122. gcore/resources/streaming/broadcasts.py +12 -36
  123. gcore/resources/streaming/directories.py +10 -30
  124. gcore/resources/streaming/players.py +12 -28
  125. gcore/resources/streaming/playlists.py +12 -36
  126. gcore/resources/streaming/quality_sets.py +4 -12
  127. gcore/resources/streaming/restreams.py +10 -30
  128. gcore/resources/streaming/statistics.py +46 -138
  129. gcore/resources/streaming/streams/overlays.py +12 -36
  130. gcore/resources/streaming/streams/streams.py +20 -52
  131. gcore/resources/streaming/videos/subtitles.py +10 -30
  132. gcore/resources/streaming/videos/videos.py +16 -40
  133. gcore/resources/waap/advanced_rules.py +2 -6
  134. gcore/resources/waap/custom_page_sets.py +12 -36
  135. gcore/resources/waap/domains/advanced_rules.py +12 -36
  136. gcore/resources/waap/domains/api_discovery.py +12 -36
  137. gcore/resources/waap/domains/api_path_groups.py +2 -6
  138. gcore/resources/waap/domains/api_paths.py +10 -30
  139. gcore/resources/waap/domains/custom_rules.py +14 -42
  140. gcore/resources/waap/domains/domains.py +12 -32
  141. gcore/resources/waap/domains/firewall_rules.py +14 -42
  142. gcore/resources/waap/domains/insight_silences.py +10 -30
  143. gcore/resources/waap/domains/insights.py +6 -18
  144. gcore/resources/waap/domains/settings.py +4 -12
  145. gcore/resources/waap/domains/statistics.py +12 -36
  146. gcore/resources/waap/insights.py +2 -6
  147. gcore/resources/waap/ip_info/ip_info.py +16 -48
  148. gcore/resources/waap/ip_info/metrics.py +2 -6
  149. gcore/resources/waap/organizations.py +2 -6
  150. gcore/resources/waap/statistics.py +2 -6
  151. gcore/resources/waap/tags.py +2 -2
  152. gcore/resources/waap/waap.py +2 -2
  153. gcore/types/cdn/__init__.py +3 -0
  154. gcore/types/cdn/alibaba_regions.py +22 -0
  155. gcore/types/cdn/aws_regions.py +22 -0
  156. gcore/types/cdn/cdn_list_purge_statuses_response.py +10 -0
  157. gcore/types/cdn/cdn_resource.py +1 -1
  158. gcore/types/cdn/logs_aggregated_stats.py +1 -1
  159. gcore/types/cdn/resource_create_params.py +1 -1
  160. gcore/types/cdn/resource_replace_params.py +1 -1
  161. gcore/types/cdn/resource_update_params.py +1 -1
  162. gcore/types/cdn/resources/cdn_resource_rule.py +1 -1
  163. gcore/types/cdn/resources/rule_create_params.py +1 -1
  164. gcore/types/cdn/resources/rule_replace_params.py +1 -1
  165. gcore/types/cdn/resources/rule_update_params.py +1 -1
  166. gcore/types/cdn/rule_template.py +1 -1
  167. gcore/types/cdn/rule_template_create_params.py +1 -1
  168. gcore/types/cdn/rule_template_replace_params.py +1 -1
  169. gcore/types/cdn/rule_template_update_params.py +1 -1
  170. gcore/types/cloud/__init__.py +2 -1
  171. gcore/types/cloud/billing_reservation.py +52 -114
  172. gcore/types/cloud/billing_reservation_list_params.py +4 -42
  173. gcore/types/cloud/billing_reservations.py +16 -0
  174. gcore/types/cloud/cost_report_get_aggregated_params.py +2 -2
  175. gcore/types/cloud/cost_report_get_detailed_params.py +2 -2
  176. gcore/types/cloud/inference/applications/__init__.py +1 -1
  177. gcore/types/cloud/inference/applications/{deployment_patch_params.py → deployment_update_params.py} +2 -2
  178. gcore/types/cloud/instance_list_params.py +1 -1
  179. gcore/types/cloud/instance_update_params.py +31 -3
  180. gcore/types/cloud/load_balancer_create_params.py +1 -1
  181. gcore/types/cloud/load_balancer_listener_detail.py +1 -1
  182. gcore/types/cloud/load_balancers/listener_create_params.py +1 -1
  183. gcore/types/cloud/load_balancers/listener_list_params.py +1 -1
  184. gcore/types/cloud/load_balancers/pool_create_params.py +1 -1
  185. gcore/types/cloud/load_balancers/pool_list_params.py +1 -1
  186. gcore/types/cloud/{project_replace_params.py → project_update_params.py} +2 -2
  187. gcore/types/cloud/task_list_params.py +3 -3
  188. gcore/types/cloud/usage_report_get_params.py +2 -2
  189. gcore/types/security/profile_create_params.py +2 -2
  190. {gcore-0.15.0.dist-info → gcore-0.17.0.dist-info}/METADATA +2 -2
  191. {gcore-0.15.0.dist-info → gcore-0.17.0.dist-info}/RECORD +193 -195
  192. gcore/resources/cdn/logs/__init__.py +0 -33
  193. gcore/resources/cdn/logs/settings.py +0 -1081
  194. gcore/types/cdn/logs/__init__.py +0 -7
  195. gcore/types/cdn/logs/log_settings.py +0 -172
  196. gcore/types/cdn/logs/setting_create_params.py +0 -200
  197. gcore/types/cdn/logs/setting_update_params.py +0 -200
  198. {gcore-0.15.0.dist-info → gcore-0.17.0.dist-info}/WHEEL +0 -0
  199. {gcore-0.15.0.dist-info → gcore-0.17.0.dist-info}/licenses/LICENSE +0 -0
@@ -207,9 +207,7 @@ class LoadBalancersResource(SyncAPIResource):
207
207
  if region_id is None:
208
208
  region_id = self._client._get_cloud_region_id_path_param()
209
209
  return self._post(
210
- f"/cloud/v1/loadbalancers/{project_id}/{region_id}"
211
- if self._client._base_url_overridden
212
- else f"https://api.gcore.com//cloud/v1/loadbalancers/{project_id}/{region_id}",
210
+ f"/cloud/v1/loadbalancers/{project_id}/{region_id}",
213
211
  body=maybe_transform(
214
212
  {
215
213
  "flavor": flavor,
@@ -235,7 +233,7 @@ class LoadBalancersResource(SyncAPIResource):
235
233
 
236
234
  def update(
237
235
  self,
238
- loadbalancer_id: str,
236
+ load_balancer_id: str,
239
237
  *,
240
238
  project_id: int | None = None,
241
239
  region_id: int | None = None,
@@ -298,12 +296,10 @@ class LoadBalancersResource(SyncAPIResource):
298
296
  project_id = self._client._get_cloud_project_id_path_param()
299
297
  if region_id is None:
300
298
  region_id = self._client._get_cloud_region_id_path_param()
301
- if not loadbalancer_id:
302
- raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
299
+ if not load_balancer_id:
300
+ raise ValueError(f"Expected a non-empty value for `load_balancer_id` but received {load_balancer_id!r}")
303
301
  return self._patch(
304
- f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}"
305
- if self._client._base_url_overridden
306
- else f"https://api.gcore.com//cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}",
302
+ f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{load_balancer_id}",
307
303
  body=maybe_transform(
308
304
  {
309
305
  "logging": logging,
@@ -381,9 +377,7 @@ class LoadBalancersResource(SyncAPIResource):
381
377
  if region_id is None:
382
378
  region_id = self._client._get_cloud_region_id_path_param()
383
379
  return self._get_api_list(
384
- f"/cloud/v1/loadbalancers/{project_id}/{region_id}"
385
- if self._client._base_url_overridden
386
- else f"https://api.gcore.com//cloud/v1/loadbalancers/{project_id}/{region_id}",
380
+ f"/cloud/v1/loadbalancers/{project_id}/{region_id}",
387
381
  page=SyncOffsetPage[LoadBalancer],
388
382
  options=make_request_options(
389
383
  extra_headers=extra_headers,
@@ -409,194 +403,6 @@ class LoadBalancersResource(SyncAPIResource):
409
403
  model=LoadBalancer,
410
404
  )
411
405
 
412
- def delete(
413
- self,
414
- loadbalancer_id: str,
415
- *,
416
- project_id: int | None = None,
417
- region_id: int | None = None,
418
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
419
- # The extra values given here take precedence over values defined on the client or passed to this method.
420
- extra_headers: Headers | None = None,
421
- extra_query: Query | None = None,
422
- extra_body: Body | None = None,
423
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
424
- ) -> TaskIDList:
425
- """
426
- Delete load balancer
427
-
428
- Args:
429
- extra_headers: Send extra headers
430
-
431
- extra_query: Add additional query parameters to the request
432
-
433
- extra_body: Add additional JSON properties to the request
434
-
435
- timeout: Override the client-level default timeout for this request, in seconds
436
- """
437
- if project_id is None:
438
- project_id = self._client._get_cloud_project_id_path_param()
439
- if region_id is None:
440
- region_id = self._client._get_cloud_region_id_path_param()
441
- if not loadbalancer_id:
442
- raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
443
- return self._delete(
444
- f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}"
445
- if self._client._base_url_overridden
446
- else f"https://api.gcore.com//cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}",
447
- options=make_request_options(
448
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
449
- ),
450
- cast_to=TaskIDList,
451
- )
452
-
453
- def failover(
454
- self,
455
- loadbalancer_id: str,
456
- *,
457
- project_id: int | None = None,
458
- region_id: int | None = None,
459
- force: bool | Omit = omit,
460
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
461
- # The extra values given here take precedence over values defined on the client or passed to this method.
462
- extra_headers: Headers | None = None,
463
- extra_query: Query | None = None,
464
- extra_body: Body | None = None,
465
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
466
- ) -> TaskIDList:
467
- """
468
- Failover load balancer
469
-
470
- Args:
471
- force: Validate current load balancer status before failover or not.
472
-
473
- extra_headers: Send extra headers
474
-
475
- extra_query: Add additional query parameters to the request
476
-
477
- extra_body: Add additional JSON properties to the request
478
-
479
- timeout: Override the client-level default timeout for this request, in seconds
480
- """
481
- if project_id is None:
482
- project_id = self._client._get_cloud_project_id_path_param()
483
- if region_id is None:
484
- region_id = self._client._get_cloud_region_id_path_param()
485
- if not loadbalancer_id:
486
- raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
487
- return self._post(
488
- f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}/failover"
489
- if self._client._base_url_overridden
490
- else f"https://api.gcore.com//cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}/failover",
491
- body=maybe_transform({"force": force}, load_balancer_failover_params.LoadBalancerFailoverParams),
492
- options=make_request_options(
493
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
494
- ),
495
- cast_to=TaskIDList,
496
- )
497
-
498
- def get(
499
- self,
500
- loadbalancer_id: str,
501
- *,
502
- project_id: int | None = None,
503
- region_id: int | None = None,
504
- show_stats: bool | Omit = omit,
505
- with_ddos: bool | Omit = omit,
506
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
507
- # The extra values given here take precedence over values defined on the client or passed to this method.
508
- extra_headers: Headers | None = None,
509
- extra_query: Query | None = None,
510
- extra_body: Body | None = None,
511
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
512
- ) -> LoadBalancer:
513
- """
514
- Get load balancer
515
-
516
- Args:
517
- show_stats: Show statistics
518
-
519
- with_ddos: Show DDoS profile
520
-
521
- extra_headers: Send extra headers
522
-
523
- extra_query: Add additional query parameters to the request
524
-
525
- extra_body: Add additional JSON properties to the request
526
-
527
- timeout: Override the client-level default timeout for this request, in seconds
528
- """
529
- if project_id is None:
530
- project_id = self._client._get_cloud_project_id_path_param()
531
- if region_id is None:
532
- region_id = self._client._get_cloud_region_id_path_param()
533
- if not loadbalancer_id:
534
- raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
535
- return self._get(
536
- f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}"
537
- if self._client._base_url_overridden
538
- else f"https://api.gcore.com//cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}",
539
- options=make_request_options(
540
- extra_headers=extra_headers,
541
- extra_query=extra_query,
542
- extra_body=extra_body,
543
- timeout=timeout,
544
- query=maybe_transform(
545
- {
546
- "show_stats": show_stats,
547
- "with_ddos": with_ddos,
548
- },
549
- load_balancer_get_params.LoadBalancerGetParams,
550
- ),
551
- ),
552
- cast_to=LoadBalancer,
553
- )
554
-
555
- def resize(
556
- self,
557
- loadbalancer_id: str,
558
- *,
559
- project_id: int | None = None,
560
- region_id: int | None = None,
561
- flavor: str,
562
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
563
- # The extra values given here take precedence over values defined on the client or passed to this method.
564
- extra_headers: Headers | None = None,
565
- extra_query: Query | None = None,
566
- extra_body: Body | None = None,
567
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
568
- ) -> TaskIDList:
569
- """
570
- Resize load balancer
571
-
572
- Args:
573
- flavor: Name of the desired flavor to resize to.
574
-
575
- extra_headers: Send extra headers
576
-
577
- extra_query: Add additional query parameters to the request
578
-
579
- extra_body: Add additional JSON properties to the request
580
-
581
- timeout: Override the client-level default timeout for this request, in seconds
582
- """
583
- if project_id is None:
584
- project_id = self._client._get_cloud_project_id_path_param()
585
- if region_id is None:
586
- region_id = self._client._get_cloud_region_id_path_param()
587
- if not loadbalancer_id:
588
- raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
589
- return self._post(
590
- f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}/resize"
591
- if self._client._base_url_overridden
592
- else f"https://api.gcore.com//cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}/resize",
593
- body=maybe_transform({"flavor": flavor}, load_balancer_resize_params.LoadBalancerResizeParams),
594
- options=make_request_options(
595
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
596
- ),
597
- cast_to=TaskIDList,
598
- )
599
-
600
406
  def create_and_poll(
601
407
  self,
602
408
  *,
@@ -615,6 +421,7 @@ class LoadBalancersResource(SyncAPIResource):
615
421
  vip_port_id: str | Omit = omit,
616
422
  vip_subnet_id: str | Omit = omit,
617
423
  polling_interval_seconds: int | Omit = omit,
424
+ polling_timeout_seconds: int | Omit = omit,
618
425
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
619
426
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
620
427
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -648,6 +455,7 @@ class LoadBalancersResource(SyncAPIResource):
648
455
  task_id=response.tasks[0],
649
456
  extra_headers=extra_headers,
650
457
  polling_interval_seconds=polling_interval_seconds,
458
+ polling_timeout_seconds=polling_timeout_seconds,
651
459
  )
652
460
  if (
653
461
  not task.created_resources
@@ -656,7 +464,7 @@ class LoadBalancersResource(SyncAPIResource):
656
464
  ):
657
465
  raise ValueError(f"Expected exactly one resource to be created in a task")
658
466
  return self.get(
659
- loadbalancer_id=task.created_resources.loadbalancers[0],
467
+ load_balancer_id=task.created_resources.loadbalancers[0],
660
468
  project_id=project_id,
661
469
  region_id=region_id,
662
470
  extra_headers=extra_headers,
@@ -665,11 +473,12 @@ class LoadBalancersResource(SyncAPIResource):
665
473
 
666
474
  def delete_and_poll(
667
475
  self,
668
- loadbalancer_id: str,
476
+ load_balancer_id: str,
669
477
  *,
670
478
  project_id: int | None = None,
671
479
  region_id: int | None = None,
672
480
  polling_interval_seconds: int | Omit = omit,
481
+ polling_timeout_seconds: int | Omit = omit,
673
482
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
674
483
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
675
484
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -681,7 +490,7 @@ class LoadBalancersResource(SyncAPIResource):
681
490
  Delete load balancer and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
682
491
  """
683
492
  response = self.delete(
684
- loadbalancer_id=loadbalancer_id,
493
+ load_balancer_id=load_balancer_id,
685
494
  project_id=project_id,
686
495
  region_id=region_id,
687
496
  extra_headers=extra_headers,
@@ -695,16 +504,18 @@ class LoadBalancersResource(SyncAPIResource):
695
504
  task_id=response.tasks[0],
696
505
  extra_headers=extra_headers,
697
506
  polling_interval_seconds=polling_interval_seconds,
507
+ polling_timeout_seconds=polling_timeout_seconds,
698
508
  )
699
509
 
700
510
  def failover_and_poll(
701
511
  self,
702
- loadbalancer_id: str,
512
+ load_balancer_id: str,
703
513
  *,
704
514
  project_id: int | None = None,
705
515
  region_id: int | None = None,
706
516
  force: bool | Omit = omit,
707
517
  polling_interval_seconds: int | Omit = omit,
518
+ polling_timeout_seconds: int | Omit = omit,
708
519
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
709
520
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
710
521
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -716,7 +527,7 @@ class LoadBalancersResource(SyncAPIResource):
716
527
  Failover load balancer and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
717
528
  """
718
529
  response = self.failover(
719
- loadbalancer_id=loadbalancer_id,
530
+ load_balancer_id=load_balancer_id,
720
531
  project_id=project_id,
721
532
  region_id=region_id,
722
533
  force=force,
@@ -731,9 +542,10 @@ class LoadBalancersResource(SyncAPIResource):
731
542
  task_id=response.tasks[0],
732
543
  extra_headers=extra_headers,
733
544
  polling_interval_seconds=polling_interval_seconds,
545
+ polling_timeout_seconds=polling_timeout_seconds,
734
546
  )
735
547
  return self.get(
736
- loadbalancer_id=loadbalancer_id,
548
+ load_balancer_id=load_balancer_id,
737
549
  project_id=project_id,
738
550
  region_id=region_id,
739
551
  extra_headers=extra_headers,
@@ -742,12 +554,13 @@ class LoadBalancersResource(SyncAPIResource):
742
554
 
743
555
  def resize_and_poll(
744
556
  self,
745
- loadbalancer_id: str,
557
+ load_balancer_id: str,
746
558
  *,
747
559
  project_id: int | None = None,
748
560
  region_id: int | None = None,
749
561
  flavor: str,
750
562
  polling_interval_seconds: int | Omit = omit,
563
+ polling_timeout_seconds: int | Omit = omit,
751
564
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
752
565
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
753
566
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -759,7 +572,7 @@ class LoadBalancersResource(SyncAPIResource):
759
572
  Resize load balancer and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
760
573
  """
761
574
  response = self.resize(
762
- loadbalancer_id=loadbalancer_id,
575
+ load_balancer_id=load_balancer_id,
763
576
  project_id=project_id,
764
577
  region_id=region_id,
765
578
  flavor=flavor,
@@ -774,77 +587,62 @@ class LoadBalancersResource(SyncAPIResource):
774
587
  task_id=response.tasks[0],
775
588
  extra_headers=extra_headers,
776
589
  polling_interval_seconds=polling_interval_seconds,
590
+ polling_timeout_seconds=polling_timeout_seconds,
777
591
  )
778
592
  return self.get(
779
- loadbalancer_id=loadbalancer_id,
593
+ load_balancer_id=load_balancer_id,
780
594
  project_id=project_id,
781
595
  region_id=region_id,
782
596
  extra_headers=extra_headers,
783
597
  timeout=timeout,
784
598
  )
785
599
 
786
-
787
- class AsyncLoadBalancersResource(AsyncAPIResource):
788
- @cached_property
789
- def l7_policies(self) -> AsyncL7PoliciesResource:
790
- return AsyncL7PoliciesResource(self._client)
791
-
792
- @cached_property
793
- def flavors(self) -> AsyncFlavorsResource:
794
- return AsyncFlavorsResource(self._client)
795
-
796
- @cached_property
797
- def listeners(self) -> AsyncListenersResource:
798
- return AsyncListenersResource(self._client)
799
-
800
- @cached_property
801
- def pools(self) -> AsyncPoolsResource:
802
- return AsyncPoolsResource(self._client)
803
-
804
- @cached_property
805
- def metrics(self) -> AsyncMetricsResource:
806
- return AsyncMetricsResource(self._client)
807
-
808
- @cached_property
809
- def statuses(self) -> AsyncStatusesResource:
810
- return AsyncStatusesResource(self._client)
811
-
812
- @cached_property
813
- def with_raw_response(self) -> AsyncLoadBalancersResourceWithRawResponse:
600
+ def delete(
601
+ self,
602
+ load_balancer_id: str,
603
+ *,
604
+ project_id: int | None = None,
605
+ region_id: int | None = None,
606
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
607
+ # The extra values given here take precedence over values defined on the client or passed to this method.
608
+ extra_headers: Headers | None = None,
609
+ extra_query: Query | None = None,
610
+ extra_body: Body | None = None,
611
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
612
+ ) -> TaskIDList:
814
613
  """
815
- This property can be used as a prefix for any HTTP method call to return
816
- the raw response object instead of the parsed content.
614
+ Delete load balancer
817
615
 
818
- For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
819
- """
820
- return AsyncLoadBalancersResourceWithRawResponse(self)
616
+ Args:
617
+ extra_headers: Send extra headers
821
618
 
822
- @cached_property
823
- def with_streaming_response(self) -> AsyncLoadBalancersResourceWithStreamingResponse:
824
- """
825
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
619
+ extra_query: Add additional query parameters to the request
826
620
 
827
- For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
621
+ extra_body: Add additional JSON properties to the request
622
+
623
+ timeout: Override the client-level default timeout for this request, in seconds
828
624
  """
829
- return AsyncLoadBalancersResourceWithStreamingResponse(self)
625
+ if project_id is None:
626
+ project_id = self._client._get_cloud_project_id_path_param()
627
+ if region_id is None:
628
+ region_id = self._client._get_cloud_region_id_path_param()
629
+ if not load_balancer_id:
630
+ raise ValueError(f"Expected a non-empty value for `load_balancer_id` but received {load_balancer_id!r}")
631
+ return self._delete(
632
+ f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{load_balancer_id}",
633
+ options=make_request_options(
634
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
635
+ ),
636
+ cast_to=TaskIDList,
637
+ )
830
638
 
831
- async def create(
639
+ def failover(
832
640
  self,
641
+ load_balancer_id: str,
833
642
  *,
834
643
  project_id: int | None = None,
835
644
  region_id: int | None = None,
836
- flavor: str | Omit = omit,
837
- floating_ip: load_balancer_create_params.FloatingIP | Omit = omit,
838
- listeners: Iterable[load_balancer_create_params.Listener] | Omit = omit,
839
- logging: load_balancer_create_params.Logging | Omit = omit,
840
- name: str | Omit = omit,
841
- name_template: str | Omit = omit,
842
- preferred_connectivity: LoadBalancerMemberConnectivity | Omit = omit,
843
- tags: Dict[str, str] | Omit = omit,
844
- vip_ip_family: InterfaceIPFamily | Omit = omit,
845
- vip_network_id: str | Omit = omit,
846
- vip_port_id: str | Omit = omit,
847
- vip_subnet_id: str | Omit = omit,
645
+ force: bool | Omit = omit,
848
646
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
849
647
  # The extra values given here take precedence over values defined on the client or passed to this method.
850
648
  extra_headers: Headers | None = None,
@@ -853,49 +651,14 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
853
651
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
854
652
  ) -> TaskIDList:
855
653
  """
856
- Create load balancer
654
+ Failover load balancer
857
655
 
858
656
  Args:
859
- flavor: Load balancer flavor name
657
+ force: Validate current load balancer status before failover or not.
860
658
 
861
- floating_ip: Floating IP configuration for assignment
659
+ extra_headers: Send extra headers
862
660
 
863
- listeners: Load balancer listeners. Maximum 50 per LB (excluding Prometheus endpoint
864
- listener).
865
-
866
- logging: Logging configuration
867
-
868
- name: Load balancer name
869
-
870
- name_template: Load balancer name which will be changed by template.
871
-
872
- preferred_connectivity: Preferred option to establish connectivity between load balancer and its pools
873
- members. L2 provides best performance, L3 provides less IPs usage. It is taking
874
- effect only if `instance_id` + `ip_address` is provided, not `subnet_id` +
875
- `ip_address`, because we're considering this as intentional `subnet_id`
876
- specification.
877
-
878
- tags: Key-value tags to associate with the resource. A tag is a key-value pair that
879
- can be associated with a resource, enabling efficient filtering and grouping for
880
- better organization and management. Some tags are read-only and cannot be
881
- modified by the user. Tags are also integrated with cost reports, allowing cost
882
- data to be filtered based on tag keys or values.
883
-
884
- vip_ip_family: IP family for load balancer subnet auto-selection if `vip_network_id` is
885
- specified
886
-
887
- vip_network_id: Network ID for load balancer. If not specified, default external network will be
888
- used. Mutually exclusive with `vip_port_id`
889
-
890
- vip_port_id: Existing Reserved Fixed IP port ID for load balancer. Mutually exclusive with
891
- `vip_network_id`
892
-
893
- vip_subnet_id: Subnet ID for load balancer. If not specified, any subnet from `vip_network_id`
894
- will be selected. Ignored when `vip_network_id` is not specified.
895
-
896
- extra_headers: Send extra headers
897
-
898
- extra_query: Add additional query parameters to the request
661
+ extra_query: Add additional query parameters to the request
899
662
 
900
663
  extra_body: Add additional JSON properties to the request
901
664
 
@@ -905,133 +668,24 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
905
668
  project_id = self._client._get_cloud_project_id_path_param()
906
669
  if region_id is None:
907
670
  region_id = self._client._get_cloud_region_id_path_param()
908
- return await self._post(
909
- f"/cloud/v1/loadbalancers/{project_id}/{region_id}"
910
- if self._client._base_url_overridden
911
- else f"https://api.gcore.com//cloud/v1/loadbalancers/{project_id}/{region_id}",
912
- body=await async_maybe_transform(
913
- {
914
- "flavor": flavor,
915
- "floating_ip": floating_ip,
916
- "listeners": listeners,
917
- "logging": logging,
918
- "name": name,
919
- "name_template": name_template,
920
- "preferred_connectivity": preferred_connectivity,
921
- "tags": tags,
922
- "vip_ip_family": vip_ip_family,
923
- "vip_network_id": vip_network_id,
924
- "vip_port_id": vip_port_id,
925
- "vip_subnet_id": vip_subnet_id,
926
- },
927
- load_balancer_create_params.LoadBalancerCreateParams,
928
- ),
671
+ if not load_balancer_id:
672
+ raise ValueError(f"Expected a non-empty value for `load_balancer_id` but received {load_balancer_id!r}")
673
+ return self._post(
674
+ f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{load_balancer_id}/failover",
675
+ body=maybe_transform({"force": force}, load_balancer_failover_params.LoadBalancerFailoverParams),
929
676
  options=make_request_options(
930
677
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
931
678
  ),
932
679
  cast_to=TaskIDList,
933
680
  )
934
681
 
935
- async def update(
936
- self,
937
- loadbalancer_id: str,
938
- *,
939
- project_id: int | None = None,
940
- region_id: int | None = None,
941
- logging: load_balancer_update_params.Logging | Omit = omit,
942
- name: str | Omit = omit,
943
- preferred_connectivity: LoadBalancerMemberConnectivity | Omit = omit,
944
- tags: Optional[TagUpdateMapParam] | Omit = omit,
945
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
946
- # The extra values given here take precedence over values defined on the client or passed to this method.
947
- extra_headers: Headers | None = None,
948
- extra_query: Query | None = None,
949
- extra_body: Body | None = None,
950
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
951
- ) -> LoadBalancer:
952
- """
953
- Rename load balancer, activate/deactivate logging, update preferred connectivity
954
- type and/or modify load balancer tags. The request will only process the fields
955
- that are provided in the request body. Any fields that are not included will
956
- remain unchanged.
957
-
958
- Args:
959
- logging: Logging configuration
960
-
961
- name: Name.
962
-
963
- preferred_connectivity: Preferred option to establish connectivity between load balancer and its pools
964
- members
965
-
966
- tags: Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide
967
- key-value pairs to add or update tags. Set tag values to `null` to remove tags.
968
- Unspecified tags remain unchanged. Read-only tags are always preserved and
969
- cannot be modified.
970
-
971
- **Examples:**
972
-
973
- - **Add/update tags:**
974
- `{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
975
- updates existing ones.
976
- - **Delete tags:** `{'tags': {'`old_tag`': null}}` removes specific tags.
977
- - **Remove all tags:** `{'tags': null}` removes all user-managed tags (read-only
978
- tags are preserved).
979
- - **Partial update:** `{'tags': {'environment': 'staging'}}` only updates
980
- specified tags.
981
- - **Mixed operations:**
982
- `{'tags': {'environment': 'production', '`cost_center`': 'engineering', '`deprecated_tag`': null}}`
983
- adds/updates 'environment' and '`cost_center`' while removing
984
- '`deprecated_tag`', preserving other existing tags.
985
- - **Replace all:** first delete existing tags with null values, then add new
986
- ones in the same request.
987
-
988
- extra_headers: Send extra headers
989
-
990
- extra_query: Add additional query parameters to the request
991
-
992
- extra_body: Add additional JSON properties to the request
993
-
994
- timeout: Override the client-level default timeout for this request, in seconds
995
- """
996
- if project_id is None:
997
- project_id = self._client._get_cloud_project_id_path_param()
998
- if region_id is None:
999
- region_id = self._client._get_cloud_region_id_path_param()
1000
- if not loadbalancer_id:
1001
- raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
1002
- return await self._patch(
1003
- f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}"
1004
- if self._client._base_url_overridden
1005
- else f"https://api.gcore.com//cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}",
1006
- body=await async_maybe_transform(
1007
- {
1008
- "logging": logging,
1009
- "name": name,
1010
- "preferred_connectivity": preferred_connectivity,
1011
- "tags": tags,
1012
- },
1013
- load_balancer_update_params.LoadBalancerUpdateParams,
1014
- ),
1015
- options=make_request_options(
1016
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1017
- ),
1018
- cast_to=LoadBalancer,
1019
- )
1020
-
1021
- def list(
682
+ def get(
1022
683
  self,
684
+ load_balancer_id: str,
1023
685
  *,
1024
686
  project_id: int | None = None,
1025
687
  region_id: int | None = None,
1026
- assigned_floating: bool | Omit = omit,
1027
- limit: int | Omit = omit,
1028
- logging_enabled: bool | Omit = omit,
1029
- name: str | Omit = omit,
1030
- offset: int | Omit = omit,
1031
- order_by: str | Omit = omit,
1032
688
  show_stats: bool | Omit = omit,
1033
- tag_key: SequenceNotStr[str] | Omit = omit,
1034
- tag_key_value: str | Omit = omit,
1035
689
  with_ddos: bool | Omit = omit,
1036
690
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1037
691
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1039,33 +693,14 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1039
693
  extra_query: Query | None = None,
1040
694
  extra_body: Body | None = None,
1041
695
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
1042
- ) -> AsyncPaginator[LoadBalancer, AsyncOffsetPage[LoadBalancer]]:
696
+ ) -> LoadBalancer:
1043
697
  """
1044
- List load balancers
698
+ Get load balancer
1045
699
 
1046
700
  Args:
1047
- assigned_floating: With or without assigned floating IP
1048
-
1049
- limit: Limit the number of returned limit request entities.
1050
-
1051
- logging_enabled: With or without logging
1052
-
1053
- name: Filter by name
1054
-
1055
- offset: Offset value is used to exclude the first set of records from the result.
1056
-
1057
- order_by: Ordering Load Balancer list result by name, `created_at`, `updated_at`,
1058
- `operating_status`, `provisioning_status`, `vip_address`, `vip_ip_family` and
1059
- flavor fields of the load balancer and directions (name.asc), default is
1060
- "`created_at`.asc"
1061
-
1062
701
  show_stats: Show statistics
1063
702
 
1064
- tag_key: Filter by tag keys.
1065
-
1066
- tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
1067
-
1068
- with_ddos: Show Advanced DDoS protection profile, if exists
703
+ with_ddos: Show DDoS profile
1069
704
 
1070
705
  extra_headers: Send extra headers
1071
706
 
@@ -1079,11 +714,10 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1079
714
  project_id = self._client._get_cloud_project_id_path_param()
1080
715
  if region_id is None:
1081
716
  region_id = self._client._get_cloud_region_id_path_param()
1082
- return self._get_api_list(
1083
- f"/cloud/v1/loadbalancers/{project_id}/{region_id}"
1084
- if self._client._base_url_overridden
1085
- else f"https://api.gcore.com//cloud/v1/loadbalancers/{project_id}/{region_id}",
1086
- page=AsyncOffsetPage[LoadBalancer],
717
+ if not load_balancer_id:
718
+ raise ValueError(f"Expected a non-empty value for `load_balancer_id` but received {load_balancer_id!r}")
719
+ return self._get(
720
+ f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{load_balancer_id}",
1087
721
  options=make_request_options(
1088
722
  extra_headers=extra_headers,
1089
723
  extra_query=extra_query,
@@ -1091,29 +725,22 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1091
725
  timeout=timeout,
1092
726
  query=maybe_transform(
1093
727
  {
1094
- "assigned_floating": assigned_floating,
1095
- "limit": limit,
1096
- "logging_enabled": logging_enabled,
1097
- "name": name,
1098
- "offset": offset,
1099
- "order_by": order_by,
1100
728
  "show_stats": show_stats,
1101
- "tag_key": tag_key,
1102
- "tag_key_value": tag_key_value,
1103
729
  "with_ddos": with_ddos,
1104
730
  },
1105
- load_balancer_list_params.LoadBalancerListParams,
731
+ load_balancer_get_params.LoadBalancerGetParams,
1106
732
  ),
1107
733
  ),
1108
- model=LoadBalancer,
734
+ cast_to=LoadBalancer,
1109
735
  )
1110
736
 
1111
- async def delete(
737
+ def resize(
1112
738
  self,
1113
- loadbalancer_id: str,
739
+ load_balancer_id: str,
1114
740
  *,
1115
741
  project_id: int | None = None,
1116
742
  region_id: int | None = None,
743
+ flavor: str,
1117
744
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1118
745
  # The extra values given here take precedence over values defined on the client or passed to this method.
1119
746
  extra_headers: Headers | None = None,
@@ -1122,9 +749,11 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1122
749
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
1123
750
  ) -> TaskIDList:
1124
751
  """
1125
- Delete load balancer
752
+ Resize load balancer
1126
753
 
1127
754
  Args:
755
+ flavor: Name of the desired flavor to resize to.
756
+
1128
757
  extra_headers: Send extra headers
1129
758
 
1130
759
  extra_query: Add additional query parameters to the request
@@ -1137,25 +766,79 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1137
766
  project_id = self._client._get_cloud_project_id_path_param()
1138
767
  if region_id is None:
1139
768
  region_id = self._client._get_cloud_region_id_path_param()
1140
- if not loadbalancer_id:
1141
- raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
1142
- return await self._delete(
1143
- f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}"
1144
- if self._client._base_url_overridden
1145
- else f"https://api.gcore.com//cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}",
769
+ if not load_balancer_id:
770
+ raise ValueError(f"Expected a non-empty value for `load_balancer_id` but received {load_balancer_id!r}")
771
+ return self._post(
772
+ f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{load_balancer_id}/resize",
773
+ body=maybe_transform({"flavor": flavor}, load_balancer_resize_params.LoadBalancerResizeParams),
1146
774
  options=make_request_options(
1147
775
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1148
776
  ),
1149
777
  cast_to=TaskIDList,
1150
778
  )
1151
779
 
1152
- async def failover(
780
+
781
+ class AsyncLoadBalancersResource(AsyncAPIResource):
782
+ @cached_property
783
+ def l7_policies(self) -> AsyncL7PoliciesResource:
784
+ return AsyncL7PoliciesResource(self._client)
785
+
786
+ @cached_property
787
+ def flavors(self) -> AsyncFlavorsResource:
788
+ return AsyncFlavorsResource(self._client)
789
+
790
+ @cached_property
791
+ def listeners(self) -> AsyncListenersResource:
792
+ return AsyncListenersResource(self._client)
793
+
794
+ @cached_property
795
+ def pools(self) -> AsyncPoolsResource:
796
+ return AsyncPoolsResource(self._client)
797
+
798
+ @cached_property
799
+ def metrics(self) -> AsyncMetricsResource:
800
+ return AsyncMetricsResource(self._client)
801
+
802
+ @cached_property
803
+ def statuses(self) -> AsyncStatusesResource:
804
+ return AsyncStatusesResource(self._client)
805
+
806
+ @cached_property
807
+ def with_raw_response(self) -> AsyncLoadBalancersResourceWithRawResponse:
808
+ """
809
+ This property can be used as a prefix for any HTTP method call to return
810
+ the raw response object instead of the parsed content.
811
+
812
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
813
+ """
814
+ return AsyncLoadBalancersResourceWithRawResponse(self)
815
+
816
+ @cached_property
817
+ def with_streaming_response(self) -> AsyncLoadBalancersResourceWithStreamingResponse:
818
+ """
819
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
820
+
821
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
822
+ """
823
+ return AsyncLoadBalancersResourceWithStreamingResponse(self)
824
+
825
+ async def create(
1153
826
  self,
1154
- loadbalancer_id: str,
1155
827
  *,
1156
828
  project_id: int | None = None,
1157
829
  region_id: int | None = None,
1158
- force: bool | Omit = omit,
830
+ flavor: str | Omit = omit,
831
+ floating_ip: load_balancer_create_params.FloatingIP | Omit = omit,
832
+ listeners: Iterable[load_balancer_create_params.Listener] | Omit = omit,
833
+ logging: load_balancer_create_params.Logging | Omit = omit,
834
+ name: str | Omit = omit,
835
+ name_template: str | Omit = omit,
836
+ preferred_connectivity: LoadBalancerMemberConnectivity | Omit = omit,
837
+ tags: Dict[str, str] | Omit = omit,
838
+ vip_ip_family: InterfaceIPFamily | Omit = omit,
839
+ vip_network_id: str | Omit = omit,
840
+ vip_port_id: str | Omit = omit,
841
+ vip_subnet_id: str | Omit = omit,
1159
842
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1160
843
  # The extra values given here take precedence over values defined on the client or passed to this method.
1161
844
  extra_headers: Headers | None = None,
@@ -1164,10 +847,45 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1164
847
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
1165
848
  ) -> TaskIDList:
1166
849
  """
1167
- Failover load balancer
850
+ Create load balancer
1168
851
 
1169
852
  Args:
1170
- force: Validate current load balancer status before failover or not.
853
+ flavor: Load balancer flavor name
854
+
855
+ floating_ip: Floating IP configuration for assignment
856
+
857
+ listeners: Load balancer listeners. Maximum 50 per LB (excluding Prometheus endpoint
858
+ listener).
859
+
860
+ logging: Logging configuration
861
+
862
+ name: Load balancer name
863
+
864
+ name_template: Load balancer name which will be changed by template.
865
+
866
+ preferred_connectivity: Preferred option to establish connectivity between load balancer and its pools
867
+ members. L2 provides best performance, L3 provides less IPs usage. It is taking
868
+ effect only if `instance_id` + `ip_address` is provided, not `subnet_id` +
869
+ `ip_address`, because we're considering this as intentional `subnet_id`
870
+ specification.
871
+
872
+ tags: Key-value tags to associate with the resource. A tag is a key-value pair that
873
+ can be associated with a resource, enabling efficient filtering and grouping for
874
+ better organization and management. Some tags are read-only and cannot be
875
+ modified by the user. Tags are also integrated with cost reports, allowing cost
876
+ data to be filtered based on tag keys or values.
877
+
878
+ vip_ip_family: IP family for load balancer subnet auto-selection if `vip_network_id` is
879
+ specified
880
+
881
+ vip_network_id: Network ID for load balancer. If not specified, default external network will be
882
+ used. Mutually exclusive with `vip_port_id`
883
+
884
+ vip_port_id: Existing Reserved Fixed IP port ID for load balancer. Mutually exclusive with
885
+ `vip_network_id`
886
+
887
+ vip_subnet_id: Subnet ID for load balancer. If not specified, any subnet from `vip_network_id`
888
+ will be selected. Ignored when `vip_network_id` is not specified.
1171
889
 
1172
890
  extra_headers: Send extra headers
1173
891
 
@@ -1181,14 +899,24 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1181
899
  project_id = self._client._get_cloud_project_id_path_param()
1182
900
  if region_id is None:
1183
901
  region_id = self._client._get_cloud_region_id_path_param()
1184
- if not loadbalancer_id:
1185
- raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
1186
902
  return await self._post(
1187
- f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}/failover"
1188
- if self._client._base_url_overridden
1189
- else f"https://api.gcore.com//cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}/failover",
903
+ f"/cloud/v1/loadbalancers/{project_id}/{region_id}",
1190
904
  body=await async_maybe_transform(
1191
- {"force": force}, load_balancer_failover_params.LoadBalancerFailoverParams
905
+ {
906
+ "flavor": flavor,
907
+ "floating_ip": floating_ip,
908
+ "listeners": listeners,
909
+ "logging": logging,
910
+ "name": name,
911
+ "name_template": name_template,
912
+ "preferred_connectivity": preferred_connectivity,
913
+ "tags": tags,
914
+ "vip_ip_family": vip_ip_family,
915
+ "vip_network_id": vip_network_id,
916
+ "vip_port_id": vip_port_id,
917
+ "vip_subnet_id": vip_subnet_id,
918
+ },
919
+ load_balancer_create_params.LoadBalancerCreateParams,
1192
920
  ),
1193
921
  options=make_request_options(
1194
922
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -1196,14 +924,16 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1196
924
  cast_to=TaskIDList,
1197
925
  )
1198
926
 
1199
- async def get(
927
+ async def update(
1200
928
  self,
1201
- loadbalancer_id: str,
929
+ load_balancer_id: str,
1202
930
  *,
1203
931
  project_id: int | None = None,
1204
932
  region_id: int | None = None,
1205
- show_stats: bool | Omit = omit,
1206
- with_ddos: bool | Omit = omit,
933
+ logging: load_balancer_update_params.Logging | Omit = omit,
934
+ name: str | Omit = omit,
935
+ preferred_connectivity: LoadBalancerMemberConnectivity | Omit = omit,
936
+ tags: Optional[TagUpdateMapParam] | Omit = omit,
1207
937
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1208
938
  # The extra values given here take precedence over values defined on the client or passed to this method.
1209
939
  extra_headers: Headers | None = None,
@@ -1212,12 +942,40 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1212
942
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
1213
943
  ) -> LoadBalancer:
1214
944
  """
1215
- Get load balancer
945
+ Rename load balancer, activate/deactivate logging, update preferred connectivity
946
+ type and/or modify load balancer tags. The request will only process the fields
947
+ that are provided in the request body. Any fields that are not included will
948
+ remain unchanged.
1216
949
 
1217
950
  Args:
1218
- show_stats: Show statistics
951
+ logging: Logging configuration
1219
952
 
1220
- with_ddos: Show DDoS profile
953
+ name: Name.
954
+
955
+ preferred_connectivity: Preferred option to establish connectivity between load balancer and its pools
956
+ members
957
+
958
+ tags: Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide
959
+ key-value pairs to add or update tags. Set tag values to `null` to remove tags.
960
+ Unspecified tags remain unchanged. Read-only tags are always preserved and
961
+ cannot be modified.
962
+
963
+ **Examples:**
964
+
965
+ - **Add/update tags:**
966
+ `{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
967
+ updates existing ones.
968
+ - **Delete tags:** `{'tags': {'`old_tag`': null}}` removes specific tags.
969
+ - **Remove all tags:** `{'tags': null}` removes all user-managed tags (read-only
970
+ tags are preserved).
971
+ - **Partial update:** `{'tags': {'environment': 'staging'}}` only updates
972
+ specified tags.
973
+ - **Mixed operations:**
974
+ `{'tags': {'environment': 'production', '`cost_center`': 'engineering', '`deprecated_tag`': null}}`
975
+ adds/updates 'environment' and '`cost_center`' while removing
976
+ '`deprecated_tag`', preserving other existing tags.
977
+ - **Replace all:** first delete existing tags with null values, then add new
978
+ ones in the same request.
1221
979
 
1222
980
  extra_headers: Send extra headers
1223
981
 
@@ -1231,47 +989,73 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1231
989
  project_id = self._client._get_cloud_project_id_path_param()
1232
990
  if region_id is None:
1233
991
  region_id = self._client._get_cloud_region_id_path_param()
1234
- if not loadbalancer_id:
1235
- raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
1236
- return await self._get(
1237
- f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}"
1238
- if self._client._base_url_overridden
1239
- else f"https://api.gcore.com//cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}",
992
+ if not load_balancer_id:
993
+ raise ValueError(f"Expected a non-empty value for `load_balancer_id` but received {load_balancer_id!r}")
994
+ return await self._patch(
995
+ f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{load_balancer_id}",
996
+ body=await async_maybe_transform(
997
+ {
998
+ "logging": logging,
999
+ "name": name,
1000
+ "preferred_connectivity": preferred_connectivity,
1001
+ "tags": tags,
1002
+ },
1003
+ load_balancer_update_params.LoadBalancerUpdateParams,
1004
+ ),
1240
1005
  options=make_request_options(
1241
- extra_headers=extra_headers,
1242
- extra_query=extra_query,
1243
- extra_body=extra_body,
1244
- timeout=timeout,
1245
- query=await async_maybe_transform(
1246
- {
1247
- "show_stats": show_stats,
1248
- "with_ddos": with_ddos,
1249
- },
1250
- load_balancer_get_params.LoadBalancerGetParams,
1251
- ),
1006
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1252
1007
  ),
1253
1008
  cast_to=LoadBalancer,
1254
1009
  )
1255
1010
 
1256
- async def resize(
1011
+ def list(
1257
1012
  self,
1258
- loadbalancer_id: str,
1259
1013
  *,
1260
1014
  project_id: int | None = None,
1261
1015
  region_id: int | None = None,
1262
- flavor: str,
1016
+ assigned_floating: bool | Omit = omit,
1017
+ limit: int | Omit = omit,
1018
+ logging_enabled: bool | Omit = omit,
1019
+ name: str | Omit = omit,
1020
+ offset: int | Omit = omit,
1021
+ order_by: str | Omit = omit,
1022
+ show_stats: bool | Omit = omit,
1023
+ tag_key: SequenceNotStr[str] | Omit = omit,
1024
+ tag_key_value: str | Omit = omit,
1025
+ with_ddos: bool | Omit = omit,
1263
1026
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1264
1027
  # The extra values given here take precedence over values defined on the client or passed to this method.
1265
1028
  extra_headers: Headers | None = None,
1266
1029
  extra_query: Query | None = None,
1267
1030
  extra_body: Body | None = None,
1268
1031
  timeout: float | httpx.Timeout | None | NotGiven = not_given,
1269
- ) -> TaskIDList:
1032
+ ) -> AsyncPaginator[LoadBalancer, AsyncOffsetPage[LoadBalancer]]:
1270
1033
  """
1271
- Resize load balancer
1034
+ List load balancers
1272
1035
 
1273
1036
  Args:
1274
- flavor: Name of the desired flavor to resize to.
1037
+ assigned_floating: With or without assigned floating IP
1038
+
1039
+ limit: Limit the number of returned limit request entities.
1040
+
1041
+ logging_enabled: With or without logging
1042
+
1043
+ name: Filter by name
1044
+
1045
+ offset: Offset value is used to exclude the first set of records from the result.
1046
+
1047
+ order_by: Ordering Load Balancer list result by name, `created_at`, `updated_at`,
1048
+ `operating_status`, `provisioning_status`, `vip_address`, `vip_ip_family` and
1049
+ flavor fields of the load balancer and directions (name.asc), default is
1050
+ "`created_at`.asc"
1051
+
1052
+ show_stats: Show statistics
1053
+
1054
+ tag_key: Filter by tag keys.
1055
+
1056
+ tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
1057
+
1058
+ with_ddos: Show Advanced DDoS protection profile, if exists
1275
1059
 
1276
1060
  extra_headers: Send extra headers
1277
1061
 
@@ -1285,17 +1069,31 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1285
1069
  project_id = self._client._get_cloud_project_id_path_param()
1286
1070
  if region_id is None:
1287
1071
  region_id = self._client._get_cloud_region_id_path_param()
1288
- if not loadbalancer_id:
1289
- raise ValueError(f"Expected a non-empty value for `loadbalancer_id` but received {loadbalancer_id!r}")
1290
- return await self._post(
1291
- f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}/resize"
1292
- if self._client._base_url_overridden
1293
- else f"https://api.gcore.com//cloud/v1/loadbalancers/{project_id}/{region_id}/{loadbalancer_id}/resize",
1294
- body=await async_maybe_transform({"flavor": flavor}, load_balancer_resize_params.LoadBalancerResizeParams),
1072
+ return self._get_api_list(
1073
+ f"/cloud/v1/loadbalancers/{project_id}/{region_id}",
1074
+ page=AsyncOffsetPage[LoadBalancer],
1295
1075
  options=make_request_options(
1296
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1076
+ extra_headers=extra_headers,
1077
+ extra_query=extra_query,
1078
+ extra_body=extra_body,
1079
+ timeout=timeout,
1080
+ query=maybe_transform(
1081
+ {
1082
+ "assigned_floating": assigned_floating,
1083
+ "limit": limit,
1084
+ "logging_enabled": logging_enabled,
1085
+ "name": name,
1086
+ "offset": offset,
1087
+ "order_by": order_by,
1088
+ "show_stats": show_stats,
1089
+ "tag_key": tag_key,
1090
+ "tag_key_value": tag_key_value,
1091
+ "with_ddos": with_ddos,
1092
+ },
1093
+ load_balancer_list_params.LoadBalancerListParams,
1094
+ ),
1297
1095
  ),
1298
- cast_to=TaskIDList,
1096
+ model=LoadBalancer,
1299
1097
  )
1300
1098
 
1301
1099
  async def create_and_poll(
@@ -1316,6 +1114,7 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1316
1114
  vip_port_id: str | Omit = omit,
1317
1115
  vip_subnet_id: str | Omit = omit,
1318
1116
  polling_interval_seconds: int | Omit = omit,
1117
+ polling_timeout_seconds: int | Omit = omit,
1319
1118
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1320
1119
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1321
1120
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1349,6 +1148,7 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1349
1148
  task_id=response.tasks[0],
1350
1149
  extra_headers=extra_headers,
1351
1150
  polling_interval_seconds=polling_interval_seconds,
1151
+ polling_timeout_seconds=polling_timeout_seconds,
1352
1152
  )
1353
1153
  if (
1354
1154
  not task.created_resources
@@ -1357,7 +1157,7 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1357
1157
  ):
1358
1158
  raise ValueError(f"Expected exactly one resource to be created in a task")
1359
1159
  return await self.get(
1360
- loadbalancer_id=task.created_resources.loadbalancers[0],
1160
+ load_balancer_id=task.created_resources.loadbalancers[0],
1361
1161
  project_id=project_id,
1362
1162
  region_id=region_id,
1363
1163
  extra_headers=extra_headers,
@@ -1366,11 +1166,12 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1366
1166
 
1367
1167
  async def delete_and_poll(
1368
1168
  self,
1369
- loadbalancer_id: str,
1169
+ load_balancer_id: str,
1370
1170
  *,
1371
1171
  project_id: int | None = None,
1372
1172
  region_id: int | None = None,
1373
1173
  polling_interval_seconds: int | Omit = omit,
1174
+ polling_timeout_seconds: int | Omit = omit,
1374
1175
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1375
1176
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1376
1177
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1382,7 +1183,7 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1382
1183
  Delete load balancer and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
1383
1184
  """
1384
1185
  response = await self.delete(
1385
- loadbalancer_id=loadbalancer_id,
1186
+ load_balancer_id=load_balancer_id,
1386
1187
  project_id=project_id,
1387
1188
  region_id=region_id,
1388
1189
  extra_headers=extra_headers,
@@ -1396,16 +1197,18 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1396
1197
  task_id=response.tasks[0],
1397
1198
  extra_headers=extra_headers,
1398
1199
  polling_interval_seconds=polling_interval_seconds,
1200
+ polling_timeout_seconds=polling_timeout_seconds,
1399
1201
  )
1400
1202
 
1401
1203
  async def failover_and_poll(
1402
1204
  self,
1403
- loadbalancer_id: str,
1205
+ load_balancer_id: str,
1404
1206
  *,
1405
1207
  project_id: int | None = None,
1406
1208
  region_id: int | None = None,
1407
1209
  force: bool | Omit = omit,
1408
1210
  polling_interval_seconds: int | Omit = omit,
1211
+ polling_timeout_seconds: int | Omit = omit,
1409
1212
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1410
1213
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1411
1214
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1417,7 +1220,7 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1417
1220
  Failover load balancer and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
1418
1221
  """
1419
1222
  response = await self.failover(
1420
- loadbalancer_id=loadbalancer_id,
1223
+ load_balancer_id=load_balancer_id,
1421
1224
  project_id=project_id,
1422
1225
  region_id=region_id,
1423
1226
  force=force,
@@ -1432,9 +1235,10 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1432
1235
  task_id=response.tasks[0],
1433
1236
  extra_headers=extra_headers,
1434
1237
  polling_interval_seconds=polling_interval_seconds,
1238
+ polling_timeout_seconds=polling_timeout_seconds,
1435
1239
  )
1436
1240
  return await self.get(
1437
- loadbalancer_id=loadbalancer_id,
1241
+ load_balancer_id=load_balancer_id,
1438
1242
  project_id=project_id,
1439
1243
  region_id=region_id,
1440
1244
  extra_headers=extra_headers,
@@ -1443,12 +1247,13 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1443
1247
 
1444
1248
  async def resize_and_poll(
1445
1249
  self,
1446
- loadbalancer_id: str,
1250
+ load_balancer_id: str,
1447
1251
  *,
1448
1252
  project_id: int | None = None,
1449
1253
  region_id: int | None = None,
1450
1254
  flavor: str,
1451
1255
  polling_interval_seconds: int | Omit = omit,
1256
+ polling_timeout_seconds: int | Omit = omit,
1452
1257
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1453
1258
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1454
1259
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -1460,7 +1265,7 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1460
1265
  Resize load balancer and poll for the result. Only the first task will be polled. If you need to poll more tasks, use the `tasks.poll` method.
1461
1266
  """
1462
1267
  response = await self.resize(
1463
- loadbalancer_id=loadbalancer_id,
1268
+ load_balancer_id=load_balancer_id,
1464
1269
  project_id=project_id,
1465
1270
  region_id=region_id,
1466
1271
  flavor=flavor,
@@ -1475,15 +1280,198 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1475
1280
  task_id=response.tasks[0],
1476
1281
  extra_headers=extra_headers,
1477
1282
  polling_interval_seconds=polling_interval_seconds,
1283
+ polling_timeout_seconds=polling_timeout_seconds,
1478
1284
  )
1479
1285
  return await self.get(
1480
- loadbalancer_id=loadbalancer_id,
1286
+ load_balancer_id=load_balancer_id,
1481
1287
  project_id=project_id,
1482
1288
  region_id=region_id,
1483
1289
  extra_headers=extra_headers,
1484
1290
  timeout=timeout,
1485
1291
  )
1486
1292
 
1293
+ async def delete(
1294
+ self,
1295
+ load_balancer_id: str,
1296
+ *,
1297
+ project_id: int | None = None,
1298
+ region_id: int | None = None,
1299
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1300
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1301
+ extra_headers: Headers | None = None,
1302
+ extra_query: Query | None = None,
1303
+ extra_body: Body | None = None,
1304
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1305
+ ) -> TaskIDList:
1306
+ """
1307
+ Delete load balancer
1308
+
1309
+ Args:
1310
+ extra_headers: Send extra headers
1311
+
1312
+ extra_query: Add additional query parameters to the request
1313
+
1314
+ extra_body: Add additional JSON properties to the request
1315
+
1316
+ timeout: Override the client-level default timeout for this request, in seconds
1317
+ """
1318
+ if project_id is None:
1319
+ project_id = self._client._get_cloud_project_id_path_param()
1320
+ if region_id is None:
1321
+ region_id = self._client._get_cloud_region_id_path_param()
1322
+ if not load_balancer_id:
1323
+ raise ValueError(f"Expected a non-empty value for `load_balancer_id` but received {load_balancer_id!r}")
1324
+ return await self._delete(
1325
+ f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{load_balancer_id}",
1326
+ options=make_request_options(
1327
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1328
+ ),
1329
+ cast_to=TaskIDList,
1330
+ )
1331
+
1332
+ async def failover(
1333
+ self,
1334
+ load_balancer_id: str,
1335
+ *,
1336
+ project_id: int | None = None,
1337
+ region_id: int | None = None,
1338
+ force: bool | Omit = omit,
1339
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1340
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1341
+ extra_headers: Headers | None = None,
1342
+ extra_query: Query | None = None,
1343
+ extra_body: Body | None = None,
1344
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1345
+ ) -> TaskIDList:
1346
+ """
1347
+ Failover load balancer
1348
+
1349
+ Args:
1350
+ force: Validate current load balancer status before failover or not.
1351
+
1352
+ extra_headers: Send extra headers
1353
+
1354
+ extra_query: Add additional query parameters to the request
1355
+
1356
+ extra_body: Add additional JSON properties to the request
1357
+
1358
+ timeout: Override the client-level default timeout for this request, in seconds
1359
+ """
1360
+ if project_id is None:
1361
+ project_id = self._client._get_cloud_project_id_path_param()
1362
+ if region_id is None:
1363
+ region_id = self._client._get_cloud_region_id_path_param()
1364
+ if not load_balancer_id:
1365
+ raise ValueError(f"Expected a non-empty value for `load_balancer_id` but received {load_balancer_id!r}")
1366
+ return await self._post(
1367
+ f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{load_balancer_id}/failover",
1368
+ body=await async_maybe_transform(
1369
+ {"force": force}, load_balancer_failover_params.LoadBalancerFailoverParams
1370
+ ),
1371
+ options=make_request_options(
1372
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1373
+ ),
1374
+ cast_to=TaskIDList,
1375
+ )
1376
+
1377
+ async def get(
1378
+ self,
1379
+ load_balancer_id: str,
1380
+ *,
1381
+ project_id: int | None = None,
1382
+ region_id: int | None = None,
1383
+ show_stats: bool | Omit = omit,
1384
+ with_ddos: bool | Omit = omit,
1385
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1386
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1387
+ extra_headers: Headers | None = None,
1388
+ extra_query: Query | None = None,
1389
+ extra_body: Body | None = None,
1390
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1391
+ ) -> LoadBalancer:
1392
+ """
1393
+ Get load balancer
1394
+
1395
+ Args:
1396
+ show_stats: Show statistics
1397
+
1398
+ with_ddos: Show DDoS profile
1399
+
1400
+ extra_headers: Send extra headers
1401
+
1402
+ extra_query: Add additional query parameters to the request
1403
+
1404
+ extra_body: Add additional JSON properties to the request
1405
+
1406
+ timeout: Override the client-level default timeout for this request, in seconds
1407
+ """
1408
+ if project_id is None:
1409
+ project_id = self._client._get_cloud_project_id_path_param()
1410
+ if region_id is None:
1411
+ region_id = self._client._get_cloud_region_id_path_param()
1412
+ if not load_balancer_id:
1413
+ raise ValueError(f"Expected a non-empty value for `load_balancer_id` but received {load_balancer_id!r}")
1414
+ return await self._get(
1415
+ f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{load_balancer_id}",
1416
+ options=make_request_options(
1417
+ extra_headers=extra_headers,
1418
+ extra_query=extra_query,
1419
+ extra_body=extra_body,
1420
+ timeout=timeout,
1421
+ query=await async_maybe_transform(
1422
+ {
1423
+ "show_stats": show_stats,
1424
+ "with_ddos": with_ddos,
1425
+ },
1426
+ load_balancer_get_params.LoadBalancerGetParams,
1427
+ ),
1428
+ ),
1429
+ cast_to=LoadBalancer,
1430
+ )
1431
+
1432
+ async def resize(
1433
+ self,
1434
+ load_balancer_id: str,
1435
+ *,
1436
+ project_id: int | None = None,
1437
+ region_id: int | None = None,
1438
+ flavor: str,
1439
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1440
+ # The extra values given here take precedence over values defined on the client or passed to this method.
1441
+ extra_headers: Headers | None = None,
1442
+ extra_query: Query | None = None,
1443
+ extra_body: Body | None = None,
1444
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1445
+ ) -> TaskIDList:
1446
+ """
1447
+ Resize load balancer
1448
+
1449
+ Args:
1450
+ flavor: Name of the desired flavor to resize to.
1451
+
1452
+ extra_headers: Send extra headers
1453
+
1454
+ extra_query: Add additional query parameters to the request
1455
+
1456
+ extra_body: Add additional JSON properties to the request
1457
+
1458
+ timeout: Override the client-level default timeout for this request, in seconds
1459
+ """
1460
+ if project_id is None:
1461
+ project_id = self._client._get_cloud_project_id_path_param()
1462
+ if region_id is None:
1463
+ region_id = self._client._get_cloud_region_id_path_param()
1464
+ if not load_balancer_id:
1465
+ raise ValueError(f"Expected a non-empty value for `load_balancer_id` but received {load_balancer_id!r}")
1466
+ return await self._post(
1467
+ f"/cloud/v1/loadbalancers/{project_id}/{region_id}/{load_balancer_id}/resize",
1468
+ body=await async_maybe_transform({"flavor": flavor}, load_balancer_resize_params.LoadBalancerResizeParams),
1469
+ options=make_request_options(
1470
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1471
+ ),
1472
+ cast_to=TaskIDList,
1473
+ )
1474
+
1487
1475
 
1488
1476
  class LoadBalancersResourceWithRawResponse:
1489
1477
  def __init__(self, load_balancers: LoadBalancersResource) -> None: