gcore 0.5.0__py3-none-any.whl → 0.6.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 (28) hide show
  1. gcore/_version.py +1 -1
  2. gcore/resources/cloud/__init__.py +14 -0
  3. gcore/resources/cloud/audit_logs.py +480 -0
  4. gcore/resources/cloud/cloud.py +32 -0
  5. gcore/resources/cloud/file_shares/file_shares.py +64 -9
  6. gcore/resources/cloud/inference/__init__.py +14 -0
  7. gcore/resources/cloud/inference/api_keys.py +621 -0
  8. gcore/resources/cloud/inference/inference.py +32 -0
  9. gcore/resources/cloud/load_balancers/pools/members.py +22 -6
  10. gcore/types/cloud/__init__.py +2 -0
  11. gcore/types/cloud/audit_log_entry.py +254 -0
  12. gcore/types/cloud/audit_log_list_params.py +158 -0
  13. gcore/types/cloud/file_share_update_params.py +29 -3
  14. gcore/types/cloud/inference/__init__.py +5 -0
  15. gcore/types/cloud/inference/api_key_create_params.py +21 -0
  16. gcore/types/cloud/inference/api_key_list_params.py +21 -0
  17. gcore/types/cloud/inference/api_key_update_params.py +16 -0
  18. gcore/types/cloud/inference/inference_api_key.py +24 -0
  19. gcore/types/cloud/inference/inference_api_key_create.py +27 -0
  20. gcore/types/cloud/load_balancer_create_params.py +14 -3
  21. gcore/types/cloud/load_balancers/pool_create_params.py +14 -3
  22. gcore/types/cloud/load_balancers/pool_update_params.py +14 -3
  23. gcore/types/cloud/load_balancers/pools/member_add_params.py +14 -3
  24. gcore/types/cloud/member.py +12 -4
  25. {gcore-0.5.0.dist-info → gcore-0.6.0.dist-info}/METADATA +2 -3
  26. {gcore-0.5.0.dist-info → gcore-0.6.0.dist-info}/RECORD +28 -19
  27. {gcore-0.5.0.dist-info → gcore-0.6.0.dist-info}/WHEEL +0 -0
  28. {gcore-0.5.0.dist-info → gcore-0.6.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 Dict, Iterable
5
+ from typing import Dict, Iterable, Optional
6
6
  from typing_extensions import Literal, overload
7
7
 
8
8
  import httpx
@@ -35,6 +35,7 @@ from ....types.cloud import (
35
35
  from ...._base_client import AsyncPaginator, make_request_options
36
36
  from ....types.cloud.file_share import FileShare
37
37
  from ....types.cloud.task_id_list import TaskIDList
38
+ from ....types.cloud.tag_update_map_param import TagUpdateMapParam
38
39
 
39
40
  __all__ = ["FileSharesResource", "AsyncFileSharesResource"]
40
41
 
@@ -219,7 +220,8 @@ class FileSharesResource(SyncAPIResource):
219
220
  *,
220
221
  project_id: int | None = None,
221
222
  region_id: int | None = None,
222
- name: str,
223
+ name: str | NotGiven = NOT_GIVEN,
224
+ tags: Optional[TagUpdateMapParam] | NotGiven = NOT_GIVEN,
223
225
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
224
226
  # The extra values given here take precedence over values defined on the client or passed to this method.
225
227
  extra_headers: Headers | None = None,
@@ -228,7 +230,7 @@ class FileSharesResource(SyncAPIResource):
228
230
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
229
231
  ) -> FileShare:
230
232
  """
231
- Rename file share
233
+ Rename file share or update tags
232
234
 
233
235
  Args:
234
236
  project_id: Project ID
@@ -237,7 +239,27 @@ class FileSharesResource(SyncAPIResource):
237
239
 
238
240
  file_share_id: File Share ID
239
241
 
240
- name: Name.
242
+ name: Name
243
+
244
+ tags: Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide
245
+ key-value pairs to add or update tags. Set tag values to `null` to remove tags.
246
+ Unspecified tags remain unchanged. Read-only tags are always preserved and
247
+ cannot be modified. **Examples:**
248
+
249
+ - **Add/update tags:**
250
+ `{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
251
+ updates existing ones.
252
+ - **Delete tags:** `{'tags': {'`old_tag`': null}}` removes specific tags.
253
+ - **Remove all tags:** `{'tags': null}` removes all user-managed tags (read-only
254
+ tags are preserved).
255
+ - **Partial update:** `{'tags': {'environment': 'staging'}}` only updates
256
+ specified tags.
257
+ - **Mixed operations:**
258
+ `{'tags': {'environment': 'production', '`cost_center`': 'engineering', '`deprecated_tag`': null}}`
259
+ adds/updates 'environment' and '`cost_center`' while removing
260
+ '`deprecated_tag`', preserving other existing tags.
261
+ - **Replace all:** first delete existing tags with null values, then add new
262
+ ones in the same request.
241
263
 
242
264
  extra_headers: Send extra headers
243
265
 
@@ -255,7 +277,13 @@ class FileSharesResource(SyncAPIResource):
255
277
  raise ValueError(f"Expected a non-empty value for `file_share_id` but received {file_share_id!r}")
256
278
  return self._patch(
257
279
  f"/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}",
258
- body=maybe_transform({"name": name}, file_share_update_params.FileShareUpdateParams),
280
+ body=maybe_transform(
281
+ {
282
+ "name": name,
283
+ "tags": tags,
284
+ },
285
+ file_share_update_params.FileShareUpdateParams,
286
+ ),
259
287
  options=make_request_options(
260
288
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
261
289
  ),
@@ -648,7 +676,8 @@ class AsyncFileSharesResource(AsyncAPIResource):
648
676
  *,
649
677
  project_id: int | None = None,
650
678
  region_id: int | None = None,
651
- name: str,
679
+ name: str | NotGiven = NOT_GIVEN,
680
+ tags: Optional[TagUpdateMapParam] | NotGiven = NOT_GIVEN,
652
681
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
653
682
  # The extra values given here take precedence over values defined on the client or passed to this method.
654
683
  extra_headers: Headers | None = None,
@@ -657,7 +686,7 @@ class AsyncFileSharesResource(AsyncAPIResource):
657
686
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
658
687
  ) -> FileShare:
659
688
  """
660
- Rename file share
689
+ Rename file share or update tags
661
690
 
662
691
  Args:
663
692
  project_id: Project ID
@@ -666,7 +695,27 @@ class AsyncFileSharesResource(AsyncAPIResource):
666
695
 
667
696
  file_share_id: File Share ID
668
697
 
669
- name: Name.
698
+ name: Name
699
+
700
+ tags: Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide
701
+ key-value pairs to add or update tags. Set tag values to `null` to remove tags.
702
+ Unspecified tags remain unchanged. Read-only tags are always preserved and
703
+ cannot be modified. **Examples:**
704
+
705
+ - **Add/update tags:**
706
+ `{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
707
+ updates existing ones.
708
+ - **Delete tags:** `{'tags': {'`old_tag`': null}}` removes specific tags.
709
+ - **Remove all tags:** `{'tags': null}` removes all user-managed tags (read-only
710
+ tags are preserved).
711
+ - **Partial update:** `{'tags': {'environment': 'staging'}}` only updates
712
+ specified tags.
713
+ - **Mixed operations:**
714
+ `{'tags': {'environment': 'production', '`cost_center`': 'engineering', '`deprecated_tag`': null}}`
715
+ adds/updates 'environment' and '`cost_center`' while removing
716
+ '`deprecated_tag`', preserving other existing tags.
717
+ - **Replace all:** first delete existing tags with null values, then add new
718
+ ones in the same request.
670
719
 
671
720
  extra_headers: Send extra headers
672
721
 
@@ -684,7 +733,13 @@ class AsyncFileSharesResource(AsyncAPIResource):
684
733
  raise ValueError(f"Expected a non-empty value for `file_share_id` but received {file_share_id!r}")
685
734
  return await self._patch(
686
735
  f"/cloud/v1/file_shares/{project_id}/{region_id}/{file_share_id}",
687
- body=await async_maybe_transform({"name": name}, file_share_update_params.FileShareUpdateParams),
736
+ body=await async_maybe_transform(
737
+ {
738
+ "name": name,
739
+ "tags": tags,
740
+ },
741
+ file_share_update_params.FileShareUpdateParams,
742
+ ),
688
743
  options=make_request_options(
689
744
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
690
745
  ),
@@ -24,6 +24,14 @@ from .secrets import (
24
24
  SecretsResourceWithStreamingResponse,
25
25
  AsyncSecretsResourceWithStreamingResponse,
26
26
  )
27
+ from .api_keys import (
28
+ APIKeysResource,
29
+ AsyncAPIKeysResource,
30
+ APIKeysResourceWithRawResponse,
31
+ AsyncAPIKeysResourceWithRawResponse,
32
+ APIKeysResourceWithStreamingResponse,
33
+ AsyncAPIKeysResourceWithStreamingResponse,
34
+ )
27
35
  from .inference import (
28
36
  InferenceResource,
29
37
  AsyncInferenceResource,
@@ -80,6 +88,12 @@ __all__ = [
80
88
  "AsyncSecretsResourceWithRawResponse",
81
89
  "SecretsResourceWithStreamingResponse",
82
90
  "AsyncSecretsResourceWithStreamingResponse",
91
+ "APIKeysResource",
92
+ "AsyncAPIKeysResource",
93
+ "APIKeysResourceWithRawResponse",
94
+ "AsyncAPIKeysResourceWithRawResponse",
95
+ "APIKeysResourceWithStreamingResponse",
96
+ "AsyncAPIKeysResourceWithStreamingResponse",
83
97
  "InferenceResource",
84
98
  "AsyncInferenceResource",
85
99
  "InferenceResourceWithRawResponse",