gcore 0.3.0__py3-none-any.whl → 0.4.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 (120) hide show
  1. gcore/__init__.py +2 -1
  2. gcore/_base_client.py +22 -0
  3. gcore/_client.py +9 -0
  4. gcore/_version.py +1 -1
  5. gcore/pagination.py +61 -1
  6. gcore/resources/__init__.py +14 -0
  7. gcore/resources/cloud/baremetal/flavors.py +11 -137
  8. gcore/resources/cloud/baremetal/images.py +10 -12
  9. gcore/resources/cloud/baremetal/servers.py +31 -28
  10. gcore/resources/cloud/billing_reservations.py +2 -2
  11. gcore/resources/cloud/file_shares/file_shares.py +7 -8
  12. gcore/resources/cloud/floating_ips.py +7 -12
  13. gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +31 -20
  14. gcore/resources/cloud/gpu_baremetal_clusters/images.py +9 -10
  15. gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py +2 -2
  16. gcore/resources/cloud/gpu_baremetal_clusters/servers.py +8 -4
  17. gcore/resources/cloud/inference/deployments/deployments.py +10 -2
  18. gcore/resources/cloud/inference/registry_credentials.py +2 -2
  19. gcore/resources/cloud/inference/secrets.py +8 -8
  20. gcore/resources/cloud/instances/flavors.py +9 -233
  21. gcore/resources/cloud/instances/images.py +47 -37
  22. gcore/resources/cloud/instances/instances.py +47 -32
  23. gcore/resources/cloud/instances/interfaces.py +2 -2
  24. gcore/resources/cloud/ip_ranges.py +34 -2
  25. gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +10 -2
  26. gcore/resources/cloud/load_balancers/listeners.py +17 -8
  27. gcore/resources/cloud/load_balancers/load_balancers.py +73 -21
  28. gcore/resources/cloud/load_balancers/metrics.py +2 -2
  29. gcore/resources/cloud/load_balancers/pools/health_monitors.py +2 -2
  30. gcore/resources/cloud/load_balancers/pools/members.py +6 -2
  31. gcore/resources/cloud/networks/networks.py +81 -17
  32. gcore/resources/cloud/networks/routers.py +18 -18
  33. gcore/resources/cloud/networks/subnets.py +51 -11
  34. gcore/resources/cloud/projects.py +38 -24
  35. gcore/resources/cloud/quotas/quotas.py +6 -6
  36. gcore/resources/cloud/quotas/requests.py +8 -8
  37. gcore/resources/cloud/registries/artifacts.py +4 -4
  38. gcore/resources/cloud/registries/registries.py +14 -16
  39. gcore/resources/cloud/registries/repositories.py +4 -4
  40. gcore/resources/cloud/registries/tags.py +2 -2
  41. gcore/resources/cloud/registries/users.py +21 -22
  42. gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +20 -20
  43. gcore/resources/cloud/reserved_fixed_ips/vip.py +10 -10
  44. gcore/resources/cloud/security_groups/rules.py +6 -6
  45. gcore/resources/cloud/security_groups/security_groups.py +70 -31
  46. gcore/resources/cloud/tasks.py +4 -4
  47. gcore/resources/cloud/users/role_assignments.py +12 -14
  48. gcore/resources/cloud/volumes.py +139 -49
  49. gcore/resources/iam/__init__.py +47 -0
  50. gcore/resources/iam/api_tokens.py +521 -0
  51. gcore/resources/iam/iam.py +199 -0
  52. gcore/resources/iam/users.py +642 -0
  53. gcore/resources/waap/__init__.py +0 -14
  54. gcore/resources/waap/waap.py +0 -32
  55. gcore/types/cloud/baremetal/__init__.py +0 -1
  56. gcore/types/cloud/baremetal/image_list_params.py +1 -5
  57. gcore/types/cloud/baremetal/server_create_params.py +4 -8
  58. gcore/types/cloud/baremetal/server_list_params.py +1 -5
  59. gcore/types/cloud/ddos_profile.py +9 -3
  60. gcore/types/cloud/file_share_create_params.py +3 -5
  61. gcore/types/cloud/floating_ip_create_params.py +2 -4
  62. gcore/types/cloud/floating_ip_list_params.py +1 -5
  63. gcore/types/cloud/gpu_baremetal_cluster_create_params.py +2 -3
  64. gcore/types/cloud/gpu_baremetal_clusters/image_upload_params.py +2 -4
  65. gcore/types/cloud/health_monitor.py +6 -1
  66. gcore/types/cloud/instance_create_params.py +7 -8
  67. gcore/types/cloud/instance_list_params.py +1 -5
  68. gcore/types/cloud/instances/__init__.py +0 -2
  69. gcore/types/cloud/instances/image_create_from_volume_params.py +2 -4
  70. gcore/types/cloud/instances/image_list_params.py +1 -5
  71. gcore/types/cloud/instances/image_upload_params.py +2 -4
  72. gcore/types/cloud/load_balancer_create_params.py +8 -4
  73. gcore/types/cloud/load_balancer_list_params.py +1 -5
  74. gcore/types/cloud/load_balancer_update_params.py +24 -0
  75. gcore/types/cloud/load_balancers/pool_create_params.py +6 -1
  76. gcore/types/cloud/load_balancers/pool_update_params.py +6 -1
  77. gcore/types/cloud/load_balancers/pools/member_add_params.py +6 -1
  78. gcore/types/cloud/member.py +6 -1
  79. gcore/types/cloud/network_create_params.py +2 -3
  80. gcore/types/cloud/network_list_params.py +4 -5
  81. gcore/types/cloud/network_update_params.py +28 -2
  82. gcore/types/cloud/networks/router_list_params.py +2 -2
  83. gcore/types/cloud/networks/subnet_create_params.py +2 -3
  84. gcore/types/cloud/networks/subnet_list_params.py +1 -5
  85. gcore/types/cloud/networks/subnet_update_params.py +25 -0
  86. gcore/types/cloud/registries/__init__.py +1 -0
  87. gcore/types/cloud/registries/user_refresh_secret_response.py +31 -0
  88. gcore/types/cloud/reserved_fixed_ip_list_params.py +2 -2
  89. gcore/types/cloud/security_group_list_params.py +3 -7
  90. gcore/types/cloud/security_group_update_params.py +25 -0
  91. gcore/types/cloud/tag_update_map_param.py +2 -2
  92. gcore/types/cloud/volume_list_params.py +1 -5
  93. gcore/types/cloud/volume_update_params.py +29 -3
  94. gcore/types/iam/__init__.py +17 -0
  95. gcore/types/iam/account_overview.py +488 -0
  96. gcore/types/iam/api_token.py +78 -0
  97. gcore/types/iam/api_token_create.py +15 -0
  98. gcore/types/iam/api_token_create_params.py +42 -0
  99. gcore/types/iam/api_token_list.py +81 -0
  100. gcore/types/iam/api_token_list_params.py +41 -0
  101. gcore/types/iam/user.py +86 -0
  102. gcore/types/iam/user_detailed.py +104 -0
  103. gcore/types/iam/user_invite.py +15 -0
  104. gcore/types/iam/user_invite_params.py +37 -0
  105. gcore/types/iam/user_list_params.py +15 -0
  106. gcore/types/iam/user_update.py +104 -0
  107. gcore/types/iam/user_update_params.py +52 -0
  108. gcore/types/waap/__init__.py +0 -1
  109. gcore/types/waap/domains/custom_rule_create_params.py +7 -3
  110. gcore/types/waap/domains/custom_rule_update_params.py +7 -3
  111. gcore/types/waap/waap_custom_rule.py +7 -3
  112. {gcore-0.3.0.dist-info → gcore-0.4.0.dist-info}/METADATA +40 -3
  113. {gcore-0.3.0.dist-info → gcore-0.4.0.dist-info}/RECORD +115 -101
  114. gcore/resources/waap/clients.py +0 -135
  115. gcore/types/cloud/baremetal/flavor_list_suitable_params.py +0 -22
  116. gcore/types/cloud/instances/flavor_list_for_resize_params.py +0 -16
  117. gcore/types/cloud/instances/flavor_list_suitable_params.py +0 -59
  118. gcore/types/waap/client_me_response.py +0 -34
  119. {gcore-0.3.0.dist-info → gcore-0.4.0.dist-info}/WHEEL +0 -0
  120. {gcore-0.3.0.dist-info → gcore-0.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Union, Iterable, Optional
5
+ from typing import Dict, List, Union, Iterable, Optional
6
6
  from datetime import datetime
7
7
  from typing_extensions import Literal, overload
8
8
 
@@ -68,7 +68,6 @@ from ....types.cloud.console import Console
68
68
  from ....types.cloud.instance import Instance
69
69
  from ....types.cloud.task_id_list import TaskIDList
70
70
  from ....types.cloud.instance_interface import InstanceInterface
71
- from ....types.cloud.tag_update_map_param import TagUpdateMapParam
72
71
 
73
72
  __all__ = ["InstancesResource", "AsyncInstancesResource"]
74
73
 
@@ -125,7 +124,7 @@ class InstancesResource(SyncAPIResource):
125
124
  security_groups: Iterable[instance_create_params.SecurityGroup] | NotGiven = NOT_GIVEN,
126
125
  servergroup_id: str | NotGiven = NOT_GIVEN,
127
126
  ssh_key_name: Optional[str] | NotGiven = NOT_GIVEN,
128
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
127
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
129
128
  user_data: str | NotGiven = NOT_GIVEN,
130
129
  username: str | NotGiven = NOT_GIVEN,
131
130
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -135,8 +134,9 @@ class InstancesResource(SyncAPIResource):
135
134
  extra_body: Body | None = None,
136
135
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
137
136
  ) -> TaskIDList:
138
- """
139
- For Linux,
137
+ """Create an instance with specified configuration.
138
+
139
+ How to get access: For Linux,
140
140
 
141
141
  - Use the `user_data` field to provide a
142
142
  [cloud-init script](https://cloudinit.readthedocs.io/en/latest/reference/examples.html)
@@ -270,7 +270,7 @@ class InstancesResource(SyncAPIResource):
270
270
  security_groups: Iterable[instance_create_params.SecurityGroup] | NotGiven = NOT_GIVEN,
271
271
  servergroup_id: str | NotGiven = NOT_GIVEN,
272
272
  ssh_key_name: Optional[str] | NotGiven = NOT_GIVEN,
273
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
273
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
274
274
  user_data: str | NotGiven = NOT_GIVEN,
275
275
  username: str | NotGiven = NOT_GIVEN,
276
276
  polling_interval_seconds: int | NotGiven = NOT_GIVEN,
@@ -429,8 +429,10 @@ class InstancesResource(SyncAPIResource):
429
429
  extra_body: Body | None = None,
430
430
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
431
431
  ) -> SyncOffsetPage[Instance]:
432
- """
433
- List instances
432
+ """List all instances in the specified project and region.
433
+
434
+ Results can be filtered
435
+ by various parameters like name, status, and IP address.
434
436
 
435
437
  Args:
436
438
  project_id: Project ID
@@ -485,9 +487,7 @@ class InstancesResource(SyncAPIResource):
485
487
 
486
488
  status: Filters instances by status.
487
489
 
488
- tag_key_value: Optional. Filter by tag key-value pairs. curl -G --data-urlencode
489
- "`tag_key_value`={"key": "value"}" --url
490
- "https://example.com/cloud/v1/resource/1/1"
490
+ tag_key_value: Optional. Filter by tag key-value pairs.
491
491
 
492
492
  tag_value: Optional. Filter by tag values. ?`tag_value`=value1&`tag_value`=value2
493
493
 
@@ -787,8 +787,10 @@ class InstancesResource(SyncAPIResource):
787
787
  extra_body: Body | None = None,
788
788
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
789
789
  ) -> TaskIDList:
790
- """
791
- Put instance into the server group
790
+ """Add an instance to a server group.
791
+
792
+ The instance must not already be in a server
793
+ group. Bare metal servers do not support server groups.
792
794
 
793
795
  Args:
794
796
  servergroup_id: Anti-affinity or affinity or soft-anti-affinity server group ID.
@@ -1008,8 +1010,11 @@ class InstancesResource(SyncAPIResource):
1008
1010
  extra_body: Body | None = None,
1009
1011
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1010
1012
  ) -> Instance:
1011
- """
1012
- **Cookie Parameters**:
1013
+ """Retrieve detailed information about a specific instance.
1014
+
1015
+ The response content
1016
+ language for `ddos_profile` can be controlled via the 'language' cookie
1017
+ parameter. **Cookie Parameters**:
1013
1018
 
1014
1019
  - `language` (str, optional): Language for the response content. Affects the
1015
1020
  `ddos_profile` field. Supported values:
@@ -1107,8 +1112,10 @@ class InstancesResource(SyncAPIResource):
1107
1112
  extra_body: Body | None = None,
1108
1113
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1109
1114
  ) -> TaskIDList:
1110
- """
1111
- Remove instance from the server group
1115
+ """Remove an instance from its current server group.
1116
+
1117
+ The instance must be in a
1118
+ server group to be removed. Bare metal servers do not support server groups.
1112
1119
 
1113
1120
  Args:
1114
1121
  extra_headers: Send extra headers
@@ -1367,7 +1374,7 @@ class AsyncInstancesResource(AsyncAPIResource):
1367
1374
  security_groups: Iterable[instance_create_params.SecurityGroup] | NotGiven = NOT_GIVEN,
1368
1375
  servergroup_id: str | NotGiven = NOT_GIVEN,
1369
1376
  ssh_key_name: Optional[str] | NotGiven = NOT_GIVEN,
1370
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
1377
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
1371
1378
  user_data: str | NotGiven = NOT_GIVEN,
1372
1379
  username: str | NotGiven = NOT_GIVEN,
1373
1380
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -1377,8 +1384,9 @@ class AsyncInstancesResource(AsyncAPIResource):
1377
1384
  extra_body: Body | None = None,
1378
1385
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1379
1386
  ) -> TaskIDList:
1380
- """
1381
- For Linux,
1387
+ """Create an instance with specified configuration.
1388
+
1389
+ How to get access: For Linux,
1382
1390
 
1383
1391
  - Use the `user_data` field to provide a
1384
1392
  [cloud-init script](https://cloudinit.readthedocs.io/en/latest/reference/examples.html)
@@ -1512,7 +1520,7 @@ class AsyncInstancesResource(AsyncAPIResource):
1512
1520
  security_groups: Iterable[instance_create_params.SecurityGroup] | NotGiven = NOT_GIVEN,
1513
1521
  servergroup_id: str | NotGiven = NOT_GIVEN,
1514
1522
  ssh_key_name: Optional[str] | NotGiven = NOT_GIVEN,
1515
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
1523
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
1516
1524
  user_data: str | NotGiven = NOT_GIVEN,
1517
1525
  username: str | NotGiven = NOT_GIVEN,
1518
1526
  polling_interval_seconds: int | NotGiven = NOT_GIVEN,
@@ -1671,8 +1679,10 @@ class AsyncInstancesResource(AsyncAPIResource):
1671
1679
  extra_body: Body | None = None,
1672
1680
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1673
1681
  ) -> AsyncPaginator[Instance, AsyncOffsetPage[Instance]]:
1674
- """
1675
- List instances
1682
+ """List all instances in the specified project and region.
1683
+
1684
+ Results can be filtered
1685
+ by various parameters like name, status, and IP address.
1676
1686
 
1677
1687
  Args:
1678
1688
  project_id: Project ID
@@ -1727,9 +1737,7 @@ class AsyncInstancesResource(AsyncAPIResource):
1727
1737
 
1728
1738
  status: Filters instances by status.
1729
1739
 
1730
- tag_key_value: Optional. Filter by tag key-value pairs. curl -G --data-urlencode
1731
- "`tag_key_value`={"key": "value"}" --url
1732
- "https://example.com/cloud/v1/resource/1/1"
1740
+ tag_key_value: Optional. Filter by tag key-value pairs.
1733
1741
 
1734
1742
  tag_value: Optional. Filter by tag values. ?`tag_value`=value1&`tag_value`=value2
1735
1743
 
@@ -2029,8 +2037,10 @@ class AsyncInstancesResource(AsyncAPIResource):
2029
2037
  extra_body: Body | None = None,
2030
2038
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2031
2039
  ) -> TaskIDList:
2032
- """
2033
- Put instance into the server group
2040
+ """Add an instance to a server group.
2041
+
2042
+ The instance must not already be in a server
2043
+ group. Bare metal servers do not support server groups.
2034
2044
 
2035
2045
  Args:
2036
2046
  servergroup_id: Anti-affinity or affinity or soft-anti-affinity server group ID.
@@ -2250,8 +2260,11 @@ class AsyncInstancesResource(AsyncAPIResource):
2250
2260
  extra_body: Body | None = None,
2251
2261
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2252
2262
  ) -> Instance:
2253
- """
2254
- **Cookie Parameters**:
2263
+ """Retrieve detailed information about a specific instance.
2264
+
2265
+ The response content
2266
+ language for `ddos_profile` can be controlled via the 'language' cookie
2267
+ parameter. **Cookie Parameters**:
2255
2268
 
2256
2269
  - `language` (str, optional): Language for the response content. Affects the
2257
2270
  `ddos_profile` field. Supported values:
@@ -2349,8 +2362,10 @@ class AsyncInstancesResource(AsyncAPIResource):
2349
2362
  extra_body: Body | None = None,
2350
2363
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
2351
2364
  ) -> TaskIDList:
2352
- """
2353
- Remove instance from the server group
2365
+ """Remove an instance from its current server group.
2366
+
2367
+ The instance must be in a
2368
+ server group to be removed. Bare metal servers do not support server groups.
2354
2369
 
2355
2370
  Args:
2356
2371
  extra_headers: Send extra headers
@@ -59,7 +59,7 @@ class InterfacesResource(SyncAPIResource):
59
59
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
60
60
  ) -> NetworkInterfaceList:
61
61
  """
62
- List network interfaces attached to the instance
62
+ List all network interfaces attached to the specified instance.
63
63
 
64
64
  Args:
65
65
  extra_headers: Send extra headers
@@ -415,7 +415,7 @@ class AsyncInterfacesResource(AsyncAPIResource):
415
415
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
416
416
  ) -> NetworkInterfaceList:
417
417
  """
418
- List network interfaces attached to the instance
418
+ List all network interfaces attached to the specified instance.
419
419
 
420
420
  Args:
421
421
  extra_headers: Send extra headers
@@ -49,7 +49,23 @@ class IPRangesResource(SyncAPIResource):
49
49
  extra_body: Body | None = None,
50
50
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
51
51
  ) -> IPRanges:
52
- """List of all Edge Cloud Egress Public IPs."""
52
+ """
53
+ Returns the complete list of IPv4 and IPv6 address ranges that Cloud uses for
54
+ outbound (egress) traffic. Typical reasons to call this endpoint:
55
+
56
+ - Host-file delivery workflows – You upload images or other assets to the Cloud
57
+ and share a download link that points to your own infrastructure. Add these
58
+ egress prefixes to your firewall or object-storage allow-list so our clients
59
+ can fetch the files without being blocked.
60
+ - Push integrations / webhooks – You subscribe to the user-actions event log and
61
+ Cloud pushes events to your listener endpoint. Whitelisting the egress IP
62
+ ranges lets you accept only traffic that originates from us.
63
+ - General security controls, audit tooling, or SIEM rules that need to verify
64
+ that traffic truly comes from the Cloud. The list is global (covers all
65
+ regions) and refreshed automatically whenever Gcore allocates new egress IP
66
+ space. The response is an array of CIDR blocks; duplicate prefixes are not
67
+ returned.
68
+ """
53
69
  return self._get(
54
70
  "/cloud/public/v1/ipranges/egress",
55
71
  options=make_request_options(
@@ -89,7 +105,23 @@ class AsyncIPRangesResource(AsyncAPIResource):
89
105
  extra_body: Body | None = None,
90
106
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
91
107
  ) -> IPRanges:
92
- """List of all Edge Cloud Egress Public IPs."""
108
+ """
109
+ Returns the complete list of IPv4 and IPv6 address ranges that Cloud uses for
110
+ outbound (egress) traffic. Typical reasons to call this endpoint:
111
+
112
+ - Host-file delivery workflows – You upload images or other assets to the Cloud
113
+ and share a download link that points to your own infrastructure. Add these
114
+ egress prefixes to your firewall or object-storage allow-list so our clients
115
+ can fetch the files without being blocked.
116
+ - Push integrations / webhooks – You subscribe to the user-actions event log and
117
+ Cloud pushes events to your listener endpoint. Whitelisting the egress IP
118
+ ranges lets you accept only traffic that originates from us.
119
+ - General security controls, audit tooling, or SIEM rules that need to verify
120
+ that traffic truly comes from the Cloud. The list is global (covers all
121
+ regions) and refreshed automatically whenever Gcore allocates new egress IP
122
+ space. The response is an array of CIDR blocks; duplicate prefixes are not
123
+ returned.
124
+ """
93
125
  return await self._get(
94
126
  "/cloud/public/v1/ipranges/egress",
95
127
  options=make_request_options(
@@ -381,7 +381,11 @@ class L7PoliciesResource(SyncAPIResource):
381
381
  extra_headers=extra_headers,
382
382
  polling_interval_seconds=polling_interval_seconds,
383
383
  )
384
- if not task.created_resources or not task.created_resources.l7polices or len(task.created_resources.l7polices) != 1:
384
+ if (
385
+ not task.created_resources
386
+ or not task.created_resources.l7polices
387
+ or len(task.created_resources.l7polices) != 1
388
+ ):
385
389
  raise ValueError(f"Expected exactly one resource to be created in a task")
386
390
  return self.get(
387
391
  l7policy_id=task.created_resources.l7polices[0],
@@ -824,7 +828,11 @@ class AsyncL7PoliciesResource(AsyncAPIResource):
824
828
  extra_headers=extra_headers,
825
829
  polling_interval_seconds=polling_interval_seconds,
826
830
  )
827
- if not task.created_resources or not task.created_resources.l7polices or len(task.created_resources.l7polices) != 1:
831
+ if (
832
+ not task.created_resources
833
+ or not task.created_resources.l7polices
834
+ or len(task.created_resources.l7polices) != 1
835
+ ):
828
836
  raise ValueError(f"Expected exactly one resource to be created in a task")
829
837
  return await self.get(
830
838
  l7policy_id=task.created_resources.l7polices[0],
@@ -175,7 +175,7 @@ class ListenersResource(SyncAPIResource):
175
175
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
176
176
  ) -> TaskIDList:
177
177
  """
178
- Update listener
178
+ Update load balancer listener
179
179
 
180
180
  Args:
181
181
  project_id: Project ID
@@ -356,7 +356,7 @@ class ListenersResource(SyncAPIResource):
356
356
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
357
357
  ) -> LoadBalancerListenerDetail:
358
358
  """
359
- Get listener
359
+ Get load balancer listener
360
360
 
361
361
  Args:
362
362
  project_id: Project ID
@@ -447,7 +447,11 @@ class ListenersResource(SyncAPIResource):
447
447
  extra_headers=extra_headers,
448
448
  polling_interval_seconds=polling_interval_seconds,
449
449
  )
450
- if not task.created_resources or not task.created_resources.listeners or len(task.created_resources.listeners) != 1:
450
+ if (
451
+ not task.created_resources
452
+ or not task.created_resources.listeners
453
+ or len(task.created_resources.listeners) != 1
454
+ ):
451
455
  raise ValueError(f"Expected exactly one resource to be created in a task")
452
456
  return self.get(
453
457
  listener_id=task.created_resources.listeners[0],
@@ -694,7 +698,7 @@ class AsyncListenersResource(AsyncAPIResource):
694
698
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
695
699
  ) -> TaskIDList:
696
700
  """
697
- Update listener
701
+ Update load balancer listener
698
702
 
699
703
  Args:
700
704
  project_id: Project ID
@@ -875,7 +879,7 @@ class AsyncListenersResource(AsyncAPIResource):
875
879
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
876
880
  ) -> LoadBalancerListenerDetail:
877
881
  """
878
- Get listener
882
+ Get load balancer listener
879
883
 
880
884
  Args:
881
885
  project_id: Project ID
@@ -966,7 +970,11 @@ class AsyncListenersResource(AsyncAPIResource):
966
970
  extra_headers=extra_headers,
967
971
  polling_interval_seconds=polling_interval_seconds,
968
972
  )
969
- if not task.created_resources or not task.created_resources.listeners or len(task.created_resources.listeners) != 1:
973
+ if (
974
+ not task.created_resources
975
+ or not task.created_resources.listeners
976
+ or len(task.created_resources.listeners) != 1
977
+ ):
970
978
  raise ValueError(f"Expected exactly one resource to be created in a task")
971
979
  return await self.get(
972
980
  listener_id=task.created_resources.listeners[0],
@@ -975,7 +983,7 @@ class AsyncListenersResource(AsyncAPIResource):
975
983
  extra_headers=extra_headers,
976
984
  timeout=timeout,
977
985
  )
978
-
986
+
979
987
  async def delete_and_poll(
980
988
  self,
981
989
  listener_id: str,
@@ -1008,7 +1016,7 @@ class AsyncListenersResource(AsyncAPIResource):
1008
1016
  task_id=response.tasks[0],
1009
1017
  extra_headers=extra_headers,
1010
1018
  polling_interval_seconds=polling_interval_seconds,
1011
- )
1019
+ )
1012
1020
 
1013
1021
  async def update_and_poll(
1014
1022
  self,
@@ -1069,6 +1077,7 @@ class AsyncListenersResource(AsyncAPIResource):
1069
1077
  timeout=timeout,
1070
1078
  )
1071
1079
 
1080
+
1072
1081
  class ListenersResourceWithRawResponse:
1073
1082
  def __init__(self, listeners: ListenersResource) -> None:
1074
1083
  self._listeners = listeners
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Iterable
5
+ from typing import Dict, List, Iterable, Optional
6
6
 
7
7
  import httpx
8
8
 
@@ -141,7 +141,7 @@ class LoadBalancersResource(SyncAPIResource):
141
141
  name: str | NotGiven = NOT_GIVEN,
142
142
  name_template: str | NotGiven = NOT_GIVEN,
143
143
  preferred_connectivity: LoadBalancerMemberConnectivity | NotGiven = NOT_GIVEN,
144
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
144
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
145
145
  vip_ip_family: InterfaceIPFamily | NotGiven = NOT_GIVEN,
146
146
  vip_network_id: str | NotGiven = NOT_GIVEN,
147
147
  vip_port_id: str | NotGiven = NOT_GIVEN,
@@ -240,6 +240,7 @@ class LoadBalancersResource(SyncAPIResource):
240
240
  logging: load_balancer_update_params.Logging | NotGiven = NOT_GIVEN,
241
241
  name: str | NotGiven = NOT_GIVEN,
242
242
  preferred_connectivity: LoadBalancerMemberConnectivity | NotGiven = NOT_GIVEN,
243
+ tags: Optional[TagUpdateMapParam] | NotGiven = NOT_GIVEN,
243
244
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
244
245
  # The extra values given here take precedence over values defined on the client or passed to this method.
245
246
  extra_headers: Headers | None = None,
@@ -248,8 +249,10 @@ class LoadBalancersResource(SyncAPIResource):
248
249
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
249
250
  ) -> LoadBalancer:
250
251
  """
251
- Rename load balancer, activate/deactivate logs or update preferred connectivity
252
- for load balancer
252
+ Rename load balancer, activate/deactivate logging, update preferred connectivity
253
+ type and/or modify load balancer tags. The request will only process the fields
254
+ that are provided in the request body. Any fields that are not included will
255
+ remain unchanged.
253
256
 
254
257
  Args:
255
258
  logging: Logging configuration
@@ -259,6 +262,26 @@ class LoadBalancersResource(SyncAPIResource):
259
262
  preferred_connectivity: Preferred option to establish connectivity between load balancer and its pools
260
263
  members
261
264
 
265
+ tags: Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide
266
+ key-value pairs to add or update tags. Set tag values to `null` to remove tags.
267
+ Unspecified tags remain unchanged. Read-only tags are always preserved and
268
+ cannot be modified. **Examples:**
269
+
270
+ - **Add/update tags:**
271
+ `{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
272
+ updates existing ones.
273
+ - **Delete tags:** `{'tags': {'`old_tag`': null}}` removes specific tags.
274
+ - **Remove all tags:** `{'tags': null}` removes all user-managed tags (read-only
275
+ tags are preserved).
276
+ - **Partial update:** `{'tags': {'environment': 'staging'}}` only updates
277
+ specified tags.
278
+ - **Mixed operations:**
279
+ `{'tags': {'environment': 'production', '`cost_center`': 'engineering', '`deprecated_tag`': null}}`
280
+ adds/updates 'environment' and '`cost_center`' while removing
281
+ '`deprecated_tag`', preserving other existing tags.
282
+ - **Replace all:** first delete existing tags with null values, then add new
283
+ ones in the same request.
284
+
262
285
  extra_headers: Send extra headers
263
286
 
264
287
  extra_query: Add additional query parameters to the request
@@ -280,6 +303,7 @@ class LoadBalancersResource(SyncAPIResource):
280
303
  "logging": logging,
281
304
  "name": name,
282
305
  "preferred_connectivity": preferred_connectivity,
306
+ "tags": tags,
283
307
  },
284
308
  load_balancer_update_params.LoadBalancerUpdateParams,
285
309
  ),
@@ -334,9 +358,7 @@ class LoadBalancersResource(SyncAPIResource):
334
358
 
335
359
  tag_key: Filter by tag keys.
336
360
 
337
- tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string. curl -G
338
- --data-urlencode "`tag_key_value`={"key": "value"}" --url
339
- "http://localhost:1111/v1/loadbalancers/1/1"
361
+ tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
340
362
 
341
363
  with_ddos: Show Advanced DDoS protection profile, if exists
342
364
 
@@ -433,7 +455,7 @@ class LoadBalancersResource(SyncAPIResource):
433
455
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
434
456
  ) -> TaskIDList:
435
457
  """
436
- Failover loadbalancer
458
+ Failover load balancer
437
459
 
438
460
  Args:
439
461
  force: Validate current load balancer status before failover or not.
@@ -531,7 +553,7 @@ class LoadBalancersResource(SyncAPIResource):
531
553
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
532
554
  ) -> TaskIDList:
533
555
  """
534
- Resize loadbalancer
556
+ Resize load balancer
535
557
 
536
558
  Args:
537
559
  flavor: Name of the desired flavor to resize to.
@@ -571,7 +593,7 @@ class LoadBalancersResource(SyncAPIResource):
571
593
  name: str | NotGiven = NOT_GIVEN,
572
594
  name_template: str | NotGiven = NOT_GIVEN,
573
595
  preferred_connectivity: LoadBalancerMemberConnectivity | NotGiven = NOT_GIVEN,
574
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
596
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
575
597
  vip_ip_family: InterfaceIPFamily | NotGiven = NOT_GIVEN,
576
598
  vip_network_id: str | NotGiven = NOT_GIVEN,
577
599
  vip_port_id: str | NotGiven = NOT_GIVEN,
@@ -611,7 +633,11 @@ class LoadBalancersResource(SyncAPIResource):
611
633
  extra_headers=extra_headers,
612
634
  polling_interval_seconds=polling_interval_seconds,
613
635
  )
614
- if not task.created_resources or not task.created_resources.loadbalancers or len(task.created_resources.loadbalancers) != 1:
636
+ if (
637
+ not task.created_resources
638
+ or not task.created_resources.loadbalancers
639
+ or len(task.created_resources.loadbalancers) != 1
640
+ ):
615
641
  raise ValueError(f"Expected exactly one resource to be created in a task")
616
642
  return self.get(
617
643
  loadbalancer_id=task.created_resources.loadbalancers[0],
@@ -798,7 +824,7 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
798
824
  name: str | NotGiven = NOT_GIVEN,
799
825
  name_template: str | NotGiven = NOT_GIVEN,
800
826
  preferred_connectivity: LoadBalancerMemberConnectivity | NotGiven = NOT_GIVEN,
801
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
827
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
802
828
  vip_ip_family: InterfaceIPFamily | NotGiven = NOT_GIVEN,
803
829
  vip_network_id: str | NotGiven = NOT_GIVEN,
804
830
  vip_port_id: str | NotGiven = NOT_GIVEN,
@@ -897,6 +923,7 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
897
923
  logging: load_balancer_update_params.Logging | NotGiven = NOT_GIVEN,
898
924
  name: str | NotGiven = NOT_GIVEN,
899
925
  preferred_connectivity: LoadBalancerMemberConnectivity | NotGiven = NOT_GIVEN,
926
+ tags: Optional[TagUpdateMapParam] | NotGiven = NOT_GIVEN,
900
927
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
901
928
  # The extra values given here take precedence over values defined on the client or passed to this method.
902
929
  extra_headers: Headers | None = None,
@@ -905,8 +932,10 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
905
932
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
906
933
  ) -> LoadBalancer:
907
934
  """
908
- Rename load balancer, activate/deactivate logs or update preferred connectivity
909
- for load balancer
935
+ Rename load balancer, activate/deactivate logging, update preferred connectivity
936
+ type and/or modify load balancer tags. The request will only process the fields
937
+ that are provided in the request body. Any fields that are not included will
938
+ remain unchanged.
910
939
 
911
940
  Args:
912
941
  logging: Logging configuration
@@ -916,6 +945,26 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
916
945
  preferred_connectivity: Preferred option to establish connectivity between load balancer and its pools
917
946
  members
918
947
 
948
+ tags: Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide
949
+ key-value pairs to add or update tags. Set tag values to `null` to remove tags.
950
+ Unspecified tags remain unchanged. Read-only tags are always preserved and
951
+ cannot be modified. **Examples:**
952
+
953
+ - **Add/update tags:**
954
+ `{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
955
+ updates existing ones.
956
+ - **Delete tags:** `{'tags': {'`old_tag`': null}}` removes specific tags.
957
+ - **Remove all tags:** `{'tags': null}` removes all user-managed tags (read-only
958
+ tags are preserved).
959
+ - **Partial update:** `{'tags': {'environment': 'staging'}}` only updates
960
+ specified tags.
961
+ - **Mixed operations:**
962
+ `{'tags': {'environment': 'production', '`cost_center`': 'engineering', '`deprecated_tag`': null}}`
963
+ adds/updates 'environment' and '`cost_center`' while removing
964
+ '`deprecated_tag`', preserving other existing tags.
965
+ - **Replace all:** first delete existing tags with null values, then add new
966
+ ones in the same request.
967
+
919
968
  extra_headers: Send extra headers
920
969
 
921
970
  extra_query: Add additional query parameters to the request
@@ -937,6 +986,7 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
937
986
  "logging": logging,
938
987
  "name": name,
939
988
  "preferred_connectivity": preferred_connectivity,
989
+ "tags": tags,
940
990
  },
941
991
  load_balancer_update_params.LoadBalancerUpdateParams,
942
992
  ),
@@ -991,9 +1041,7 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
991
1041
 
992
1042
  tag_key: Filter by tag keys.
993
1043
 
994
- tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string. curl -G
995
- --data-urlencode "`tag_key_value`={"key": "value"}" --url
996
- "http://localhost:1111/v1/loadbalancers/1/1"
1044
+ tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string.
997
1045
 
998
1046
  with_ddos: Show Advanced DDoS protection profile, if exists
999
1047
 
@@ -1090,7 +1138,7 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1090
1138
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1091
1139
  ) -> TaskIDList:
1092
1140
  """
1093
- Failover loadbalancer
1141
+ Failover load balancer
1094
1142
 
1095
1143
  Args:
1096
1144
  force: Validate current load balancer status before failover or not.
@@ -1190,7 +1238,7 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1190
1238
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1191
1239
  ) -> TaskIDList:
1192
1240
  """
1193
- Resize loadbalancer
1241
+ Resize load balancer
1194
1242
 
1195
1243
  Args:
1196
1244
  flavor: Name of the desired flavor to resize to.
@@ -1230,7 +1278,7 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1230
1278
  name: str | NotGiven = NOT_GIVEN,
1231
1279
  name_template: str | NotGiven = NOT_GIVEN,
1232
1280
  preferred_connectivity: LoadBalancerMemberConnectivity | NotGiven = NOT_GIVEN,
1233
- tags: TagUpdateMapParam | NotGiven = NOT_GIVEN,
1281
+ tags: Dict[str, str] | NotGiven = NOT_GIVEN,
1234
1282
  vip_ip_family: InterfaceIPFamily | NotGiven = NOT_GIVEN,
1235
1283
  vip_network_id: str | NotGiven = NOT_GIVEN,
1236
1284
  vip_port_id: str | NotGiven = NOT_GIVEN,
@@ -1270,7 +1318,11 @@ class AsyncLoadBalancersResource(AsyncAPIResource):
1270
1318
  extra_headers=extra_headers,
1271
1319
  polling_interval_seconds=polling_interval_seconds,
1272
1320
  )
1273
- if not task.created_resources or not task.created_resources.loadbalancers or len(task.created_resources.loadbalancers) != 1:
1321
+ if (
1322
+ not task.created_resources
1323
+ or not task.created_resources.loadbalancers
1324
+ or len(task.created_resources.loadbalancers) != 1
1325
+ ):
1274
1326
  raise ValueError(f"Expected exactly one resource to be created in a task")
1275
1327
  return await self.get(
1276
1328
  loadbalancer_id=task.created_resources.loadbalancers[0],
@@ -59,7 +59,7 @@ class MetricsResource(SyncAPIResource):
59
59
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
60
60
  ) -> LoadBalancerMetricsList:
61
61
  """
62
- Get loadbalancer metrics, including cpu, memory and network
62
+ Get load balancer metrics, including cpu, memory and network
63
63
 
64
64
  Args:
65
65
  time_interval: Time interval
@@ -132,7 +132,7 @@ class AsyncMetricsResource(AsyncAPIResource):
132
132
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
133
133
  ) -> LoadBalancerMetricsList:
134
134
  """
135
- Get loadbalancer metrics, including cpu, memory and network
135
+ Get load balancer metrics, including cpu, memory and network
136
136
 
137
137
  Args:
138
138
  time_interval: Time interval
@@ -68,7 +68,7 @@ class HealthMonitorsResource(SyncAPIResource):
68
68
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
69
69
  ) -> TaskIDList:
70
70
  """
71
- Create Load Balancer Pool Health Monitor
71
+ Create load balancer pool health monitor
72
72
 
73
73
  Args:
74
74
  project_id: Project ID
@@ -219,7 +219,7 @@ class AsyncHealthMonitorsResource(AsyncAPIResource):
219
219
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
220
220
  ) -> TaskIDList:
221
221
  """
222
- Create Load Balancer Pool Health Monitor
222
+ Create load balancer pool health monitor
223
223
 
224
224
  Args:
225
225
  project_id: Project ID